InOutParam.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
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
namespace OnlineStore.DeviceLibrary
{
public class InOutParam
{
public MoveType paramType = MoveType.None;
public InOutParam(MoveType type, string posId, string code = "", int plateH = 0, int plateW = 0)
{
position = null;
PosCode = code;
PosId = posId;
MoveP = null;
this.PlateW = plateW;
this.PlateH = plateH;
this.paramType = type;
}
public InOutParam(MoveType paramType, string posId, StoreMoveP linePosition, string wareNo = "")
{
position = null;
PosCode = wareNo;
PosId = posId;
MoveP = linePosition;
this.paramType = paramType;
}
public string ToStr()
{
if (paramType.Equals(MoveType.InStore))
{
return "【入库:" + PosId + " ,[" + PosCode + "][" + PlateW + "X" + PlateH + "]】";
}
else if (paramType.Equals(MoveType.OutStore))
{
return "【出库:" + PosId + ",[" + PosCode + "][" + PlateW + "X" + PlateH + "]】";
}
return "[" + PosId + "][" + PosCode + "][" + PlateW + "X" + PlateH + "]";
}
private VerticalPosition position = null;
public VerticalPosition Position
{
get
{
if (position == null)
{
position = CSVPositionReader<VerticalPosition>.GetPositon(PosId);
}
return position;
}
}
/// <summary>
/// 物品二维码信息
/// </summary>
public string PosCode = "";
/// <summary>
/// 位置坐标名(对应配置表的位置)
/// </summary>
public string PosId = "";
public StoreMoveP MoveP { get; set; }
/// <summary>
/// 料盘高度
/// </summary>
public int PlateH = 0;
/// <summary>
/// 料盘宽度
/// </summary>
public int PlateW = 0;
internal bool LoadParam(VerticalStoreConfig Config)
{
//加载位置
if (MoveP == null)
{
StoreMoveP p = new StoreMoveP();
VerticalPosition position = Position;
if (position == null)
{
LogUtil.error("出入库时发现param中取到的Position=null,没有库位不能执行出入库");
return false;
}
p.Middle_P2 = position.MiddleAxis_P2;
this.MoveP = p;
return true;
}
return true;
}
public string LogName
{
get
{
if (paramType.Equals(MoveType.InStore))
{
return "【入库:" + PosId + "】";
}
else if (paramType.Equals(MoveType.OutStore))
{
return "【出库:" + PosId + "】";
}
else
{
return PosId;
}
}
}
}
public class StirInfo
{
public StirInfo()
{
InStirWork = false;
StartTime = DateTime.Now;
StopTime = DateTime.Now;
StirParam = new InOutParam(MoveType.None, "", "");
}
/// <summary>
/// 是否在搅拌中
/// </summary>
public bool InStirWork = false;
/// <summary>
/// 搅拌区状态:1=物料1已放入,2=物料2已放入,3=搅拌中,4=搅拌完成,等待取出物料,5=物料1已取出,6=物料2已取出,7=全部完成
/// </summary>
public int MoveStatus = 0;
/// <summary>
/// 开始搅拌信息
/// </summary>
public DateTime StartTime = DateTime.Now;
/// <summary>
/// 需要停止搅拌的时间
/// </summary>
public DateTime StopTime = DateTime.Now;
/// <summary>
/// 搅拌参数
/// </summary>
public InOutParam StirParam = null;
public string toStr()
{
if (MoveStatus.Equals(0))
{
return "暂无搅拌信息";
}
string str = "等待物料放入搅拌区";
if (MoveStatus.Equals(1))
{
str = "物料1已放入";
}
else if (MoveStatus.Equals(2))
{
str = "物料2已放入";
}
else if (MoveStatus.Equals(3))
{
str = "搅拌中,结束时间:"+StopTime.ToLongTimeString();
}
else if (MoveStatus.Equals(4))
{
str = "搅拌完成,等待物料回库 ";
}
else if (MoveStatus.Equals(5))
{
str = "物料1已回库";
}
else if (MoveStatus.Equals(6))
{
str = "物料2已回库";
}
return "[" + str + "]" + StirParam.ToStr();
}
}
}