Commit 066a96c2 LN

报警验证修改

1 个父辈 547fd939
...@@ -255,12 +255,12 @@ namespace OnlineStore.AssemblyLine ...@@ -255,12 +255,12 @@ namespace OnlineStore.AssemblyLine
lineBean.StopRun(); lineBean.StopRun();
} }
// IOManager.instance.CloseAllDO(); // IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection(); IOManager.instance.CloseAllConnection();
//AIManager.CloseConnect(); //AIManager.CloseConnect();
ACServerManager.CloseAllPort(); ACServerManager.CloseAllPort();
// CodeManager.CloseAllCamera(); // CodeManager.CloseAllCamera();
// TrayManager.RfidReader.Close(); TrayManager.RfidReader.Close();
//this.Close(); //this.Close();
System.Environment.Exit(System.Environment.ExitCode); System.Environment.Exit(System.Environment.ExitCode);
} }
...@@ -492,7 +492,8 @@ namespace OnlineStore.AssemblyLine ...@@ -492,7 +492,8 @@ namespace OnlineStore.AssemblyLine
if ((lineBean.runStatus.Equals(LineRunStatus.HomeMoving) || lineBean.runStatus.Equals(LineRunStatus.Reset)) if ((lineBean.runStatus.Equals(LineRunStatus.HomeMoving) || lineBean.runStatus.Equals(LineRunStatus.Reset))
&& lineBean.alarmType.Equals(LineAlarmType.None)) && lineBean.alarmType.Equals(LineAlarmType.None))
{ {
SetMenuS(复位RToolStripMenuItem, false); SetMenuS(启动AToolStripMenuItem, false); SetMenuS(复位RToolStripMenuItem, false);
SetMenuS(启动AToolStripMenuItem, false);
} }
else else
{ {
......
...@@ -166,7 +166,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -166,7 +166,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.DLine_Reset).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.DLine_Reset).Equals(IO_VALUE.HIGH))
{ {
if (alarmType.Equals(LineAlarmType.None)) if (NoAlarm())
{ {
if (MoveInfo.MoveType.Equals(LineMoveType.None)) if (MoveInfo.MoveType.Equals(LineMoveType.None))
{ {
...@@ -188,7 +188,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -188,7 +188,7 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess(); BusyMoveProcess();
//判断流水线打开了才可以运行 //判断流水线打开了才可以运行
if (runStatus.Equals(LineRunStatus.Runing) && alarmType.Equals(LineAlarm.None)) if (runStatus.Equals(LineRunStatus.Runing) && NoAlarm())
{ {
//判断是否需要入库 //判断是否需要入库
if (IOValue(IO_Type.DLine_Exit_Check3).Equals(IO_VALUE.LOW) && LineRuning.Equals(false)) if (IOValue(IO_Type.DLine_Exit_Check3).Equals(IO_VALUE.LOW) && LineRuning.Equals(false))
...@@ -218,7 +218,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -218,7 +218,7 @@ namespace OnlineStore.DeviceLibrary
IOTimeOutProcess(); IOTimeOutProcess();
//判断红灯状态 //判断红灯状态
if (alarmType.Equals(LineAlarmType.None)) if (NoAlarm())
{ {
IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.LOW); IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.LOW);
} }
......
...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
internal bool CanStartOut(int lineNum) internal bool CanStartOut(int lineNum)
{ {
if (alarmType.Equals(LineAlarm.None).Equals(false) || runStatus.Equals(LineRunStatus.Runing).Equals(false)) if (NoAlarm() || runStatus.Equals(LineRunStatus.Runing).Equals(false))
{ {
return false; return false;
} }
......
...@@ -392,7 +392,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -392,7 +392,7 @@ namespace OnlineStore.DeviceLibrary
{ {
TimeSpan rwSpan = DateTime.Now - preRWTime; TimeSpan rwSpan = DateTime.Now - preRWTime;
//一分钟还未检测到 //一分钟还未检测到
if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut) if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut&&NoAlarm())
{ {
ConfigIO io = baseConfig.getWaitIO(wait.IoType); ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "等待" + NotOkMsg + " 超时"; WarnMsg = Name + "等待" + NotOkMsg + " 超时";
...@@ -461,7 +461,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -461,7 +461,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveInfo.EndStepWait(); moveInfo.EndStepWait();
} }
else if (span.TotalSeconds > moveInfo.TimeOutSeconds) else if (span.TotalSeconds > moveInfo.TimeOutSeconds )
{ {
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待[" + NotOkMsg WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待[" + NotOkMsg
+ "]超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; + "]超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
......
...@@ -323,7 +323,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -323,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (IOValue(IO_Type.SL_Reset_BTN).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SL_Reset_BTN).Equals(IO_VALUE.HIGH))
{ {
if (alarmType.Equals(LineAlarmType.None)) if (NoAlarm())
{ {
if (MoveInfo.MoveType.Equals(LineMoveType.None)) if (MoveInfo.MoveType.Equals(LineMoveType.None))
{ {
...@@ -343,7 +343,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -343,7 +343,7 @@ namespace OnlineStore.DeviceLibrary
} }
BusyMoveProcess(); BusyMoveProcess();
//判断流水线打开了才可以运行 //判断流水线打开了才可以运行
if (MoveInfo.MoveType.Equals(LineMoveType.None)&&alarmType.Equals(LineAlarmType.None)) if (MoveInfo.MoveType.Equals(LineMoveType.None)&&NoErrorAlarm())
{ {
if ( Config.IsCanOut.Equals(0)) if ( Config.IsCanOut.Equals(0))
{ {
...@@ -354,7 +354,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -354,7 +354,7 @@ namespace OnlineStore.DeviceLibrary
StartOutStoreP(); StartOutStoreP();
} }
} }
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None) &&( isInSuddenDown.Equals(false)&&isNoAirCheck.Equals(false))) if (SecondMoveInfo.MoveType.Equals(LineMoveType.None) && NoErrorAlarm())
{ {
StartCheckFixture(); StartCheckFixture();
} }
......
...@@ -50,10 +50,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,10 +50,10 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
if (Config.SidesWayNum > 0) if (Config.SidesWayNum > 0)
{ {
bool isTestNeed = (LineManager.Line.runStatus <= LineRunStatus.Wait); bool isTestNeed = (LineManager.Line.runStatus <= LineRunStatus.Wait);
bool isNeedTray = (LineManager.Line.SwNoProcess(Config.SidesWayNum)); bool isNeedTray = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && (isTestNeed || isNeedTray)) if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && (isTestNeed || isNeedTray))
...@@ -69,7 +69,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -69,7 +69,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up); CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up);
} }
else else
{ {
preTrayNum = currTrayNum; preTrayNum = currTrayNum;
currTrayNum = num; currTrayNum = num;
TrayManager.UpdateSWState(Config.SidesWayNum, 1); TrayManager.UpdateSWState(Config.SidesWayNum, 1);
...@@ -80,13 +80,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -80,13 +80,13 @@ namespace OnlineStore.DeviceLibrary
////判断是否是需要的托盘 ////判断是否是需要的托盘
//if (CurrTrayIsNeed(num, true)) //if (CurrTrayIsNeed(num, true))
//{ //{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam); SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
TrayManager.UpdateSWState(Config.SidesWayNum, 2); TrayManager.UpdateSWState(Config.SidesWayNum, 2);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down);
CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,最多等待1秒"); CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,最多等待1秒");
IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW)); // SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
//} //}
//else //else
//{ //{
...@@ -103,7 +103,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,7 +103,7 @@ namespace OnlineStore.DeviceLibrary
{ {
// int num = TrayManager.GetTrayNum(DeviceID); // int num = TrayManager.GetTrayNum(DeviceID);
//托盘在两个阻挡内 //托盘在两个阻挡内
if ( IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH))
{ {
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
CheckLog("检测到FL_TrayCheck:" + SecondMoveInfo.SLog + " FL阻挡1上升)"); CheckLog("检测到FL_TrayCheck:" + SecondMoveInfo.SLog + " FL阻挡1上升)");
...@@ -155,7 +155,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -155,7 +155,7 @@ namespace OnlineStore.DeviceLibrary
{ {
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸上升,等待SW_TrayCheck=1)"); CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸上升,等待SW_TrayCheck=1)");
IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW); IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW)); // SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH));
} }
} }
...@@ -710,23 +710,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -710,23 +710,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_25_MoveCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.FI_25_MoveCylinder_Up);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升, 托盘开始放行"); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升, 托盘开始放行");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//Task.Factory.StartNew(delegate
//{
// //更新托盘条码信息
// string code = CodeManager.ProcessCode(LastCodeList);
// TrayManager.UpdateTrayInfo(currTrayNum, true, 1, code, "", LastHeight, LastWidth);
// if (code.Equals(""))
// {
// TrayManager.UpdateInStoreNG(currTrayNum, true, "扫码失败");
// }
// //从服务器获取库位号
// string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
// if (!result.Equals(""))
// {
// TrayManager.UpdateInStoreNG(currTrayNum, true, result);
// LogUtil.error(Name + "托盘【" + currTrayNum + "】" + result);
// }
//});
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
} }
...@@ -830,7 +813,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -830,7 +813,7 @@ namespace OnlineStore.DeviceLibrary
FI_12_MoveCylinder_Give(); FI_12_MoveCylinder_Give();
} }
else else
{ {
//无料盘 //无料盘
MoveInfo.ShelfNoTray = true; MoveInfo.ShelfNoTray = true;
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2); MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
...@@ -876,10 +859,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -876,10 +859,11 @@ namespace OnlineStore.DeviceLibrary
if (LastHeight <= 8) { LastHeight = 8; } if (LastHeight <= 8) { LastHeight = 8; }
else else
{ {
LastHeight = (int)Math.Ceiling(1F * (LastHeight-2) / 4) * 4; LastHeight = (int)Math.Ceiling(1F * (LastHeight - 2 - 4) / 4) * 4;
} }
if (LastHeight <= 8) { LastHeight = 8; }
LogUtil.info(msg + ",归类为" + LastHeight); LogUtil.info(msg + ",归类为" + LastHeight);
return LastHeight; return LastHeight;
} }
public int GetWidth() public int GetWidth()
{ {
......
...@@ -125,9 +125,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -125,9 +125,9 @@ namespace OnlineStore.DeviceLibrary
if (IsDebug) if (IsDebug)
{ {
rfidList = new List<string>() { //rfidList = new List<string>() {
"192.168.210.116","192.168.210.120","192.168.210.121" // "192.168.210.116","192.168.210.120","192.168.210.121"
}; //};
try try
{ {
cioList = new List<string>(); cioList = new List<string>();
...@@ -183,15 +183,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -183,15 +183,15 @@ namespace OnlineStore.DeviceLibrary
{ {
IOManager.instance.ConnectionIOList(cioList); IOManager.instance.ConnectionIOList(cioList);
Thread.Sleep(5); Thread.Sleep(5);
if (!IsDebug) // if (!IsDebug)
{ //{
//Task.Factory.StartNew(delegate // Task.Factory.StartNew(delegate
//{ // {
// string[] rfidArray = rfidList.ToArray(); // string[] rfidArray = rfidList.ToArray();
// //连接rfip // //连接rfip
// TrayManager.RfidReader.Open(rfidArray); // TrayManager.RfidReader.Open(rfidArray);
//}); // });
} //}
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check)); addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN)); addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
addLastDI(IO_Type.Reset_BTN, IOValue(IO_Type.Reset_BTN)); addLastDI(IO_Type.Reset_BTN, IOValue(IO_Type.Reset_BTN));
...@@ -323,7 +323,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -323,7 +323,6 @@ namespace OnlineStore.DeviceLibrary
isInprocess = false; isInprocess = false;
isInSuddenDown = false; isInSuddenDown = false;
isNoAirCheck = false; isNoAirCheck = false;
alarmType = LineAlarmType.None;
TrayManager.TrayErrorMsg = ""; TrayManager.TrayErrorMsg = "";
SetWarnMsg(""); SetWarnMsg("");
PreIsHasProcess = true; PreIsHasProcess = true;
...@@ -376,7 +375,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -376,7 +375,7 @@ namespace OnlineStore.DeviceLibrary
isNeedAllReset = true; isNeedAllReset = true;
LogUtil.error( Name + "收到复位信号,在急停中或没有气压中,强制所有设备复位,清理出库需要的托盘数量~"); LogUtil.error( Name + "收到复位信号,在急停中或没有气压中,强制所有设备复位,清理出库需要的托盘数量~");
} }
else if ((runStatus == LineRunStatus.HomeMoving || runStatus == LineRunStatus.Reset) && alarmType.Equals(LineAlarmType.None)) else if ((runStatus == LineRunStatus.HomeMoving || runStatus == LineRunStatus.Reset) && NoAlarm())
{ {
LogUtil.error( Name + "收到复位信号,已经在复位或原点返回中,且当前无报警,不处理复位"); LogUtil.error( Name + "收到复位信号,已经在复位或原点返回中,且当前无报警,不处理复位");
return false; return false;
...@@ -405,7 +404,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -405,7 +404,7 @@ namespace OnlineStore.DeviceLibrary
//调试状态不再重置 //调试状态不再重置
if (!equip.IsDebug) if (!equip.IsDebug)
{ {
if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!equip.alarmType.Equals(LineAlarmType.None))) if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm()))
{ {
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位"); LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
equip.Reset(); equip.Reset();
...@@ -608,14 +607,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -608,14 +607,14 @@ namespace OnlineStore.DeviceLibrary
bool isNeedAlarmLed = false; bool isNeedAlarmLed = false;
bool isInOut = false; bool isInOut = false;
if (alarmType.Equals(LineAlarmType.None).Equals(false) || isNoAirCheck || isInSuddenDown || TrayManager.TrayErrorMsg != "") if (NoAlarm().Equals(false) || TrayManager.TrayErrorMsg != "")
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
foreach (MoveEquip moveEquip in MoveEquipMap.Values) foreach (MoveEquip moveEquip in MoveEquipMap.Values)
{ {
if (!moveEquip.alarmType.Equals(LineAlarmType.None)) if (!moveEquip.NoAlarm())
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
...@@ -908,7 +907,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -908,7 +907,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if ((moveEquip.runStatus.Equals(LineRunStatus.HomeMoving) || moveEquip.runStatus.Equals(LineRunStatus.Reset)) && moveEquip.IsDebug.Equals(false)) if ((moveEquip.runStatus.Equals(LineRunStatus.HomeMoving) || moveEquip.runStatus.Equals(LineRunStatus.Reset)) && moveEquip.IsDebug.Equals(false))
{ {
if (moveEquip.alarmType.Equals(LineAlarmType.None)) if (moveEquip.NoAlarm())
{ {
isOk = false; isOk = false;
break; break;
......
...@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary
if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut) if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut)
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
if (alarmType.Equals(LineAlarmType.None)) if (NoAlarm())
{ {
WarnMsg = Name + " 等待" + NotOkMsg + "超时"; WarnMsg = Name + " 等待" + NotOkMsg + "超时";
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
...@@ -252,7 +252,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -252,7 +252,7 @@ namespace OnlineStore.DeviceLibrary
{ {
checkWaitInfo.EndStepWait(); checkWaitInfo.EndStepWait();
} }
else if (span.TotalSeconds > checkWaitInfo.TimeOutSeconds&&alarmType.Equals(LineAlarmType.None)) else if (span.TotalSeconds > checkWaitInfo.TimeOutSeconds )
{ {
WarnMsg = checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒"; WarnMsg = checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 100); LogUtil.error(WarnMsg, 100);
...@@ -852,7 +852,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -852,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns> /// <returns></returns>
public bool CanOutStore(int id) public bool CanOutStore(int id)
{ {
if (!alarmType.Equals(LineAlarmType.None) || isInSuddenDown || isNoAirCheck) if (!NoErrorAlarm())
{ {
return false; return false;
} }
...@@ -861,7 +861,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -861,7 +861,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
MoveEquip move = MoveEquipMap[id]; MoveEquip move = MoveEquipMap[id];
if (!move.alarmType.Equals(LineAlarmType.None) || move.waitInStoreList.Count > 0 || move.IsDebug || move.waitOutStoreList.Count > 0) if (!move.NoAlarm() || move.waitInStoreList.Count > 0 || move.IsDebug || move.waitOutStoreList.Count > 0)
{ {
return false; return false;
} }
...@@ -882,7 +882,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -882,7 +882,7 @@ namespace OnlineStore.DeviceLibrary
public bool CanIntore(int id) public bool CanIntore(int id)
{ {
if ( isInSuddenDown || isNoAirCheck) if (!NoErrorAlarm())
{ {
return false; return false;
} }
...@@ -891,7 +891,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -891,7 +891,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
MoveEquip move = MoveEquipMap[id]; MoveEquip move = MoveEquipMap[id];
if (!move.alarmType.Equals(LineAlarmType.None) || move.IsDebug || move.waitOutStoreList.Count > 0) if (!move.NoAlarm() || move.IsDebug || move.waitOutStoreList.Count > 0)
{ {
return false; return false;
} }
......
...@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
public class TrayManager public class TrayManager
{ {
public static int StopDownWaitTime = 1000; public static int StopDownWaitTime = 1000;
// public static RFID RfidReader = new RFID(); public static RFID RfidReader = new RFID();
///// <summary> ///// <summary>
///// 出库时,可以不下降直接放料盘的宽度 ///// 出库时,可以不下降直接放料盘的宽度
///// </summary> ///// </summary>
...@@ -185,34 +185,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -185,34 +185,27 @@ namespace OnlineStore.DeviceLibrary
public static int GetTrayNum(int subType, bool isClear = false) public static int GetTrayNum(int subType, bool isClear = false)
{ {
return 9; return 9;
//if (subType.Equals(104)) if (subType.Equals(104))
//{ {
// return LineManager.Line.Sw23TrayNum; return LineManager.Line.Sw23TrayNum;
//} }
//else if (subType.Equals(101)) else if (subType.Equals(101))
//{ {
// return LineManager.Line.Sw41TrayNum; return LineManager.Line.Sw41TrayNum;
//} }
string ip = GetRFIP(subType);
//获取盘号
RFIDData data = ReadRFID(ip,isClear);
if (data != null)
{
if (data.RFType.Equals((byte)'E'))
{
return data.Num;
}
return 0;
}
//string ip = GetRFIP(subType);
////获取盘号
//RFIDData data = ReadRFID(ip);
//if (data != null)
//{
// if (data.RFType.Equals((byte)'E'))
// {
// return data.Num;
// }
// return 0;
// //else
// //{
// // LogUtil.error("读取托盘RFID[" + subType + "][" + ip + "]的数据出错:" + data.ToStr());
// //}
//}
//if (isClear)
//{
// RfidReader.Clear(ip);
//}
return 0; return 0;
} }
public static RFIDData GetShelfData(int subType) public static RFIDData GetShelfData(int subType)
...@@ -222,25 +215,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -222,25 +215,24 @@ namespace OnlineStore.DeviceLibrary
} }
public static RFIDData ReadRFID(string ip) public static RFIDData ReadRFID(string ip,bool isClear=false)
{ {
//try try
//{ {
// if (String.IsNullOrEmpty(ip).Equals(false) && LineManager.Line.rfidList.Contains(ip)) if (String.IsNullOrEmpty(ip).Equals(false) && LineManager.Line.rfidList.Contains(ip))
// { {
// //获取盘号 RFIDData data= new RFIDData(RfidReader.Read(ip));
// byte[] data = RfidReader.Read(ip); if (isClear)
// if (data != null && data.Length >= 2) {
// { RfidReader.Clear(ip);
// RFIDData d = new RFIDData(data); }
// return d; return data;
// } }
// } }
//} catch (Exception ex)
//catch (Exception ex) {
//{ //LogUtil.error("ReadRFID["+ip+"]出错:" + ex.ToString());
// //LogUtil.error("ReadRFID["+ip+"]出错:" + ex.ToString()); }
//}
return new RFIDData(-1, -1); return new RFIDData(-1, -1);
} }
...@@ -363,8 +355,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -363,8 +355,11 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
RFType = data[1]; if (data != null && data.Length > 2)
Num = Convert.ToInt32(data[2]); {
RFType = data[1];
Num = Convert.ToInt32(data[2]);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -167,15 +167,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -167,15 +167,37 @@ namespace OnlineStore.DeviceLibrary
case LineAlarmType.IoSingleTimeOut: case LineAlarmType.IoSingleTimeOut:
aType = 3; aType = 3;
break; break;
case LineAlarmType.StellAlarm:
aType = 2;
alarmDetial = "5";
break;
default: break; default: break;
} }
alarmInfo = new AlarmInfo(DeviceID, aType, alarmDetial, alarmMsg, inoutStatus); alarmInfo = new AlarmInfo(DeviceID, aType, alarmDetial, alarmMsg, inoutStatus);
} }
protected bool NoErrorAlarm()
{
if (isInSuddenDown || isNoAirCheck)
{
return false;
}
if (alarmType > LineAlarmType.IoSingleTimeOut)
{
return false;
}
return true;
}
internal bool NoAlarm()
{
if (isInSuddenDown || isNoAirCheck)
{
return false;
}
if (alarmType.Equals(LineAlarmType.None))
{
return true ;
}
return false ;
}
/// <summary> /// <summary>
/// 开始运行 /// 开始运行
/// </summary> /// </summary>
......
...@@ -928,32 +928,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -928,32 +928,30 @@ namespace OnlineStore.DeviceLibrary
public enum LineAlarmType public enum LineAlarmType
{ {
/// <summary> /// <summary>
/// 没有报警 /// 没有报警,数字越大报警级别越大
/// </summary> /// </summary>
None = 0, None = 0,
/// <summary> /// <summary>
/// 轴报警 /// io信号超时未收到
/// </summary>
AxisAlarm = 1,
/// <summary>
/// 收到急停
/// </summary> /// </summary>
SuddenStop = 10, IoSingleTimeOut = 10,
/// <summary> /// <summary>
/// 没有气压信号 /// 轴报警
/// </summary> /// </summary>
NoAirCheck = 11, AxisAlarm = 1000,
/// <summary> /// <summary>
/// 轴运动错误,没有达到指定脉冲,但是io判断已停止运动 /// 轴运动错误,没有达到指定脉冲,但是io判断已停止运动
/// </summary> /// </summary>
AxisMoveError = 20, AxisMoveError = 1001,
/// <summary> /// <summary>
/// io信号超时未收到 /// 没有气压信号
/// </summary> /// </summary>
IoSingleTimeOut = 30, NoAirCheck = 9999,
/// <summary> /// <summary>
/// 电钢报警 /// 收到急停
/// </summary> /// </summary>
StellAlarm=50, SuddenStop = 10000,
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!