Exemplo n.º 1
0
        private bool sendSetTrackingModeCommand(out string error)
        {
            TrackingMode           mode = rbTrackingModeLine.Checked ? TrackingMode.Line : TrackingMode.Object;
            SetTrackingModeCommand cmd  = new SetTrackingModeCommand(_appState, _commsPort, mode);

            cmd.Execute();

            bool isOk = cmd.IsSuccessful;

            if (isOk)
            {
                //save the settings
                SetTrackingModeCommand.SetModeInConfig(Settings.Default, mode);
                Settings.Default.Save();
            }
            error = cmd.ErrorDescription;
            return(isOk);
        }
Exemplo n.º 2
0
        private void optionsFormLoad(object sender, EventArgs e)
        {
            Settings settings = Settings.Default;

            lbResult.Text = "";

            if (_friendlyNameByPort == null)
            {
                //repopulate the comports first time through
                _friendlyNameByPort = SerialHelper.GetPorts();
            }

            setupComportDropdown();

            cobBaudRate.SelectedIndex  = GetIndex(cobBaudRate, Settings.Default.BaudRate);
            cobDataBits.SelectedIndex  = GetIndex(cobDataBits, Settings.Default.DataBits);
            cobHandshake.SelectedIndex = GetIndex(cobHandshake, (int)Settings.Default.Handshake);
            cobParity.SelectedIndex    = GetIndex(cobParity, (int)Settings.Default.Parity);
            cobStopBits.SelectedIndex  = GetIndex(cobStopBits, (int)Settings.Default.StopBits);

            cbUseAutoWhiteBalance.Checked       = settings.AutoWhiteBalance;
            cbUseAutoAdjust.Checked             = settings.AutoAdjustMode;
            cbUseFlourescentLightFilter.Checked = settings.FlourescentLightFilter;

            TrackingMode mode = SetTrackingModeCommand.GetModeFromConfig(Settings.Default);

            rbTrackingModeLine.Checked   = mode == TrackingMode.Line;
            rbTrackingModeObject.Checked = mode == TrackingMode.Object;

            cbCheckForUpdates.Checked = settings.CheckForUpdates;


            _isChangeUploaded = true;
            lbMessage.Text    = "";

            lbMessageAdv.Text    = "";
            _isChangeUploadedAdv = true;

            _hasDoneTest      = false;
            _hasSavedSettings = false;
        }