Commit d9dc5137 刘韬

优化io手动安全检测

1 个父辈 2128f57a
...@@ -573,10 +573,9 @@ namespace DeviceLibrary ...@@ -573,10 +573,9 @@ namespace DeviceLibrary
else if (isInSuddenDown) else if (isInSuddenDown)
{ {
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
Msg.add(crc.GetString("Res0100", "急停中"), MsgLevel.alarm); Msg.add(crc.GetString("Res0100", "急停中"), MsgLevel.alarm, ErrInfo.SuddenStop);
ok = false; ok = false;
} }
else if (alarmType != AlarmType.None) else if (alarmType != AlarmType.None)
{ {
//if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)) //if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH))
...@@ -590,7 +589,6 @@ namespace DeviceLibrary ...@@ -590,7 +589,6 @@ namespace DeviceLibrary
ok = false; ok = false;
} }
} }
if (ok && !AxisBean.RunMultiAxis(true, out string msg, AxisBean.List)) if (ok && !AxisBean.RunMultiAxis(true, out string msg, AxisBean.List))
{ {
ok = false; ok = false;
......
...@@ -169,12 +169,7 @@ namespace TheMachine ...@@ -169,12 +169,7 @@ namespace TheMachine
}).ContinueWith(delegate { }).ContinueWith(delegate {
CylinderButton.IsSafe += () => CylinderButton.IsSafe += () =>
{ {
if(RobotManage.isRunning) return IOControls.IsSafe();
return (false, "Safety interlock activated");
if (!RobotManage.mainMachine.IsAllDoorClosed())
return (false, "Safe door was not closed");
return (true, "");
}; };
}); });
...@@ -434,25 +429,39 @@ namespace TheMachine ...@@ -434,25 +429,39 @@ namespace TheMachine
if (msg.errInfo == ErrInfo.X09_BoxNotDetect) if (msg.errInfo == ErrInfo.X09_BoxNotDetect)
{ {
btn_IgnoreX09.Visible = true; btn_IgnoreX09.Visible = true;
}else if (msg.errInfo == ErrInfo.X09_Clear) }
else if (msg.errInfo == ErrInfo.X09_Clear)
{ {
btn_IgnoreX09.Visible = false; btn_IgnoreX09.Visible = false;
} }
else if (msg.errInfo == ErrInfo.LabelInPaste) else if (msg.errInfo == ErrInfo.LabelInPaste)
{ {
RobotManage.mainMachine.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.LOW); RobotManage.mainMachine.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.LOW);
if (FrmAlarm.ShowAlarmDialog("Labeling Exceptions:" + "\r\n"+ msg.msgtxt) == DialogResult.OK) if (FrmAlarm.ShowAlarmDialog("Labeling Exceptions:" + "\r\n" + msg.msgtxt) == DialogResult.OK)
{ {
LogUtil.info("用户确认已处理"); LogUtil.info("用户确认已处理");
//Setting_Init.Runtime_Step = Runtime_StepE.None; //Setting_Init.Runtime_Step = Runtime_StepE.None;
RobotManage.UserPause(false); RobotManage.UserPause(false);
} }
else { else
{
btn_stop_Click(this, EventArgs.Empty); btn_stop_Click(this, EventArgs.Empty);
LogUtil.info("用户取消处理,系统停止"); LogUtil.info("用户取消处理,系统停止");
} }
} }
else if (msg.errInfo == ErrInfo.SuddenStop)
{
Task.Run(() =>
{
LogUtil.info("急停触发停止");
if (RobotManage.isRunning)
this.Invoke((EventHandler)delegate
{
btn_stop_Click(this, EventArgs.Empty);
});
});
}
} }
this.ResumeLayout(true); this.ResumeLayout(true);
......
...@@ -141,14 +141,17 @@ namespace TheMachine ...@@ -141,14 +141,17 @@ namespace TheMachine
RobotManage.mainMachine.RotateEquip.TurnRound(); RobotManage.mainMachine.RotateEquip.TurnRound();
} }
public (bool,string) IsSafe() { public static (bool, string) IsSafe()
{
if (RobotManage.mainMachine.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
return (false, "Emergency stop.");
if (RobotManage.isRunning) if (RobotManage.isRunning)
return (false, "Safety interlock activated"); return (false, "Safety interlock activated");
if (!RobotManage.mainMachine.IsAllDoorClosed()) if (!RobotManage.mainMachine.IsAllDoorClosed())
return (false, "Safe door was not closed"); return (false, "Safe door was not closed");
return (true, ""); return (true, "");
} }
private void button9_Click(object sender, EventArgs e) private void button9_Click(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!