Commit 3dac20b8 张东亮

三色灯逻辑优化

1 个父辈 b6dbd966
...@@ -207,7 +207,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -207,7 +207,10 @@ namespace OnlineStore.DeviceLibrary
SaveNGImageToFile(deviceName, cameraName + nameStr, bmp); SaveNGImageToFile(deviceName, cameraName + nameStr, bmp);
} }
SaveOKImageToFile(deviceName, cameraName, bmp); else
{
SaveOKImageToFile(deviceName, cameraName, bmp);
}
} }
if (deviceName != "" || r != "") if (deviceName != "" || 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);
} }
deleteFiles(dire); using(Bitmap bit = (Bitmap)bitmap.Clone())
bit.Save(dire + iamgeName, ImageFormat.Bmp); {
bit.Dispose(); deleteFiles(dire);
bit.Save(dire + iamgeName, ImageFormat.Bmp);
// 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,34 +565,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -565,34 +565,37 @@ 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))
{
SecurityAccessStop();
}
else if (IOValue(IO_Type.TurnoverBox_SafetyRasterSignal).Equals(IO_VALUE.LOW))
{
SecurityAccessStop();
}
} }
else if (IOValue(IO_Type.Shelf_SafetyRasterSignal).Equals(IO_VALUE.LOW)) else if (CurrSecurityAccess.Equals(1))
{
SecurityAccessStop();
}
else if (IOValue(IO_Type.TurnoverBox_SafetyRasterSignal).Equals(IO_VALUE.LOW))
{ {
SecurityAccessStop(); if (IOValue(IO_Type.Shelf_SafetyRasterSignal).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.TurnoverBox_SafetyRasterSignal).Equals(IO_VALUE.HIGH))
{
SecurityAccessReset();
}
} }
} }
else if (CurrSecurityAccess.Equals(1)) else
{ {
//if (!StoreManager.DisSecurityAccess) if (CurrSecurityAccess.Equals(1))
//{
// SecurityAccessReset();
//}
//else
if (IOValue(IO_Type.Shelf_SafetyRasterSignal).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.TurnoverBox_SafetyRasterSignal).Equals(IO_VALUE.HIGH))
{ {
SecurityAccessReset(); {
SecurityAccessReset();
}
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!