1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using Edge.Core.Parser.BinaryParser.Attributes;
- using System.Collections.Generic;
- namespace PetroChinaOnlineWatchPlugin.MessageEntity.Incoming
- {
- public class IfsfMessageDataIn
- {
- [Format(1, EncodingType.BIN, -9890)]
- public byte DataIdentifier { get; set; }
- [Format(1, EncodingType.BIN, -9880)]
- public int DataLength { get; set; }
- [EnumerableFormat("%cascade", -9870)]
- public List<byte> Data { get; set; }
- public override string ToString()
- {
- return $"{DataIdentifier} {DataLength}";
- }
- }
- public class AnswerWriteUnsolicitedMessageIn : MessageBase
- {
- [Format(2, EncodingType.BIN, -9930)]
- public int MessageLength { get; set; }
- [Format(1, EncodingType.BIN, -9920)]
- public int DatabaseAddressLength { get; set; }
- [EnumerableFormat("DatabaseAddressLength", -9910)]
- public List<byte> DatabaseAddress { get; set; }
- public int DataListLength { get { return MessageLength - 1 - DatabaseAddress.Count; } }
- [EnumerableFormat("DataListLength", -9900)]
- public List<IfsfMessageDataIn> DataList { get; set; }
- public override string ToString()
- {
- string dbAddress = string.Empty;
- foreach (byte ad in DatabaseAddress)
- { dbAddress += " " + ad.ToString(); }
- string dtList = string.Empty;
- foreach (var dt in DataList)
- { dtList += " " + dt.ToString(); }
- return $"{MessageLength} {DatabaseAddressLength} {dbAddress} {dtList}";
- }
- }
- }
|