EquipControl.cs
4.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
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
160
161
162
163
164
165
166
167
168
169
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OnlineStore.DeviceLibrary;
namespace OnlineStore.XLRStore
{
public partial class EquipControl : UserControl
{
public string EquipText
{
get { return lblText.Text; }
set { lblText.Text = value; }
}
public string WorkStatus
{
get { return lblStatus.Text; }
set { lblStatus.Text = value; }
}
public string MoveInfo
{
get { return lblMoveInfo.Text; }
set { lblMoveInfo.Text = value; }
}
public Color ColorStatus
{
get { return this.BackColor; }
set
{
this.BackColor = value;
}
}
public void SelectStyle()
{
panName.BackColor = Color.DeepSkyBlue;
}
public void UnSelectStyle()
{
panName.BackColor = Color.Transparent;
}
public void InitData(string text)
{
lblText.Text = text;
}
public int DeviceId = 0;
public void ShowData(bool isDebug, string runStr, string warnMsg, DeviceMoveInfo MoveInfo, Color backColor,string shelfStr="")
{
//lblTrayNum.Text = "托盘:" + currTrayNum;
lblStatus.Text = runStr;
toolTip1.ToolTipTitle = "" + EquipText + ":双击进入";
lblDebug.Text = "启用" + (isDebug ? "✘" : "✔");
lblWarn.Text = warnMsg;
lblShelf.Text = shelfStr;
string str = "";
if (MoveInfo.MoveType.Equals(MoveType.InStore))
{
str = "入库中:";
InOutPosInfo pos = MoveInfo.MoveParam.PosInfo;
if (pos != null)
{
if (pos.IsNG)
{
str = "NG料:" + pos.PosId + "_" + pos.barcode;
}
else
{
str = "入库中:" + pos.PosId + "_" + pos.barcode;
}
}
}
else if (MoveInfo.MoveType.Equals(MoveType.OutStore))
{
str = "出库中:";
InOutPosInfo pos = MoveInfo.MoveParam.PosInfo;
if (pos != null)
{
if (pos.urgentReel)
{
str = "紧急料出库:" + pos.PosId + "_" + pos.barcode;
}
else if (pos.cutReel)
{
str = "分盘料出库:" + pos.PosId + "_" + pos.barcode;
}
else if (pos.cutReel)
{
str = "出库中:" + pos.PosId + "_" + pos.barcode;
}
}
}
lblMoveInfo.Text = str;
this.BackColor = backColor;
}
public EquipControl()
{
InitializeComponent();
}
private void EquipControl_Load(object sender, EventArgs e)
{
}
private void lblName_DoubleClick(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
private void lblName_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void panName_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void panName_DoubleClick(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
private void lblStatus_DoubleClick(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
private void lblStatus_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void lblBox_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void lblDebug_MouseEnter(object sender, EventArgs e)
{
SelectStyle();
}
private void lblDebug_MouseLeave(object sender, EventArgs e)
{
UnSelectStyle();
}
private void EquipControl_MouseLeave(object sender, EventArgs e)
{
UnSelectStyle();
}
private void EquipControl_MouseEnter(object sender, EventArgs e)
{
SelectStyle();
}
}
}