Commit a37eb025 刘韬
2 个父辈 f9d3b078 9b7d6fbc
...@@ -93,6 +93,8 @@ namespace DeviceLibrary ...@@ -93,6 +93,8 @@ namespace DeviceLibrary
return "W="; return "W=";
case MsgLevel.alarm: case MsgLevel.alarm:
return "A="; return "A=";
case MsgLevel.critical:
return "C=";
} }
return ""; return "";
......
...@@ -347,7 +347,8 @@ namespace DeviceLibrary ...@@ -347,7 +347,8 @@ namespace DeviceLibrary
warning, warning,
info, info,
alarm alarm,
critical,
} }
public enum ErrInfo public enum ErrInfo
{ {
......
...@@ -153,20 +153,33 @@ namespace DeviceLibrary ...@@ -153,20 +153,33 @@ namespace DeviceLibrary
} }
public static void UserPause(bool userpause) public static void UserPause(bool userpause)
{ {
UserPause("", userpause); UserPause("", userpause,false);
} }
public static void UserPause(string msg="",bool userpause=true) { public static void UserPause(string msg="",bool userpause=true,bool upload=true) {
UserPauseSet?.Invoke(null, userpause);
mainMachine.UserPause = userpause;
if (userpause) if (userpause)
{ {
if(string.IsNullOrEmpty(msg)) if(string.IsNullOrEmpty(msg))
{
if(upload)
{
Msg.add("用户暂停", MsgLevel.critical);
}
LogUtil.info("用户暂停"); LogUtil.info("用户暂停");
}
else else
LogUtil.info("系统暂停: "+msg); {
if (upload)
{
Msg.add("系统暂停: " + msg, MsgLevel.critical);
}
LogUtil.info("系统暂停: " + msg);
}
} }
else else
LogUtil.info("用户取消暂停"); LogUtil.info("用户取消暂停");
UserPauseSet?.Invoke(null, userpause);
mainMachine.UserPause = userpause;
} }
public static void IgnoreSafecheck(bool s) public static void IgnoreSafecheck(bool s)
{ {
......
...@@ -468,7 +468,7 @@ namespace TheMachine ...@@ -468,7 +468,7 @@ namespace TheMachine
private void btn_opendoor_Click(object sender, EventArgs e) private void btn_opendoor_Click(object sender, EventArgs e)
{ {
LogUtil.info("用户点击打开舱门"); LogUtil.info("用户点击打开舱门");
RobotManage.UserPause(true); RobotManage.UserPause("打开舱门", true);
FrmReleaseDoor frmReleaseDoor = new FrmReleaseDoor(); FrmReleaseDoor frmReleaseDoor = new FrmReleaseDoor();
frmReleaseDoor.ShowDialog(); frmReleaseDoor.ShowDialog();
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!