Пример #1
0
        /// <summary>
        /// 读取输入水量记录
        /// </summary>
        /// <param name="data"></param>
        /// <param name="refValue"></param>
        private void Read_InWater(byte[] Data, ref object oPars)
        {
            //总记录号
            toRec = Data[7];
            //记录号
            noRec = Data[8];
            //日期时间
            string Date = "20" + Data[9].ToString("x2") + "-" + Data[10].ToString("x") + "-" + Data[11].ToString("x");
            string Time = Data[12].ToString("x") + ":" + Data[13].ToString("x2") + ":" + Data[14].ToString("x2");

            datetime = Date + " " + Time;
            //输入水量
            string strInWater = "";

            for (int i = 15; i < 19; i++)//15,16,17,18
            {
                strInWater += Data[i].ToString("x2");
            }
            inWater = Convert.ToInt32(strInWater, 16);
            oPars   = new Gate_Inp(comAdr, toRec, noRec, datetime, inWater);
        }
Пример #2
0
 /// <summary>
 /// ��ȡ����ˮ����¼
 /// </summary>
 /// <param name="data"></param>
 /// <param name="refValue"></param>
 private void Read_InWater(byte[] Data, ref object oPars)
 {
     //�ܼ�¼��
     toRec = Data[7];
     //��¼��
     noRec = Data[8];
     //����ʱ��
     string Date = "20" + Data[9].ToString("x2") + "-" + Data[10].ToString("x") + "-" + Data[11].ToString("x");
     string Time = Data[12].ToString("x") + ":" + Data[13].ToString("x2") + ":" + Data[14].ToString("x2");
     datetime = Date + " " + Time;
     //����ˮ��
     string strInWater = "";
     for (int i = 15; i < 19; i++)//15,16,17,18
     {
         strInWater += Data[i].ToString("x2");
     }
     inWater = Convert.ToInt32(strInWater, 16);
     oPars = new Gate_Inp(comAdr, toRec, noRec, datetime, inWater);
 }