예제 #1
0
        /// <summary>
        /// 消息触发配置处理
        /// </summary>
        private void setActionMask(DH_MSG_HANDLE msgHandle)
        {
            //是否有效
            chkActionMask01.Enabled = ((int)(msgHandle.dwActionMask & 0x00000001) == 0x00000001 ? true : false);//上传服务器 0x00000001
            chkActionMask02.Enabled = ((int)(msgHandle.dwActionMask & 0x00000002) == 0x00000002 ? true : false);//联动录像 0x00000002
            chkActionMask08.Enabled = ((int)(msgHandle.dwActionMask & 0x00000008) == 0x00000008 ? true : false);//发送邮件 0x00000008
            chkActionMask10.Enabled = ((int)(msgHandle.dwActionMask & 0x00000010) == 0x00000010 ? true : false);//设备本地报警轮巡 0x00000010
            chkActionMask20.Enabled = ((int)(msgHandle.dwActionMask & 0x00000020) == 0x00000020 ? true : false);//设备提示使能 0x00000020
            chkActionMask40.Enabled = ((int)(msgHandle.dwActionMask & 0x00000040) == 0x00000040 ? true : false);//设备报警输出使能 0x00000040
            //是否选择
            chkActionMask01.Checked = ((int)(msgHandle.dwActionFlag & 0x00000001) == 0x00000001 ? true : false);//上传服务器 0x00000001
            chkActionMask02.Checked = ((int)(msgHandle.dwActionFlag & 0x00000002) == 0x00000002 ? true : false);//联动录像 0x00000002
            chkActionMask08.Checked = ((int)(msgHandle.dwActionFlag & 0x00000008) == 0x00000008 ? true : false);//发送邮件 0x00000008
            chkActionMask10.Checked = ((int)(msgHandle.dwActionFlag & 0x00000010) == 0x00000010 ? true : false);//设备本地报警轮巡 0x00000010
            chkActionMask20.Checked = ((int)(msgHandle.dwActionFlag & 0x00000020) == 0x00000020 ? true : false);//设备提示使能 0x00000020
            chkActionMask40.Checked = ((int)(msgHandle.dwActionFlag & 0x00000040) == 0x00000040 ? true : false);//设备报警输出使能 0x00000040

            chkRelAlarmOut01.Checked = ((int)msgHandle.byRelAlarmOut[0] == 1 ? true : false);
            chkRelAlarmOut02.Checked = ((int)msgHandle.byRelAlarmOut[1] == 1 ? true : false);
            chkRelAlarmOut03.Checked = ((int)msgHandle.byRelAlarmOut[2] == 1 ? true : false);
            chkRelAlarmOut04.Checked = ((int)msgHandle.byRelAlarmOut[3] == 1 ? true : false);
            chkRelAlarmOut05.Checked = ((int)msgHandle.byRelAlarmOut[4] == 1 ? true : false);
            chkRelAlarmOut06.Checked = ((int)msgHandle.byRelAlarmOut[5] == 1 ? true : false);
            chkRelAlarmOut07.Checked = ((int)msgHandle.byRelAlarmOut[6] == 1 ? true : false);
            chkRelAlarmOut08.Checked = ((int)msgHandle.byRelAlarmOut[7] == 1 ? true : false);
            chkRelAlarmOut09.Checked = ((int)msgHandle.byRelAlarmOut[8] == 1 ? true : false);
            chkRelAlarmOut10.Checked = ((int)msgHandle.byRelAlarmOut[9] == 1 ? true : false);
            chkRelAlarmOut11.Checked = ((int)msgHandle.byRelAlarmOut[10] == 1 ? true : false);
            chkRelAlarmOut12.Checked = ((int)msgHandle.byRelAlarmOut[11] == 1 ? true : false);
            chkRelAlarmOut13.Checked = ((int)msgHandle.byRelAlarmOut[12] == 1 ? true : false);
            chkRelAlarmOut14.Checked = ((int)msgHandle.byRelAlarmOut[13] == 1 ? true : false);
            chkRelAlarmOut15.Checked = ((int)msgHandle.byRelAlarmOut[14] == 1 ? true : false);
            chkRelAlarmOut16.Checked = ((int)msgHandle.byRelAlarmOut[15] == 1 ? true : false);
            chkRecordChannel01.Checked = ((int)msgHandle.byRecordChannel[0] == 1 ? true : false);
            chkRecordChannel02.Checked = ((int)msgHandle.byRecordChannel[1] == 1 ? true : false);
            chkRecordChannel03.Checked = ((int)msgHandle.byRecordChannel[2] == 1 ? true : false);
            chkRecordChannel04.Checked = ((int)msgHandle.byRecordChannel[3] == 1 ? true : false);
            chkRecordChannel05.Checked = ((int)msgHandle.byRecordChannel[4] == 1 ? true : false);
            chkRecordChannel06.Checked = ((int)msgHandle.byRecordChannel[5] == 1 ? true : false);
            chkRecordChannel07.Checked = ((int)msgHandle.byRecordChannel[6] == 1 ? true : false);
            chkRecordChannel08.Checked = ((int)msgHandle.byRecordChannel[7] == 1 ? true : false);
            chkRecordChannel09.Checked = ((int)msgHandle.byRecordChannel[8] == 1 ? true : false);
            chkRecordChannel10.Checked = ((int)msgHandle.byRecordChannel[9] == 1 ? true : false);
            chkRecordChannel11.Checked = ((int)msgHandle.byRecordChannel[10] == 1 ? true : false);
            chkRecordChannel12.Checked = ((int)msgHandle.byRecordChannel[11] == 1 ? true : false);
            chkRecordChannel13.Checked = ((int)msgHandle.byRecordChannel[12] == 1 ? true : false);
            chkRecordChannel14.Checked = ((int)msgHandle.byRecordChannel[13] == 1 ? true : false);
            chkRecordChannel15.Checked = ((int)msgHandle.byRecordChannel[14] == 1 ? true : false);
            chkRecordChannel16.Checked = ((int)msgHandle.byRecordChannel[15] == 1 ? true : false);
        }
