private void selectMonitor(Panel panel) { string name = panel.Name; //name 由 panel + 闸机号构成 string selectedGateNo = name.Substring(5); int gateNo = Int32.Parse(selectedGateNo); //不是上一次监控的闸机 if (previewMonitor != monitorList[gateNo - 1]) { previewControler.setMonitor(monitorList[gateNo - 1]); bool isSuccess = previewControler.preview(); if (isSuccess) { previewMonitor = monitorList[gateNo - 1]; previewMonitorPanels = panel; xtraTabControl.SelectedTabPage = xtraTabPage_shipinMonitor; } else { previewMonitor = null; previewMonitorPanels = null; } //设置视频监控中选中的闸机 comboBox_shipin_1.SelectedIndex = gateNo - 1; } }
/// <summary> /// 初始化总通道数 /// </summary> public void init() { try { gateTotal = GateService.getInstance().getGateTotal(); for (int i = 1; i <= gateTotal; i++) { zhuhai.monitorinfo.Monitor monitor = new zhuhai.monitorinfo.Monitor(); monitor.gateNo = i; this.monitorList.Add(monitor); } } catch (Exception ex) { /*********************************上线时去掉 start****************************************************/ for (int i = 1; i <= gateTotal; i++) { zhuhai.monitorinfo.Monitor monitor = new zhuhai.monitorinfo.Monitor(); monitor.gateNo = i; this.monitorList.Add(monitor); } /*********************************上线时去掉 end****************************************************/ if (MessageBox.Show(ex.Message + "\n是否退出系统?", "错误", MessageBoxButtons.YesNo) == DialogResult.Yes) { System.Environment.Exit(0); } } }
public void viewVideo() { Monitor monitor = new Monitor(); monitor.gateNo = comboBox__channel.SelectedIndex + 1; playbackControler.setMonitor(monitor); GateRecord gateRecord = new GateRecord(); DateTime dt = DateTime.Parse(dateTimePicker_startTime.Text + " " + dateTimePicker_startTime_time.Text); DateTime dt1 = DateTime.Parse(dateTimePicker_endTime.Text + " " + dateTimePicker_endTime_time.Text); gateRecord.nvr_begintime = dt; gateRecord.nvr_endtime = dt1; playbackControler.play(gateRecord); }
public ClearanceVideoReplayForm(DataRow dr) { InitializeComponent(); ICustomsCMS server = XmlRpcInstance.getInstance(); playbackControler = new H264Controler(this.searchVideoPlayWnd, server); playbackControler.setToolStripStatusLabel(this.toolStripStatusLabel); bool isSuccess = playbackControler.init(); if (!isSuccess) { System.Environment.Exit(0); } gateRecord = new ModelHandler<GateRecord>().FillModel(dr); Monitor monitor = new Monitor(); monitor.gateNo = gateRecord.gate_id; playbackControler.setMonitor(monitor); playbackControler.play(gateRecord); }
private void comboBox_shipin_3_SelectedIndexChanged(object sender, EventArgs e) { int gateNo = comboBox_shipin_3.SelectedIndex + 1; //不是上一次监控的闸机 if (previewMonitor2 != monitorList[gateNo - 1]) { previewControler2.setMonitor(monitorList[gateNo - 1]); bool isSuccess = previewControler2.preview(); if (isSuccess) { previewMonitor2 = monitorList[gateNo - 1]; } else { previewMonitor2 = null; } } }
public void initMonitorControler() { ICustomsCMS server = XmlRpcInstance.getInstance(); previewControler1 = new H264Controler(this.videoPlayWnd_1, server); previewControler = new H264Controler(this.videoPlayWnd, server); previewControler2 = new H264Controler(this.videoPlayWnd_2, server); previewControler.setToolStripStatusLabel(this.toolStripStatusLabel); previewControler1.setToolStripStatusLabel(this.toolStripStatusLabel); previewControler2.setToolStripStatusLabel(this.toolStripStatusLabel); bool isSuccess = previewControler.init(); isSuccess = previewControler1.init() || isSuccess; isSuccess = previewControler2.init() || isSuccess; if (!isSuccess) { System.Environment.Exit(0); } previewMonitor = this.monitorList[0]; previewMonitor1 = this.monitorList[1]; previewMonitor2 = this.monitorList[2]; previewControler.setMonitor(previewMonitor); previewControler1.setMonitor(this.monitorList[1]); previewControler2.setMonitor(this.monitorList[2]); isSuccess = previewControler.preview(); isSuccess = previewControler1.preview() || isSuccess; isSuccess = previewControler2.preview() || isSuccess; if (isSuccess) { Panel panel = this.monitorPanels[0]; previewMonitorPanels = panel; } else { previewMonitor = null; previewMonitorPanels = null; } }