using Edge.Core.Parser.BinaryParser.Attributes; using Edge.Core.Parser.BinaryParser.Util; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LanTian_Pump_664_Or_886.MessageEntity.Outgoing { /// /// 3、写提前关阀量 /// public class WriteCloseAheadValveThresholdRequest : MessageBase { /// /// /// /// max 2 digits, 35 表示设置提前关阀量为0.35L public WriteCloseAheadValveThresholdRequest(int thresholdValueWithoutDecimalPoint) { if (thresholdValueWithoutDecimalPoint > 99 || thresholdValueWithoutDecimalPoint <= 0) throw new ArgumentException("写提前关阀量 should range from 0 to 9999"); base.BodyAndXRL = thresholdValueWithoutDecimalPoint.GetBCDBytes(1).ToList(); // cmd byte this.BodyAndXRL.Add(0xD2); // add a place hold for XRL this.BodyAndXRL.Add(0); } } }