Class1.cs
5.0 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
using CodeLibrary;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
[Serializable]
public class RemoteLoad
{
/// <summary>
/// 动作
/// </summary>
public string Action;
public long Seq;
/// <summary>
/// 设备名称
/// </summary>
public string GroupName;
/// <summary>
/// 载荷信息
/// </summary>
public RequestLoadInfo RequestLoadInfo;
}
[Serializable]
public class RequestLoadInfo
{
/// <summary>
/// 目的地设备名称
/// </summary>
public string DeviceGroupName;
/// <summary>
/// 托盘类型
/// </summary>
public string TrayType;
/// <summary>
/// 是否空托盘
/// </summary>
public bool IsEmpty;
/// <summary>
/// 料盘数据
/// </summary>
public ReelParam LoadParam;
//public DoorStatusE DoorStatus;
[Newtonsoft.Json.JsonIgnore]
public TrayTypeE GetTrayType
{
get
{
try
{
return (TrayTypeE)Enum.Parse(typeof(TrayTypeE), TrayType);
}
catch
{
return TrayTypeE.None;
}
}
}
}
public enum RobotStatusE
{
INROBOT, BOXDOOR, FINISHED
}
/// <summary>
/// 治具类型
/// </summary>
public enum TrayTypeE
{
None,
/// <summary>
/// 流水线料盘托盘
/// </summary>
MTP1, //流水线料盘托盘
/// <summary>
/// 流水线治具托盘
/// </summary>
MTP2, //流水线治具托盘
/// <summary>
/// 料串
/// </summary>
S007, //料串
/// <summary>
/// Tray料格
/// </summary>
M03, //Tray料格
/// <summary>
/// PCB料格
/// </summary>
M02, //PCB料格
/// <summary>
/// PizzaBOX料格
/// </summary>
M01, //PizzaBOX料格
/// <summary>
/// ShoeBOX料格
/// </summary>
M04, //ShoeBOX料格
}
[Serializable]
public class ReelParam
{
/// <summary>
/// 创建新出入库信息
/// </summary>
/// <param name="wareNo">二维码内容</param>
/// <param name="platew">宽度</param>
/// <param name="plateh">高度</param>
/// <param name="IsNg">是否是入库NG料</param>
/// <param name="ngMsg">NG消息</param>
public ReelParam(string wareNo = "", int platew = 0, int plateh = 0, bool _IsNg = false, string ngMsg = "")
{
WareCode = wareNo;
PlateW = platew;
PlateH = plateh;
IsNg = _IsNg;
NgMsg = ngMsg;
}
/// <summary>
/// 物品二维码信息
/// </summary>
public string WareCode { get; set; }
/// <summary>
/// 库位号
/// </summary>
public string PosID { get; set; }
public string bitmapfilename = "";
public List<CodeInfo> codeInfos { get; set; }
/// <summary>
/// 料盘高度
/// </summary>
public int PlateH { get; set; }
/// <summary>
/// 料盘宽度
/// </summary>
public int PlateW { get; set; }
/// <summary>
/// 是否是入料NG料
/// </summary>
public bool IsNg = false;
/// <summary>
/// 入料NG消息
/// </summary>
public string NgMsg = "";
/// <summary>
/// 物料编码
/// </summary>
public string PN { get; set; }
/// <summary>
/// 数量
/// </summary>
public int QTY { get; set; } = 0;
/// <summary>
/// 厂家代码
/// </summary>
public string FC { get; set; }
/// <summary>
/// 唯一序列号
/// </summary>
public string RI { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string Batch { get; set; }
public string cid { get; set; }
public bool ReelOnFixture { get; set; } = false;
public int HeightPos = 0;
public string RFID = "";
public ReelParam clone()
{
ReelParam dstobject;
using (MemoryStream mStream = new MemoryStream())
{
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(mStream, this);
mStream.Seek(0, SeekOrigin.Begin);//指定当前流的位置为流的开头。
dstobject = (ReelParam)bf.Deserialize(mStream);
mStream.Close();
}
return dstobject;
}
public string ToStr()
{
if (IsNg)
{
return $":{NgMsg}[{WareCode}][{RFID}][{PlateW}x{PlateH}]";
}
else
{
return $":[{PosID}][{WareCode}][{RFID}][{PlateW}x{PlateH}]";
}
}
}
public enum DoorStatusE {
Busy,
Free,
CanInStore,
CanOutStore,
CanInOut,
}
public enum RemoteResult
{
None,
Timeout,
False,
True
}
[Serializable]
public class MTP
{
/// <summary>
/// 料盘托盘
/// </summary>
public static readonly string MTP1 = "MTP1";
/// <summary>
/// 治具托盘
/// </summary>
public static readonly string MTP2 = "MTP2";
}