ActionFinishPkg.cs
1.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mushiny.Model
{
/// <summary>
/// AGV->RCS
/// 动作完成数据包:
/// (直行完成、转弯完成、料仓取放货完成、货架取放货完成、路径结束、充电对接完成、充满电)
/// </summary>
internal class ActionFinishPkg:PkgData
{
public ActionFinishPkg() : base()
{
}
public byte ActionCode { get; set; }
public byte[] AddrCodeID { get; set; }
public byte[] Dir { get; set; }
public byte[] ShelvesCode { get; set; }
public byte[] ContainerCode { get; set;}
public override bool Parse(byte[] bytes)
{
bool result = false;
try
{
if (base.Parse(bytes))
{
if (bytes.Length < 53)
{
return false;
}
ActionCode = Common.GetSubBytes(bytes, 12, 1)[0];
AddrCodeID = Common.GetSubBytes(bytes, 13, 4);
Dir = Common.GetSubBytes(bytes, 17, 2);
ShelvesCode = Common.GetSubBytes(bytes, 19, 16);
ContainerCode = Common.GetSubBytes(bytes, 35, 16);
result = true;
}
else
{
result = false;
}
}
catch (Exception ex)
{
throw ex;
}
return result;
}
}
}