Ejemplo n.º 1
0
        protected bool SetConfig()
        {
            if (mConfig == null && mManager != null)
            {
                mConfig = mManager.CreateConfigInstance();
            }

            if (mConfig != null)
            {
                (mConfig as CConfig).Name = textBox_name.Text;
                mConfig.SetValue("Name", textBox_name.Text);

                mConfig.Desc        = textBox_desc.Text;
                mConfig.Type        = CtrlUtil.GetComboBoxText(comboBox_type);
                mConfig.FPS         = (int)numericUpDown_fps.Value;
                mConfig.IP          = textBox_ip.Text;
                mConfig.Port        = (short)numericUpDown_port.Value;
                mConfig.Channel     = (int)numericUpDown_channel.Value;
                mConfig.ShowOSDType = (int)numericUpDown_osd.Value;
                mConfig.UserName    = textBox_username.Text;
                mConfig.Password    = textBox_password.Text;
                mConfig.IsRecord    = checkBox_record.Checked;
                mConfig.Enabled     = checkBox_enabled.Checked;

                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        public void ApplyConfig(IVisionParamConfig visionParamConfig)
        {
            if (visionParamConfig == null)
            {
                return;
            }

            visionParamConfig.VSName = CtrlUtil.GetComboBoxText(comboBox_vs);

            visionParamConfig.AutoSaveAlarmRecord = checkBox_autoSaveAlarmRecord.Checked;

            IVisionUserParamConfig visionUseParamConfig = visionParamConfig as IVisionUserParamConfig;

            if (visionUseParamConfig != null)
            {
                visionUseParamConfig.ProcessMode = checkBox_processMode.Checked ? 0 : 1;
            }

            IBlobTrackParamConfig blobTrackParamConfig = visionParamConfig as IBlobTrackParamConfig;

            if (blobTrackParamConfig != null)
            {
                blobTrackParamConfig.MinWidth  = (int)numericUpDown_minWidth.Value;
                blobTrackParamConfig.MinHeight = (int)numericUpDown_minHeight.Value;

                blobTrackParamConfig.MaxWidth  = (int)numericUpDown_maxWidth.Value;
                blobTrackParamConfig.MaxHeight = (int)numericUpDown_maxHeight.Value;

                blobTrackParamConfig.ProcessorParams = textBox_processorParams.Text;
            }
        }
Ejemplo n.º 3
0
        protected bool SetConfig()
        {
            if (mConfig == null && mManager != null)
            {
                mConfig = mManager.CreateConfigInstance();
            }

            if (mConfig != null)
            {
                (mConfig as CConfig).Name = textBox_name.Text;
                mConfig.SetValue("Name", textBox_name.Text);

                mConfig.Desc      = textBox_desc.Text;
                mConfig.Type      = CtrlUtil.GetComboBoxText(comboBox_type);
                mConfig.Scheduler = CtrlUtil.GetComboBoxText(comboBox_scheduler);
                mConfig.AutoRun   = checkBox_autorun.Checked;
                mConfig.Enabled   = checkBox_enabled.Checked;

                mConfig.ClearActions();
                foreach (IActionParam config in checkedListBox_action.Items)
                {
                    mConfig.AppendAction(config);
                }

                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
        protected bool SetVSConfig()
        {
            if (mVSConfig != null)
            {
                mVSConfig.Type = CtrlUtil.GetComboBoxText(comboBox_vsType);
                mVSConfig.FPS  = (int)numericUpDown_fps.Value;
                mVSConfig.IP   = textBox_dvr_ip.Text;
                mVSConfig.Port = (short)numericUpDown_dvr_port.Value;
                mVSConfig.SetValue("Channel", textBox_channel.Text);
                mVSConfig.ShowOSDType = (int)numericUpDown_osd.Value;
                mVSConfig.StartTime   = dateTimePicker_begin.Value;
                mVSConfig.StopTime    = dateTimePicker_end.Value;
                mVSConfig.SetValue("Domain", textBox_domain.Text);
                mVSConfig.UserName = textBox_username.Text;
                mVSConfig.Password = textBox_password.Text;
                mVSConfig.FileName = textBox_filename.Text;
                mVSConfig.RunMode  = checkBox_runMode_push.Checked ? VideoSourceRunMode.Push : VideoSourceRunMode.Pull;
                mVSConfig.IsCycle  = checkBox_cycle.Checked;

                mVSConfig.OnChanged();

                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
        protected bool SetConfig()
        {
            DoBeforeChanged();

            if (mConfig != null)
            {
                mConfig.Desc = textBox_desc.Text;
                mConfig.Type = CtrlUtil.GetComboBoxText(comboBox_type);

                mConfig.Host = textBox_ip.Text;
                mConfig.Port = (short)numericUpDown_port.Value;
                //mConfig.AutoRun = checkBox_autorun.Checked;
                mConfig.Enabled            = checkBox_enabled.Checked;
                mConfig.AutoSaveAlarmInfo  = true;
                mConfig.AutoSaveAlarmImage = true;

                mVisionConfig = mConfig as IVisionMonitorConfig;
                if (mVisionConfig != null)
                {
                    mVisionConfig.VisionParamConfig.VSName = CtrlUtil.GetComboBoxText(comboBox_vs);
                }

                mVisionUserConfig = mConfig as IVisionUserConfig;
                if (mVisionUserConfig != null)
                {
                    mVisionUserConfig.VisionUserParamConfig.ProcessMode = checkBox_processMode.Checked ? 0 : 1;
                }

                mBlobTrackerConfig = mConfig as IBlobTrackerConfig;
                if (mBlobTrackerConfig != null)
                {
                    mBlobTrackerConfig.BlobTrackParamConfig.ProcessorParams = "0,0,0,1,0,0:100";// textBox_processorParams.Text;
                    alertAreaConfigCtrl_alertArea.ApplyConfig();
                }

                runPlanConfigCtrl_runPlan.ApplyConfig();
                monitorActionConfigCtrl_action.ApplyConfig();

                mConfig.OnChanged(); //yhx 2013-9-30 add;

                if (SetVSConfig())
                {
                    DoAfterChanged();
                    return(true);
                }
            }
            DoAfterChanged();
            return(false);
        }
Ejemplo n.º 6
0
        protected bool SetConfig()
        {
            if (mConfig == null && mManager != null)
            {
                mConfig = mManager.CreateConfigInstance();
            }

            if (mConfig != null)
            {
                (mConfig as CConfig).Name = textBox_name.Text;
                mConfig.SetValue("Name", textBox_name.Text);

                mConfig.Desc    = textBox_desc.Text;
                mConfig.Type    = CtrlUtil.GetComboBoxText(comboBox_type);
                mConfig.AutoRun = checkBox_autorun.Checked;
                mConfig.Enabled = checkBox_enabled.Checked;

                mConfig.SetValue("StartTime", comboBox_startTime.Text);
                mConfig.SetValue("StopTime", comboBox_stopTime.Text);
                mConfig.SetValue("Delay", comboBox_delayTime.Text);
                mConfig.SetValue("Period", comboBox_period.Text);
                mConfig.Cycle       = (int)numericUpDown_cycleNumber.Value;
                mConfig.PerCycle    = 1;
                mConfig.OnTimeStart = checkBox_onTimeStart.Checked;

                ITimeSegment ts = null;

                mConfig.ClearTimeSegment();
                foreach (DataGridViewRow row in dataGridView_timeSegment.Rows)
                {
                    if (row.Cells[0].Value != null || row.Cells[1].Value != null)
                    {
                        ts = mConfig.AppendTimeSegment();

                        ts.SetValue("StartTime", row.Cells[0].Value != null ? row.Cells[0].Value.ToString() : "");

                        ts.SetValue("StopTime", row.Cells[1].Value != null ? row.Cells[1].Value.ToString() : "");

                        ts.Enabled = Convert.ToBoolean(row.Cells[2].Value);
                    }
                }

                return(true);
            }
            return(false);
        }
Ejemplo n.º 7
0
        protected bool SetConfig()
        {
            if (mConfig == null && mManager != null)
            {
                mConfig = mManager.CreateConfigInstance();
            }

            if (mConfig != null)
            {
                (mConfig as CConfig).Name = textBox_name.Text;
                mConfig.SetValue("Name", textBox_name.Text);

                mConfig.Desc = textBox_desc.Text;
                mConfig.Type = CtrlUtil.GetComboBoxText(comboBox_type);
                mConfig.SetValue("Params", textBox_params.Text);
                mConfig.AutoRun = checkBox_autorun.Checked;
                mConfig.Enabled = checkBox_enabled.Checked;

                return(true);
            }
            return(false);
        }
Ejemplo n.º 8
0
        protected bool SetConfig()
        {
            if (mConfig == null && mManager != null)
            {
                mConfig = mManager.CreateConfigInstance();
            }

            if (mConfig != null)
            {
                (mConfig as CConfig).Name = textBox_name.Text;
                mConfig.SetValue("Name", textBox_name.Text);

                mConfig.Desc            = textBox_desc.Text;
                mConfig.FactoryClass    = textBox_factoryClass.Text;
                mConfig.ConfigFormClass = textBox_formClass.Text;
                mConfig.FileName        = textBox_fileName.Text;
                mConfig.BackPlayType    = CtrlUtil.GetComboBoxText(comboBox_backPlayType);
                mConfig.Enabled         = checkBox_enabled.Checked;

                return(true);
            }
            return(false);
        }
Ejemplo n.º 9
0
        protected bool SetConfig()
        {
            if (mConfig == null && mManager != null)
            {
                mConfig = mManager.CreateConfigInstance();
            }

            if (mConfig != null)
            {
                (mConfig as CConfig).Name = textBox_name.Text;
                mConfig.SetValue("Name", textBox_name.Text);

                mConfig.Desc     = textBox_desc.Text;
                mConfig.Type     = CtrlUtil.GetComboBoxText(comboBox_type);
                mConfig.FPS      = (int)numericUpDown_fps.Value;
                mConfig.FileName = textBox_filename.Text;
                mConfig.IsCycle  = checkBox_cycle.Checked;
                mConfig.IsRecord = checkBox_record.Checked;
                mConfig.Enabled  = checkBox_enabled.Checked;

                return(true);
            }
            return(false);
        }
Ejemplo n.º 10
0
        protected bool SetConfig()
        {
            if (mConfig != null)
            {
                (mConfig as CConfig).Name = textBox_name.Text;
                mConfig.SetValue("Name", textBox_name.Text);

                mConfig.Desc = textBox_desc.Text;
                mConfig.Type = CtrlUtil.GetComboBoxText(comboBox_type);

                mConfig.Host = textBox_ip.Text;
                mConfig.Port = (short)numericUpDown_port.Value;

                mConfig.Enabled            = checkBox_enabled.Checked;
                mConfig.AutoSaveAlarmInfo  = checkBox_autoSaveAlarmInfo.Checked;
                mConfig.AutoSaveAlarmImage = checkBox_autoSaveAlarmImage.Checked;

                mVisionConfig = mConfig as IVisionMonitorConfig;
                if (mVisionConfig != null)
                {
                    visionParamConfigCtrl_visionParams.ApplyConfig();
                }

                mBlobTrackerConfig = mConfig as IBlobTrackerConfig;
                if (mBlobTrackerConfig != null)
                {
                    alertAreaConfigCtrl_alertArea.ApplyConfig();
                }

                monitorActionConfigCtrl_action.ApplyConfig();
                runPlanConfigCtrl_runPlan.ApplyConfig();

                return(true);
            }
            return(false);
        }