Exemplo n.º 1
0
        //
        // PUBLIC COM INTERFACE ITelescopeV3 IMPLEMENTATION
        //

        /// <summary>
        ///     ''' Displays the Setup Dialog form.
        ///     ''' If the user clicks the OK button to dismiss the form, then
        ///     ''' the new settings are saved, otherwise the old values are reloaded.
        ///     ''' THIS IS THE ONLY PLACE WHERE SHOWING USER INTERFACE IS ALLOWED!
        ///     ''' </summary>
        public void SetupDialog()
        {
            using (var f = new SetupDialogForm(Profile, this, (s) => this.LogMessage(LoggingFlags.Setup, s)))
            {
                if (f.ShowDialog() == DialogResult.OK)
                {
                    SharedResources.WriteProfile(f.GetProfileData());                     // Persist device configuration values to the ASCOM Profile store
                    SharedResources.SetTraceFlags(Profile.TraceFlags);
                }
            }
        }
Exemplo n.º 2
0
        //
        // PUBLIC COM INTERFACE IFocuserV3 IMPLEMENTATION
        //

        #region Common properties and methods.

        /// <summary>
        /// Displays the Setup Dialog form.
        /// If the user clicks the OK button to dismiss the form, then
        /// the new settings are saved, otherwise the old values are reloaded.
        /// THIS IS THE ONLY PLACE WHERE SHOWING USER INTERFACE IS ALLOWED!
        /// </summary>
        public void SetupDialog()
        {
            // consider only showing the setup dialog if not connected
            // or call a different dialog if connected
            if (IsConnected)
            {
                MessageBox.Show("OAT is connected, use Telescope driver to control focuser manually.");
            }

            using (var f = new SetupDialogForm(Profile, null, null))
            {
                if (f.ShowDialog() == DialogResult.OK)
                {
                    SharedResources.WriteProfile(f.GetProfileData());                     // Persist device configuration values to the ASCOM Profile store
                }
            }
        }
Exemplo n.º 3
0
        //
        // PUBLIC COM INTERFACE ITelescopeV3 IMPLEMENTATION
        //

        /// <summary>
        ///     ''' Displays the Setup Dialog form.
        ///     ''' If the user clicks the OK button to dismiss the form, then
        ///     ''' the new settings are saved, otherwise the old values are reloaded.
        ///     ''' THIS IS THE ONLY PLACE WHERE SHOWING USER INTERFACE IS ALLOWED!
        ///     ''' </summary>
        public void SetupDialog()
        {
            // consider only showing the setup dialog if not connected
            // or call a different dialog if connected
            if (IsConnected)
            {
                MessageBox.Show("Already connected, just press OK");
            }

            using (var f = new SetupDialogForm(Profile)) {
                if (f.ShowDialog() == DialogResult.OK)
                {
                    SharedResources.WriteProfile(f
                                                 .GetProfileData()); // Persist device configuration values to the ASCOM Profile store
                }
            }
        }