Commit 03f4a83b 几米阳光

1

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