Ejemplo n.º 1
0
        private void DoBackPlayStausChanged(AlarmPlayback playbox, IMonitorSystemContext context, PlayState state)
        {
            toolStripButton_realplay.Enabled = true;
            if (ActiveBox != null && playbox == ActiveBox)
            {
                if (state == PlayState.Open || state == PlayState.Play)
                {
                    toolStripButton_backplay.Text    = "关闭";
                    toolStripButton_realplay.Enabled = false;
                }
                else
                {
                    toolStripButton_backplay.Text = "回放";
                }
            }
            else
            {
                toolStripButton_backplay.Text = "回放";
            }

            if (OnBackPlayStateChanged != null)
            {
                OnBackPlayStateChanged(playbox, context, state);
            }
        }
Ejemplo n.º 2
0
 private void DoActiveBoxChanging(AlarmPlayback box)
 {
     if (box != null)
     {
         box.BorderStyle = BorderStyle.FixedSingle;
     }
 }
Ejemplo n.º 3
0
 private void DoBoxLinkObjChanged(AlarmPlayback playbox)
 {
     if (playbox != null && playbox == ActiveBox)
     {
         RefreshInfo();
     }
 }
Ejemplo n.º 4
0
 private void alarmPlayback_backplay_OnBackPlayStateChanged(AlarmPlayback playbox, IMonitorSystemContext context, PlayState state)
 {
     if (state == PlayState.Play)
     {
         button_backplay.Text = "═Бо╣";
     }
     else
     {
         button_backplay.Text = "╗пи┼";
     }
 }
Ejemplo n.º 5
0
        private void DoAlarmPlaybackStateChanged(AlarmPlayback playbox, int index, int count)
        {
            if (ActiveBox != null && playbox == ActiveBox)
            {
                RefreshInfo(playbox, index, count);
            }

            if (OnAlarmPlaybackStateChanged != null)
            {
                OnAlarmPlaybackStateChanged(playbox, index, count);
            }
        }
Ejemplo n.º 6
0
        private bool InitBox(AlarmPlayback box)
        {
            box.Name        = string.Format("alarmPlayback_{0}", panel_main.Controls.Count + 1);
            box.BorderStyle = BorderStyle.FixedSingle;
            box.ShowButton  = false;

            box.OnBoxLinkObjChanged         += new AlarmPlaybackEventHandle(DoBoxLinkObjChanged);
            box.OnAlarmPlaybackStateChanged += new AlarmPlaybackStateEventHandle(DoAlarmPlaybackStateChanged);
            box.OnBackPlayStateChanged      += new AlarmPlaybackPlayStateEventHandle(DoBackPlayStausChanged);
            box.OnRealPlayStateChanged      += new AlarmPlaybackPlayStateEventHandle(DoRealPlayStausChanged);
            box.OnMonitorStateChanged       += new MonitorStateChanged(DoMonitorStateChanged);

            box.MouseClick       += new MouseEventHandler(MonitorBoxMouseClick);
            box.MouseDoubleClick += new MouseEventHandler(MonitorBoxMouseDoubleClick);

            return(true);
        }
Ejemplo n.º 7
0
        private void DoActiveBoxChanged(AlarmPlayback box)
        {
            if (box != null)
            {
                box.BorderStyle = BorderStyle.Fixed3D;

                IVideoSource vs = box.RealPlayer;
                if (vs != null)
                {
                    if (vs.PlayStatus == PlayState.Open || vs.PlayStatus == PlayState.Play)
                    {
                        toolStripButton_realplay.Text = "关闭";
                    }
                    else
                    {
                        toolStripButton_realplay.Text = "预览";
                    }
                }
                else
                {
                    toolStripButton_realplay.Text = "预览";
                }

                vs = box.BackPlayer;
                if (vs != null)
                {
                    if (vs.PlayStatus == PlayState.Open || vs.PlayStatus == PlayState.Play)
                    {
                        toolStripButton_backplay.Text = "关闭";
                    }
                    else
                    {
                        toolStripButton_backplay.Text = "回放";
                    }
                }
                else
                {
                    toolStripButton_backplay.Text = "回放";
                }
            }

            RefreshInfo();
        }
Ejemplo n.º 8
0
        private void RefreshInfo(AlarmPlayback playbox, int index, int count)
        {
            toolStripLabel_showInfo.Text    = "";
            toolStripLabel_alarmInfo.Text   = "";
            toolStripButton_init.Visible    = false;
            toolStripButton_start.Visible   = false;
            toolStripButton_stop.Visible    = false;
            toolStripButton_cleanup.Visible = false;
            toolStripSeparator_fl_1.Visible = false;
            toolStripSeparator_fl_2.Visible = false;

            toolStripButton_realplay.Visible = false;

            bool isVisionMonitor = false;

            bool v = count > 0;

            if (playbox != null)
            {
                CFuncNode node = playbox.LinkObj as CFuncNode;
                if (node != null)
                {
                    IMonitorConfig monitorConfig = node.ExtConfigObj as IMonitorConfig;
                    if (monitorConfig != null)
                    {
                        isVisionMonitor = ((node.ExtConfigObj as IVisionMonitorConfig) != null);
                        toolStripButton_realplay.Visible = isVisionMonitor;

                        toolStripLabel_showInfo.Text  = "“" + node.OriginText + "”";
                        toolStripLabel_alarmInfo.Text = "报警信息(" + index + "/" + count + "):";

                        IMonitor monitor = node.ExtObj as IMonitor;
                        if (monitor != null)
                        {
                            toolStripButton_init.Visible    = !monitor.IsInit;
                            toolStripButton_start.Visible   = !monitor.IsActive;
                            toolStripButton_stop.Visible    = monitor.IsActive;
                            toolStripButton_cleanup.Visible = monitor.IsInit;
                        }
                        else
                        {
                            toolStripButton_init.Visible = true;
                        }
                        toolStripSeparator_fl_1.Visible = true;
                        toolStripSeparator_fl_2.Visible = true;
                    }
                    else
                    {
                        IConfigManager <IMonitorType> monitorType = node.ExtConfigObj as IConfigManager <IMonitorType>;
                        if (monitorType != null)
                        {
                            isVisionMonitor = true;
                            toolStripLabel_showInfo.Text  = "“" + monitorType.SystemContext.Desc + "”";
                            toolStripLabel_alarmInfo.Text = "报警信息(" + index + "/" + count + "):";

                            toolStripSeparator_fl_2.Visible = v;
                        }
                    }
                }
            }

            toolStripLabel_alarmInfo.Visible = v;
            toolStripButton_first.Visible    = v && index > 0;
            toolStripButton_prior.Visible    = v && index > 0;
            toolStripButton_next.Visible     = v && index <= count;
            toolStripButton_last.Visible     = v && index <= count;

            toolStripButton_backplay.Visible = v && isVisionMonitor;
            toolStripButton_transact.Visible = v;
            toolStripButton_clear.Visible    = v;

            toolStripButton_fl.Visible    = v && !toolStripLabel_alarmInfo.Text.Equals("");
            toolStripSeparator_fl.Visible = v || isVisionMonitor;
        }