MainMachine _BtnProcess.cs
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using CodeLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
partial class MainMachine
{
void BtnProcess()
{
}
void Reset_BTN() {
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.HIGH))
{
if (!AxisBean.ClearMultiAlarm(out string msg, AxisBean.List))
Msg.add(msg, MsgLevel.warning);
Msg.add(crc.GetString(L.reset_press, "按下复位按钮."), MsgLevel.info, ErrInfo.ResetBtn);
ButtenEvent?.Invoke(null, ErrInfo.ResetBtn);
}
else
{
Msg.add(crc.GetString(L.reset_press_with_sudden, "急停未解除,按下复位按钮尝试复位安全继电器."), MsgLevel.info, ErrInfo.SuddenStop);
}
LogUtil.info("按下复位按钮");
ProcessMsgEvent?.Invoke(Msg.get());
//暂停时按下reaet按钮
if (RobotManage.isRunning && RobotManage.mainMachine.UserPause)
{
RobotManage.UserPause("Reset_BTN", false);
}
}
void HomeReset_BTN()
{
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.HIGH))
{
Msg.add(crc.GetString(L.reset_press, "按下复位按钮."), MsgLevel.info, ErrInfo.ResetBtn);
}
else
{
Msg.add(crc.GetString(L.reset_press_with_sudden, "急停未解除,按下复位按钮尝试复位安全继电器."), MsgLevel.info, ErrInfo.SuddenStop);
}
if (mstart)
{
LogUtil.info("长按下复位按钮,系统正在运行,开始复位");
BeginHomeReset();
}
ProcessMsgEvent?.Invoke(Msg.get());
}
void Run_BTN() {
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.HIGH))
{
if (!RobotManage.isRunning)
{
Msg.add(crc.GetString(L.runbtn_press, "按下启动按钮,开始启动."), MsgLevel.info, ErrInfo.RunBtn);
ButtenEvent?.Invoke(null, ErrInfo.RunBtn);
}
else
Msg.add(crc.GetString(L.system_is_running, "系统正在运行."), MsgLevel.info);
}
else
{
Msg.add(crc.GetString(L.runbtn_press_with_sudden, "急停中,按下启动按钮,无法启动."), MsgLevel.warning);
}
LogUtil.info("按下启动按钮");
ProcessMsgEvent?.Invoke(Msg.get());
}
}
}