示例#1
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             if (TL != null)
             {
                 TL.Enabled = false;
                 TL.Dispose();
                 TL = null;
             }
             if (Utl != null)
             {
                 Utl.Dispose();
                 Utl = (Util)null;
             }
         }
         if (Nov31 != null)
         {
             Nov31.Dispose();
             Nov31 = (NOVAS31)null;
         }
     }
     disposedValue = true;
 }
示例#2
0
 public AstroUtils(int leapSeconds, IAscomDataStore store, ITraceLogger logger)
 {
     Utl          = new Util();
     Nov31        = new NOVAS31();
     Store        = store ?? (IAscomDataStore) new EntityStore();
     TL           = logger ?? new TraceLogger("", "Astrometry");
     TL.Enabled   = Store?.GetProfile <bool>("Utilities", "Trace Astro Utils", false) ?? false;
     UtcTaiOffset = Store?.GetProfile("Astrometry", "Leap Seconds", 36) ?? 36;
     TL.LogMessage("New", "AstroUtils created Utilities component OK");
     TL.LogMessage("New", $"Leap seconds: {UtcTaiOffset}");
     TL.LogMessage("New", "Finished initialisation OK");
 }
示例#3
0
 public Planet()
 {
     this.m_ephdisps             = new int[5];
     this.m_earthephdisps        = new int[5];
     this.m_name                 = (string)null;
     this.m_bDTValid             = false;
     this.m_ephobj               = (IEphemeris) new ASCOM.Astrometry.Kepler.Ephemeris();
     this.m_earthephobj          = (IEphemeris) new ASCOM.Astrometry.Kepler.Ephemeris();
     this.m_earthephobj.BodyType = BodyType.Moon;
     this.m_earthephobj.Name     = "Earth";
     this.m_earthephobj.Number   = Body.Earth;
     this.Nov31 = new NOVAS31();
 }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FMounterV1"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl         = new TraceLogger("", "FMounterV1");
            tl.Enabled = traceState;
            tl.LogMessage("Telescope", "Starting initialisation");

            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            fNOVAS         = new NOVAS31();
            fTransform     = new Astrometry.Transform.Transform();

            //TODO: Implement your additional construction here

            tl.LogMessage("Telescope", "Completed initialisation");

            fMounter = new TFMounter(true);

            isCreated = true;
        }