Beispiel #1
0
        private void UpdateStatus(TelescopeStatusUpdatedMessage action)
        {
            // This is a registered message handler. It could be called from a worker thread
            // and we need to be sure that the work is done on the U/I thread.

            Task.Factory.StartNew(() =>
            {
                Status = action.Status;

                if (JogRates == null)
                {
                    BuildJogRatesLists();
                }

                if (SlewDirections == null)
                {
                    SetSlewDirections();
                }

                UpdateCanStartMove();

                IsTracking = (Status != null && Status.Connected) ? Status.Tracking : false;

                if (_isActive && _isFixedSlewInProgress && !Status.Slewing)
                {
                    _isFixedSlewInProgress = false;
                    Messenger.Default.Send(new SlewInProgressMessage(false));
                }

                SetParkCommandAction();

                RelayCommand.RaiseCanExecuteChanged();
            }, CancellationToken.None, TaskCreationOptions.None, Globals.UISyncContext);
        }
Beispiel #2
0
        private void UpdateStatus(TelescopeStatusUpdatedMessage action)
        {
            // This is a registered message handler. It could be called from a worker thread
            // and we need to be sure that the work is done on the U/I thread.

            Task.Factory.StartNew(() =>
            {
                Status      = action.Status;
                IsConnected = Status.Connected;

                UpdateTrackingRateText();

                if (!Capabilities.CanSetDeclinationRate || !Capabilities.CanSetRightAscensionRate)
                {
                    CanChangeOffsetRate = false;
                }
                else if (Status.TrackingRate != DriveRates.driveSidereal)
                {
                    CanChangeOffsetRate = true;
                }
                else if (Status.RightAscensionRate == 0.0 && Status.DeclinationRate == 0.0)
                {
                    CanChangeOffsetRate = true;
                }
                else
                {
                    CanChangeOffsetRate = false;
                }
            }, CancellationToken.None, TaskCreationOptions.None, Globals.UISyncContext);
        }
		private void UpdateStatus( TelescopeStatusUpdatedMessage action )
		{
			SetStatus( action.Status );
		}