예제 #1
0
 /// <summary>
 /// 设备信息显示
 /// </summary>
 /// <param name="sysAttrConfig">设备属性</param>
 private void setDataToControl(DHDEV_SYSTEM_ATTR_CFG sysAttrConfig)
 {
     try
     {
         txtDevType.Text = sysAttrConfig.DevType();//设备类型                
         txtDevType2.Text="";
         for(int i =0 ; i<sysAttrConfig.szDevType.Length;i++)
         {
             txtDevType2.Text += (char)sysAttrConfig.szDevType[i];
         }
         txtSN.Text = sysAttrConfig.DevSerialNo();//序列号
         txtVideoIn.Text = sysAttrConfig.byVideoCaptureNum.ToString("D");//视频输入数
         txtAudioIn.Text = sysAttrConfig.byAudioCaptureNum.ToString("D");//音频输入数
         txtAlarmIn.Text = sysAttrConfig.byAlarmInNum.ToString("D");//报警输入数
         txtAlarmOut.Text = sysAttrConfig.byAlarmOutNum.ToString("D");//报警输出数
         txtNetIO.Text = sysAttrConfig.byNetIONum.ToString("D");//网络口数
         txtUSBIO.Text = sysAttrConfig.byUsbIONum.ToString("D");//USB口数
         txtIDEIO.Text = sysAttrConfig.byIdeIONum.ToString("D");//IDE口数
         txt232IO.Text = sysAttrConfig.byComIONum.ToString("D");//232口数
         txtLPTIO.Text = sysAttrConfig.byLPTIONum.ToString("D");//并口数
         txtTalkIn.Text = sysAttrConfig.byTalkInChanNum.ToString("D");//对讲输入数
         txtTalkOut.Text = sysAttrConfig.byTalkOutChanNum.ToString("D");//对讲输出数
         txtDecodeChanNum.Text = sysAttrConfig.byDecodeChanNum.ToString();//解码通道数
         txtIdeControlNum.Text = sysAttrConfig.byIdeControlNum.ToString();//IDE控制器数
         txtIdeControlType.Text = sysAttrConfig.byIdeControlType.ToString();//IDE控制器类型
         txtVgaIONum.Text = sysAttrConfig.byVgaIONum.ToString();//VGA口数
         txtDevNo.Text = sysAttrConfig.wDevNo.ToString();//设备号
         cmbOverWrite.SelectedIndex = sysAttrConfig.byOverWrite;//硬盘满
         txtRecordLen.Text = sysAttrConfig.byRecordLen.ToString();//录像打包长度
         cmbVideoStandard.SelectedIndex = sysAttrConfig.byVideoStandard;//视频制式
         cmbTimeFmt.SelectedIndex = sysAttrConfig.byTimeFmt;//时间格式
         cmbDateFormat.SelectedIndex = sysAttrConfig.byDateFormat;//日期格式
         cmbDateSprtr.SelectedIndex = sysAttrConfig.byDateSprtr;//日期分割符
         txtStartChanNo.Text = sysAttrConfig.byStartChanNo.ToString();//开始通道号
         txtSoftWareVersion.Text = "软件版本:" + DHClient.DHUInt32ToString(sysAttrConfig.stVersion.dwSoftwareVersion, "V1.V2") + ";创建日期:" + DHClient.DHUInt32ToString(sysAttrConfig.stVersion.dwSoftwareBuildDate, "yyyy年m月d日");//软件版本
     }
     catch
     {
         MessageBox.Show("赋值错误!", pMsgTitle);
     }
 }
