示例#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);
                }
            }
        }
示例#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
                }
            }
        }
示例#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
                }
            }
        }