Commit 03f4a83b 几米阳光

1

1 个父辈 0877157c
...@@ -1317,9 +1317,12 @@ namespace OnlineStore.AutoInOutStore ...@@ -1317,9 +1317,12 @@ namespace OnlineStore.AutoInOutStore
{ {
stop_button_Click(null, null); stop_button_Click(null, null);
} }
LogUtil.info("ExitApp:停止料仓运行");
store.Exit(); store.Exit();
LogUtil.info("ExitApp:料仓已停止,关闭所有DO");
IOManager.instance.CloseAllDO(); IOManager.instance.CloseAllDO();
StoreOpenStatus(false); StoreOpenStatus(false);
LogUtil.info("ExitApp:关闭所有DO完成,端口所有IO连接");
IOManager.instance.CloseAllConnection(); IOManager.instance.CloseAllConnection();
//KNDAIManager.CloseAllConnection(); //KNDAIManager.CloseAllConnection();
//WCFControl.CloseWCF(); //WCFControl.CloseWCF();
......
...@@ -753,7 +753,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -753,7 +753,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public override void StopRun() public override void StopRun()
{ {
WarnMsg = ""; WarnMsg = "";
autoNext = false; autoNext = false;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
serverConnectTimer.Enabled = false; serverConnectTimer.Enabled = false;
...@@ -764,7 +764,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -764,7 +764,9 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Wait; storeRunStatus = StoreRunStatus.Wait;
storeStatus = StoreStatus.ResetMove; storeStatus = StoreStatus.ResetMove;
//mainTimer.Enabled = false; //mainTimer.Enabled = false;
LogUtil.info("StopRun:批量模块停止运行");
AutomaticBaiting.StopRun(); AutomaticBaiting.StopRun();
LogUtil.info("StopRun:关闭所有DO");
IOManager.instance.CloseAllDO(); IOManager.instance.CloseAllDO();
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
{ {
...@@ -772,7 +774,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -772,7 +774,7 @@ namespace OnlineStore.DeviceLibrary
} }
HumitureController.Release(); HumitureController.Release();
StoreManager.CurrInOutType = 0; StoreManager.CurrInOutType = 0;
LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + runTimeWatch.Elapsed.ToString()); LogUtil.info(LOGGER, StoreName + "StopRun,停止运行,总运行时间:" + runTimeWatch.Elapsed.ToString());
} }
public void Exit() public void Exit()
{ {
......
...@@ -479,7 +479,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -479,7 +479,7 @@ namespace OnlineStore.DeviceLibrary
lastPosIdStatus = StoreStatus.InStoreEnd; lastPosIdStatus = StoreStatus.InStoreEnd;
storeStatus = StoreStatus.InStoreEnd; storeStatus = StoreStatus.InStoreEnd;
//手动发给服务器状态,防止没有手动 //手动发给服务器状态,防止没有手动
//SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd); SendLineStatus();
StoreMove.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag); StoreMove.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag);
ComMoveToPosition(moveP.ComPress_P3, true); ComMoveToPosition(moveP.ComPress_P3, true);
...@@ -721,6 +721,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -721,6 +721,8 @@ namespace OnlineStore.DeviceLibrary
lastPosId = posId; lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStoreBoxEnd; lastPosIdStatus = StoreStatus.OutStoreBoxEnd;
storeStatus = StoreStatus.OutStoreBoxEnd; storeStatus = StoreStatus.OutStoreBoxEnd;
//手动发给服务器状态,防止没有手动
SendLineStatus();
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_06_BagDeviceBack) else if (StoreMove.MoveStep == StoreMoveStep.SO_06_BagDeviceBack)
...@@ -976,8 +978,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -976,8 +978,16 @@ namespace OnlineStore.DeviceLibrary
public void AddWaitOutInfo(FixtureCodeInfo code) public void AddWaitOutInfo(FixtureCodeInfo code)
{ {
lock (waitOutListLock) lock (waitOutListLock)
{ {//判断已经有此库位号的出库信息,直接抛弃不处理
waitOutStoreList.Add(code); List<FixtureCodeInfo> list = (from m in waitOutStoreList where m.PosId.Equals(code.PosId) select m).ToList<FixtureCodeInfo>();
if (list.Count > 0)
{
LogUtil.info("【" + code.ToStr() + "】 加入等待队列失败,【" + code.PosId + "】已在出库队列中");
}
else
{
waitOutStoreList.Add(code);
}
} }
} }
......
...@@ -46,7 +46,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -46,7 +46,7 @@ namespace OnlineStore.DeviceLibrary
codeTypeList.Add(str.Trim()); codeTypeList.Add(str.Trim());
} }
LoadCamera(); LoadCamera(false );
CodeLibrary.HDCodeLearnHelper.LoadConfig(nameStr, codeStr); CodeLibrary.HDCodeLearnHelper.LoadConfig(nameStr, codeStr);
} }
...@@ -55,8 +55,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -55,8 +55,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("解析摄像机配置出错:" + ex.ToString()); LogUtil.error("解析摄像机配置出错:" + ex.ToString());
} }
} }
private static void LoadCamera() private static void LoadCamera(bool isReLoad)
{ {
if (isReLoad)
{
CodeLibrary.HIKCamera.Instance.Load();
CodeLibrary.BaslerCamera.Instance.Load();
}
string[] names = CodeLibrary.HIKCamera.Instance.CameraName; string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
hikNameList.AddRange(names); hikNameList.AddRange(names);
names = CodeLibrary.BaslerCamera.Instance.CameraName; names = CodeLibrary.BaslerCamera.Instance.CameraName;
...@@ -74,12 +79,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -74,12 +79,7 @@ namespace OnlineStore.DeviceLibrary
{ {
Bitmap bitm = null; Bitmap bitm = null;
//若未加载到相机,需要重新加载相机
if (balserNameList.Count <= 0 && hikNameList.Count <= 0)
{
LogUtil.error("获取图片时发现未加载到相机,重新加载相机");
LoadCamera();
}
if (balserNameList.Contains(cameraName)) if (balserNameList.Contains(cameraName))
{ {
BaslerCamera.Instance.Open(cameraName); BaslerCamera.Instance.Open(cameraName);
...@@ -87,7 +87,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -87,7 +87,7 @@ namespace OnlineStore.DeviceLibrary
bitm = BaslerCamera.Instance.Image; bitm = BaslerCamera.Instance.Image;
BaslerCamera.Instance.Close(); BaslerCamera.Instance.Close();
} }
else if(hikNameList.Contains(cameraName)) else if (hikNameList.Contains(cameraName))
{ {
HIKCamera.Instance.Open(cameraName); HIKCamera.Instance.Open(cameraName);
HIKCamera.Instance.GrabOne(); HIKCamera.Instance.GrabOne();
...@@ -96,11 +96,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -96,11 +96,16 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.info("未找到摄像机【"+cameraName+"】无法获取图片"); LogUtil.info("未找到摄像机【" + cameraName + "】无法获取图片");
//若未加载到相机,需要重新加载相机
if (balserNameList.Count <= 0 && hikNameList.Count <= 0)
{
LogUtil.error("获取图片时发现未加载到相机,重新加载相机");
LoadCamera(true);
}
} }
return bitm; return bitm;
} }
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan() public static List<string> CameraScan()
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!