예제 #2
0
        /// <summary>
        /// 用户登录按钮按下
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnUserLogin_Click(object sender, EventArgs e)
        {
            string strLogin = StringUtil.ConvertString("设备用户登录");
            string strLogout = StringUtil.ConvertString("设备用户注销");

            if (btnUserLogin.Text.Equals(strLogin))
            {
                frm_AddDevice fadFrom = new frm_AddDevice();
                fadFrom.ShowDialog();
                if (fadFrom.blnOKEnter == true)
                {
                    //设备用户信息获得
                    NET_DEVICEINFO deviceInfo = new NET_DEVICEINFO();
                    int error = 0;
                    pLoginID = DHClient.DHLogin(fadFrom.cmbDevIP.Text.ToString(), ushort.Parse(fadFrom.txtDevProt.Text.ToString()), fadFrom.txtName.Text.ToString(), fadFrom.txtPassword.Text.ToString(), out deviceInfo, out error);
                    if (pLoginID != 0)
                    {
                        btnUserLogin.BackColor = Color.Yellow;
                        btnUserLogin.Text = strLogout;
                        grbMain.Enabled = true;
                        tbcMain.SelectedIndex = 0;
                    }
                    else
                    {
                        //报最后一次操作的错误信息
                        MessageBox.Show(DHClient.LastOperationInfo.ToString(pErrInfoFormatStyle), pMsgTitle);
                        btnUserLogin_Click(null, null);
                    }
                }
            }
            else
            {
                bool result = DHClient.DHLogout(pLoginID);
                if (result == false)
                {
                    //报最后一次操作的错误信息
                    MessageBox.Show(DHClient.LastOperationInfo.ToString(pErrInfoFormatStyle), pMsgTitle);
                }

                //画面初始化
                this.Controls.Clear();
                InitializeComponent();
                pLoginID = 0;
                sysAttrConfig = new DHDEV_SYSTEM_ATTR_CFG();
                channelConfig = new DHDEV_CHANNEL_CFG[16];
                netConfig = new DHDEV_NET_CFG();
                recConfig = new DHDEV_RECORD_CFG[16];
                commConfig = new DHDEV_COMM_CFG();
                alarmAllConfig = new DHDEV_ALARM_SCHEDULE();
                btnUserLogin.BackColor = Color.Transparent;
                btnUserLogin.Text = strLogin;
                grbMain.Enabled = false;
                tbcMain.SelectedIndex = 0;
            }
        }
예제 #3
0
 /// <summary>
 /// 设备属性设定
 /// </summary>
 /// <param name="lLoginID">设备用户登录ID:CLIENT_Login的返回值</param>
 /// <param name="systemAttrConfig">设备属性</param>
 /// <param name="waittime">等待时间</param>
 /// <returns>true:成功;false:失败</returns>
 public static bool DHSetDevConfig(int lLoginID,DHDEV_SYSTEM_ATTR_CFG systemAttrConfig, int waittime)
 {
     bool returnValue = false;
     returnValue = PSetDevConfig(lLoginID, 0, CONFIG_COMMAND.DH_DEV_DEVICECFG, (object)systemAttrConfig, typeof(DHDEV_SYSTEM_ATTR_CFG), waittime);
     return returnValue;
 }
예제 #4
0
 /// <summary>
 /// 设备属性设定[默认等待时间3000]
 /// </summary>
 /// <param name="lLoginID">设备用户登录ID:CLIENT_Login的返回值</param>
 /// <param name="systemAttrConfig">设备属性</param>
 /// <returns>true:成功;false:失败</returns>
 public static bool DHSetDevConfig(int lLoginID, DHDEV_SYSTEM_ATTR_CFG systemAttrConfig)
 {
     return DHSetDevConfig(lLoginID, systemAttrConfig, 3000);
 }
예제 #5
0
 /// <summary>
 ///  获取设备配置[设备信息配置]
 /// </summary>
 /// <param name="lLoginID">设备用户登录ID:CLIENT_Login的返回值</param>
 /// <param name="systemAttrConfig">设备信息</param>
 /// <param name="waittime">等待时间</param>
 /// <returns>true:成功;false:失败</returns>
 public static bool DHGetDevConfig(int lLoginID, ref DHDEV_SYSTEM_ATTR_CFG systemAttrConfig, int waittime)
 {
     object result = new object();
     bool returnValue = false;
     returnValue = PGetDevConfig(lLoginID, 0, CONFIG_COMMAND.DH_DEV_DEVICECFG, ref result, typeof(DHDEV_SYSTEM_ATTR_CFG),waittime);
     systemAttrConfig = (DHDEV_SYSTEM_ATTR_CFG)result;
     return returnValue;
 }