Commit 46d84b6a LN

入库失败时蜂鸣器响

1 个父辈 9cf6fb80
......@@ -125,4 +125,7 @@ DeCodeType=解码类型,0=halcon,1=zxing解码 西安料仓解析方式。2=
扫码时最多扫2次,通知服务器没扫到码,等待料盘拿走后,再重新开始扫码
20200305
入库失败时蜂鸣器响
......@@ -232,6 +232,7 @@ namespace OnlineStore.DeviceLibrary
SetWarnMsg();
CurrInOutACount = 0;
CurrInOutCount = 0;
InStoreFail = false;
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
......@@ -269,6 +270,7 @@ namespace OnlineStore.DeviceLibrary
CurrInOutCount = 0;
CurrInOutACount = 0;
InStoreFail = false;
CurrScanCount = 0;
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
......@@ -816,7 +818,7 @@ namespace OnlineStore.DeviceLibrary
}
bool isNeedAlarmLed = false;
//报警灯
if (!alarmType.Equals(StoreAlarmType.None) || isTemp30M)
if (!alarmType.Equals(StoreAlarmType.None) || isTemp30M|| InStoreFail)
{
isNeedAlarmLed = true;
}
......@@ -1051,9 +1053,9 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE checkIO = IOManager.IOValue(IO_Type.TrayCheck_Door);
int height = GetHeight();
//判断料门口是否有料
if ((checkIO.Equals(IO_VALUE.HIGH)) && height > 0 && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)&&IsDebug.Equals(false))
if ((checkIO.Equals(IO_VALUE.HIGH)) && height > 0 )
{
if (!CanStartCode())
if (!CanStartCode() || IsDebug || IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
return;
}
......@@ -1066,7 +1068,7 @@ namespace OnlineStore.DeviceLibrary
isWaitScan = false;
IsScanCode = true;
CurrScanCount++;
LogUtil.info(StoreName + "检测到" + height + "寸料盘,开始扫码,次数 ["+ CurrScanCount + "]");
LogUtil.info(StoreName + "检测到" + height + "寸料盘,开始扫码,次数 [" + CurrScanCount + "]");
GetCameraCode();
}
}
......@@ -1078,6 +1080,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
InStoreFail = false;
CurrScanCount = 0;
isWaitScan = false;
}
......@@ -1318,7 +1321,7 @@ namespace OnlineStore.DeviceLibrary
#region datalogic扫码枪代码
private bool isWaitScan = false;
private DateTime StartWaitScanTime = DateTime.Now;
private bool IsNotScanCode = false;
private bool InStoreFail = false;
private bool IsScanCode = false;
/// <summary>
/// 扫码枪数据接收
......@@ -1334,12 +1337,12 @@ namespace OnlineStore.DeviceLibrary
message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message))
{
IsNotScanCode = true;
IsScanCode = false;
CodeMsg =ResourceControl.GetChinaString(ResourceControl.NoCodeMsg, "没有收到二维码信息,请重新放入料盘");
CodeMsgEn = ResourceControl.GetEnglishString(ResourceControl.NoCodeMsg, "没有收到二维码信息,请重新放入料盘");
if (CurrScanCount >= MaxScanCount)
{
InStoreFail = true;
LogUtil.info(LOGGER, StoreName + "没有收到二维码信息 【" + CurrScanCount + "】次,请重新放入料盘,通知服务器未扫到条码");
//TODO 向服务器发送未扫到码消息
......@@ -1357,7 +1360,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
IsNotScanCode = false;
InStoreFail = false;
if (storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(LOGGER, StoreName + "二维码【 " + message + "】,设备未启动,不需要发送服务器");
......@@ -1424,6 +1427,7 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#');
if (!(posArray.Length == 2))
{
InStoreFail = true;
//WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
SetWarnMsg(ResourceControl.InStoreError, message, posId);
LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
......@@ -1436,9 +1440,9 @@ namespace OnlineStore.DeviceLibrary
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId);
if (position == null)
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
InStoreFail = true;
SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
// WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
// WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
LogUtil.error(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return;
......@@ -1446,6 +1450,7 @@ namespace OnlineStore.DeviceLibrary
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (CanStarInOut())
{
InStoreFail = false;
IsScanCode = false;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
......@@ -1455,6 +1460,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
InStoreFail = true;
LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
IsScanCode = false;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!