MainMachine _BtnProcess.cs
1.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
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, Config).Equals(IO_VALUE.HIGH))
{
MsgService.Add(crc.GetString("Res0131","按下复位按钮."), MsgLevel.info, ErrInfo.ResetBtn);
//if (!RobotManage.isRunning)
RobotManage.Start(MachineSideE.Left | MachineSideE.Right);
}
else
{
MsgService.Add(crc.GetString("Res0132","急停未解除,按下复位按钮尝试复位安全继电器."), MsgLevel.info);
}
LogUtil.info("按下复位按钮");
}
void HomeReset_BTN()
{
if (IOValue(IO_Type.SuddenStop_BTN, Config).Equals(IO_VALUE.HIGH))
{
MsgService.Add(crc.GetString("Res0131", "按下复位按钮."), MsgLevel.info, ErrInfo.ResetBtn);
}
else
{
MsgService.Add(crc.GetString("Res0132", "急停未解除,按下复位按钮尝试复位安全继电器."), MsgLevel.info, ErrInfo.SuddenStop);
}
LogUtil.info("长按下复位按钮,系统正在运行,开始复位");
RobotManage.Stores.ForEach(s => {
if (s.isRunning)
{
LogUtil.info($"{s.MachineSide}侧回原");
s.BeginHomeReset();
}
});
//ProcessMsgEvent?.Invoke(Msg.get());
}
}
}