Пример #1
0
        //报警解析
        public static xd100x.AlarmState AlarmParse(byte[] alarm)
        {
            xd100x.AlarmState gral = new xd100x.AlarmState();
            if (alarm[0] != 0x00 || alarm[1] != 0x00)
            {
                gral._all = xd100x.GRAlarm.;
            }
            else
            {
                gral._all = xd100x.GRAlarm.无;
            }
            gral._yicigongdiya   = DataInfo.GetAlarmData(alarm[1], 0);
            gral._ercigonggaoya  = DataInfo.GetAlarmData(alarm[1], 1);
            gral._ercihuigaoya   = DataInfo.GetAlarmData(alarm[1], 2);
            gral._ercihuidiya    = DataInfo.GetAlarmData(alarm[1], 3);
            gral._yicigongdiwen  = DataInfo.GetAlarmData(alarm[1], 4);
            gral._ercigonggaowen = DataInfo.GetAlarmData(alarm[1], 5);
            gral._shuiweigao     = DataInfo.GetAlarmData(alarm[1], 6);
            gral._shuiweidi      = DataInfo.GetAlarmData(alarm[1], 7);

            gral._xunhuanbeng1 = DataInfo.GetAlarmData(alarm[0], 0);
            gral._xunhuanbeng2 = DataInfo.GetAlarmData(alarm[0], 1);
            gral._xunhuanbeng3 = DataInfo.GetAlarmData(alarm[0], 2);
            gral._bushuibeng1  = DataInfo.GetAlarmData(alarm[0], 3);
            gral._bushuibeng2  = DataInfo.GetAlarmData(alarm[0], 4);
            gral._kaiguangao   = DataInfo.GetAlarmData(alarm[0], 5);
            gral._kaiguandi    = DataInfo.GetAlarmData(alarm[0], 6);
            gral._diaodian     = DataInfo.GetAlarmData(alarm[0], 7);
            gral._word         = alarm[0] * 256 + alarm[1];
            return(gral);
        }