Example #1
0
 //设置报警设置
 public byte[] Set_alarm(Set_alarm sa)
 {
     int[] alarm = { Convert.ToInt16(sa._yicigdiya * 100), Convert.ToInt16(sa._erciggaoya * 100), Convert.ToInt16(sa._ercihgaoya * 100), Convert.ToInt16(sa._ercihdiya * 100), sa._yicigdiwen, sa._erciggaowen, Convert.ToInt16(sa._waterlow * 100), Convert.ToInt16(sa._waterhight * 100) };
     return setdata(198, alarm);
 }
Example #2
0
 //解析报警设置
 public Set_alarm Read_alarm(byte[] inByte)
 {
     Set_alarm sa = new Set_alarm();
     sa._yicigdiya = (float)Math.Round(DataInfo.GetLongValue2(inByte, 3) / 100.0, 1);
     sa._erciggaoya = (float)Math.Round(DataInfo.GetLongValue2(inByte, 5) / 100.0, 1);
     sa._ercihgaoya=(float)Math.Round(DataInfo.GetLongValue2(inByte, 7) / 100.0, 1);
     sa._ercihdiya=(float)Math.Round(DataInfo.GetLongValue2(inByte, 9) / 100.0, 1);
     sa._yicigdiwen=DataInfo.GetLongValue2(inByte, 11);
     sa._erciggaowen = DataInfo.GetLongValue2(inByte, 13);
     sa._waterlow=(float)Math.Round(DataInfo.GetLongValue2(inByte, 15) / 100.0, 1);
     sa._waterhight=(float)Math.Round(DataInfo.GetLongValue2(inByte, 17) / 100.0, 1);
     return sa;
 }