Commit a64130bc LN

托盘经过时上传托盘号到服务器。

1 个父辈 c8b734a6
......@@ -497,6 +497,7 @@ namespace OnlineStore.DeviceLibrary
else
{
currTrayNum = RFIDManager.GetTrayNum(DeviceID, true);
SServerManager.updateTray(currTrayNum);
LogUtil.LOGGER.Info(Name + " [" + trayCount + "] IP [" + RFIDManager.GetRFIP(DeviceID) + "] [" + preTrayNum + "] 当前托盘 [" + currTrayNum + "]");
if (preTrayNum.Equals(currTrayNum) && currTrayNum > 0)
{
......
......@@ -365,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.ReelCheck));
}
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2);
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2,DeviceID);
TrayMoveOk();
return;
}
......@@ -376,7 +376,7 @@ namespace OnlineStore.DeviceLibrary
if ((!isfull) && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.HIGH))
{
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2);
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2, DeviceID);
TrayMoveOk();
return;
}
......@@ -388,7 +388,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.ReelCheck));
}
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 需拦截有料托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1);
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1, DeviceID);
TrayMoveOk();
return;
}
......
......@@ -92,7 +92,7 @@ namespace OnlineStore.DeviceLibrary
//增加AGV小车客户端
AgvClient.NodeList.Add(config.AgvInName);
AgvClient.NodeList.Add(config.AgvOutName);
LogUtil.info(Name + $" {equip.Name} DeviceID: {equip.DeviceID} ");
AddDeviceName(ioList, config.IOIPList);
FeedingEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip);
......@@ -102,6 +102,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveEquip equip = new MoveEquip(lineConfig.CID, config);
LogUtil.info(Name + $" {equip.Name} DeviceID: {equip.DeviceID} ");
AddDeviceName(ioList, config.IOIPList);
MoveEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip);
......@@ -110,6 +111,7 @@ namespace OnlineStore.DeviceLibrary
{
ProvidingEquip equip = new ProvidingEquip(lineConfig.CID, config);
LogUtil.info(Name + $" {equip.Name} DeviceID: {equip.DeviceID} ");
AddDeviceName(ioList, config.IOIPList);
ProvidingEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip);
......@@ -119,6 +121,7 @@ namespace OnlineStore.DeviceLibrary
{
DischargeLine equip = new DischargeLine(lineConfig.CID, config);
LogUtil.info(Name + $" {equip.Name} DeviceID: {equip.DeviceID} ");
AddDeviceName(ioList, config.IOIPList);
DisLineMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip);
......
......@@ -581,6 +581,7 @@ namespace OnlineStore.DeviceLibrary
else
{
Sw41TrayNum = RFIDManager.GetTrayNum(204, true);
SServerManager.updateTray(Sw41TrayNum);
}
}
}
......@@ -597,6 +598,7 @@ namespace OnlineStore.DeviceLibrary
else
{
Sw23TrayNum = RFIDManager.GetTrayNum(103, true);
SServerManager.updateTray(Sw23TrayNum);
}
}
}
......
......@@ -167,6 +167,7 @@ namespace OnlineStore.DeviceLibrary
//读取进仓5处的托盘号
Shunt2TrayNum = RFIDManager.GetTrayNum(5, false);
SServerManager.updateTray(Shunt2TrayNum);
Shunt2Log("分流横移2:托盘号【" + Shunt2TrayNum + "】等待阻挡1亮,阻挡2亮,阻挡1上升,升降1下降 ");
CylinderMove(Shunt2_MoveInfo, IO_Type.Shunt2_TopCylinder_Up1, IO_Type.Shunt2_TopCylinder_Down1, true);
CheckAndMove(IO_Type.Shunt2_StopDown1_Front, IO_VALUE.LOW);
......@@ -247,6 +248,7 @@ namespace OnlineStore.DeviceLibrary
//读取进仓5处的托盘号
Shunt2TrayNum = RFIDManager.GetTrayNum(5, false);
SServerManager.updateTray(Shunt2TrayNum);
Shunt2Log("分流横移2:托盘号【" + Shunt2TrayNum + "】等待阻挡1亮,阻挡2亮,阻挡1上升,升降1下降 ");
CylinderMove(Shunt2_MoveInfo, IO_Type.Shunt2_TopCylinder_Up1, IO_Type.Shunt2_TopCylinder_Down1, true);
CheckAndMove(IO_Type.Shunt2_StopDown1_Front, IO_VALUE.LOW);
......
......@@ -352,7 +352,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error(Name + "入库 [" + posId + "],升降气缸下降到托盘[" + currTrayNum + "]取料失败,升降轴上升,禁用托盘,同时放行托盘");
LogInfo("入库 [" + posId + "]" + MoveInfo.SLog + ": 升降轴上升,禁用托盘,同时放行托盘,顶升气缸1下降");
TrayDisableManager.AddDisable(currTrayNum, Name, "入库取料失败",0);
TrayDisableManager.AddDisable(currTrayNum, Name, "入库取料失败",0, DeviceID);
MI_18_UpdownUp();
}
}
......@@ -398,7 +398,7 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil.error(Name + "入库 [" + posId + "],托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,升降轴上升,禁用托盘,同时放行托盘");
LogInfo("入库 [" + posId + "]" + MoveInfo.SLog + ": 升降轴上升,禁用托盘,同时放行托盘,顶升气缸1下降");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1);
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1, DeviceID);
MI_18_UpdownUp();
}
else
......@@ -665,7 +665,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.TrayCheck));
}
LogInfo(" 出库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2);
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2, DeviceID);
}
else
{
......@@ -754,7 +754,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.TrayCheck));
}
LogInfo(" 入库需拦截有料托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,禁用托盘");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1);
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1,DeviceID);
return false;
}
else if (!LineServer.BoxCanInStore(StoreID))
......
......@@ -181,7 +181,7 @@ namespace OnlineStore.DeviceLibrary
if(resCode==-1)
{
TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】");
TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】",DeviceID);
LogUtil.info($"【屏蔽料盘二次判断】【-1】【需要禁用该托盘】【{tray.ToStr()}】");
}
else if (resCode==100)
......@@ -242,7 +242,7 @@ namespace OnlineStore.DeviceLibrary
(int resCode, taskInfo task) = SServerManager.getTaskInfo(barcode);
if (resCode == -1)
{
TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】");
TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】",DeviceID);
LogUtil.info($"【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】 【禁用该托盘】【{tray.ToStr()}】");
}
else if (resCode == 100)
......
......@@ -930,11 +930,11 @@ namespace OnlineStore.DeviceLibrary
{
if (String.IsNullOrEmpty(disabledTray))
{
disabledTray += "E" + dis.TrayCode;
disabledTray += "E" + dis.TrayCode+"="+dis.DeviceId;
}
else
{
disabledTray += ",E" + dis.TrayCode;
disabledTray += ",E" + dis.TrayCode + "=" + dis.DeviceId;
}
}
try
......@@ -959,6 +959,33 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("disabledTray 出错", ex);
}
}
///rest/api/qisda/device/updateTray?trayId=xxx
private static string Addr_updateTray = "/rest/api/qisda/device/updateTray";
public static void updateTray(int trayNum)
{
Task.Factory.StartNew(delegate
{
try
{
//code= 0 表示正常,其他为异常
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("trayId", "E" + trayNum);//
string server = GetAddr(Addr_updateTray, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Get(server);
LogUtil.debug("updateTray [" + trayNum + "] " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
}
catch (Exception ex)
{
LogUtil.error("updateTray [" + trayNum + "] 出错", ex);
}
});
}
}
public class ReturnData
......
......@@ -43,9 +43,9 @@ namespace OnlineStore.DeviceLibrary
/// <param name="deviceName"></param>
/// <param name="describle"></param>
/// <param name="type">0,无;1:硬件未检测到;2:硬件检测到</param>
public static void AddDisable(int trayNum, string deviceName, string describle,int type)
public static void AddDisable(int trayNum, string deviceName, string describle,int type,int deviceId)
{
TrayDisableInfo t = new TrayDisableInfo(trayNum, deviceName, describle);
TrayDisableInfo t = new TrayDisableInfo(trayNum, deviceName, describle,deviceId);
if(UseNewLogic)
{
TrayInfo tray = TrayManager.GetTrayInfo(trayNum);
......@@ -108,12 +108,13 @@ namespace OnlineStore.DeviceLibrary
}
}
public static void AddDisableTray(int trayNum,string deviceName,string describe )
public static void AddDisableTray(int trayNum,string deviceName,string describe,int deviceId )
{
TrayDisableInfo t = new TrayDisableInfo();
t.TrayCode = trayNum;
t.DDescribe = describe;
t.DDeviceName = deviceName;
t.DeviceId = deviceId;
if (TrayDisableMap.ContainsKey(trayNum))
{
TrayDisableMap[trayNum] = t;
......
......@@ -109,7 +109,7 @@ namespace OnlineStore.DeviceLibrary
DisableTime = DateTime.Now;
}
public TrayDisableInfo(int trayNum,string deviceName,string describle)
public TrayDisableInfo(int trayNum,string deviceName,string describle,int deviceId)
{
this.TrayCode = trayNum;
this.DDeviceName = deviceName;
......@@ -124,10 +124,14 @@ namespace OnlineStore.DeviceLibrary
public string DDescribe { get; set; } = "";
public DateTime DisableTime { get; set; }
/// <summary>
/// 禁用的设备ID
/// </summary>
public int DeviceId { get; set; }
public string ToStr()
{
return $"托盘 [{TrayCode }] [{DisableTime.ToLongTimeString() }] [{DDeviceName} [{DDescribe}]";
return $"托盘 [{TrayCode }] [{DisableTime.ToLongTimeString() }] [{DDeviceName} [{DDescribe}]设备ID[{DeviceId}]";
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!