Commit 43b8e0f3 LN

bug修改

1 个父辈 65acfca6
此文件类型无法预览
...@@ -288,7 +288,7 @@ namespace OnlineStore.Common ...@@ -288,7 +288,7 @@ namespace OnlineStore.Common
if (_serialPort.IsOpen) if (_serialPort.IsOpen)
{ {
//lock (lockObj) //lock (lockObj)
if(Monitor.TryEnter(lockObj,10)) if(Monitor.TryEnter(lockObj,Overtime))
{ {
//Monitor.Enter(lockObj); //Monitor.Enter(lockObj);
try try
...@@ -358,7 +358,7 @@ namespace OnlineStore.Common ...@@ -358,7 +358,7 @@ namespace OnlineStore.Common
if (_serialPort.IsOpen) if (_serialPort.IsOpen)
{ {
if (Monitor.TryEnter(lockObj, 10)) if (Monitor.TryEnter(lockObj, Overtime))
{ {
//Monitor.Enter(lockObj); //Monitor.Enter(lockObj);
try try
......
...@@ -115,7 +115,7 @@ namespace OnlineStore.Common ...@@ -115,7 +115,7 @@ namespace OnlineStore.Common
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, ex.Message); LogUtil.error(LOGGER, "ReceiveAccept方法,客户端【"+client.AddStr+"】:" + ex.Message);
//throw new Exception(ex.Message); //throw new Exception(ex.Message);
} }
} }
...@@ -159,18 +159,18 @@ namespace OnlineStore.Common ...@@ -159,18 +159,18 @@ namespace OnlineStore.Common
i++; i++;
} }
} }
} }
Thread.Sleep(ReviceMsgMS); Thread.Sleep(ReviceMsgMS);
} }
} }
catch (SocketException e) catch (SocketException e)
{ {
LogUtil.error(e.ToString(), 1006); LogUtil.error("客户端{" + client.AddStr + "]:" + e.ToString(), 1006);
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(ex.ToString(), 1005); LogUtil.error("客户端{" + client.AddStr + "]:" + ex.ToString(), 1005);
} }
} }
//private void ReceiveMessages(Client client) //private void ReceiveMessages(Client client)
......
...@@ -237,9 +237,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -237,9 +237,10 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.FR_13_LocationCylinder_Down: case LineMoveStep.FR_13_LocationCylinder_Down:
MoveInfo.NextMoveStep(LineMoveStep.FR_14_TopCylinderDown); MoveInfo.NextMoveStep(LineMoveStep.FR_14_TopCylinderDown);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.SLog + ":SL1定位气缸下降SOL,出口顶升气缸下降"); LogInfo(MoveInfo.MoveType + ":" + MoveInfo.SLog + ":SL1定位气缸下降SOL,出口顶升气缸下降,夹紧气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down); CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down); CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
break; break;
case LineMoveStep.FR_14_TopCylinderDown: case LineMoveStep.FR_14_TopCylinderDown:
......
...@@ -299,7 +299,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -299,7 +299,10 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
bool result = moveEquip.StartRun(); Task.Factory.StartNew(delegate
{
bool result = moveEquip.StartRun();
});
} }
} }
...@@ -397,7 +400,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -397,7 +400,9 @@ namespace OnlineStore.DeviceLibrary
if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm())) if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm()))
{ {
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位"); LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
equip.Reset(); Task.Factory.StartNew(delegate {
equip.Reset();
});
} }
else else
{ {
...@@ -893,13 +898,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -893,13 +898,17 @@ namespace OnlineStore.DeviceLibrary
foreach (EquipBase moveEquip in this.AllEquipMap.Values) foreach (EquipBase moveEquip in this.AllEquipMap.Values)
{ {
if ((moveEquip.runStatus.Equals(LineRunStatus.HomeMoving) || moveEquip.runStatus.Equals(LineRunStatus.Reset)) && moveEquip.IsDebug.Equals(false)) if (moveEquip.IsDebug)
{
continue;
}
if (moveEquip.runStatus.Equals(LineRunStatus.HomeMoving) || moveEquip.runStatus.Equals(LineRunStatus.Reset) || moveEquip.runStatus.Equals(LineRunStatus.Wait))
{ {
if (moveEquip.NoAlarm()) if (moveEquip.NoAlarm())
{ {
if (moveEquip.baseConfig.DType.Equals(DeviceType.FeedingEquip) && moveEquip.MoveInfo.MoveStep >= LineMoveStep.FR_11_BatchAxisHome) if (moveEquip.baseConfig.DType.Equals(DeviceType.FeedingEquip) && moveEquip.MoveInfo.MoveStep >= LineMoveStep.FR_11_BatchAxisHome)
{ {
continue; continue;
} }
isOk = false; isOk = false;
break; break;
......
...@@ -76,7 +76,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -76,7 +76,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_52_UpDownCylinderDown)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_52_UpDownCylinderDown))
{ {
MoveInfo.NextMoveStep(LineMoveStep.MO_53_UpDownCylinderDownWait); MoveInfo.NextMoveStep(LineMoveStep.MO_53_UpDownCylinderDownWait);
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸1下降 后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作)"); OutLog("出库 " + MoveInfo.SLog + ": 等待300ms后夹紧");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_53_UpDownCylinderDownWait)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_53_UpDownCylinderDownWait))
...@@ -214,7 +214,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -214,7 +214,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_07_UpDownCylinderDown)) if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_07_UpDownCylinderDown))
{ {
MoveInfo.NextMoveStep(LineMoveStep.MI_07_UpDownCylinderDownWait); MoveInfo.NextMoveStep(LineMoveStep.MI_07_UpDownCylinderDownWait);
InLog("入库 " + MoveInfo.SLog + ": 编码与仓位一致,上下气缸1下降后等待0.3秒再夹紧,防止没有下降到位就夹紧"); InLog("入库 " + MoveInfo.SLog + ": 等待300ms后夹紧");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
} }
//只有当BOX可以进行出入库时,移栽物品,防止卡住 //只有当BOX可以进行出入库时,移栽物品,防止卡住
......
...@@ -62,7 +62,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -62,7 +62,7 @@ namespace OnlineStore.DeviceLibrary
} }
list.Add(str.Trim()); list.Add(str.Trim());
//string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim(); //string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
string code = width + "x" + height + "=" + str.Trim(); string code = "=" + width + "x" + height + "=" + str.Trim();
codeStr = codeStr + code + spiltStr; codeStr = codeStr + code + spiltStr;
} }
if (String.IsNullOrEmpty(codeStr)) if (String.IsNullOrEmpty(codeStr))
...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary
//code: 条码内容 //code: 条码内容
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cids", LineServer.GetAllCID()); paramMap.Add("cids", LineServer.GetAllCID());
paramMap.Add("code", "=" + codeStr); paramMap.Add("code", codeStr);
string server = GetAddr(Addr_PosForPutin, paramMap); string server = GetAddr(Addr_PosForPutin, paramMap);
//string server = GetAddr(Addr_PosForPutin) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr; //string server = GetAddr(Addr_PosForPutin) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr;
...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
lock (moveEquip.waitInListLock) lock (moveEquip.waitInListLock)
{ {
//如果当前正在出入库中,需要记录下来,等待空闲时执行 //如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(moveEquip.Name + " 入库命令: " + " + param.ToStr() + " + "加入等待列表中!"); LogUtil.info(moveEquip.Name + " 入库命令: " + param.ToStr() + "加入等待列表中!");
moveEquip.waitInStoreList.Add(param); moveEquip.waitInStoreList.Add(param);
} }
} }
......
...@@ -73,7 +73,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -73,7 +73,14 @@ namespace OnlineStore.DeviceLibrary
if (names != null) if (names != null)
{ {
hikNameList.AddRange(names); foreach (string n in names)
{
if (!hikNameList.Contains(n))
{
hikNameList.Add(n);
}
}
// hikNameList.AddRange(names);
foreach (string name in hikNameList) foreach (string name in hikNameList)
{ {
LogUtil.info("加载到HIK相机:" + name); LogUtil.info("加载到HIK相机:" + name);
...@@ -82,7 +89,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,7 +89,14 @@ namespace OnlineStore.DeviceLibrary
names = CodeLibrary.BaslerCamera.Instance.CameraName; names = CodeLibrary.BaslerCamera.Instance.CameraName;
if (names != null) if (names != null)
{ {
balserNameList.AddRange(names); foreach (string n in names)
{
if (!balserNameList.Contains(n))
{
balserNameList.Add(n);
}
}
// balserNameList.AddRange(names);
foreach (string name in balserNameList) foreach (string name in balserNameList)
{ {
LogUtil.info("加载到Balser相机:" + name); LogUtil.info("加载到Balser相机:" + name);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!