예제 #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.IP               = textBox_ip.Text;
                mConfig.Port             = (int)numericUpDown_port.Value;
                mConfig.RemoteSystemName = textBox_rsname.Text;
                mConfig.UserName         = textBox_username.Text;
                mConfig.Password         = mOldPassword.Equals("") ? CommonUtil.ToMD5Str(textBox_password.Text) : mOldPassword;
                mConfig.AutoLogin        = checkBox_autologin.Checked;
                mConfig.Enabled          = checkBox_enabled.Checked;

                return(true);
            }
            return(false);
        }
예제 #2
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);
        }
예제 #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);
        }
예제 #4
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 = mConfig.Name;

                mConfig.Password   = mOldPassword.Equals("") ? CommonUtil.ToMD5Str(textBox_password.Text) : mOldPassword;
                mConfig.MultiLogin = checkBox_multiLogin.Checked;
                mConfig.Enabled    = checkBox_enabled.Checked;

                mConfig.RoleList = "";
                if (listBox_role_user.Items.Count > 0)
                {
                    foreach (IRoleConfig config in listBox_role_user.Items)
                    {
                        if (config != null)
                        {
                            mConfig.RoleList += config.Name + ";";
                        }
                    }
                }

                return(true);
            }
            return(false);
        }
예제 #5
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);
        }
예제 #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.Enabled = checkBox_enabled.Checked;

                IACItem      acitem;
                IConfig      config;
                CNameDescMap type;
                bool         isview, ismanager, isexec;

                mConfig.ClearACItem();
                foreach (DataGridViewRow row in dataGridView_ACList.Rows)
                {
                    isview    = Convert.ToBoolean(row.Cells[3].Value.ToString());
                    ismanager = Convert.ToBoolean(row.Cells[4].Value.ToString());
                    isexec    = Convert.ToBoolean(row.Cells[5].Value.ToString());

                    if (isview || ismanager || isexec)
                    {
                        type   = row.Cells[1].Value as CNameDescMap;
                        config = row.Cells[2].Value as IConfig;

                        acitem = mConfig.AppendACItem();

                        acitem.Type = type != null ? type.Name : row.Cells[1].Value.ToString();

                        acitem.Name = config != null ? config.Name : row.Cells[2].Value.ToString();

                        acitem.CtrlOpt = (ushort)((isview ? ACOpts.View : ACOpts.None) | (ismanager ? ACOpts.Manager : ACOpts.None) | (isexec ? ACOpts.Exec : ACOpts.None));
                    }
                }

                return(true);
            }
            return(false);
        }
예제 #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);
        }
예제 #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.ConfigClass     = textBox_configClass.Text;
                mConfig.ConfigFormClass = textBox_formClass.Text;
                mConfig.ActionClass     = textBox_createClass.Text;
                mConfig.FileName        = textBox_fileName.Text;
                mConfig.Enabled         = checkBox_enabled.Checked;

                return(true);
            }
            return(false);
        }
예제 #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.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);
        }
예제 #10
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);
        }
예제 #11
0
        protected bool InitDialog()
        {
            tabControl_monitor.SelectedIndex = 0;

            if (mConfig != null)
            {
                textBox_name.Text                   = mConfig.Name;
                textBox_desc.Text                   = mConfig.Desc;
                comboBox_type.SelectedItem          = mConfig.SystemContext.MonitorTypeManager.GetConfig(mConfig.Type);
                textBox_ip.Text                     = mConfig.Host;
                numericUpDown_port.Value            = mConfig.Port;
                checkBox_enabled.Checked            = mConfig.Enabled;
                checkBox_autoSaveAlarmInfo.Checked  = mConfig.AutoSaveAlarmInfo;
                checkBox_autoSaveAlarmImage.Checked = mConfig.AutoSaveAlarmImage;

                comboBox_type.Enabled = false;

                textBox_name.Enabled = false;
            }
            else
            {
                textBox_name.Text          = mType != null ? mType.Name + "_" : "Monitor_";
                textBox_desc.Text          = mType != null ? "新" + mType.Desc : "监控应用";
                comboBox_type.SelectedItem = mType != null?mType.SystemContext.MonitorTypeManager.GetConfig(mType.Name) : null;

                textBox_ip.Text                     = "";
                numericUpDown_port.Value            = 3800;
                checkBox_enabled.Checked            = true;
                checkBox_autoSaveAlarmInfo.Checked  = false;
                checkBox_autoSaveAlarmImage.Checked = false;

                comboBox_type.Enabled = mType == null;

                if (mManager != null && mType != null)
                {
                    mConfig = mManager.CreateConfigInstance(mType);
                }

                textBox_name.Enabled = true;
            }

            if (mConfig != null)
            {
                IVisionMonitorConfig visionMonitorConfig = mConfig as IVisionMonitorConfig;
                if (visionMonitorConfig != null)
                {
                    visionParamConfigCtrl_visionParams.VisionParamConfig = visionMonitorConfig.VisionParamConfig;
                }

                IBlobTrackerConfig blobTrackerConfig = mConfig as IBlobTrackerConfig;
                if (blobTrackerConfig != null)
                {
                    alertAreaConfigCtrl_alertArea.VSConfig             = visionParamConfigCtrl_visionParams.VSConfig;
                    alertAreaConfigCtrl_alertArea.BlobTrackParamConfig = blobTrackerConfig.BlobTrackParamConfig;
                }

                monitorActionConfigCtrl_action.ActionParamConfig = mConfig.ActionParamConfig;

                runPlanConfigCtrl_runPlan.RunParamConfig = mConfig.RunParamConfig;

                comboBox_runMode.SelectedIndex = (int)mConfig.RunParamConfig.RunMode;

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