Shelves.cs
2.9 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CtuDeviceLib
{
/// <summary>
/// 货架
/// </summary>
public class Shelves
{
/// <summary>
/// 货架号
/// </summary>
public string PosId { get; set; }
/// <summary>
/// 楼层
/// </summary>
public int Floor { get; set; }
/// <summary>
/// 巷道编码
/// </summary>
public string Lanway { get; set; }
/// <summary>
/// 库位在车头的左侧/右侧
/// </summary>
public char Side { get; set; }
/// <summary>
/// 地面点位编码
/// </summary>
public uint PointCode { get; set; }
/// <summary>
/// 所在层
/// </summary>
public int Row { get; set; }
/// <summary>
/// 升降高度
/// </summary>
public int UpDownHeight { get; set; }
/// <summary>
/// 进出深度
/// </summary>
public int InoutDepth { get; set; }
/// <summary>
/// 料箱码读码偏移距离
/// </summary>
public int ScanCodeShift { get; set; }
/// <summary>
/// 料箱宽度
/// </summary>
public int ContainerWidth { get; set; }
//描述
public string Desc { get; set; }
/// <summary>
/// 货架码
/// 16位
/// </summary>
/// <param name="posid"></param>
public Shelves(string posid, string pointcode, int updown, int inout, int scancode, int containerWidth)
{
if (string.IsNullOrEmpty(posid))
return;
if (posid.Length < 16)
{
posid = "";
Lanway = "";
if (!string.IsNullOrEmpty(pointcode))
{
PointCode = uint.Parse(pointcode);
}
InoutDepth = inout;
ScanCodeShift = scancode;
ContainerWidth = containerWidth;
return;
}
PosId = posid;
string floor = posid.Substring(0, 1);
string laneway = posid.Substring(1, 3);
string side = posid.Substring(4, 1);
string pointCode = posid.Substring(5, 8);
if (!string.IsNullOrEmpty(pointcode))
{
pointCode = pointcode;
}
string row = posid.Substring(14);
int.TryParse(floor, out int val);
Floor = val;
Lanway = laneway;
Side = side[0];
PointCode = uint.Parse(pointCode);
Row = int.Parse(row);
UpDownHeight = updown;
InoutDepth = inout;
ScanCodeShift = scancode;
ContainerWidth = containerWidth;
}
}
}