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();
         }
     }
 }
 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();
     }
 }
Exemple #3
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(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, 80) < 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
         {
             tempConnect = DMSDK.DM_Connect(this.Handle, IPAddressIP.IPAdd.ToString(), 80);
             if (tempConnect < 0)
             {
                 MessageBox.Show("连接失败!请检查设备与参数后重试!");
                 return;
             }
             btnConfirm.Text = "确认修改";
             btnConfirm.Tag  = "Confirm";
             Mac             = new StringBuilder();
             SubMask         = new StringBuilder();
             GateWay         = new StringBuilder();
             DMSDK.DM_GetMAC(tempConnect, Mac);
             DMSDK.DM_GetNetmask(tempConnect, SubMask);
             DMSDK.DM_GetGateway(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;;
         }
     }
 }
Exemple #4
0
 private void FrmAlarmConfig_Load(object sender, EventArgs e)
 {
     tempConnect = DMSDK.DM_Connect(this.Handle, StaticClass.Temper_Ip, 80);//
     if (tempConnect < 0)
     {
         MessageBox.Show("连接失败,请重试!");
     }
     Init_Param();
 }
 private void FrmMaintain_Load(object sender, EventArgs e)
 {
     tempConnect = DMSDK.DM_Connect(this.Handle, StaticClass.Temper_Ip, 80);//
     if (tempConnect < 0)
     {
         MessageBox.Show("连接失败,请重试!");
         return;
     }
     DMSDK.DM_GetSystemInfo(tempConnect, systemInfo);
     lblSystemInfo.Text = systemInfo.ToString();
 }
Exemple #6
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();
 }
Exemple #7
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;
     }
 }
Exemple #8
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();
 }
Exemple #9
0
        private int tempConnect;//临时连接句柄

        private void FrmCameraConfig_Load(object sender, EventArgs e)
        {
            Mac     = new StringBuilder();
            SubMask = new StringBuilder();
            GateWay = new StringBuilder();
            if (StaticClass.Temper_Ip != "")
            {
                string[] str = StaticClass.Temper_Ip.Split('.');
                IPAddressIP.tbx1.Text = str[0];
                IPAddressIP.tbx2.Text = str[1];
                IPAddressIP.tbx3.Text = str[2];
                IPAddressIP.tbx4.Text = str[3];
                if (DMSDK.DM_CheckOnline(StaticClass.Temper_Ip, 80) < 0)// 离线检测  为离线
                {
                    btnConfirm.Tag = "Reconnect";
                    Update_IpAddrGateWay("0.0.0.0");
                    Update_IpAddrSubMask("0.0.0.0");
                    chbModifyGateWay.Enabled    = false;
                    chbModifyMac.Enabled        = false;
                    chbModifyNetMask.Enabled    = false;
                    btnUpdateIsenable.Visible   = true;
                    cbxIsEnable.SelectedIndex   = Convert.ToInt32(StaticClass.Temper_IsEnanle);
                    StaticClass.Temper_IsEnanle = Convert.ToBoolean(cbxIsEnable.SelectedIndex);
                }
                else if (DMSDK.DM_CheckOnline(StaticClass.Temper_Ip, 80) > 0)               //连接成功
                {
                    tempConnect = DMSDK.DM_Connect(this.Handle, StaticClass.Temper_Ip, 80); //
                    if (tempConnect <= 0)
                    {
                        MessageBox.Show("连接失败!请检查设备与参数后重试!");
                        return;
                    }
                    DMSDK.DM_GetMAC(tempConnect, Mac);
                    if (Mac.Length == 0)
                    {
                        btnConfirm.Tag = "Reconnect";
                        Update_IpAddrGateWay("0.0.0.0");
                        Update_IpAddrSubMask("0.0.0.0");
                        chbModifyGateWay.Enabled    = false;
                        chbModifyMac.Enabled        = false;
                        chbModifyNetMask.Enabled    = false;
                        btnUpdateIsenable.Visible   = true;
                        cbxIsEnable.SelectedIndex   = Convert.ToInt32(StaticClass.Temper_IsEnanle);
                        StaticClass.Temper_IsEnanle = Convert.ToBoolean(cbxIsEnable.SelectedIndex);
                        MessageBox.Show("连接失败!请检查设备与参数后重试!");
                    }
                    else
                    {
                        DMSDK.DM_GetNetmask(tempConnect, SubMask);
                        DMSDK.DM_GetGateway(tempConnect, GateWay);
                        Update_IpAddrGateWay(GateWay.ToString());
                        Update_IpAddrSubMask(SubMask.ToString());
                        tbxMAC.Text = Mac.ToString();
                        cbxIsEnable.SelectedIndex   = Convert.ToInt32(StaticClass.Temper_IsEnanle);
                        StaticClass.Temper_IsEnanle = Convert.ToBoolean(cbxIsEnable.SelectedIndex);
                        btnConfirm.Tag            = "Confirm";
                        chbModifyGateWay.Enabled  = true;
                        chbModifyMac.Enabled      = true;
                        chbModifyNetMask.Enabled  = true;
                        btnUpdateIsenable.Visible = false;
                    }
                }
            }
            if (btnConfirm.Tag.ToString() == "Confirm")
            {
                btnConfirm.Text = "确认修改";
            }
            else if (btnConfirm.Tag.ToString() == "Reconnect")
            {
                btnConfirm.Text = "重新连接";
            }
        }