Commit 3dac20b8 张东亮

三色灯逻辑优化

1 个父辈 b6dbd966
...@@ -207,8 +207,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -207,8 +207,11 @@ namespace OnlineStore.DeviceLibrary
SaveNGImageToFile(deviceName, cameraName + nameStr, bmp); SaveNGImageToFile(deviceName, cameraName + nameStr, bmp);
} }
else
{
SaveOKImageToFile(deviceName, cameraName, bmp); SaveOKImageToFile(deviceName, cameraName, bmp);
} }
}
if (deviceName != "" || r != "") if (deviceName != "" || r != "")
{ {
LogUtil.info(deviceName + " 【" + cameraName + "】扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】[" + findRightCode + "]" + ScanCount + " :" + r); LogUtil.info(deviceName + " 【" + cameraName + "】扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】[" + findRightCode + "]" + ScanCount + " :" + r);
...@@ -415,11 +418,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -415,11 +418,11 @@ namespace OnlineStore.DeviceLibrary
string iamgeName = date + ".bmp"; string iamgeName = date + ".bmp";
try try
{ {
Bitmap bit = (Bitmap)bitmap.Clone();
if (Directory.Exists(dire).Equals(false)) if (Directory.Exists(dire).Equals(false))
{ {
Directory.CreateDirectory(dire); Directory.CreateDirectory(dire);
} }
Bitmap bit = (Bitmap)bitmap.Clone();
//deleteFiles(dire); //deleteFiles(dire);
bit.Save(dire + iamgeName, ImageFormat.Bmp); bit.Save(dire + iamgeName, ImageFormat.Bmp);
bit.Dispose(); bit.Dispose();
...@@ -439,14 +442,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -439,14 +442,16 @@ namespace OnlineStore.DeviceLibrary
string iamgeName = date + ".bmp"; string iamgeName = date + ".bmp";
try try
{ {
Bitmap bit = (Bitmap)bitmap.Clone();
if (Directory.Exists(dire).Equals(false)) if (Directory.Exists(dire).Equals(false))
{ {
Directory.CreateDirectory(dire); Directory.CreateDirectory(dire);
} }
using(Bitmap bit = (Bitmap)bitmap.Clone())
{
deleteFiles(dire); deleteFiles(dire);
bit.Save(dire + iamgeName, ImageFormat.Bmp); bit.Save(dire + iamgeName, ImageFormat.Bmp);
bit.Dispose(); // bit.Dispose();
}
LogUtil.info(deviceName + " 【" + cameraName + "】保存OK图片到【" + dire + iamgeName + "】成功"); LogUtil.info(deviceName + " 【" + cameraName + "】保存OK图片到【" + dire + iamgeName + "】成功");
} }
......
...@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary
//空闲时,自动清除 //空闲时,自动清除
if (runStatus == RunStatus.Runing) if (runStatus == RunStatus.Runing)
{ {
if(!string.IsNullOrEmpty(WarnMsg)) if (!string.IsNullOrEmpty(WarnMsg))
{ {
WarnMsg = ""; WarnMsg = "";
} }
...@@ -561,27 +561,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -561,27 +561,19 @@ namespace OnlineStore.DeviceLibrary
{ {
yellowMove = true; yellowMove = true;
} }
if (isInSuddenDown || isNoAirpressure_Check || alarmType >= alarmRedLedType) if (isInSuddenDown || isNoAirpressure_Check || alarmType >= alarmRedLedType || MoveStop
|| !string.IsNullOrEmpty(WarnMsg))
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
else if (alarmType.Equals(AlarmType.None).Equals(false) || MoveStop)
{
yellowMove = true;
}
if (isNoAirpressure_Check || isInSuddenDown || alarmType >= alarmRedLedType) if (alarmType.Equals(AlarmType.None).Equals(false))
{
isNeedAlarmLed = true;
}
else if (alarmType.Equals(AlarmType.None).Equals(false))
{ {
yellowMove = true; yellowMove = true;
} }
//黄灯 //黄灯
if (yellowMove) if (yellowMove)
{ {
......
...@@ -565,12 +565,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -565,12 +565,11 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
if (CurrSecurityAccess.Equals(0)) if (!StoreManager.DisSecurityAccess)//未屏蔽光栅
{ {
if (StoreManager.DisSecurityAccess) if (CurrSecurityAccess.Equals(0))
{ {
} if (IOValue(IO_Type.Shelf_SafetyRasterSignal).Equals(IO_VALUE.LOW))
else if (IOValue(IO_Type.Shelf_SafetyRasterSignal).Equals(IO_VALUE.LOW))
{ {
SecurityAccessStop(); SecurityAccessStop();
} }
...@@ -581,18 +580,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -581,18 +580,22 @@ namespace OnlineStore.DeviceLibrary
} }
else if (CurrSecurityAccess.Equals(1)) else if (CurrSecurityAccess.Equals(1))
{ {
//if (!StoreManager.DisSecurityAccess)
//{
// SecurityAccessReset();
//}
//else
if (IOValue(IO_Type.Shelf_SafetyRasterSignal).Equals(IO_VALUE.HIGH) && if (IOValue(IO_Type.Shelf_SafetyRasterSignal).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.TurnoverBox_SafetyRasterSignal).Equals(IO_VALUE.HIGH)) IOValue(IO_Type.TurnoverBox_SafetyRasterSignal).Equals(IO_VALUE.HIGH))
{ {
SecurityAccessReset(); SecurityAccessReset();
} }
} }
}
else
{
if (CurrSecurityAccess.Equals(1))
{
{
SecurityAccessReset();
}
}
}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!