Commit 3547a0c6 LN

1

1 个父辈 179c6ed8
...@@ -377,6 +377,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -377,6 +377,10 @@ namespace OnlineStore.DeviceLibrary
{ {
return true; return true;
} }
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return true;
}
if (SW12_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false)) if (SW12_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{ {
return true; return true;
......
...@@ -44,14 +44,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,14 +44,11 @@ namespace OnlineStore.DeviceLibrary
{ {
isInprocess = true; isInprocess = true;
lastProTime = DateTime.Now; lastProTime = DateTime.Now;
if (!isCanProcessLine())
{
return;
}
//出入料口条件: 各料仓无报警( 伺服), 各移栽装置处 于原位待机, 检测夹具IO,驱动电机运转 //出入料口条件: 各料仓无报警( 伺服), 各移栽装置处 于原位待机, 检测夹具IO,驱动电机运转
if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.LOW)) if (!isCanProcessLine() || IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.LOW))
{ {
isWaitOutGo = false; isWaitOutGo = false;
isInprocess = false;
return; return;
} }
...@@ -274,6 +271,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -274,6 +271,7 @@ namespace OnlineStore.DeviceLibrary
if (!wait.IsEnd) if (!wait.IsEnd)
{ {
List<WriteIOInfo> wLists = checkWaitInfo.WriteIoList;
TimeSpan rwSpan = DateTime.Now - preRWTime; TimeSpan rwSpan = DateTime.Now - preRWTime;
if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut) if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut)
{ {
...@@ -281,20 +279,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -281,20 +279,19 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = Name + " 等待" + NotOkMsg + "超时"; WarnMsg = Name + " 等待" + NotOkMsg + "超时";
Alarm(LineAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, checkWaitInfo.MoveType); Alarm(LineAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, checkWaitInfo.MoveType);
LogUtil.error(checkWaitInfo.Name + ":" + wait.IoType + "等待" + NotOkMsg + "超时", 14); LogUtil.error(checkWaitInfo.Name + ":" + checkWaitInfo.MoveStep + "等待" + NotOkMsg + "超时", 14);
isOk = false; isOk = false;
break; break;
} }
else if (rwSpan.TotalSeconds > 3 && span.TotalSeconds > 3 && (checkWaitInfo.WriteIoList != null) && checkWaitInfo.WriteIoList.Count > 0) else if (rwSpan.TotalSeconds > 3 && span.TotalSeconds > 3 && (wLists != null) && wLists.Count > 0)
{ {
List<WriteIOInfo> wLists = new List<WriteIOInfo>(checkWaitInfo.WriteIoList);
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
string msg = checkWaitInfo.Name + " " + NotOkMsg + " 已等待" + Math.Abs(span.TotalSeconds) + "秒,重写DO:"; string msg = checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "]" + " 已等待 " + NotOkMsg + Math.Abs(span.TotalSeconds) + "秒,重写DO:";
foreach (WriteIOInfo ww in wLists) foreach (WriteIOInfo ww in wLists)
{ {
IOMove(ww.IoType, ww.IoValue); IOMove(ww.IoType, ww.IoValue);
msg += "[" + ww.IoType + "+" + ww.IoValue + "],"; msg += "[" + ww.IoType + "=" + ww.IoValue + "],";
} }
LogUtil.error(msg); LogUtil.error(msg);
} }
...@@ -339,7 +336,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -339,7 +336,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:" + ex.ToString()); LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:" + ex.StackTrace);
} }
} }
...@@ -419,7 +416,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -419,7 +416,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NewMove(LineMoveType.InStore); MoveInfo.NewMove(LineMoveType.InStore);
MoveInfo.NextMoveStep(LineMoveStep.LI_00_Wait100); MoveInfo.NextMoveStep(LineMoveStep.LI_00_Wait100);
MoveInfo.MoveParam = param; MoveInfo.MoveParam = param;
preTrayNum = param.TrayNumber;
//等待料仓验证成功,最多等待10秒,若验证不成功,直接失败 //等待料仓验证成功,最多等待10秒,若验证不成功,直接失败
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
...@@ -460,6 +456,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -460,6 +456,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
preTrayNum = MoveInfo.MoveParam.TrayNumber;
lock (moveEquip.waitInListLock) lock (moveEquip.waitInListLock)
{ {
//如果当前正在出入库中,需要记录下来,等待空闲时执行 //如果当前正在出入库中,需要记录下来,等待空闲时执行
...@@ -612,8 +609,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -612,8 +609,20 @@ namespace OnlineStore.DeviceLibrary
private bool SideWay12IsWait = false; private bool SideWay12IsWait = false;
private DateTime SideWay34Ntime = DateTime.Now; private DateTime SideWay34Ntime = DateTime.Now;
private bool SideWay34IsWait = false; private bool SideWay34IsWait = false;
private bool sdIsInprocess = false;
private DateTime sdlastProTime = DateTime.Now;
private void SideWayTimerProcess() private void SideWayTimerProcess()
{ {
TimeSpan span = DateTime.Now - sdlastProTime;
if (sdIsInprocess && span.TotalSeconds < 5)
{
return;
}
try
{
sdIsInprocess = true; sdlastProTime = DateTime.Now;
//流水线转动中,并且在忙碌或出入库处理中,需要处理移栽 //流水线转动中,并且在忙碌或出入库处理中,需要处理移栽
if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH) && runStatus >= LineRunStatus.Runing) if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH) && runStatus >= LineRunStatus.Runing)
{ {
...@@ -702,6 +711,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -702,6 +711,12 @@ namespace OnlineStore.DeviceLibrary
SideWay12IsWait = false; SideWay12IsWait = false;
} }
} }
catch (Exception ex)
{
LogUtil.error("SideWayTimerProcess 出错:" + ex.StackTrace);
}
sdIsInprocess = false;
}
private void SideWay12BusyProcess() private void SideWay12BusyProcess()
{ {
...@@ -812,7 +827,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -812,7 +827,8 @@ namespace OnlineStore.DeviceLibrary
else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW02_WaitFixtureCheck)) else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW02_WaitFixtureCheck))
{ {
SW34_MoveInfo.NextMoveStep(LineMoveStep.SW03_TopCylinderUp); SW34_MoveInfo.NextMoveStep(LineMoveStep.SW03_TopCylinderUp);
SWLog("横移轨道34:顶升气缸上升 ,横移3阻挡上升 "); SWLog("横移轨道34:顶升气缸上升 ,横移3阻挡上升,至少等待1000 ");
SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
IOMove(IO_Type.SidesWay3_StopCylinderDown, IO_VALUE.LOW); IOMove(IO_Type.SidesWay3_StopCylinderDown, IO_VALUE.LOW);
SideWay34TopCylinderMove(IO_VALUE.LOW, IO_VALUE.HIGH, SW34_MoveInfo); SideWay34TopCylinderMove(IO_VALUE.LOW, IO_VALUE.HIGH, SW34_MoveInfo);
} }
......
...@@ -45,7 +45,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -45,7 +45,7 @@ namespace OnlineStore.DeviceLibrary
} }
//this.Box = box; //this.Box = box;
MoveInfo = new LineMoveInfo(DeviceID,"移栽-"+DeviceID+"-MoveInfo"); MoveInfo = new LineMoveInfo(DeviceID, "移栽-" + DeviceID + "-MoveInfo");
SecondMoveInfo = new LineMoveInfo(DeviceID, "移栽-" + DeviceID + "-SecondMoveInfo"); SecondMoveInfo = new LineMoveInfo(DeviceID, "移栽-" + DeviceID + "-SecondMoveInfo");
IsDebug = config.IsDebug.Equals(1); IsDebug = config.IsDebug.Equals(1);
UpdownUseAxis = config.UpDownUseAxis.Equals(1); UpdownUseAxis = config.UpDownUseAxis.Equals(1);
...@@ -66,7 +66,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,7 +66,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始运行 /// 开始运行
/// </summary> /// </summary>
public override bool StartRun( ) public override bool StartRun()
{ {
preTrayNum = 0; preTrayNum = 0;
currMoveTrayNum = 0; currMoveTrayNum = 0;
...@@ -89,7 +89,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -89,7 +89,7 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.StoreOnline; lineStatus = LineStatus.StoreOnline;
//TODO 调试时暂时注释 //TODO 调试时暂时注释
runStatus = LineRunStatus.HomeMoving; runStatus = LineRunStatus.HomeMoving;
bool result= MoveEquipMentHome(); bool result = MoveEquipMentHome();
if (result) if (result)
{ {
mainTimer.Enabled = true; mainTimer.Enabled = true;
...@@ -167,7 +167,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -167,7 +167,7 @@ namespace OnlineStore.DeviceLibrary
StopMoveProcess(); StopMoveProcess();
} }
if (SecondMoveInfo.MoveType .Equals( LineMoveType.CheckFixture)) if (SecondMoveInfo.MoveType.Equals(LineMoveType.CheckFixture))
{ {
CheckFixtureProcess(); CheckFixtureProcess();
} }
...@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None)) if (SecondMoveInfo.MoveType.Equals(LineMoveType.None))
{ {
LineBean lineBean = LineManager.Line; LineBean lineBean = LineManager.Line;
if (lineBean.isCanProcessLine() && IOManager.IOValue(IO_Type.DriveMotor_Run,0).Equals(IO_VALUE.HIGH) && lineBean.runStatus >= LineRunStatus.Runing && lineBean.IsSleep.Equals(false)) if (lineBean.isCanProcessLine() && IOManager.IOValue(IO_Type.DriveMotor_Run, 0).Equals(IO_VALUE.HIGH) && lineBean.runStatus >= LineRunStatus.Runing && lineBean.IsSleep.Equals(false))
{ {
// LogUtil.info("StartCheckFixture"); // LogUtil.info("StartCheckFixture");
StartCheckFixture(); StartCheckFixture();
...@@ -207,7 +207,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -207,7 +207,7 @@ namespace OnlineStore.DeviceLibrary
} }
IOTimeOutProcess(); IOTimeOutProcess();
OutStoreListPro (); OutStoreListPro();
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -251,9 +251,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -251,9 +251,18 @@ namespace OnlineStore.DeviceLibrary
{ {
lock (waitOutListLock) lock (waitOutListLock)
{ {
//判断是否已经加入,不重复加
List<InOutParam> paramList = (from m in waitOutStoreList where m.PosId.Equals(param.PosId) select m).ToList<InOutParam>();
if (paramList.Count > 0)
{
LogUtil.error(Name + "出库【" + param.ToStr() + "】加入等待出库队列失败,此库位已存在列表中");
}
else
{
waitOutStoreList.Add(param); waitOutStoreList.Add(param);
} }
} }
}
private DateTime preIoTimerOutTime = DateTime.Now; private DateTime preIoTimerOutTime = DateTime.Now;
private void IOTimeOutProcess() private void IOTimeOutProcess()
...@@ -261,17 +270,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -261,17 +270,17 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
TimeSpan span = DateTime.Now - preIoTimerOutTime; TimeSpan span = DateTime.Now - preIoTimerOutTime;
if (span.TotalSeconds > 1&& alarmType.Equals(LineAlarmType.IoSingleTimeOut)) if (span.TotalSeconds > 1 && alarmType.Equals(LineAlarmType.IoSingleTimeOut))
{ {
preIoTimerOutTime = DateTime.Now; preIoTimerOutTime = DateTime.Now;
if (runStatus < LineRunStatus.Runing|| isInSuddenDown || isNoAirCheck) if (runStatus < LineRunStatus.Runing || isInSuddenDown || isNoAirCheck)
{ {
return; return;
} }
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过 //若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if (MoveInfo.IsInWait .Equals(false)&&SecondMoveInfo.IsInWait.Equals(false)) if (MoveInfo.IsInWait.Equals(false) && SecondMoveInfo.IsInWait.Equals(false))
{ {
LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 "); LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 ");
alarmType = LineAlarmType.None; alarmType = LineAlarmType.None;
...@@ -281,7 +290,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -281,7 +290,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error( "IOTimeOutProcess出错:" + ex.ToString()); LogUtil.error("IOTimeOutProcess出错:" + ex.ToString());
} }
} }
...@@ -298,7 +307,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -298,7 +307,7 @@ namespace OnlineStore.DeviceLibrary
alarmType = LineAlarmType.None; alarmType = LineAlarmType.None;
runStatus = LineRunStatus.HomeMoving; runStatus = LineRunStatus.HomeMoving;
LogInfo( "开始原点返回: (上下气缸回原点,阻挡气缸输入=0 )开始"); LogInfo("开始原点返回: (上下气缸回原点,阻挡气缸输入=0 )开始");
MoveInfo.NewMove(LineMoveType.ReturnHome); MoveInfo.NewMove(LineMoveType.ReturnHome);
//移载装置原点状态:顶升气缸下降端,前后气缸后退端,上下气缸上升端,夹料气缸放松端,阻挡气缸输入=0 //移载装置原点状态:顶升气缸下降端,前后气缸后退端,上下气缸上升端,夹料气缸放松端,阻挡气缸输入=0
UpdownHomeMove(); UpdownHomeMove();
...@@ -338,7 +347,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -338,7 +347,7 @@ namespace OnlineStore.DeviceLibrary
//重置时清理盘号,从头开始判断 //重置时清理盘号,从头开始判断
preTrayNum = 0; preTrayNum = 0;
currMoveTrayNum = 0; currMoveTrayNum = 0;
LogInfo( "开始重置:清零上一个托盘号,(上下气缸回原点,阻挡气缸输入=0 )开始;"); LogInfo("开始重置:清零上一个托盘号,(上下气缸回原点,阻挡气缸输入=0 )开始;");
runStatus = LineRunStatus.Reset; runStatus = LineRunStatus.Reset;
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
MoveInfo.NewMove(LineMoveType.Reset); MoveInfo.NewMove(LineMoveType.Reset);
...@@ -389,7 +398,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -389,7 +398,7 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.MH_UpDownCylinder_Up: case LineMoveStep.MH_UpDownCylinder_Up:
MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back); MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back);
LogInfo( "重置: (上升到位,顶升气缸下降,前后气缸回退 )开始"); LogInfo("重置: (上升到位,顶升气缸下降,前后气缸回退 )开始");
CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After); CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten); CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
...@@ -397,7 +406,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -397,7 +406,7 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.MH_OtherCylinder_Back: case LineMoveStep.MH_OtherCylinder_Back:
LogInfo( "重置完成!"); LogInfo("重置完成!");
runStatus = LineRunStatus.Runing; runStatus = LineRunStatus.Runing;
MoveInfo.EndMove(); MoveInfo.EndMove();
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
...@@ -444,7 +453,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -444,7 +453,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove(); MoveInfo.EndMove();
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
LogInfo( "原点返回完成!"); LogInfo("原点返回完成!");
runStatus = LineRunStatus.Runing; runStatus = LineRunStatus.Runing;
//如果是调试模式,移栽装置两个阻挡气缸落下,并且不再移动 //如果是调试模式,移栽装置两个阻挡气缸落下,并且不再移动
if (IsDebug) if (IsDebug)
...@@ -480,7 +489,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -480,7 +489,7 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.MH_UpDownCylinder_Up: case LineMoveStep.MH_UpDownCylinder_Up:
{ {
MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back); MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back);
LogInfo( "停止运动: (上升到位,顶升气缸下降,前后气缸回退 )开始"); LogInfo("停止运动: (上升到位,顶升气缸下降,前后气缸回退 )开始");
IOMove(IO_Type.UpDownCylinder_Up, IO_VALUE.LOW); IOMove(IO_Type.UpDownCylinder_Up, IO_VALUE.LOW);
CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
...@@ -513,7 +522,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -513,7 +522,7 @@ namespace OnlineStore.DeviceLibrary
//如果正在出库中,需要减去托盘号 //如果正在出库中,需要减去托盘号
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore)) if (MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{ {
LogInfo( "停止运动时出库执行中,减去托盘数;"); LogInfo("停止运动时出库执行中,减去托盘数;");
//减去需要的盘数 //减去需要的盘数
TrayManager.DelNeedEmptyTrayNum(); TrayManager.DelNeedEmptyTrayNum();
MoveInfo.EndMove(); MoveInfo.EndMove();
...@@ -521,7 +530,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -521,7 +530,7 @@ namespace OnlineStore.DeviceLibrary
runStatus = LineRunStatus.Busy; runStatus = LineRunStatus.Busy;
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
LogInfo( "停止运动:(上下气缸上升端,阻挡气缸输入=0 )开始 "); LogInfo("停止运动:(上下气缸上升端,阻挡气缸输入=0 )开始 ");
MoveInfo.NewMove(LineMoveType.StopMove); MoveInfo.NewMove(LineMoveType.StopMove);
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
...@@ -559,7 +568,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -559,7 +568,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
internal void OpenStopCylinder() internal void OpenStopCylinder()
{ {
LogInfo( "下降阻挡气缸,上下气缸上升,顶升气缸下降"); LogInfo("下降阻挡气缸,上下气缸上升,顶升气缸下降");
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
//上下气缸上升 //上下气缸上升
...@@ -574,7 +583,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -574,7 +583,7 @@ namespace OnlineStore.DeviceLibrary
} }
internal void CloseCylinderStop() internal void CloseCylinderStop()
{ {
LogInfo( "上升阻挡气缸,关闭上下气缸,顶升气缸IO"); LogInfo("上升阻挡气缸,关闭上下气缸,顶升气缸IO");
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
//上下气缸上升 //上下气缸上升
...@@ -632,25 +641,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -632,25 +641,25 @@ namespace OnlineStore.DeviceLibrary
if (ACServerManager.ServerOnStatus(portName, slvAddr)) if (ACServerManager.ServerOnStatus(portName, slvAddr))
{ {
LogUtil.info( Name + "成功打开轴:" + Config.UpDown_Axis.Explain); LogUtil.info(Name + "成功打开轴:" + Config.UpDown_Axis.Explain);
} }
else else
{ {
//清理报警,再重新打开一次 //清理报警,再重新打开一次
LogUtil.info( Name + "第一次打开轴" + Config.UpDown_Axis.Explain + "失败,先清理一下报警,再重新打开一次"); LogUtil.info(Name + "第一次打开轴" + Config.UpDown_Axis.Explain + "失败,先清理一下报警,再重新打开一次");
ACServerManager.AlarmClear(portName, slvAddr); ACServerManager.AlarmClear(portName, slvAddr);
System.Threading.Thread.Sleep(1200); System.Threading.Thread.Sleep(1200);
ACServerManager.ServoOn(portName, slvAddr); ACServerManager.ServoOn(portName, slvAddr);
System.Threading.Thread.Sleep(100); System.Threading.Thread.Sleep(100);
if (ACServerManager.ServerOnStatus(portName, slvAddr)) if (ACServerManager.ServerOnStatus(portName, slvAddr))
{ {
LogUtil.info( Name + "清理报警后重新打卡轴成功:" + Config.UpDown_Axis.Explain); LogUtil.info(Name + "清理报警后重新打卡轴成功:" + Config.UpDown_Axis.Explain);
} }
else else
{ {
ACServerManager.ServoOff(portName, slvAddr); ACServerManager.ServoOff(portName, slvAddr);
WarnMsg = Name + "打开轴" + Config.UpDown_Axis.Explain + "失败 "; WarnMsg = Name + "打开轴" + Config.UpDown_Axis.Explain + "失败 ";
LogUtil.info( Name + WarnMsg); LogUtil.info(Name + WarnMsg);
Alarm(LineAlarmType.AxisAlarm, 5.ToString(), WarnMsg, MoveInfo.MoveType); Alarm(LineAlarmType.AxisAlarm, 5.ToString(), WarnMsg, MoveInfo.MoveType);
return false; return false;
} }
...@@ -677,7 +686,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -677,7 +686,7 @@ namespace OnlineStore.DeviceLibrary
private void ACAxisHomeMove(ConfigMoveAxis moveAxis) private void ACAxisHomeMove(ConfigMoveAxis moveAxis)
{ {
moveAxis.TargetPosition = 0; moveAxis.TargetPosition = 0;
LogUtil.info( moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回"); LogUtil.info(moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true)); MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
} }
...@@ -713,7 +722,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -713,7 +722,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动 //判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error( moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount + LogUtil.error(moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次"); "],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
...@@ -722,7 +731,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -722,7 +731,7 @@ namespace OnlineStore.DeviceLibrary
{ {
msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警"; + "],误差过大,需要报警";
LogUtil.error( msg); LogUtil.error(msg);
} }
} }
return false; return false;
...@@ -742,7 +751,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -742,7 +751,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动 //判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error( moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次"); LogUtil.error(moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点"); //LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
...@@ -750,7 +759,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -750,7 +759,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error( msg); LogUtil.error(msg);
} }
} }
return false; return false;
...@@ -787,7 +796,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -787,7 +796,7 @@ namespace OnlineStore.DeviceLibrary
if (UpdownUseAxis) if (UpdownUseAxis)
{ {
int position = Config.GetUpdownBoxPosition(trayHeight); int position = Config.GetUpdownBoxPosition(trayHeight);
ACAxisMove(Config.UpDown_Axis, position,Config.UpdownAxis_DownSpeed); ACAxisMove(Config.UpDown_Axis, position, Config.UpdownAxis_DownSpeed);
} }
else else
{ {
......
...@@ -90,9 +90,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,9 +90,9 @@ namespace OnlineStore.DeviceLibrary
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
WarnMsg = Name + "等待" + NotOkMsg + " 超时"; WarnMsg = Name + "等待" + NotOkMsg + " 超时";
Alarm(LineAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType); Alarm(LineAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType);
LogUtil.error( MoveInfo.Name + WarnMsg, 13); LogUtil.error(MoveInfo.Name + WarnMsg, 13);
} }
else if (rwSpan.TotalSeconds > 3&&span.TotalSeconds>3) else if (rwSpan.TotalSeconds > 3 && span.TotalSeconds > 3)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
string msg = moveInfo.Name + " " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:"; string msg = moveInfo.Name + " " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:";
...@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
{ {
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds); wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
} }
else if (wait.WaitType.Equals( 8)) else if (wait.WaitType.Equals(8))
{ {
string posId = moveInfo.MoveParam.PosId; string posId = moveInfo.MoveParam.PosId;
int id = moveInfo.MoveParam.GetStoreId(); int id = moveInfo.MoveParam.GetStoreId();
...@@ -130,9 +130,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -130,9 +130,10 @@ namespace OnlineStore.DeviceLibrary
{ {
int storeId = moveInfo.MoveParam.GetStoreId(); int storeId = moveInfo.MoveParam.GetStoreId();
wait.IsEnd = LineServer.BoxCanReviceTray(storeId); wait.IsEnd = LineServer.BoxCanReviceTray(storeId);
}else if (wait.WaitType.Equals(10)) }
else if (wait.WaitType.Equals(10))
{ {
// wait.IsEnd = LineManager.Line.SideWay34HasTray().Equals(false); wait.IsEnd = LineManager.Line.SideWay34HasTray().Equals(false);
} }
if (wait.IsEnd && moveInfo.OneWaitCanEndStep) if (wait.IsEnd && moveInfo.OneWaitCanEndStep)
{ {
...@@ -153,7 +154,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,7 +154,7 @@ namespace OnlineStore.DeviceLibrary
{ {
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) + "]秒";
LogUtil.error( WarnMsg, 18); LogUtil.error(WarnMsg, 18);
Alarm(LineAlarmType.IoSingleTimeOut, "", WarnMsg, moveInfo.MoveType); Alarm(LineAlarmType.IoSingleTimeOut, "", WarnMsg, moveInfo.MoveType);
} }
...@@ -540,7 +541,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -540,7 +541,7 @@ namespace OnlineStore.DeviceLibrary
{ {
reIndex = i; reIndex = i;
currCode = cc; currCode = cc;
LogInfo("***************入库*****需要入库,托盘号【" + currMoveTrayNum + "】,是排队列表中的入库信息【" + currCode.ToStr() + "】 ,入库移栽"); LogInfo("*******托盘" + currMoveTrayNum + "需要入库【" + currCode.ToStr() + "】 ,开始入库移栽");
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW); SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW);
break; break;
} }
...@@ -550,8 +551,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -550,8 +551,8 @@ namespace OnlineStore.DeviceLibrary
waitInStoreList.RemoveAt(reIndex); waitInStoreList.RemoveAt(reIndex);
if (!LineServer.BoxCanInStore(DeviceID)) if (!LineServer.BoxCanInStore(DeviceID))
{ {
LogUtil.info(Name + "***************需要入库 【" + currCode.ToStr() + "】 ,料仓未上线或出库中,入库失败"); LogUtil.info(Name + "*******托盘" + currMoveTrayNum + "需要入库【" + currCode.ToStr() + "】,BoxCanInStore验证失败,先移栽再等待料仓可入库,开始入库移栽");
return false; return true;
} }
else else
{ {
...@@ -578,7 +579,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -578,7 +579,8 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"); CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.EndStepWait(); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.LOW));
// SecondMoveInfo.EndStepWait();
} }
else else
{ {
...@@ -590,10 +592,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -590,10 +592,11 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down);
CheckLog(" 托盘检测:料盘检测 SecondStoreMove(MIO_01_StopCylinder1Down阻挡气缸1-1下降 ,等待夹具检测4=1,最多等待1秒)"); CheckLog(" 托盘检测:料盘检测 SecondStoreMove(MIO_01_StopCylinder1Down阻挡气缸1-1下降 ,最多等待1秒)");
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); // SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
} }
} }
private void CheckFixtureProcess() private void CheckFixtureProcess()
...@@ -617,6 +620,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -617,6 +620,7 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_02_FixtureCheck 阻挡气缸1-1上升,等待夹具检测4=1)"); CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_02_FixtureCheck 阻挡气缸1-1上升,等待夹具检测4=1)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.HIGH));
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_02_FixtureCheck)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_02_FixtureCheck))
...@@ -624,7 +628,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -624,7 +628,8 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"); CheckLog("托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.EndStepWait(); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.LOW));
// SecondMoveInfo.EndStepWait();
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_StopCylinder2Down)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_03_StopCylinder2Down))
{ {
...@@ -681,12 +686,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -681,12 +686,12 @@ namespace OnlineStore.DeviceLibrary
} }
CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"); CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo);
//if (DeviceID.Equals(2)) if (DeviceID.Equals(2))
//{ {
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay()); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
// SecondMoveInfo.OneWaitCanEndStep = true; SecondMoveInfo.OneWaitCanEndStep = true;
//} }
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -761,12 +766,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -761,12 +766,12 @@ namespace OnlineStore.DeviceLibrary
{ {
CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"); CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo);
//if (DeviceID.Equals(2)) if (DeviceID.Equals(2))
//{ {
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay()); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
// SecondMoveInfo.OneWaitCanEndStep = true; SecondMoveInfo.OneWaitCanEndStep = true;
//} }
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_07_WaitCanGo)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_07_WaitCanGo))
...@@ -774,7 +779,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -774,7 +779,8 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)"); CheckLog("托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_10_StopCylinder2_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_10_StopCylinder2_Down);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
SecondMoveInfo.EndStepWait(); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH));
// SecondMoveInfo.EndStepWait();
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_10_StopCylinder2_Down)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_10_StopCylinder2_Down))
{ {
...@@ -787,6 +793,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -787,6 +793,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_StopCylinder_Back); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_StopCylinder_Back);
CheckLog("托盘放行 SecondStoreMove:(MO_12_StopCylinder_Back , 阻挡气缸1-2上升 )"); CheckLog("托盘放行 SecondStoreMove:(MO_12_StopCylinder_Back , 阻挡气缸1-2上升 )");
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_StopCylinder_Back)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_StopCylinder_Back))
...@@ -845,7 +852,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -845,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
public void LogInfo(string logInfo) public void LogInfo(string logInfo)
{ {
LogUtil.info( Name + logInfo); LogUtil.info(Name + logInfo);
} }
} }
} }
...@@ -88,17 +88,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,17 +88,13 @@ namespace OnlineStore.DeviceLibrary
{ {
if (balserNameList.Contains(cameraName)) if (balserNameList.Contains(cameraName))
{ {
bool result = BaslerCamera.Instance.IsOpen; bool result = BaslerCamera.Instance.Open(cameraName);
if (!result) // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result = BaslerCamera.Instance.Open(cameraName);
LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
}
if (result) if (result)
{ {
BaslerCamera.Instance.GrabOne(); BaslerCamera.Instance.GrabOne();
bitm = BaslerCamera.Instance.Image; bitm = BaslerCamera.Instance.Image;
//BaslerCamera.Instance.Close(); BaslerCamera.Instance.Close();
} }
else else
{ {
...@@ -107,17 +103,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,17 +103,13 @@ namespace OnlineStore.DeviceLibrary
} }
else if (hikNameList.Contains(cameraName)) else if (hikNameList.Contains(cameraName))
{ {
bool result = HIKCamera.Instance.IsOpen; bool result = HIKCamera.Instance.Open(cameraName);
if (!result) // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result = HIKCamera.Instance.Open(cameraName);
LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
}
if (result) if (result)
{ {
HIKCamera.Instance.GrabOne(); HIKCamera.Instance.GrabOne();
bitm = HIKCamera.Instance.Image; bitm = HIKCamera.Instance.Image;
//HIKCamera.Instance.Close(); HIKCamera.Instance.Close();
} }
else else
{ {
......
...@@ -38,7 +38,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -38,7 +38,8 @@ namespace OnlineStore.DeviceLibrary
{ {
return true; return true;
} }
}return false; }
return false;
} }
/// <summary> /// <summary>
/// 移栽装置拦截托盘时, 判断是否可以入库,入库执行可以入库,出库过程中不能入库 /// 移栽装置拦截托盘时, 判断是否可以入库,入库执行可以入库,出库过程中不能入库
...@@ -74,13 +75,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -74,13 +75,13 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 判断库位是否验证成功 /// 判断库位是否验证成功
/// </summary> /// </summary>
public static bool RightInPosId(int id,string posId) public static bool RightInPosId(int id, string posId)
{ {
BoxInfo box = GetBoxInfo(id); BoxInfo box = GetBoxInfo(id);
if (box != null) if (box != null)
{ {
TimeSpan span = DateTime.Now - box.LastMsgTime; TimeSpan span = DateTime.Now - box.LastMsgTime;
if (span.TotalSeconds < ClientKeepSecond ) if (span.TotalSeconds < ClientKeepSecond)
{ {
if (box.WaitInStoreList != null && box.WaitInStoreList.Contains(posId)) if (box.WaitInStoreList != null && box.WaitInStoreList.Contains(posId))
{ {
...@@ -90,22 +91,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,22 +91,20 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
/// <summary> public static bool IsInStorePro(int id)
/// 移栽装置送盘到料仓门口时,需要判断是否可以将盘送入
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static bool BoxCanReviceTray(int id)
{ {
BoxInfo box = GetBoxInfo(id); BoxInfo box = GetBoxInfo(id);
if (box != null)
{
TimeSpan span = DateTime.Now - box.LastMsgTime; TimeSpan span = DateTime.Now - box.LastMsgTime;
if (span.TotalSeconds < ClientKeepSecond&&box.HasTray.Equals(0)&&box.SAlarmType.Equals(LineAlarmType.None) )
if (box != null && span.TotalSeconds < ClientKeepSecond)
{ {
LineStatus status = (LineStatus)box.SStatus;
LineRunStatus runs = (LineRunStatus)box.SRunStatus; LineRunStatus runs = (LineRunStatus)box.SRunStatus;
if (runs.Equals(LineRunStatus.Runing)) if (runs.Equals(LineRunStatus.Busy))
{
if (status.Equals(LineStatus.InStoreEnd) || status.Equals(LineStatus.InStoreExecute))
{ {
return true; return true;
} }
...@@ -113,20 +112,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -113,20 +112,22 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
public static bool IsInStorePro(int id) /// <summary>
/// 移栽装置送盘到料仓门口时,需要判断是否可以将盘送入
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static bool BoxCanReviceTray(int id)
{ {
BoxInfo box = GetBoxInfo(id); BoxInfo box = GetBoxInfo(id);
if (box != null)
{
TimeSpan span = DateTime.Now - box.LastMsgTime; TimeSpan span = DateTime.Now - box.LastMsgTime;
if (span.TotalSeconds < ClientKeepSecond && box.HasTray.Equals(0) && box.SAlarmType.Equals(LineAlarmType.None))
if (box != null && span.TotalSeconds < ClientKeepSecond)
{ {
LineStatus status = (LineStatus)box.SStatus;
LineRunStatus runs = (LineRunStatus)box.SRunStatus; LineRunStatus runs = (LineRunStatus)box.SRunStatus;
if (runs.Equals(LineRunStatus.Busy)) if (runs.Equals(LineRunStatus.Runing))
{
if (status.Equals(LineStatus.InStoreEnd) || status.Equals(LineStatus.InStoreExecute))
{ {
return true; return true;
} }
...@@ -192,11 +193,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -192,11 +193,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, "关闭 监听出错:" + ex.ToString()); LogUtil.error(LOGGER, "关闭 监听出错:" + ex.ToString());
} }
} }
public static bool UpdateBoxDebug(int id,int isDebug) public static bool UpdateBoxDebug(int id, int isDebug)
{ {
if (ClientMap.ContainsKey(id)) if (ClientMap.ContainsKey(id))
{ {
Dictionary<string,object> paramList =new Dictionary<string, object>(); Dictionary<string, object> paramList = new Dictionary<string, object>();
paramList.Add(S_Cmd, cmd_updateDebug); paramList.Add(S_Cmd, cmd_updateDebug);
int canOutStore = LineManager.Line.CanOutStore(id) ? 1 : 0; int canOutStore = LineManager.Line.CanOutStore(id) ? 1 : 0;
paramList.Add(S_CanOutStore, canOutStore); paramList.Add(S_CanOutStore, canOutStore);
...@@ -228,7 +229,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -228,7 +229,7 @@ namespace OnlineStore.DeviceLibrary
bool result = SendStrToClient(client, msg); bool result = SendStrToClient(client, msg);
if (!result) if (!result)
{ {
LogUtil.error("StartInStore【" + id+"】【"+msg+"】失败"); LogUtil.error("StartInStore【" + id + "】【" + msg + "】失败");
} }
} }
return false; return false;
...@@ -276,7 +277,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -276,7 +277,8 @@ namespace OnlineStore.DeviceLibrary
// LogUtil.info("CheckInStorePos【" + id + "】【" + msg + "】发送成功"); // LogUtil.info("CheckInStorePos【" + id + "】【" + msg + "】发送成功");
} }
} }
}catch(Exception ex) }
catch (Exception ex)
{ {
LogUtil.error("CheckInStorePos【" + id + "】【" + param.ToStr() + "】失败"); LogUtil.error("CheckInStorePos【" + id + "】【" + param.ToStr() + "】失败");
} }
...@@ -306,7 +308,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -306,7 +308,7 @@ namespace OnlineStore.DeviceLibrary
return result + "\r"; return result + "\r";
} }
private static object MapLock = ""; private static object MapLock = "";
private static void SaveBoxClient(int id,BoxInfo box,Client client) private static void SaveBoxClient(int id, BoxInfo box, Client client)
{ {
lock (MapLock) lock (MapLock)
{ {
...@@ -336,7 +338,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -336,7 +338,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("处理料仓消息【"+msg+"】出错:"+ ex.ToString()); LogUtil.error("处理料仓消息【" + msg + "】出错:" + ex.ToString());
} }
} }
...@@ -349,14 +351,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -349,14 +351,14 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug("收到【" + add + "】的消息【" + msg + "】"); LogUtil.debug("收到【" + add + "】的消息【" + msg + "】");
StoreSendBean storeSMsg = JsonHelper.DeserializeJsonToObject<StoreSendBean>(msg); StoreSendBean storeSMsg = JsonHelper.DeserializeJsonToObject<StoreSendBean>(msg);
if ( storeSMsg==null) if (storeSMsg == null)
{ {
LogUtil.error("收到【" + add + "】的消息【" + msg + "】,解析失败"); LogUtil.error("收到【" + add + "】的消息【" + msg + "】,解析失败");
} }
else else
{ {
int id = storeSMsg.StoreId; int id = storeSMsg.StoreId;
BoxInfo box = new BoxInfo(storeSMsg.StoreId,storeSMsg.Cid,storeSMsg.Seq,storeSMsg.SStatus,storeSMsg.SRunStatus,storeSMsg.DoorHasTray,storeSMsg.AlarmType,storeSMsg.WaitInStoreList); BoxInfo box = new BoxInfo(storeSMsg.StoreId, storeSMsg.Cid, storeSMsg.Seq, storeSMsg.SStatus, storeSMsg.SRunStatus, storeSMsg.DoorHasTray, storeSMsg.AlarmType, storeSMsg.WaitInStoreList);
SaveBoxClient(id, box, client); SaveBoxClient(id, box, client);
string cmd = storeSMsg.Cmd; string cmd = storeSMsg.Cmd;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!