InOutParam.cs
2.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
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;
this.PlateW = plateW;
this.PlateH = plateH;
this.paramType = type;
}
public InOutParam(MoveType type, string posId, VerticalPosition position)
{
this.position = position;
PosCode = "";
PosId = posId;
this.PlateW = position.BagWidth;
this.PlateH = position.BagHigh;
this.paramType = type;
}
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 = "";
/// <summary>
/// 料盘高度
/// </summary>
public int PlateH = 0;
/// <summary>
/// 料盘宽度
/// </summary>
public int PlateW = 0;
public string LogName
{
get
{
if (paramType.Equals(MoveType.InStore))
{
return "【入库:" + PosId + "】";
}
else if (paramType.Equals(MoveType.OutStore))
{
return "【出库:" + PosId + "】";
}
else
{
return PosId;
}
}
}
}
}