123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DWZB_Agv_Agreement.Agv_Agreement
- {
- /// <summary>
- /// 运行状态更改指令实体类
- /// </summary>
- public class AgvChangeRunStatusCmdMd : DataHeadMd
- {
- private const int btyArrLen = 11;
- /// <summary>
- /// 指令编号
- /// </summary>
- public int CmdNo { get; set; }
- /// <summary>
- /// 指令代码
- /// </summary>
- public byte CmdCode { get; set; }
- /// <summary>
- /// 状态代码
- /// </summary>
- public byte StatusCode { get; set; }
- /// <summary>
- /// 序列化为byte数组。
- /// </summary>
- public byte[] SerializeBytArr()
- {
- List<byte> retBtArr = new(btyArrLen);
- retBtArr.Add(FunctionCode);
- retBtArr.AddRange(DataHandleHelper.ReverseBtyArr(BitConverter.GetBytes(AgvNo)));
- retBtArr.AddRange(DataHandleHelper.ReverseBtyArr(BitConverter.GetBytes(CmdNo)));
- retBtArr.Add(CmdCode);
- retBtArr.Add(StatusCode);
- return retBtArr.ToArray();
- }
- }
- }
|