123456789101112131415161718192021222324252627282930313233 |
- using Edge.Core.Parser.BinaryParser.Attributes;
- using System.Collections.Generic;
- namespace PetroChinaOnlineWatchPlugin.MessageEntity.Incoming
- {
- public class ReadMessageIn : 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 DataIdentifierLength { get { return MessageLength - 1 - DatabaseAddressLength; } }
- [EnumerableFormat("DataIdentifierLength", -9900)]
- public List<byte> DataIdentifier { get; set; }
- public override string ToString()
- {
- string dbAddress = string.Empty;
- foreach (byte ad in DatabaseAddress)
- { dbAddress += " " + ad.ToString(); }
- string dtIdentifier = string.Empty;
- foreach (byte ad in DataIdentifier)
- { dtIdentifier += " " + ad.ToString(); }
- return $"{MessageLength} {DatabaseAddressLength} {dbAddress} {dtIdentifier}";
- }
- }
- }
|