FrmPosDebug.cs
3.6 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
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;
txtEndDrawerRow.Text = boxEquip.Config.Drawer_Rows.ToString();
txtEndDrawerCol.Text = boxEquip.Config.Drawer_Columns.ToString();
List<int> ints = new List<int>();
for (int i = 1; i <= boxEquip.Config.Rows_In_Drawer; i++)
{
ints.Add(i);
}
txtRowsInDrawer.Text = String.Join(",", ints.ToArray());
ints.Clear();
for (int i = 1; i <= boxEquip.Config.Cols_In_Drawer; i++)
{
ints.Add(i);
}
txtColsInDrawer.Text= String.Join(",", ints.ToArray());
}
BoxEquip boxEquip;
private void btnStart_Click(object sender, EventArgs e)
{
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);
string[] rowsInDrawer = txtRowsInDrawer.Text.Split(',');
string[] colsInDrawer = txtColsInDrawer.Text.Split(',');
boxEquip.posDebugInfo.SetDrawerParam(startDrawerRow,startDrawerCol,endDrawerRow,endDrawerCol);
boxEquip.posDebugInfo.SetGridParam(rowsInDrawer, colsInDrawer);
InOutParam inOutParam = new InOutParam(new InOutPosInfo("PosDebug", $"{boxEquip.posDebugInfo.CurGrid}"));
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 (MessageBox.Show("确认停止库位调试?", "提示", MessageBoxButtons.OKCancel).Equals(DialogResult.OK))
boxEquip.posDebugInfo.IsBreak = true;
}
FrmPosResult frmPosResult = null;
private void btnPosResult_Click(object sender, EventArgs e)
{
if(frmPosResult ==null)
{
frmPosResult = new FrmPosResult();
frmPosResult.Show();
}
else
{
if(frmPosResult.IsDisposed)
{
frmPosResult = new FrmPosResult();
frmPosResult.Show();
}
else
{
frmPosResult.Activate();
}
}
}
private void btnContinue_Click(object sender, EventArgs e)
{
boxEquip.posDebugInfo.IsPause = false;
}
private void btnPause_Click(object sender, EventArgs e)
{
boxEquip.posDebugInfo.IsPause = true;
}
}
}