Commit 7127ef2c LN

rfid 读取 bug修改

1 个父辈 d61d070a
此文件类型无法预览
...@@ -215,6 +215,7 @@ namespace OnlineStore.AssemblyLine ...@@ -215,6 +215,7 @@ namespace OnlineStore.AssemblyLine
IOManager.instance.CloseAllConnection(); IOManager.instance.CloseAllConnection();
AxisManager.instance.CloseAllPort(); AxisManager.instance.CloseAllPort();
AxisManager.instance.CloseCard(); AxisManager.instance.CloseCard();
RFIDManager.Close();
if (Camera._cam != null) if (Camera._cam != null)
{ {
Camera._cam.CloseAll(); Camera._cam.CloseAll();
......
...@@ -163,6 +163,11 @@ ...@@ -163,6 +163,11 @@
// //
this.numNum.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numNum.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numNum.Location = new System.Drawing.Point(144, 192); this.numNum.Location = new System.Drawing.Point(144, 192);
this.numNum.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.numNum.Name = "numNum"; this.numNum.Name = "numNum";
this.numNum.Size = new System.Drawing.Size(120, 26); this.numNum.Size = new System.Drawing.Size(120, 26);
this.numNum.TabIndex = 283; this.numNum.TabIndex = 283;
......
...@@ -27,7 +27,7 @@ namespace OnlineStore.AssemblyLine ...@@ -27,7 +27,7 @@ namespace OnlineStore.AssemblyLine
private void FrmPwd_Load(object sender, EventArgs e) private void FrmPwd_Load(object sender, EventArgs e)
{ {
comboxType.Items.Clear(); comboxType.Items.Clear();
foreach (EquipBase b in LineManager.Line.AllEquipMap.Values) foreach (EquipBase b in LineManager.Line.MoveEquipMap.Values)
{ {
string key = b.Name + "-托盘RF"; string key = b.Name + "-托盘RF";
string value = RFIDManager.GetRFIP(b.DeviceID); string value = RFIDManager.GetRFIP(b.DeviceID);
...@@ -37,20 +37,22 @@ namespace OnlineStore.AssemblyLine ...@@ -37,20 +37,22 @@ namespace OnlineStore.AssemblyLine
foreach (FeedingEquip b in LineManager.Line.FeedingEquipMap.Values) foreach (FeedingEquip b in LineManager.Line.FeedingEquipMap.Values)
{ {
string key = b.Name + "-料架RF"; string key = b.Name + "-料架RF";
string value = RFIDManager.GetRFIP(b.DeviceID, 1); string value = RFIDManager.GetRFIP(b.DeviceID );
rfMap.Add(key, value); rfMap.Add(key, value);
comboxType.Items.Add(key); comboxType.Items.Add(key);
} }
foreach (HYEquipBase b in LineManager.Line.HYEquipMap.Values) foreach (HYEquipBase b in LineManager.Line.HYEquipMap.Values)
{ {
string key = b.Name + "-托盘RF"; string key = b.Name + "-托盘RF";
string value = RFIDManager.GetRFIP(b.DeviceID, 1); string value = RFIDManager.GetRFIP(b.DeviceID);
if (!String.IsNullOrEmpty(value)) if (!String.IsNullOrEmpty(value))
{ {
rfMap.Add(key, value); rfMap.Add(key, value);
comboxType.Items.Add(key); comboxType.Items.Add(key);
} }
} }
string v = RFIDManager.GetRFIP(300);
rfMap.Add("T3-C1-托盘RF", v);
comboxType.SelectedIndex = 0; comboxType.SelectedIndex = 0;
comType.SelectedIndex = 0; comType.SelectedIndex = 0;
......
...@@ -33,7 +33,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -33,7 +33,7 @@ namespace OnlineStore.DeviceLibrary
port = 13000; port = 13000;
} }
LogUtil.info("RFID Server Open,port=" + port); LogUtil.info("RFID Server Open,port=" + port);
readAll.Start(); readAll.Start(port);
IsOpen = true; IsOpen = true;
} }
catch (Exception ex) catch (Exception ex)
...@@ -78,15 +78,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -78,15 +78,6 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
if (subType.Equals(104))
{
return;
}
else if (subType.Equals(101))
{
return;
}
string ip = GetRFIP(subType); string ip = GetRFIP(subType);
RFIDData data = ReadRFID(ip, true); RFIDData data = ReadRFID(ip, true);
} }
...@@ -95,20 +86,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -95,20 +86,16 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("ClearTrayNum【" + subType + "】出错:" + ex.ToString()); LogUtil.error("ClearTrayNum【" + subType + "】出错:" + ex.ToString());
} }
} }
public static RFIDData GetShelfId(int subType) public static RFIDData GetShelfId(int deviceId)
{ {
string ip = GetRFIP(subType, 1); string ip = GetRFIP(deviceId );
return ReadRFID(ip, true); return ReadRFID(ip, true);
} }
public static string GetRFIP(int subType, int rtType = 0) public static string GetRFIP(int deviceId )
{ {
string ip = ""; string ip = "";
string rtName = DeviceConfig.RFIP_Str + "_" + subType.ToString().PadLeft(3, '0'); string rtName = DeviceConfig.RFIP_Str + "_" + deviceId.ToString().PadLeft(3, '0');
if (rtType > 0)
{
rtName += "-" + rtType.ToString();
}
if (DeviceConfig.ProRFIpMap.ContainsKey(rtName)) if (DeviceConfig.ProRFIpMap.ContainsKey(rtName))
{ {
ip = DeviceConfig.ProRFIpMap[rtName]; ip = DeviceConfig.ProRFIpMap[rtName];
...@@ -147,7 +134,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -147,7 +134,11 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
if (IsOpen)
{
readAll.Stop(); readAll.Stop();
IsOpen = false;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!