private void SetStatus( DevHubTelescopeStatus status )
		{
			// Make sure that we update the Status on the U/I thread.

			Task.Factory.StartNew( () =>
			{
				Status = status;
				UpdateCanDoDirectSlew();

				if ( !_isActive )
				{
					double ra = ( Status != null ) ? Status.RightAscension : Double.NaN;
					double dec = ( Status != null ) ? Status.Declination : Double.NaN;
					double az = ( Status != null ) ? Status.Azimuth : Double.NaN;
					double alt = ( Status != null ) ? Status.Altitude : Double.NaN;

					SetDirectCoordinates( ra, dec, az, alt );
				}

				if ( _isActive && _isSlewInProgress && !Status.Slewing )
				{
					_isSlewInProgress = false;
					Messenger.Default.Send( new SlewInProgressMessage( false ) );
				}
			}, CancellationToken.None, TaskCreationOptions.None, Globals.UISyncContext );
		}
Example #2
0
        public static DevHubTelescopeStatus GetEmptyStatus()
        {
            DevHubTelescopeStatus status = new DevHubTelescopeStatus();

            status.Clean();

            return(status);
        }