WorkParam.cs
5.3 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 出入仓参数(出入库操作时传入的参数类)
/// </summary>
public class WorkParam
{
public WorkParam(int inPosType = 1, int tPosType = 0, string barcode = "", int plateH = 0, int plateW = 0, bool test = false )
{
this.InPosType = inPosType;
this.TargetPosType = tPosType;
WareCode = barcode;
// PosId = posId;
this.PlateW = plateW;
this.PlateH = plateH;
this.IsTest = test;
}
public string WareCode = "";
/// <summary>
/// 当前状态
/// </summary>
public int TrayStatus = -1;
public int PlateH = 0;
public int PlateW = 0;
/// <summary>
/// 点料结果:数量
/// </summary>
public int WareCount = 0;
/// <summary>
/// 入口位置:1=左侧入口,2=右侧入口
/// </summary>
public int InPosType = 0;
/// <summary>
/// 目标位置:1=XRay入口,2=人工工位上层,3=人工工位下层
/// </summary>
public int TargetPosType = 0;
public bool IsNgReel = false;
public string NgMsg = "";
/// <summary>
/// 是否是测试步骤
/// </summary>
public bool IsTest = false;
public string ToStr()
{
string tP = "";
if (TargetPosType.Equals(1))
{
tP = "[XRay入口]";
}
else if (TargetPosType.Equals(2))
{
tP = "[工位上层]";
}
else if (TargetPosType.Equals(3))
{
tP = "[工位下层]";
}
return " [" + WareCode + "] " + "[" + PlateW + " X " + PlateH + "] " + "[" + (InPosType.Equals(1) ? "左侧入口" : "右侧入口") + "]-->" + tP;
}
public string OutStr()
{
return "[" + WareCode + "] [ " + PlateW + "X" + PlateH + " ] [" + WareCount + "]" + (IsNgReel ? "[NG料:" + NgMsg + "]" : "") + "";
}
public int Get_Inout_P2(InputEquip_Config config)
{
if (InPosType.Equals(1))
{
return config.InoutAxis_P2_L;
}
else
{
return config.InoutAxis_P2_R;
}
}
public int Get_Middle_P2(InputEquip_Config config)
{
if (InPosType.Equals(1))
{
return config.MiddleAxis_P2_L;
}
else
{
return config.MiddleAxis_P2_R;
}
}
public int Get_Updown_P2(InputEquip_Config config)
{
if (InPosType.Equals(1))
{
return config.UpdownAxis_P2_L;
}
else
{
return config.UpdownAxis_P2_R;
}
}
public int Get_Updown_PutP(InputEquip_Config config)
{
if (TargetPosType.Equals(1))
{
return config.UpdownAxis_P3;
}
else if (TargetPosType.Equals(2))
{
return config.UpdownAxis_P4_H;
}
else if (TargetPosType.Equals(3))
{
return config.UpdownAxis_P4_L;
}
return config.UpdownAxis_P1;
}
public void SetReelInfo(ReelInfo reel)
{
this.PlateH = reel.PlateH;
this.PlateW = reel.PlateW;
this.WareCode = reel.WareCode;
this.WareCount = reel.WareCount;
this.IsNgReel = reel.IsNgReel;
this.NgMsg = reel.NgMsg;
}
public ReelInfo GetReelInfo()
{
ReelInfo reel = new ReelInfo(WareCode, PlateW, PlateH, WareCount, IsNgReel, NgMsg);
return reel;
}
}
public class ReelInfo
{
public ReelInfo(string code = "", int plateW = 7, int plateH = 8,int count=0,bool IsNg=false,string msg="")
{
this.WareCode = code;
this.PlateH = plateH;
this.PlateW = plateW;
this.WareCount = count;
this.IsNgReel = IsNg;
this.NgMsg = msg;
}
/// <summary>
/// 物品二维码信息
/// </summary>
public string WareCode = "";
/// <summary>
/// 料盘高度
/// </summary>
public int PlateH = 0;
/// <summary>
/// 料盘宽度
/// </summary>
public int PlateW = 0;
public int WareCount = 0;
public bool IsNgReel = false;
public string NgMsg = "";
public string ToStr()
{
return "[" + WareCode + "] [ " + PlateW + "X" + PlateH + " ] ["+WareCount+"]"+(IsNgReel?"[NG料:"+NgMsg+"]":"")+"";
}
public ReelInfo GetReelInfo()
{
ReelInfo reel = new ReelInfo(WareCode, PlateW, PlateH, WareCount, IsNgReel, NgMsg);
return reel;
}
}
}