Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the DashboardForm class
        /// </summary>
        /// <param name="theEventsPort">The Events Port for passing events back to the service</param>
        /// <param name="state">The service state</param>
        public DashboardForm(DashboardFormEvents theEventsPort, RobotDashboardState state)
        {
            this.eventsPort = theEventsPort;

            this.InitializeComponent();

            this.options = new GUIOptions();
            this.options = state.Options;

            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(this.options.WindowStartX, this.options.WindowStartY);

            // The dead zone can't be negative, but it can be zero
            this.options.DeadZoneX = Math.Abs(state.Options.DeadZoneX);
            this.options.DeadZoneY = Math.Abs(state.Options.DeadZoneY);

            // Just in case the scale factors have not been initialized
            if (state.Options.TranslateScaleFactor == 0)
            {
                this.options.TranslateScaleFactor = 1.0;
            }
            else
            {
                this.options.TranslateScaleFactor = state.Options.TranslateScaleFactor;
            }

            if (state.Options.RotateScaleFactor == 0)
            {
                this.options.RotateScaleFactor = 0.5;
            }
            else
            {
                this.options.RotateScaleFactor = state.Options.RotateScaleFactor;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handle Options Menu Item
        /// </summary>
        /// <param name="sender">The parameter is not used.</param>
        /// <param name="e">The parameter is not used.</param>
        private void OptionsMenuItemClick(object sender, EventArgs e)
        {
            GUIOptions opt = this.options;

            using (OptionsForm optDialog = new OptionsForm(ref opt))
            {
                DialogResult result = optDialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    this.options = opt;
                    ////ReformatForm();
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes an instance of the OnQueryFrame class
 /// </summary>
 /// <param name="form">The associated form</param>
 /// <param name="opt">The option settings</param>
 public OnOptionSettings(DashboardForm form, GUIOptions opt)
     : base(form)
 {
     this.Options = new GUIOptions();
     this.Options = opt;
 }
 /// <summary>
 /// Initializes an instance of the OptionsForm class
 /// </summary>
 /// <param name="options">Option settings</param>
 /// <remarks>Constructor takes a reference to the options so that
 /// we can return the results of changes made by the user</remarks>
 public OptionsForm(ref GUIOptions options)
 {
     this.InitializeComponent();
     this.opt = options;
 }