Exemplo n.º 1
0
        /// <summary>
        /// 读取上传数据卡输入数据时的数据
        /// </summary>
        /// <param name="data"></param>
        /// <param name="refValue"></param>
        private void Read_Inp_Water(byte[] Data, ref object oPars)
        {
            //记录号
            recordNO = Data[7];

            //打卡日期时间
            string RunDate = "20" + Data[10].ToString("x2") + "-" + Data[9].ToString("x") + "-" + Data[8].ToString("x");
            string RunTime = Data[13].ToString("x") + ":" + Data[12].ToString("x2") + ":" + Data[11].ToString("x2");

            datetime = RunDate + " " + RunTime;

            //加入水量
            string strInWater = "";

            for (int i = 14; i < 18; i++)//14,15,16,17
            {
                strInWater += Data[i].ToString("x2");
            }
            inWater = Convert.ToInt32(strInWater, 16);

            //打卡前剩余水量
            string strReWater = "";

            for (int i = 18; i < 22; i++)//18,19,20,21
            {
                strReWater += Data[i].ToString("x2");
            }
            reWater = Convert.ToInt32(strReWater, 16);

            //打卡前剩余水量
            string in_strReWater = "";

            for (int i = 22; i < 26; i++)//22,23,24,25
            {
                in_strReWater += Data[i].ToString("x2");
            }
            in_reWater = Convert.ToInt32(in_strReWater, 16);
            oPars      = new Pump_Inp(address, recordNO, datetime, inWater, reWater, in_reWater);
        }
Exemplo n.º 2
0
        /// <summary>
        /// ��ȡ�ϴ����ݿ���������ʱ������
        /// </summary>
        /// <param name="data"></param>
        /// <param name="refValue"></param>
        private void Read_Inp_Water(byte[] Data, ref object oPars)
        {
            //��¼��
            recordNO = Data[7];

            //������ʱ��
            string RunDate = "20" + Data[10].ToString("x2") + "-" + Data[9].ToString("x") + "-" + Data[8].ToString("x");
            string RunTime = Data[13].ToString("x") + ":" + Data[12].ToString("x2") + ":" + Data[11].ToString("x2");
            datetime = RunDate + " " + RunTime;

            //����ˮ��
            string strInWater = "";
            for (int i = 14; i < 18; i++)//14,15,16,17
            {
                strInWater += Data[i].ToString("x2");
            }
            inWater = Convert.ToInt32(strInWater, 16);

            //��ǰʣ��ˮ��
            string strReWater = "";
            for (int i = 18; i < 22; i++)//18,19,20,21
            {
                strReWater += Data[i].ToString("x2");
            }
            reWater = Convert.ToInt32(strReWater, 16);

            //��ǰʣ��ˮ��
            string in_strReWater = "";
            for (int i = 22; i < 26; i++)//22,23,24,25
            {
                in_strReWater += Data[i].ToString("x2");
            }
            in_reWater = Convert.ToInt32(in_strReWater, 16);
            oPars = new Pump_Inp(address, recordNO, datetime, inWater, reWater, in_reWater);
        }