Exemple #1
0
        public void ActivatePropertyControl(VsDeviceType propType, String propName)
        {
            vsPropertyType = propType;
            vsTypeName     = propName;

            this.Enabled = true;

            switch (vsPropertyType)
            {
            case VsDeviceType.CAMERA:
                CameraProperty();
                this.vsCamera = vsCoreMonitor.GetCameraByName(vsTypeName);
                break;

            case VsDeviceType.CHANNEL:
                ChannelProperty();
                this.vsChannel = vsCoreMonitor.GetChannelByName(vsTypeName);
                break;

            case VsDeviceType.PAGE:
                PageProperty();
                this.vsPage = vsCoreMonitor.GetPageByName(vsTypeName);
                break;
            }
        }
Exemple #2
0
        private void buttonRecorder_Click(object sender, EventArgs e)
        {
            switch (vsPropertyType)
            {
            case VsDeviceType.CAMERA:
            {
                VsCamera vsCamera = vsCoreMonitor.GetCameraByName(vsTypeName);
                if (vsCamera == null)
                {
                    return;
                }
                vsCamera.Recording = !vsCamera.Recording;
                ActivatePropertyControl(VsDeviceType.CAMERA, vsTypeName);
            }
            break;

            case VsDeviceType.CHANNEL:
            {
                VsChannel vsChannel = vsCoreMonitor.GetChannelByName(vsTypeName);
                if (vsChannel == null)
                {
                    return;
                }
                vsChannel.Recording = !vsChannel.Recording;
                ActivatePropertyControl(VsDeviceType.CHANNEL, vsTypeName);
            }
            break;
            }
        }
Exemple #3
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;
            }
        }
Exemple #4
0
        private void ChannelProperty()
        {
            // text define
            //this.tabPageCamera.Text = "Layout";
            //this.label1.Text = "Properties : " + "\"" + vsTypeName + "\"";

            /*
             * // enable/disable control
             * if (this.tabControl1.Contains(tabPageAnalyzer))
             *  this.tabControl1.Controls.Remove(tabPageAnalyzer);
             * if (this.tabControl1.Contains(tabPageRecorder))
             *  this.tabControl1.Controls.Remove(tabPageRecorder);
             */
            //if (!this.tabControl1.Contains(tabPageStreamer))
            //    this.tabControl1.Controls.Add(tabPageStreamer);

            //controlBox.Hide();

            // enable/disable button
            this.buttonAnalyzer.Show();
            this.buttonRecorder.Show();
            this.buttonDataAlert.Hide();
            this.buttonEventAlert.Hide();
            this.buttonAnalyzerStatus.Show();
            this.buttonRecorderStatus.Show();
            this.buttonDataAlertStatus.Hide();
            this.buttonEventAlertStatus.Hide();

            // get channel
            VsChannel vsChannel = vsCoreMonitor.GetChannelByName(this.vsTypeName);

            if (vsChannel == null)
            {
                return;
            }

            // connecter button
            if (vsChannel.Running)
            {
                this.buttonConnecter.Text = "Stop Channel";
            }
            else
            {
                this.buttonConnecter.Text = "Start Channel";
            }

            // streamer button
            if (vsChannel.Streaming)
            {
                this.buttonStreamer.Text = "Stop Streamer";
            }
            else
            {
                this.buttonStreamer.Text = "Start Streamer";
            }
        }
 // On page changing
 protected override void OnPageChanging(int page)
 {
     if (page == 1)
     {
         vsChannel = vsChannelDescription.Channel;
         vsChannelStructure.Channel = vsChannel;
         vsAnalyzerSetting.Channel  = vsChannel;
         vsEncoderSetting.Channel   = vsChannel;
     }
     base.OnPageChanging(page);
 }
