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 { /// /// Without decimal points /// 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)); } } /// /// Without decimal points /// 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)); } } } }