Ejemplo 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);
                }
            }
        }
Ejemplo n.º 2
0
        //
        // Constructor - Must be public for COM registration!
        //
        public Telescope()
        {
            _driverId = Marshal.GenerateProgIdForType(this.GetType());

            logMessageFunc = SharedResources.LogMessageCallback;
            SharedResources.SetTraceFlags(Profile.TraceFlags);
            LogMessage(LoggingFlags.Scope, $"Starting initialization - v{Version}");

            // TODO: Implement your additional construction here
            _transform.SetJ2000(_utilities.HMSToHours("02:31:51.12"), _utilities.DMSToDegrees("89:15:51.4"));
            _transform.SiteElevation = SiteElevation;
            _transform.SiteLatitude  = SiteLatitude;
            _transform.SiteLongitude = SiteLongitude;
            PolarisRAJNow            = _transform.RATopocentric;

            _azAltTransform.SiteElevation = SiteElevation;
            _azAltTransform.SiteLatitude  = SiteLatitude;
            _azAltTransform.SiteLongitude = SiteLongitude;

            LogMessage(LoggingFlags.Scope, "Completed initialization");
        }