예제 #1
0
파일: xd100n.cs 프로젝트: hkiaipc/guye
 //设置调节阀分时调整
 public byte[] Set_timepace(Set_timepace tp)
 {
     int[] st = { Convert.ToInt16(tp._v1 * 10), Convert.ToInt16(tp._v2 * 10), Convert.ToInt16(tp._v3 * 10), Convert.ToInt16(tp._v4 * 10), Convert.ToInt16(tp._v5 * 10), Convert.ToInt16(tp._v6 * 10), Convert.ToInt16(tp._v7 * 10), Convert.ToInt16(tp._v8 * 10), Convert.ToInt16(tp._v9 * 10), Convert.ToInt16(tp._v10 * 10), Convert.ToInt16(tp._v11 * 10), Convert.ToInt16(tp._v12 * 10)};
     return setdata(133, st);
 }
예제 #2
0
파일: xd100n.cs 프로젝트: hkiaipc/guye
 //解析分时调整
 public Set_timepace Read_timepace(byte[] inByte)
 {
     Set_timepace st = new Set_timepace();
     st._v1 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 3)/ 10.0, 1);
     st._v2 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 5)/ 10.0, 1);
     st._v3 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 7)/ 10.0, 1);
     st._v4 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 9)/ 10.0, 1);
     st._v5 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 11)/ 10.0, 1);
     st._v6 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 13)/ 10.0, 1);
     st._v7 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 15)/ 10.0, 1);
     st._v8 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 17)/ 10.0, 1);
     st._v9 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 19)/ 10.0, 1);
     st._v10 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 21)/ 10.0, 1);
     st._v11 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 23)/ 10.0, 1);
     st._v12 = (float)Math.Round(DataInfo.GetLongValue2(inByte, 25) / 10.0, 1);
     return st;
 }