Example #1
0
        private void buttonConnecter_Click(object sender, EventArgs e)
        {
            switch (vsPropertyType)
            {
            case VsDeviceType.CAMERA:
            {
                this.vsCamera = vsCoreMonitor.GetCameraByName(vsTypeName);

                if (vsCamera == null)
                {
                    return;
                }
                if (vsCamera.Running)
                {
                    vsCoreMonitor.DisconnectCamera(vsTypeName);
                }
                else
                {
                    vsCoreMonitor.ConnectCamera(vsTypeName, false);
                }
            }
            break;

            case VsDeviceType.CHANNEL:
            {
                this.vsChannel = vsCoreMonitor.GetChannelByName(vsTypeName);
                if (vsChannel == null)
                {
                    return;
                }
                if (vsChannel.Running)
                {
                    vsCoreMonitor.DisconnectChannel(vsTypeName);
                }
                else
                {
                    vsCoreMonitor.ConnectChannel(vsTypeName, false);
                }
            }
            break;

            case VsDeviceType.PAGE:
            {
                this.vsPage = vsCoreMonitor.GetPageByName(vsTypeName);
                if (vsPage == null)
                {
                    return;
                }
                if (vsPage.Running)
                {
                    vsCoreMonitor.DisconnectPage(vsTypeName);
                }
                else
                {
                    vsCoreMonitor.ConnectPage(vsTypeName, false);
                }
            }
            break;
            }
        }
Example #2
0
        private void channelDisconnectMenu_Click(object sender, EventArgs e)
        {
            TreeNode node = vsCameraTree.SelectedNode;

            if (node == null || node.Parent == null)
            {
                return;
            }
            String selectedNode = node.Text;

            // test if camera is connected
            if (!vsCoreMonitor.ConnectingChannel(selectedNode))
            {
                return;
            }

            // try to connect
            if (vsCoreMonitor.DisconnectChannel(selectedNode))
            {
                // TODO...
            }

            // TODO...
        }
Example #3
0
        private void CloseAll()
        {
            foreach (TreeNode tn in vsLiveviewTool1.VsApplicationControl1.CamerasNode.Nodes)
            {
                VsCamera vsCamera = vsCoreMonitor.GetCameraByName(tn.Text);

                if (vsCamera == null)
                {
                    continue;
                }
                if (vsCamera.Running)
                {
                    vsCoreMonitor.DisconnectCamera(tn.Text);
                }
                // else vsCoreMonitor.ConnectCamera(vsTypeName, false);
            }
            foreach (TreeNode tn in vsLiveviewTool1.VsApplicationControl1.ChannelsNode.Nodes)
            {
                VsChannel vsChannel = vsCoreMonitor.GetChannelByName(tn.Text);
                if (vsChannel == null)
                {
                    continue;
                }
                if (vsChannel.Running)
                {
                    vsCoreMonitor.DisconnectChannel(tn.Text);
                }
                //else vsCoreMonitor.ConnectChannel(vsTypeName, false);
            }

            for (int i = 24; i >= 0; i--)
            {
                VsSingleViewer viewer = vsLiveviewTool1.VsMultiViewer1.VsSingleViewers[i];
                viewer.CloseCameraView();
            }
        }