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; } }
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; } }
private void PageProperty() { // text define //this.tabPageCamera.Text = "Page"; //this.label1.Text = "Properties : " + "\"" + vsTypeName + "\""; // enable/disable control //this.tabPageAnalyzer.Hide(); //this.tabPageRecorder.Hide(); // enable/disable button this.buttonAnalyzer.Hide(); this.buttonRecorder.Hide(); this.buttonDataAlert.Hide(); this.buttonEventAlert.Hide(); this.buttonAnalyzerStatus.Hide(); this.buttonRecorderStatus.Hide(); this.buttonDataAlertStatus.Hide(); this.buttonEventAlertStatus.Hide(); // get channel VsPage vsPage = vsCoreMonitor.GetPageByName(this.vsTypeName); if (vsPage == null) { return; } // connecter button if (vsPage.Running) { this.buttonConnecter.Text = "Stop Page"; } else { this.buttonConnecter.Text = "Start Page"; } // streamer button if (vsPage.Streaming) { this.buttonStreamer.Text = "Stop Streamer"; } else { this.buttonStreamer.Text = "Start Streamer"; } this.Enabled = false; }
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; } }