public void SlewToAltAz(double azimuth, double altitude)
        {
            AzimuthConverter  azConverter  = new AzimuthConverter((decimal)azimuth);
            AltitudeConverter altConverter = new AltitudeConverter((decimal)altitude);

            LogActivityLine(ActivityMessageTypes.Commands, "SlewToAltAz \r\nAz {0}\r\nAlt {1}: {2}"
                            , azConverter, altConverter, SlewStarted);
            CheckDevice();
            Status.Slewing = true;
            Service.SlewToAltAz(azimuth, altitude);
            try
            {
                double ra = Service.TargetRightAscension;
                Status.TargetRightAscension = ra;
            }
            catch { }
            try
            {
                double dec = Service.TargetDeclination;
                Status.TargetDeclination = dec;
            }
            catch { }

            Status.RightAscension = Service.RightAscension;
            Status.Declination    = Service.Declination;
            Status.Azimuth        = Service.Azimuth;
            Status.Altitude       = Service.Altitude;
            LogActivityLine(ActivityMessageTypes.Commands, "SlewToAltAz: {0}", SlewComplete);
        }
        public void SlewToAltAzAsync(double azimuth, double altitude)
        {
            AzimuthConverter  azConverter  = new AzimuthConverter((decimal)azimuth);
            AltitudeConverter altConverter = new AltitudeConverter((decimal)altitude);

            LogActivityLine(ActivityMessageTypes.Commands, "SlewToAltAzAsync \r\nAz {0}\r\nAlt {1}: {2}"
                            , azConverter, altConverter, SlewStarted);
            CheckDevice();
            Status.Slewing = true;
            Service.SlewToAltAzAsync(azimuth, altitude);
        }
Exemple #3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string retval      = "NO DATA";
            double rawAltitude = (double)value;

            if (!Double.IsNaN(rawAltitude))
            {
                AltitudeConverter converter = new AltitudeConverter((decimal)rawAltitude);
                retval = converter.ToString();
            }

            return(retval);
        }
        public void SyncToAltAz(double azimuth, double altitude)
        {
            AzimuthConverter  azConverter  = new AzimuthConverter((decimal)azimuth);
            AltitudeConverter altConverter = new AltitudeConverter((decimal)altitude);

            LogActivityLine(ActivityMessageTypes.Commands, "SyncToAltAz \r\nAz {0}\r\nAlt {1}:", azConverter, altConverter);
            CheckDevice();
            Service.SyncToAltAz(azimuth, altitude);
            Status.Slewing = true;
            Status.TargetRightAscension = Service.TargetRightAscension;
            Status.TargetDeclination    = Service.TargetDeclination;
            Status.RightAscension       = Service.RightAscension;
            Status.Declination          = Service.Declination;
            Status.Azimuth  = Service.Azimuth;
            Status.Altitude = Service.Altitude;
            LogActivityLine(ActivityMessageTypes.Commands, "SyncToAltAz: {0}", Done);
        }
		private void EditAltitude()
		{
			decimal alt = Double.IsNaN( TargetAltitude ) ? 0.0m : (decimal)TargetAltitude;
			AltitudeConverter converter = new AltitudeConverter( alt );

			AltitudeValuesEntryViewModel vm = new AltitudeValuesEntryViewModel();
			vm.InitializeValues( converter.Values );

			IDialogService svc = ServiceContainer.Instance.GetService<IDialogService>();
			bool? result = svc.ShowDialog( vm );

			if ( result.HasValue && result.Value )
			{
				int[] values = vm.GetValues();

				converter = new AltitudeConverter( values );
				TargetAltitude = (double)converter.Value;
			}

			vm.Dispose();
			vm = null;
		}