public DomeLayoutSettings(DomeLayoutSettings other)
 {
     this._domeScopeOffset = other._domeScopeOffset;
     this._domeRadius      = other._domeRadius;
     this._gemAxisOffset   = other._gemAxisOffset;
     this._azimuthAccuracy = other._azimuthAccuracy;
     this._slaveInterval   = other._slaveInterval;
 }
 public DomeControl(DomeLayoutSettings layout, double siteLatitude)
 {
     _domeRadius   = layout.DomeRadius;
     _otaOffset    = layout.GemAxisOffset;
     _isGem        = _otaOffset > 0.0;
     _scopeOffset  = new Point3D(layout.DomeScopeOffset.Y, layout.DomeScopeOffset.X, layout.DomeScopeOffset.Z);
     _siteLatitude = siteLatitude;
 }
Beispiel #3
0
        public static DomeSettings FromProfile()
        {
            string domeID;
            double layoutXOffset;
            double layoutYOffset;
            double layoutZOffset;
            int    domeRadius;
            int    gemAxisOffset;
            int    azimuthAccuracy;
            double azimuthAdjustment;
            int    slaveInterval;
            bool   loggerEnabled;
            bool   usePOTHCalculation;
            double fastUpdatePeriod;

            using (Profile profile = new Profile())
            {
                profile.DeviceType = "Dome";
                domeID             = profile.GetValue(DriverID, _domeIDProfileName, String.Empty, _domeIDDefault);
                layoutXOffset      = Convert.ToDouble(profile.GetValue(DriverID, _xOffsetProfileName, String.Empty, _offsetDefault), CultureInfo.InvariantCulture);
                layoutYOffset      = Convert.ToDouble(profile.GetValue(DriverID, _yOffsetProfileName, String.Empty, _offsetDefault), CultureInfo.InvariantCulture);
                layoutZOffset      = Convert.ToDouble(profile.GetValue(DriverID, _zOffsetProfileName, String.Empty, _offsetDefault), CultureInfo.InvariantCulture);
                domeRadius         = Convert.ToInt32(profile.GetValue(DriverID, _radiusProfileName, String.Empty, _radiusDefault));
                gemAxisOffset      = Convert.ToInt32(profile.GetValue(DriverID, _gemAxisOffsetProfileName, String.Empty, _gemAxisOffsetDefault));
                azimuthAccuracy    = Convert.ToInt32(profile.GetValue(DriverID, _azimuthAccuracyProfileName, String.Empty, _azimuthAccuracyDefault));
                azimuthAdjustment  = Convert.ToDouble(profile.GetValue(DriverID, _azimuthAdjustmentProfileName, String.Empty, _azimuthAdjustmentDefault));
                slaveInterval      = Convert.ToInt32(profile.GetValue(DriverID, _slaveIntervalProfileName, String.Empty, _slaveIntervalDefault));
                loggerEnabled      = Convert.ToBoolean(profile.GetValue(DriverID, _traceStateProfileName, String.Empty, _traceStateDefault));
                usePOTHCalculation = Convert.ToBoolean(profile.GetValue(DriverID, _usePOTHSlavingCalculationProfileName, String.Empty, _usePOTHSlavingCalculationDefault));
                fastUpdatePeriod   = Convert.ToDouble(profile.GetValue(DriverID, _fastUpdateProfileName, String.Empty, _fastUpdateDefault));
            }

            // Prevent the user from circumventing the valid fast update by setting the value in the profile store directly.

            fastUpdatePeriod = Math.Max(Globals.DOME_FAST_UPDATE_MIN, Math.Min(fastUpdatePeriod, Globals.DOME_FAST_UPDATE_MAX));

            DomeLayoutSettings layoutSettings = new DomeLayoutSettings
            {
                DomeScopeOffset = new System.Windows.Media.Media3D.Point3D(layoutXOffset, layoutYOffset, layoutZOffset),
                DomeRadius      = domeRadius,
                GemAxisOffset   = gemAxisOffset,
                AzimuthAccuracy = azimuthAccuracy,
                SlaveInterval   = slaveInterval
            };

            DomeSettings settings = new DomeSettings
            {
                DomeID                      = domeID,
                DomeLayout                  = layoutSettings,
                AzimuthAdjustment           = azimuthAdjustment,
                UsePOTHDomeSlaveCalculation = usePOTHCalculation,
                IsLoggingEnabled            = loggerEnabled,
                FastUpdatePeriod            = fastUpdatePeriod
            };

            return(settings);
        }
Beispiel #4
0
 public void InitializeLayout(DomeLayoutSettings settings)
 {
     _domeRadius      = settings.DomeRadius;
     _gemAxisOffset   = settings.GemAxisOffset;
     _scopeOffsetEWX  = (int)settings.DomeScopeOffset.X;
     _scopeOffsetNSY  = (int)settings.DomeScopeOffset.Y;
     _scopeOffsetUDZ  = (int)settings.DomeScopeOffset.Z;
     _azimuthAccuracy = settings.AzimuthAccuracy;
     _slaveInterval   = settings.SlaveInterval;
 }