예제 #2
0
 private void AlarmSaveData(ref DH_MSG_HANDLE msgHandle)
 {
     msgHandle.dwActionMask =(uint) (msgHandle.dwActionMask | (chkActionMask01.Checked == true ? 0x00000001 : 0x00000000));
     msgHandle.dwActionMask = (uint)(msgHandle.dwActionMask | (chkActionMask02.Checked == true ? 0x00000002 : 0x00000000));
     msgHandle.dwActionMask = (uint)(msgHandle.dwActionMask | (chkActionMask08.Checked == true ? 0x00000008 : 0x00000000));
     msgHandle.dwActionMask = (uint)(msgHandle.dwActionMask | (chkActionMask10.Checked == true ? 0x00000010 : 0x00000000));
     msgHandle.dwActionMask = (uint)(msgHandle.dwActionMask | (chkActionMask20.Checked == true ? 0x00000020 : 0x00000000));
     msgHandle.dwActionMask = (uint)(msgHandle.dwActionMask | (chkActionMask40.Checked == true ? 0x00000040 : 0x00000000));
     msgHandle.byRecordChannel[0] = (byte)(chkRecordChannel01.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[1] = (byte)(chkRecordChannel02.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[2] = (byte)(chkRecordChannel03.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[3] = (byte)(chkRecordChannel04.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[4] = (byte)(chkRecordChannel05.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[5] = (byte)(chkRecordChannel06.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[6] = (byte)(chkRecordChannel07.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[7] = (byte)(chkRecordChannel08.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[8] = (byte)(chkRecordChannel09.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[9] = (byte)(chkRecordChannel10.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[10] = (byte)(chkRecordChannel11.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[11] = (byte)(chkRecordChannel12.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[12] = (byte)(chkRecordChannel13.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[13] = (byte)(chkRecordChannel14.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[14] = (byte)(chkRecordChannel15.Checked == true ? 1 : 0);
     msgHandle.byRecordChannel[15] = (byte)(chkRecordChannel16.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[0] = (byte)(chkRelAlarmOut01.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[1] = (byte)(chkRelAlarmOut02.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[2] = (byte)(chkRelAlarmOut03.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[3] = (byte)(chkRelAlarmOut04.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[4] = (byte)(chkRelAlarmOut05.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[5] = (byte)(chkRelAlarmOut06.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[6] = (byte)(chkRelAlarmOut07.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[7] = (byte)(chkRelAlarmOut08.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[8] = (byte)(chkRelAlarmOut09.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[9] = (byte)(chkRelAlarmOut10.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[10] = (byte)(chkRelAlarmOut11.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[11] = (byte)(chkRelAlarmOut12.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[12] = (byte)(chkRelAlarmOut13.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[13] = (byte)(chkRelAlarmOut14.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[14] = (byte)(chkRelAlarmOut15.Checked == true ? 1 : 0);
     msgHandle.byRelAlarmOut[15] = (byte)(chkRelAlarmOut16.Checked == true ? 1 : 0);
 }