12345678910111213141516171819202122232425262728293031 |
- 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
- {
- /// <summary>
- /// 3、写提前关阀量
- /// </summary>
- public class WriteCloseAheadValveThresholdRequest : MessageBase
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="thresholdValueWithoutDecimalPoint">max 2 digits, 35 表示设置提前关阀量为0.35L</param>
- 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);
- }
- }
- }
|