Пример #1
0
 private void FrmIpConfig_Load(object sender, EventArgs e)
 {
     if (DMSDK.DM_CheckOnline("192.168.1.2", 5000) < 0)
     {
         MessageBox.Show("未检测到在线仪器,请检查后重试!");
         btnConfirm.Text = "重新连接";
     }
     else
     {
         temp_OperateHandle = DMSDK.DM_Connect(ucPbx1.Handle, "192.168.1.2", 80);
         if (temp_OperateHandle > 0)
         {
             temp_ConnectHandle = DMSDK.DM_OpenMonitor(ucPbx1.Handle, "192.168.1.2", 5000, 0);
         }
         if (temp_OperateHandle > 0 && temp_ConnectHandle > 0)
         {
             DMSDK.DM_GetNetmask(temp_OperateHandle, SubMask);
             DMSDK.DM_GetGateway(temp_OperateHandle, GateWay);
         }
         else
         {
             MessageBox.Show("连接失败,请重试!");
             this.Close();
         }
         if (SubMask.Length == 0)
         {
             MessageBox.Show("连接失败,请重试!");
             this.Close();
         }
     }
 }
Пример #2
0
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     if (btnConfirm.Text == "重新连接")
     {
         if (DMSDK.DM_CheckOnline("192.168.1.2", 80) < 0)
         {
             MessageBox.Show("未检测到在线仪器,请检查后重试!");
             btnConfirm.Text = "重新连接";
         }
         else
         {
             DMSDK.DM_Init();
             temp_OperateHandle = DMSDK.DM_Connect(ucPbx1.Handle, "192.168.1.2", 80);
             temp_ConnectHandle = DMSDK.DM_OpenMonitor(ucPbx1.Handle, "192.168.1.2", 5000, 0);
             DMSDK.DM_GetNetmask(temp_OperateHandle, SubMask);
             DMSDK.DM_GetGateway(temp_OperateHandle, GateWay);
             btnConfirm.Text = "确认修改";
         }
     }
     else if (btnConfirm.Text == "确认修改")
     {
         if (SubMask.ToString() == "" || GateWay.ToString() == "")
         {
             MessageBox.Show("参数异常!请重试!");
             return;
         }
         DMSDK.DM_SetIPAddr(temp_OperateHandle, ipAddressTextBox1.IPAdd.ToString(), SubMask.ToString(), GateWay.ToString());
         MessageBox.Show("修改完成");
         this.Close();
     }
 }
        private void FrmSaveImageConfig_Load(object sender, EventArgs e)
        {
            string path;

            path = ConfigurationManager.AppSettings["ImageSavePath"];
            tbxSaveImage.Text = path;
            tempMonitor       = DMSDK.DM_OpenMonitor(pbxTemper.Handle, StaticClass.Temper_Ip, 5000, 0);
        }
 private void FrmSaveVideoConfig_Load(object sender, EventArgs e)
 {
     path = ConfigurationManager.AppSettings["ImageSavePath"];
     tbxSaveVideo.Text = path;
     tempMonitor       = DMSDK.DM_OpenMonitor(pbxTemper.Handle, StaticClass.Temper_Ip, 5000, 0);
     if (tempMonitor < 0)
     {
         MessageBox.Show("连接失败,请重试!");
     }
 }
Пример #5
0
 private void FrmMeasureTemperConfig_Load(object sender, EventArgs e)
 {
     tempConnect = DMSDK.DM_Connect(pbxScreen.Handle, StaticClass.Temper_Ip, 80);
     if (tempConnect > 0)
     {
         tempMonitor = DMSDK.DM_OpenMonitor(pbxScreen.Handle, StaticClass.Temper_Ip, 5000, 0);
     }
     if (tempConnect < 0 || tempMonitor < 0)
     {
         MessageBox.Show("连接异常!请重试!");
         return;
     }
     Get_Area_Param();
 }
Пример #6
0
 private void FrmVideoConfig_Load(object sender, EventArgs e)
 {
     tempConnect = DMSDK.DM_Connect(this.Handle, StaticClass.Temper_Ip, 80);
     if (tempConnect > 0)
     {
         tempMonitor = DMSDK.DM_OpenMonitor(pbxVideo.Handle, StaticClass.Temper_Ip, 5000, 0);
     }
     if (tempConnect < 0 || tempMonitor < 0)
     {
         MessageBox.Show("连接失败,请重试!");
     }
     else
     {
         #region//显示位置归零
         //DMSDK.DM_SetOSDInfo_DateTime(tempConnect, 1, 100, 0);
         //DMSDK.DM_SetOSDInfo_CameraName(tempConnect, tbxCameraName.Text, 1,  0, 0);
         //DMSDK.DM_GetOSDInfo_UserDefine(StaticClass.intPtrs_Operate[iPCameraId - 1], cUserDefineInfo, out iDisplayUserDefineInfo, out iDisplayUserDefineInfoX, out iDisplayUserDefineInfoY);//自定义信息
         #endregion
         DMSDK.DM_GetDM6xResolution(tempConnect, ref tagResolutionInfo);//获取分辨率
         tempConnect = DMSDK.DM_Connect(pbxVideo.Handle, StaticClass.Temper_Ip, 80);
         tempMonitor = DMSDK.DM_OpenMonitor(pbxVideo.Handle, StaticClass.Temper_Ip, 5000, 0);
         DMSDK.DM_GetEncodingInfo_Major(tempConnect, ref Major_BitrateType, ref Major_Resolution, ref Major_Bitrate, ref Major_FrameRate);
         DMSDK.DM_GetEncodingInfo_Minor(tempConnect, ref Minor_BitrateType, ref Minor_Resolution, ref Minor_Bitrate, ref Minor_FrameRate);
         DMSDK.DM_GetOSDInfo_CameraName(tempConnect, cCameraName, out iDisplayName, out iDisplayNameX, out iDisplayNameY); //cCameraName 乱码 未解决
         DMSDK.DM_GetOSDInfo_DateTime(tempConnect, out iDisplayTime, out iDisplayTimeX, out iDisplayTimeY);
         DMSDK.DM_GetDateTime(tempConnect, dateTime);                                                                      //RTM的难搞
         dtpCameraDateTime.Value = Convert.ToDateTime(dateTime.ToString());                                                //获取相机的系统时间并显示
         if (iDisplayName == 0)
         {
             rdbNotCameraName.Checked = true;
         }
         else
         {
             rdbIsCameraName.Checked = true;
         }
         if (iDisplayTime == 0)
         {
             rdbNotTime.Checked = true;
         }
         else
         {
             rdbIsTime.Checked = true;
         }
         DMSDK.DM_SetOSDInfo_CameraName(tempConnect, StaticClass.Temper_CameraName, iDisplayName, iDisplayNameX, iDisplayNameY);
         tbxCameraName.Text = StaticClass.Temper_CameraName;
         rdbMajor.Checked   = true;
     }
 }