Exemple #6
0
        private void buttonStreamer_Click(object sender, EventArgs e)
        {
            switch (vsPropertyType)
            {
            case VsDeviceType.CAMERA:
            {
                VsCamera vsCamera = vsCoreMonitor.GetCameraByName(vsTypeName);
                if (vsCamera == null)
                {
                    return;
                }
                vsCamera.Streaming = !vsCamera.Streaming;
                ActivatePropertyControl(VsDeviceType.CAMERA, vsTypeName);
            }
            break;

            case VsDeviceType.CHANNEL:
            {
                VsChannel vsChannel = vsCoreMonitor.GetChannelByName(vsTypeName);
                if (vsChannel == null)
                {
                    return;
                }

                if (vsChannel.Streaming)
                {
                    vsCoreMonitor.StopStreamChannel(vsTypeName);
                }
                else
                {
                    vsCoreMonitor.StartStreamChannel(vsTypeName, textIp.Text, int.Parse(textPort.Text));
                }
                ActivatePropertyControl(VsDeviceType.CHANNEL, vsTypeName);
            }
            break;

            case VsDeviceType.PAGE:
            {
                VsPage vsPage = vsCoreMonitor.GetPageByName(vsTypeName);
                if (vsPage == null)
                {
                    return;
                }
                vsPage.Streaming = !vsPage.Streaming;
                ActivatePropertyControl(VsDeviceType.PAGE, vsTypeName);
            }
            break;
            }
        }
Exemple #7
0
        private void ChannelProperty()
        {
            // text define
            this.label1.Text = "Properties : " + "\"" + vsTypeName + "\"";

            // enable/disable button
            this.buttonRecorder.Show();
            this.buttonRecorderStatus.Show();

            // get channel
            VsChannel vsChannel = vsCoreMonitor.GetChannelByName(this.vsTypeName);

            if (vsChannel == null)
            {
                return;
            }

            // connecter button
            if (vsChannel.Running)
            {
                this.buttonConnecter.Text = "Stop Channel";
            }
            else
            {
                this.buttonConnecter.Text = "Start Channel";
            }

            // streamer button
            if (vsChannel.Streaming)
            {
                this.buttonStreamer.Text = "Stop Streamer";
            }
            else
            {
                this.buttonStreamer.Text = "Start Streamer";
            }
        }
Exemple #8
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();
            }
        }
Exemple #9
0
        public void connectDevice(string send)
        {
            if (vsStatus == VsViewStatusType.VIEW_CONNECTING || vsStatus == VsViewStatusType.VIEW_CONNECTED)
            {
                return;
            }

            string[] cmd = send.Split('\\');

            vsDeviceName = cmd[1];
            // check if not root node
            if (cmd.Length == 2 && cmd[0] == "Analyzers")
            {
                // set flag
                vsDeviceType = VsDeviceType.CAMERA;
                vsStatus     = VsViewStatusType.VIEW_CONNECTING;

                // update event
                this.vsUpdateEvent(this, new VsMonitorEventArgs(
                                       new VsParameter(VsAppControlType.APP_SIGLEVIEW, VsAppControlType.APP_SIGLEVIEW, vsDeviceType, vsDeviceName)));

                labelStatus.Text = "Connecting...";
                // the current camera is connected
                if (!vsCoreMonitor.ConnectingCamera(vsDeviceName))
                {
                    // not connected
                    // try to connect
                    if (!vsCoreMonitor.ConnectCamera(vsDeviceName, false))
                    {
                        return;
                    }

                    // cache current camera
                    vsCamera = vsCoreMonitor.GetCameraByName(vsDeviceName);
                }

                // the camera is connected
                // attach to current view
                vsCoreMonitor.AttachCameraView(vsDeviceName, this);
                vsAttachType = VsAttachType.ATTACH_RECEIVER;

                // enable toolbox
                buttonStop.Enabled     = true;
                buttonAttach.Enabled   = true;
                buttonAnalyzer.Enabled = true;
            }
            else if (cmd.Length == 2 && cmd[0] == "Layouts")
            {
                // set flag
                vsDeviceType = VsDeviceType.CHANNEL;
                vsStatus     = VsViewStatusType.VIEW_CONNECTING;

                // update event
                this.vsUpdateEvent(this, new VsMonitorEventArgs(
                                       new VsParameter(VsAppControlType.APP_SIGLEVIEW, VsAppControlType.APP_SIGLEVIEW, vsDeviceType, vsDeviceName)));

                // the current channel is connected
                if (!vsCoreMonitor.ConnectingChannel(vsDeviceName))
                {
                    // not connected
                    // try to connect
                    if (!vsCoreMonitor.ConnectChannel(vsDeviceName, false))
                    {
                        return;
                    }

                    // cache current camera
                    vsChannel = vsCoreMonitor.GetChannelByName(vsDeviceName);
                }

                // the camera is connected
                // attach to current view
                vsCoreMonitor.AttachChannelView(vsDeviceName, this);

                // enable toolbox
                buttonStop.Enabled     = true;
                buttonAttach.Enabled   = true;
                buttonAnalyzer.Enabled = true;
            }
        }