Commit d9dc5137 刘韬

优化io手动安全检测

1 个父辈 2128f57a
......@@ -573,10 +573,9 @@ namespace DeviceLibrary
else if (isInSuddenDown)
{
Alarm(AlarmType.SuddenStop);
Msg.add(crc.GetString("Res0100", "急停中"), MsgLevel.alarm);
Msg.add(crc.GetString("Res0100", "急停中"), MsgLevel.alarm, ErrInfo.SuddenStop);
ok = false;
}
}
else if (alarmType != AlarmType.None)
{
//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
ok = false;
}
}
if (ok && !AxisBean.RunMultiAxis(true, out string msg, AxisBean.List))
{
ok = false;
......
......@@ -169,12 +169,7 @@ namespace TheMachine
}).ContinueWith(delegate {
CylinderButton.IsSafe += () =>
{
if(RobotManage.isRunning)
return (false, "Safety interlock activated");
if (!RobotManage.mainMachine.IsAllDoorClosed())
return (false, "Safe door was not closed");
return (true, "");
return IOControls.IsSafe();
};
});
......@@ -434,25 +429,39 @@ namespace TheMachine
if (msg.errInfo == ErrInfo.X09_BoxNotDetect)
{
btn_IgnoreX09.Visible = true;
}else if (msg.errInfo == ErrInfo.X09_Clear)
}
else if (msg.errInfo == ErrInfo.X09_Clear)
{
btn_IgnoreX09.Visible = false;
}
else if (msg.errInfo == ErrInfo.LabelInPaste)
{
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("用户确认已处理");
//Setting_Init.Runtime_Step = Runtime_StepE.None;
RobotManage.UserPause(false);
}
else {
else
{
btn_stop_Click(this, EventArgs.Empty);
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);
......
......@@ -141,14 +141,17 @@ namespace TheMachine
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)
return (false, "Safety interlock activated");
if (!RobotManage.mainMachine.IsAllDoorClosed())
return (false, "Safe door was not closed");
return (true, "");
}
private void button9_Click(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!