BoxInfo.cs
6.4 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 System;
using System.Collections.Generic;
using System.Linq;
namespace OnlineStore.DeviceLibrary
{
public class BoxInfo
{
public BoxInfo()
{
ID = 0;
CId = "";
Seq = 0;
SStatus = (int)LineStatus.None;
SRunStatus = (int)LineRunStatus.Wait;
SAlarmType = LineAlarmType.None;
HasTray = 0;
WaitInStoreList = new List<string>();
CurrPosId = "";
}
public BoxInfo(int id,string cid,int seq,int ss,int runs,int hasTray,int alarmType,List<string> inList,string currPosId,string rfids)
{
this.ID = id;
CId = cid;
Seq = seq;
SStatus = (int)ss;
SRunStatus = (int)runs;
SAlarmType = (LineAlarmType)alarmType;
LastMsgTime = DateTime.Now;
this.HasTray = hasTray;
this.WaitInStoreList = inList;
this.CurrPosId = currPosId;
this.rfids = rfids;
}
public string ToShowStr()
{
return KTK_Store.GetRunStr((LineRunStatus)SRunStatus, (LineStatus)SStatus);
}
/// <summary>
/// 编号,1-4
/// </summary>
public int ID { get; set; }
/// <summary>
/// 料仓CID
/// </summary>
public string CId { get; set; }
/// <summary>
/// 请求序列号
/// </summary>
public int Seq { get; set; }
/// <summary>
/// 与LineStatus枚举值对应
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
///2=急停,3=故障,4=警告,5=调试
/// 6=入库执行中,7=入仓完成,8=入仓失败
/// 9=出库执行,10=出仓完成,11=出库失败
/// </summary>
public int SStatus { get; set; }
/// <summary>
/// 与LineRunStatus枚举值对应
/// 0= 等待启动/已经停止,1=初始化完成, 2=正常运行中,3=可以进行新的处理,4=忙碌,重置
/// </summary>
public int SRunStatus { get; set; }
/// <summary>
/// 报警信息
/// </summary>
public LineAlarmType SAlarmType { get; set; }
public DateTime LastMsgTime { get; set; }
/// <summary>
/// 料门口是否有料盘信号
/// </summary>
public int HasTray { get; set; }
public List<string> WaitInStoreList = new List<string>();
/// <summary>
/// 当前出入库的库位号
/// </summary>
public string CurrPosId = "";
/// <summary>
/// 出料机构料架号
/// </summary>
public string rfids = "";
private char rfidSpilt = ';';
public string GetRfids()
{
string str = "";
string[] array = rfids.Split(rfidSpilt);
if (array != null && array.Length > 0)
{
foreach (string obj in array)
{
string realRfid = obj;
string xuniRfid = "";
if (obj.Contains(","))
{
string[] rarray = obj.Split(',');
if (rarray.Length == 2)
{
realRfid = rarray[0];
xuniRfid = rarray[1];
}
}
str += realRfid + rfidSpilt;
}
}
str = str.Substring(0, str.Length - 1);
return str;
}
//internal bool HasRightRFID(OutWareInfo wareInfo, out string TargetRfid)
//{
// TargetRfid = "";
// string[] rfidArray = rfids.Split(rfidSpilt);
// if (rfidArray == null || rfidArray.Length <= 0)
// {
// return false;
// }
// foreach (string obj in rfidArray)
// {
// string realRfid = obj;
// string xuniRfid = "";
// if (obj.Contains(","))
// {
// string[] rarray = obj.Split(',');
// if (rarray.Length == 2)
// {
// realRfid = rarray[0];
// xuniRfid = rarray[1];
// }
// }
// if (realRfid.Equals(wareInfo.realRFID))
// {
// TargetRfid = obj;
// return true;
// }
// else if (String.IsNullOrEmpty(wareInfo.realRFID))
// {
// if ((!xuniRfid.Equals("")) && xuniRfid.Equals(wareInfo.rfid))
// {
// TargetRfid = obj;
// return true;
// }
// if (!String.IsNullOrEmpty(wareInfo.usedRfidList))
// {
// string[] array = wareInfo.usedRfidList.Split(',');
// //若料架已使用过,直接返回false
// if (array.Contains(realRfid))
// {
// return false;
// }
// }
// if (xuniRfid.Equals(""))
// {
// TargetRfid = obj;
// return true;
// }
// }
// }
// return false;
//}
//public Dictionary<string, string> GetRfidMap()
//{
// Dictionary<string, string> map = new Dictionary<string, string>();
// string[] array = rfids.Split(rfidSpilt);
// if (array != null && array.Length > 0)
// {
// foreach (string obj in array)
// {
// string realRfid = obj;
// string xuniRfid = "";
// if (obj.Contains("-"))
// {
// string[] rarray = obj.Split('-');
// if (rarray.Length == 2)
// {
// realRfid = rarray[0];
// xuniRfid = rarray[1];
// }
// }
// map.Add(realRfid, xuniRfid);
// }
// }
// return map;
//}
}
}