Exemple #1
0
        private void btnAutoConn_Click(object sender, EventArgs e)
        {
            RefreshOnlineDevice();
            if (comboBoxOnlineDevice.Items.Count == 0)
            {
                return;
            }

            if (btnAutoConn.Text == "一键连接播放")
            {
                if (comboBoxOnlineDevice.Items.Count >= 1)
                {
                    for (int i = 0; i < comboBoxOnlineDevice.Items.Count; i++)
                    {
                        ConnectionCamer(_LstEnumInfo[i].intCamIp);
                        FormDisplay frmDisplay = _DataControl.GetBindedDisplayForm(_LstEnumInfo[i].intCamIp); //选择已经绑定的IP的显示窗口
                        if (frmDisplay != null)
                        {
                            frmDisplay.GetDateDisplay().Play();
                            ChangeBtnCursor(2);
                        }
                    }
                    btnAutoConn.Text = "一键断开停止播放";
                }
            }
            else if (btnAutoConn.Text == "一键断开停止播放")
            {
                DialogResult MsgBoxResult = MessageBox.Show("确定要停止播放且停止采集热点?",                //对话框的显示内容
                                                            "操作提示",                           //对话框的标题
                                                            MessageBoxButtons.YesNo,          //定义对话框的按钮,这里定义了YSE和NO两个按钮
                                                            MessageBoxIcon.Question,          //定义对话框内的图表式样,这里是一个黄色三角型内加一个感叹号
                                                            MessageBoxDefaultButton.Button2); //定义对话框的按钮式样
                if (MsgBoxResult == DialogResult.Yes)
                {
                    if (comboBoxOnlineDevice.Items.Count >= 1)
                    {
                        for (int i = 0; i < comboBoxOnlineDevice.Items.Count; i++)
                        {
                            DislinkCamera(_LstEnumInfo[i].intCamIp);
                            FormDisplay frmDisplay = _DataControl.GetBindedDisplayForm(_LstEnumInfo[i].intCamIp); //选择已经绑定的IP的显示窗口
                            if (frmDisplay != null)
                            {
                                frmDisplay.Stop = false;
                                frmDisplay.GetDateDisplay().GetDevice().StopProcessImage();
                                frmDisplay.Invalidate(false);
                                isThreadRun = false;
                                ChangeBtnCursor(1);
                            }
                        }
                        FormMain.GetOPCTaskInfo("视频停止播放,热点信息停止采集,任务停止发送!");
                    }
                    btnAutoConn.Text = "一键连接播放";
                }
            }
            RefreshOnlineDevice();
        }
Exemple #2
0
        /// <summary>
        /// 断开摄像头连接
        /// </summary>
        /// <param name="intCameraIP"></param>
        private void DislinkCamera(uint intCameraIP)
        {
            FormDisplay frmDisplay = _DataControl.GetBindedDisplayForm(intCameraIP);

            if (frmDisplay != null)
            {
                MagDevice device = frmDisplay.GetDateDisplay().GetDevice();
                device.StopProcessImage();
                device.DisLinkCamera();
                frmDisplay.Invalidate(false);
            }
        }
Exemple #3
0
        private void buttonStop_Click(object sender, EventArgs e)
        {
            int index = comboBoxOnlineDevice.SelectedIndex;

            if (index < 0)
            {
                return;
            }

            MagService service = _DataControl.GetService();
            uint       dev_num = service.GetTerminalList(_LstEnumInfo, MAX_ENUMDEVICE);

            FormDisplay frmDisplay = _DataControl.GetBindedDisplayForm(_LstEnumInfo[index].intCamIp);

            if (frmDisplay == null)
            {
                return;
            }

            frmDisplay.GetDateDisplay().GetDevice().StopProcessImage();
            frmDisplay.Invalidate(false);
        }
Exemple #4
0
        private void buttonStop_Click(object sender, EventArgs e)
        {
            int index = comboBoxOnlineDevice.SelectedIndex;

            if (index < 0)
            {
                return;
            }
            DialogResult MsgBoxResult = MessageBox.Show("确定要停止播放且停止采集热点?",                //对话框的显示内容
                                                        "操作提示",                           //对话框的标题
                                                        MessageBoxButtons.YesNo,          //定义对话框的按钮,这里定义了YSE和NO两个按钮
                                                        MessageBoxIcon.Question,          //定义对话框内的图表式样,这里是一个黄色三角型内加一个感叹号
                                                        MessageBoxDefaultButton.Button2); //定义对话框的按钮式样

            if (MsgBoxResult == DialogResult.Yes)
            {
                MagService service = _DataControl.GetService();
                uint       dev_num = service.GetTerminalList(_LstEnumInfo, MAX_ENUMDEVICE);
                for (int i = 0; i < comboBoxOnlineDevice.Items.Count; i++)
                {
                    FormDisplay frmDisplay = _DataControl.GetBindedDisplayForm(_LstEnumInfo[i].intCamIp);
                    if (frmDisplay == null)
                    {
                        continue;
                    }
                    frmDisplay.Stop = false;
                    frmDisplay.GetDateDisplay().GetDevice().StopProcessImage();
                    frmDisplay.Invalidate(false);
                    isThreadRun = false;

                    FormMain.GetOPCTaskInfo("线程停止!");
                    FormMain.GetOPCTaskInfo("视频停止播放,热点信息停止采集,任务停止发送!");
                    ChangeBtnCursor(1);
                }
            }
        }