Commit 3dac20b8 张东亮

三色灯逻辑优化

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