Beispiel #5
0
        public static DomeSettings FromProfile()
        {
            string domeID;
            double layoutXOffset;
            double layoutYOffset;
            double layoutZOffset;
            int    domeRadius;
            int    gemAxisOffset;
            int    azimuthAccuracy;
            double azimuthAdjustment;
            int    slaveInterval;
            bool   loggerEnabled;
            bool   usePOTHCalculation;
            bool   FindHomeAtStartup;

            using (Profile profile = new Profile())
            {
                profile.DeviceType = "Dome";
                domeID             = profile.GetValue(DriverID, _domeIDProfileName, String.Empty, _domeIDDefault);
                layoutXOffset      = Convert.ToDouble(profile.GetValue(DriverID, _xOffsetProfileName, String.Empty, _offsetDefault), CultureInfo.InvariantCulture);
                layoutYOffset      = Convert.ToDouble(profile.GetValue(DriverID, _yOffsetProfileName, String.Empty, _offsetDefault), CultureInfo.InvariantCulture);
                layoutZOffset      = Convert.ToDouble(profile.GetValue(DriverID, _zOffsetProfileName, String.Empty, _offsetDefault), CultureInfo.InvariantCulture);
                domeRadius         = Convert.ToInt32(profile.GetValue(DriverID, _radiusProfileName, String.Empty, _radiusDefault));
                gemAxisOffset      = Convert.ToInt32(profile.GetValue(DriverID, _gemAxisOffsetProfileName, String.Empty, _gemAxisOffsetDefault));
                azimuthAccuracy    = Convert.ToInt32(profile.GetValue(DriverID, _azimuthAccuracyProfileName, String.Empty, _azimuthAccuracyDefault));
                azimuthAdjustment  = Convert.ToDouble(profile.GetValue(DriverID, _azimuthAdjustmentProfileName, String.Empty, _azimuthAdjustmentDefault));
                slaveInterval      = Convert.ToInt32(profile.GetValue(DriverID, _slaveIntervalProfileName, String.Empty, _slaveIntervalDefault));
                loggerEnabled      = Convert.ToBoolean(profile.GetValue(DriverID, _traceStateProfileName, String.Empty, _traceStateDefault));
                usePOTHCalculation = Convert.ToBoolean(profile.GetValue(DriverID, _usePOTHSlavingCalculationProfileName, String.Empty, _usePOTHSlavingCalculationDefault));
                FindHomeAtStartup  = Convert.ToBoolean(profile.GetValue(DriverID, _FindHomeAtStartupProfileName, String.Empty, _FindHomeAtStartupDefault));
            }

            DomeLayoutSettings layoutSettings = new DomeLayoutSettings
            {
                DomeScopeOffset = new System.Windows.Media.Media3D.Point3D(layoutXOffset, layoutYOffset, layoutZOffset),
                DomeRadius      = domeRadius,
                GemAxisOffset   = gemAxisOffset,
                AzimuthAccuracy = azimuthAccuracy,
                SlaveInterval   = slaveInterval
            };

            DomeSettings settings = new DomeSettings
            {
                DomeID                      = domeID,
                DomeLayout                  = layoutSettings,
                AzimuthAdjustment           = azimuthAdjustment,
                UsePOTHDomeSlaveCalculation = usePOTHCalculation,
                FindDomeHomeAtStartup       = FindHomeAtStartup,
                IsLoggingEnabled            = loggerEnabled
            };

            return(settings);
        }
        public DomeSynchronize(DomeLayoutSettings layout, double siteLatitude)
        {
            // Define the origin of the dome.

            _domeCenter = new Vector3D(0.0, 0.0, 0.0);

            _domeRadius          = layout.DomeRadius;
            _otaOffset           = layout.GemAxisOffset;
            _isGem               = _otaOffset > 0.0;
            _mountOffset         = new Vector3D(layout.DomeScopeOffset.X, layout.DomeScopeOffset.Y, layout.DomeScopeOffset.Z);
            _siteLatitudeRadians = siteLatitude * Globals.DEG_TO_RAD;
        }
Beispiel #7
0
        public DomeLayoutSettings GetLayout()
        {
            DomeLayoutSettings settings = new DomeLayoutSettings
            {
                DomeRadius      = _domeRadius,
                GemAxisOffset   = _gemAxisOffset,
                DomeScopeOffset = new Point3D((double)_scopeOffsetEWX, (double)_scopeOffsetNSY, (double)_scopeOffsetUDZ),
                AzimuthAccuracy = _azimuthAccuracy,
                SlaveInterval   = _slaveInterval
            };

            return(settings);
        }