예제 #1
0
        public OptionsForm(AbstractFeedOptions options)
        {
            InitializeComponent();

            this.options = options;

            Log.debug(String.Format("Current Options {0}",options));

            //prevent manual input
            cbDetectorType.DropDownStyle = ComboBoxStyle.DropDownList;

            lCameraName.Text = options.Name;
            tbOpacity.Minimum = 0;
            tbOpacity.Maximum = 100;

            //undos
            motionUndoRecord = options.EnableRecording;
            motionUndoAlertsound = options.EnableAlertSound;

            //pull values from options
            cbAlwaysShow.Checked = options.EnableAlwaysShow;
            cbRecord.Checked = options.EnableRecording;
            tbRecordFolder.Text = options.RecordFolder;
            cbAlertSound.Checked = options.EnableAlertSound;
            tbAudioFile.Text = options.AlertSoundFile;
            cbEnableMotionAlarm.Checked = options.EnableMotionAlert;
            flopFileSelectionBoxes();
            flopAlerts();

            tbOpacity.Value = (int)(options.Opacity * 100);

            //Global Check
            if (options is GlobalVideoFeedOptions)
            {
                cbGlobalOptions.Visible = false;
            }
            else
            {
                cbGlobalOptions.Checked = options.UseGlobal;
                initialUseGlobal = options.UseGlobal; //for cancel
            }

            //for cancel
            initialOpacity = options.Opacity;

            this.MaximumSize = this.Size; //prevent resizin'
            this.MinimumSize = this.Size;
            this.MaximizeBox = false;

            //motion detector types
            cbDetectorType.DataSource = Enum.GetValues(typeof(VideoSource.DetectorType));
            cbDetectorType.FormattingEnabled = true;
            cbDetectorType.Format += delegate(object sender, ListControlConvertEventArgs e)
            {
                if ( ((VideoSource.DetectorType)e.Value) == VideoSource.DetectorType.FastBlock)
                {
                    e.Value = "Block (Optimized)";
                }
                else
                {
                    e.Value = e.Value;
                }
            };
            cbDetectorType.SelectedItem = options.DetectorType;

            //prevents window disposal
            this.FormClosing += new FormClosingEventHandler(OptionsForm_FormClosing);

            //Log
            cbCodec.Items.AddRange(CodecOption.getAvailableCodecs());
            cbCodec.SelectedItem = options.Codec;
            Log.debug("Selected Codec: " + options.Codec);
        }
예제 #2
0
        public OptionsForm(AbstractFeedOptions options)
        {
            InitializeComponent();

            this.options = options;

            Log.debug(String.Format("Current Options {0}", options));

            //prevent manual input
            cbDetectorType.DropDownStyle = ComboBoxStyle.DropDownList;

            lCameraName.Text  = options.Name;
            tbOpacity.Minimum = 0;
            tbOpacity.Maximum = 100;

            //undos
            motionUndoRecord     = options.EnableRecording;
            motionUndoAlertsound = options.EnableAlertSound;

            //pull values from options
            cbAlwaysShow.Checked        = options.EnableAlwaysShow;
            cbRecord.Checked            = options.EnableRecording;
            tbRecordFolder.Text         = options.RecordFolder;
            cbAlertSound.Checked        = options.EnableAlertSound;
            tbAudioFile.Text            = options.AlertSoundFile;
            cbEnableMotionAlarm.Checked = options.EnableMotionAlert;
            flopFileSelectionBoxes();
            flopAlerts();

            tbOpacity.Value = (int)(options.Opacity * 100);

            //Global Check
            if (options is GlobalVideoFeedOptions)
            {
                cbGlobalOptions.Visible = false;
            }
            else
            {
                cbGlobalOptions.Checked = options.UseGlobal;
                initialUseGlobal        = options.UseGlobal; //for cancel
            }

            //for cancel
            initialOpacity = options.Opacity;

            this.MaximumSize = this.Size; //prevent resizin'
            this.MinimumSize = this.Size;
            this.MaximizeBox = false;


            //motion detector types
            cbDetectorType.DataSource        = Enum.GetValues(typeof(VideoSource.DetectorType));
            cbDetectorType.FormattingEnabled = true;
            cbDetectorType.Format           += delegate(object sender, ListControlConvertEventArgs e)
            {
                if (((VideoSource.DetectorType)e.Value) == VideoSource.DetectorType.FastBlock)
                {
                    e.Value = "Block (Optimized)";
                }
                else
                {
                    e.Value = e.Value;
                }
            };
            cbDetectorType.SelectedItem = options.DetectorType;


            //prevents window disposal
            this.FormClosing += new FormClosingEventHandler(OptionsForm_FormClosing);

            //Log
            cbCodec.Items.AddRange(CodecOption.getAvailableCodecs());
            cbCodec.SelectedItem = options.Codec;
            Log.debug("Selected Codec: " + options.Codec);
        }