Commit 29861c1c LN

增加TaskCreationOptions.LongRunning

1 个父辈 254bf6bb
......@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
Alarm(LineAlarmType.SuddenStop);
return;
}
});
}, TaskCreationOptions.LongRunning);
}
}
else if (IOValue(IO_Type.DLine_Reset).Equals(IO_VALUE.HIGH))
......@@ -489,13 +489,18 @@ namespace OnlineStore.DeviceLibrary
}
NewTypeScan();
}
else
{
LogUtil.error (Name + "Line3EndProcess result=" + result + "");
}
}
private bool ScanIsEnd()
{
TimeSpan span = DateTime.Now - LastScanTime;
if (IsInScanCode && span.TotalMinutes < 1)
{
return false ;
//if (IsInScanCode && span.TotalMinutes < 1)
if (IsInScanCode)
{
return false;
}
return true;
}
......@@ -527,25 +532,6 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW))
{
UpdateScanInfo(IO_VALUE.LOW,"");
//List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), "", true);
//LastCode = SServerManager.ProcessCodeList(LastCodeList);
//if (LastCodeList.Count > 0)
//{
// UpdateScanInfo(IO_VALUE.HIGH, LastCode);
// LogUtil.info(hengyiName + "ExitTray_Check3不亮,但扫到条码,更改为有料: " + LastCode);
// if (DeviceID.Equals(301))
// {
// if (Line3LastTrayP > Line3MaxPosition) { Line3LastTrayP = Line3MaxPosition; }
// // StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
// }
// else
// {
// if (Line3LastTrayP > Line3MaxPosition - 1)
// {
// Line3LastTrayP = Line3MaxPosition - 1;
// }
// }
//}
IsInScanCode = false;
}
......@@ -589,7 +575,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(hengyiName + " 扫码工位 : 扫码结束 ," + StationInfo_Scan.ToStr + " IsInScanCode = " + IsInScanCode);
}
}
});
}, TaskCreationOptions.LongRunning);
}
private void UpdateScanInfo(IO_VALUE value,string code)
......
......@@ -365,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
}
return;
}
});
}, TaskCreationOptions.LongRunning);
}
}
else if (IOValue(IO_Type.SL_Reset_BTN).Equals(IO_VALUE.HIGH))
......@@ -764,7 +764,7 @@ namespace OnlineStore.DeviceLibrary
{
Thread.Sleep(1000);
AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.None, ClientLevel.High, true);
});
}, TaskCreationOptions.LongRunning);
ProcessShelfOut = false;
LogUtil.info(logName + ",停止转动,清空料架["+ LastOutShelfId + "], 结束");
}
......@@ -786,7 +786,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
ProcessShelfOut = false;
}
});
}, TaskCreationOptions.LongRunning);
}
internal void ShelfEnterProcess()
{
......@@ -844,7 +844,7 @@ namespace OnlineStore.DeviceLibrary
{
Thread.Sleep(1000);
AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None, ClientLevel.High, true);
});
}, TaskCreationOptions.LongRunning);
ProcessShelfEnter = false;
LogUtil.info(logName + " 结束");
}
......@@ -862,7 +862,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
ProcessShelfEnter = false;
}
});
}, TaskCreationOptions.LongRunning);
}
private bool ReadShelfId()
......
......@@ -755,9 +755,19 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_ScanCode))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_14_CylinderTake);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
if (ScanCodeTask == null || ScanCodeTask.IsCompleted)
{
MoveInfo.NextMoveStep(LineMoveStep.FI_14_CylinderTake);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
ClearTimeoutAlarm("扫码执行结束超时");
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 扫码执行结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_CylinderTake))
{
......@@ -1152,7 +1162,7 @@ namespace OnlineStore.DeviceLibrary
//需要等待500再下降
Thread.Sleep(500);
CylinderMove(null, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
});
}, TaskCreationOptions.LongRunning);
}
}
else
......@@ -1244,6 +1254,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
private Task ScanCodeTask = null;
private void FI_13_ScanCode()
{
if (CylinderIsOk(IO_Type.SL_MoveCylinder_Take,IO_Type.SL_MoveCylinder_Give))
......@@ -1253,6 +1264,7 @@ namespace OnlineStore.DeviceLibrary
LastCodeList = new List<string>();
ScanCodeTask = null;
if (NextCodeList.Count > 0)
{
InLog("料盘移栽" + MoveInfo.SLog + ":开始扫码:使用预扫码");
......@@ -1271,7 +1283,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(7000));
try
{
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
ScanCodeTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
bool hasRightCode = CodeManager.HasRightCode(LastCodeList.ToArray());
......@@ -1280,7 +1292,7 @@ namespace OnlineStore.DeviceLibrary
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name, false, 3000);
}
return LastCodeList;
});
}, TaskCreationOptions.LongRunning);
}
catch (Exception ex)
{
......
......@@ -661,7 +661,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + "【" + MoveInfo.MoveParam.WareCode + "】【" + CurrShelfId + "】【" + OutStoreCount.ToString() + "】afterPutCut 结果:" + msg);
taskData = null;
}
});
}, TaskCreationOptions.LongRunning);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_221_UpdownAxisToP1))
{
......
......@@ -182,7 +182,7 @@ namespace OnlineStore.DeviceLibrary
canStart = true;
AgvClient.Init();
});
}, TaskCreationOptions.LongRunning);
}
......@@ -686,7 +686,7 @@ namespace OnlineStore.DeviceLibrary
SetWarnMsg("收到急停信号,报警急停");
Alarm(LineAlarmType.SuddenStop);
}
});
}, TaskCreationOptions.LongRunning);
}
}
else if (fuweiValue.Equals(IO_VALUE.HIGH) && (!fuweiValue.Equals(lastFuwei)))
......
......@@ -534,7 +534,7 @@ namespace OnlineStore.DeviceLibrary
waitInStoreList.RemoveAt(reIndex);
Task.Factory.StartNew(delegate {
SServerManager.cancelPutInTask(Name, currCode.WareCode);
});
}, TaskCreationOptions.LongRunning);
return false;
}
......
......@@ -401,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
{
canWhileCount = 3;
LineRunAndWait(timeOutMS);
});
}, TaskCreationOptions.LongRunning);
}
private string LineRunAndWait(int timeOutMS = 30000)
......@@ -519,7 +519,7 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate
{
turnEnd?.Invoke(result.Equals(""));
});
}, TaskCreationOptions.LongRunning);
}
InTurn = false;
WaitCheckDI_High = false;
......
......@@ -152,7 +152,7 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate
{
SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode);
});
}, TaskCreationOptions.LongRunning);
}
//入料失败料
return inoup;
......
......@@ -140,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(moveEquip.Name + " 入库命令: " + param.ToStr() + " 给料仓发送验证失败,等待3秒后重发 ");
Thread.Sleep(3000);
LineServer.CheckInStorePos(storeId, param);
});
}, TaskCreationOptions.LongRunning);
}
lock (moveEquip.waitInListLock)
{
......@@ -589,7 +589,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(deviceName + "[" + moveEquip.Name + " ]入库命令: " + param.ToStr() + " 给料仓发送验证失败,等待3秒后重发 ");
Thread.Sleep(3000);
LineServer.CheckInStorePos(storeId, param);
});
}, TaskCreationOptions.LongRunning);
}
lock (moveEquip.waitInListLock)
{
......
......@@ -536,7 +536,7 @@ namespace OnlineStore.DeviceLibrary
}
}
IOManager.IOMove(IoType, tValue, baseConfig.Id);
});
}, TaskCreationOptions.LongRunning);
}
}
public IO_VALUE IOValue(string IoType)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!