Esempio n. 1
0
        public VideoReplayForm(int gateTotal)
        {
            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);
            }

            this.dateTimePicker_startTime.Format    = DateTimePickerFormat.Custom;
            this.dateTimePicker_startTime.Text      = DateTime.Now.ToString();
            this.dateTimePicker_startTime_time.Text = DateTime.Now.ToString();
            this.dateTimePicker_endTime.Format      = DateTimePickerFormat.Custom;
            this.dateTimePicker_endTime.Text        = DateTime.Now.ToString();
            this.dateTimePicker_endTime_time.Text   = DateTime.Now.ToString();

            //以下初始化通道
            object[] items = new object[gateTotal];
            for (int i = 0; i < gateTotal; i++)
            {
                items[i] = (i + 1).ToString();
            }
            this.comboBox__channel.Items.AddRange(items);
            this.comboBox__channel.SelectedIndex = 0;
        }
Esempio n. 2
0
        private void receiveGateState(object obj)
        {
            while (true && (!this.IsDisposed))
            {
                try
                {
                    ICustomsCMS server  = XmlRpcInstance.getInstance();
                    List <int>  gateIds = new List <int>();
                    for (int i = 1; i <= 100; i++)
                    {
                        gateIds.Add(i);
                    }

                    Gate_state_record_Response reportContent_Response = server.getGateAllInfo(AppConfig.gateSensor, gateIds.ToArray());
                    if (reportContent_Response.error_code == 0 && !this.IsDisposed)
                    {
                        this.Invoke(new Action <Gate_state_record_Response>(this.refreshGateMonitors), reportContent_Response);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("获取闸机状态出错:" + ex.Message, "错误");
                }
                finally
                {
                    System.Threading.Thread.Sleep(AppConfig.getGateSecond);
                }
            }
        }
Esempio n. 3
0
 private void receiveMessage(object obj)
 {
     while (true)
     {
         try
         {
             ICustomsCMS        server             = XmlRpcInstance.getInstance();
             GateRecordResponse gateRecordResponse = server.getAbnormalRecord(AppConfig.gateSensor);
             if (gateRecordResponse.error_code == 0 && !this.IsDisposed)
             {
                 gateRecordResponse.gate_record.nvr_begintime = gateRecordResponse.gate_record.nvr_begintime;
                 gateRecordResponse.gate_record.nvr_endtime   = gateRecordResponse.gate_record.nvr_endtime;
                 this.Invoke(new Action <GateRecordResponse>(this.addAbnormalList), gateRecordResponse);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("获取异常人员出错:" + ex.Message, "错误");
         }
         finally
         {
             System.Threading.Thread.Sleep(AppConfig.getMessageSecond);
         }
     }
 }
Esempio n. 4
0
        private List <GateRecord> abnormalList = new List <GateRecord>();//检测异常人员集

        public void addAbnormalList(GateRecordResponse gateRecordResponse)
        {
            int gate_id = gateRecordResponse.gate_record.gate_id;

            gateRecordResponse.gate_record.unnormal_type_name = zhuhai.util.AbnormalType.getAllAbnormalTypeNames()[gateRecordResponse.gate_record.unnormal_type + 1];
            gateRecordResponse.gate_record.gate_mode_name     = zhuhai.util.GateWorkState.getAllGateWorkStateNames()[gateRecordResponse.gate_record.gate_mode];
            abnormalList.Insert(0, gateRecordResponse.gate_record);
            //超过显示的数量则删除最后一条记录
            if (abnormalList.Count > AppConfig.personNo)
            {
                abnormalList.RemoveAt(abnormalList.Count - 1);
            }
            gridControl_abnormal.DataSource = abnormalList;
            gridControl_abnormal.RefreshDataSource();

            if (!this.IsDisposed)
            {
                System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(this.channelBlinkThread), gate_id);
                ICustomsCMS server = XmlRpcInstance.getInstance();


                if (gateRecordResponse.gate_record.unnormal_type == (int)zhuhai.xmlrpc.AbnormalType.Temperatare && MessageBox.Show("检查到温度异常记录,是否切换到温度异常预案中?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    RichTextEditorForm richTextEditorForm = new RichTextEditorForm(0, "温度异常", DisposePlanService.getInstance(), true);
                    richTextEditorForm.ShowDialog();
                }
                else if (gateRecordResponse.gate_record.unnormal_type == (int)zhuhai.xmlrpc.AbnormalType.Nuclear && MessageBox.Show("检查到核素异常记录,是否切换到核素异常预案中?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    RichTextEditorForm richTextEditorForm = new RichTextEditorForm(0, "核素异常", DisposePlanService.getInstance(), true);
                    richTextEditorForm.ShowDialog();
                }
                else if (gateRecordResponse.gate_record.unnormal_type == (int)zhuhai.xmlrpc.AbnormalType.TemperatareNuclear && MessageBox.Show("检查到温度核素异常记录,是否切换到温度核素异常预案中?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    RichTextEditorForm richTextEditorForm = new RichTextEditorForm(0, "温度核素异常", DisposePlanService.getInstance(), true);
                    richTextEditorForm.ShowDialog();
                }
                else if (gateRecordResponse.gate_record.unnormal_type == (int)zhuhai.xmlrpc.AbnormalType.Shenbao && MessageBox.Show("检查到申报异常记录,是否切换到申报异常预案中?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    RichTextEditorForm richTextEditorForm = new RichTextEditorForm(0, "申报异常", DisposePlanService.getInstance(), true);
                    richTextEditorForm.ShowDialog();
                }
            }
        }
Esempio n. 5
0
        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;
            }
        }
        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);
        }