FrmPosDebug.cs
5.5 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.XLRStore
{
public partial class FrmPosDebug : Form
{
public FrmPosDebug()
{
CheckForIllegalCrossThreadCalls = false;
InitializeComponent();
boxEquip = StoreManager.XLRStore.boxEquip;
}
BoxEquip boxEquip;
private void btnStart_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
if(MessageBox.Show("是否开始库位调试?","提示",MessageBoxButtons.YesNo).Equals(DialogResult.Yes))
{
boxEquip.posDebugInfo.IsBreak = false;
int startDrawerRow = int.Parse(txtStartDrawerRow.Text);
int startDrawerCol = int.Parse(txtStartDrawerCol.Text);
int endDrawerRow = int.Parse(txtEndDrawerRow.Text);
int endDrawerCol = int.Parse(txtEndDrawerCol.Text);
int startRowInDrawer = int.Parse(txtStartRowInDrawer.Text);
int startColInDrawer = int.Parse(txtStartColInDrawer.Text);
int endRowInDrawer = int.Parse(txtEndRowInDrawer.Text);
int endColInDrawer = int.Parse(txtEndColInDrawer.Text);
boxEquip.posDebugInfo.SetDrawerParam(startDrawerRow,startDrawerCol,endDrawerRow,endDrawerCol);
boxEquip.posDebugInfo.SetGridParam(startRowInDrawer,startColInDrawer,endRowInDrawer,endColInDrawer);
InOutParam inOutParam = new InOutParam(new InOutPosInfo("PosDebug", $"{boxEquip.posDebugInfo.CurGrid}"));
//boxEquip.Test();
boxEquip.StartPosDebug(inOutParam);
}
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if(radioButton1.Checked)
{
boxEquip.posDebugInfo.PosSide = "AA";
}
if(radioButton2.Checked)
boxEquip.posDebugInfo.PosSide = "BB";
}
private void btnStop_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
if (MessageBox.Show("确认停止库位调试?", "提示", MessageBoxButtons.OKCancel).Equals(DialogResult.OK))
boxEquip.posDebugInfo.IsBreak = true;
}
FrmPosResult frmPosResult = null;
private void btnPosResult_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
if (frmPosResult ==null)
{
frmPosResult = new FrmPosResult();
frmPosResult.Show();
}
else
{
if(frmPosResult.IsDisposed)
{
frmPosResult = new FrmPosResult();
frmPosResult.Show();
}
else
{
frmPosResult.Activate();
}
}
}
FrmMoveAxisDebug frmMoveAxisDebug = null;
private void button1_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
try
{
FrmPwd fw = new FrmPwd(10);
DialogResult result = fw.ShowDialog();
if (!result.Equals(DialogResult.OK))
{
LogUtil.info("打开行走机构循环测试时,没有正确输入密码");
return;
}
if (frmMoveAxisDebug == null)
{
frmMoveAxisDebug = new FrmMoveAxisDebug();
frmMoveAxisDebug.Show();
}
else
{
if (frmMoveAxisDebug.IsDisposed)
{
frmMoveAxisDebug = new FrmMoveAxisDebug();
frmMoveAxisDebug.Show();
}
else
{
frmMoveAxisDebug.Activate();
}
}
}
catch (Exception ex)
{
LogUtil.error("打开行走机构循环测试时出错:", ex);
}
}
private void button3_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
boxEquip.posDebugInfo.IsPause = false;
}
private void button2_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
boxEquip.posDebugInfo.IsPause = true;
}
}
}