Commit 7127ef2c LN

rfid 读取 bug修改

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