Пример #7
0
 private void FrmConfig_Load(object sender, EventArgs e)
 {
     DMSDK.DM_Init();
     DMSDK.DM_PlayerInit(uCPbx.Handle);
     StaticClass.tempIntPtr = uCPbx.Handle;
     if (DMSDK.DM_CheckOnline(StaticClass.Temper_Ip, 5000) < 0)
     {
         MessageBox.Show("该探测器未连接,无法进行其他设置!");
     }
     else
     {
         StaticClass.tempConnect = DMSDK.DM_Connect(uCPbx.Handle, StaticClass.Temper_Ip, 80);
         if (StaticClass.tempConnect > 0)
         {
             StaticClass.tempMonitor = DMSDK.DM_OpenMonitor(uCPbx.Handle, StaticClass.Temper_Ip, 5000, 0);
         }
     }
     grpConfig.Text         = "网络设置";
     btnNetConfig.Tag       = 1;
     btnNetConfig.BackColor = Color.Yellow;
     btnNetConfig.PerformClick();
 }
Пример #8
0
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     if (btnConfirm.Tag.ToString() == "Confirm")
     {
         btnConfirm.Text = "确认修改";
         if (Mac.Length == 0)
         {
             MessageBox.Show("MAC地址无效!重试!");
             return;
         }
         DMSDK.DM_SetIPAddr(StaticClass.tempConnect, IPAddressIP.IPAdd.ToString(), IPAddressSubMask.IPAdd.ToString(), IPAddressGateWay.IPAdd.ToString());
         sqlCreate.UpDate_CameraEnable(StaticClass.Temper_CameraId, "无", Convert.ToBoolean(cbxIsEnable.SelectedIndex), StaticClass.DataBaseName);
         MessageBox.Show("修改成功!请重新进入!");
         StaticClass.Temper_IsEnanle = Convert.ToBoolean(cbxIsEnable.SelectedIndex);
         this.Close();
     }
     else if (btnConfirm.Tag.ToString() == "Reconnect")
     {
         btnConfirm.Text = "重新连接";
         if (DMSDK.DM_CheckOnline(StaticClass.Temper_Ip, 5000) < 0)// 离线检测  为离线
         {
             MessageBox.Show("无法连接探测器,请检查线路,或修改参数后重新连接!");
             btnConfirm.Tag              = "Reconnect";
             chbModifyGateWay.Enabled    = false;
             chbModifyMac.Enabled        = false;
             chbModifyNetMask.Enabled    = false;
             cbxIsEnable.SelectedIndex   = Convert.ToInt32(StaticClass.Temper_IsEnanle);
             StaticClass.Temper_IsEnanle = Convert.ToBoolean(cbxIsEnable.SelectedIndex);
         }
         else
         {
             StaticClass.tempConnect = DMSDK.DM_Connect(StaticClass.tempIntPtr, StaticClass.Temper_Ip, 80);//
             if (StaticClass.tempConnect > 0)
             {
                 StaticClass.tempMonitor = DMSDK.DM_OpenMonitor(StaticClass.tempIntPtr, StaticClass.Temper_Ip, 5000, 0);
             }
             if (StaticClass.tempConnect < 0 || StaticClass.tempMonitor < 0)
             {
                 MessageBox.Show("连接失败!请检查设备与参数后重试!");
                 return;
             }
             btnConfirm.Text = "确认修改";
             btnConfirm.Tag  = "Confirm";
             Mac             = new StringBuilder();
             SubMask         = new StringBuilder();
             GateWay         = new StringBuilder();
             DMSDK.DM_GetMAC(StaticClass.tempConnect, Mac);
             DMSDK.DM_GetNetmask(StaticClass.tempConnect, SubMask);
             DMSDK.DM_GetGateway(StaticClass.tempConnect, GateWay);
             cbxIsEnable.SelectedIndex   = Convert.ToInt32(StaticClass.Temper_IsEnanle);
             StaticClass.Temper_IsEnanle = Convert.ToBoolean(cbxIsEnable.SelectedIndex);
             Update_IpAddrGateWay(GateWay.ToString());
             Update_IpAddrSubMask(SubMask.ToString());
             tbxMAC.Text = Mac.ToString();
             tbxMAC.Text = Mac.ToString();
             chbModifyGateWay.Enabled = true;
             chbModifyMac.Enabled     = true;
             chbModifyNetMask.Enabled = true;
             cbxIsEnable.Enabled      = true;;
         }
     }
 }