123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using Edge.Core.Parser.BinaryParser.Util;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LanTian_Pump_664_Or_886.MessageEntity.Incoming
- {
- public class ReadShiftTotalizerResponse : MessageBase
- {
- /// <summary>
- /// Without decimal points
- /// </summary>
- public long VolumeTotalizer
- {
- get
- {
- if (base.BodyAndXRL.Count - 2 == 10)
- {
- /*Model 664*/
- return base.BodyAndXRL.Take(5).GetBcdLong();
- }
- else if (base.BodyAndXRL.Count - 2 == 12)
- {
- /*Model 886*/
- return base.BodyAndXRL.Take(6).GetBcdLong();
- }
- throw new InvalidDataException("data body length should either 10 or 12, but now is: " + (base.BodyAndXRL.Count - 1));
- }
- }
- /// <summary>
- /// Without decimal points
- /// </summary>
- public long AmountTotalizer
- {
- get
- {
- if (base.BodyAndXRL.Count - 2 == 10)
- {
- /*Model 664*/
- return base.BodyAndXRL.Skip(5).Take(5).GetBcdLong();
- }
- else if (base.BodyAndXRL.Count - 2 == 12)
- {
- /*Model 886*/
- return base.BodyAndXRL.Skip(6).Take(6).GetBcdLong();
- }
- throw new InvalidDataException("data body length should either 10 or 12, but now is: " + (base.BodyAndXRL.Count - 1));
- }
- }
- }
- }
|