public GameControllerAxisCommandState(GameControllerAxisCommand command, bool highspeed, bool reverse)
 {
     Command   = command;
     Highspeed = highspeed;
     Reverse   = reverse;
     Timestamp = DateTime.Now.Ticks;
 }
        private void HandleAxisCommand(GameControllerAxisCommand command, GameControllerUpdateNotification notification, bool reverse, bool highspeed)
        {
            if (IsParked || !IsConnected)
            {
                return;
            }
            ASCOM.DeviceInterface.TelescopeAxes axis = ASCOM.DeviceInterface.TelescopeAxes.axisPrimary;
            double rate;

            switch (command)
            {
            case GameControllerAxisCommand.SlewNSLowSpeed:
            case GameControllerAxisCommand.SlewNSHighSpeed:
            case GameControllerAxisCommand.SlewNSDualSpeed:
                if (highspeed)
                {
                    rate = MaxDecSlewRate * Constants.SIDEREAL_RATE_DEGREES;
                }
                else
                {
                    rate = Settings.SlewRatePreset.DecRate * Constants.SIDEREAL_RATE_DEGREES;
                }
                axis = ASCOM.DeviceInterface.TelescopeAxes.axisSecondary;
                break;

            case GameControllerAxisCommand.SlewEWLowSpeed:
            case GameControllerAxisCommand.SlewEWHighSpeed:
            case GameControllerAxisCommand.SlewEWDualSpeed:
                if (highspeed)
                {
                    rate = MaxRASlewRate * Constants.SIDEREAL_RATE_DEGREES;
                }
                else
                {
                    rate = Settings.SlewRatePreset.RARate * Constants.SIDEREAL_RATE_DEGREES;
                }
                axis = ASCOM.DeviceInterface.TelescopeAxes.axisPrimary;
                break;

            default:
                return;
            }
            if (notification == GameControllerUpdateNotification.CommandUp)
            {
                // Stop slew
                Driver.MoveAxis(axis, 0.0);
            }
            else if (notification == GameControllerUpdateNotification.CommandDown)
            {
                if (reverse)
                {
                    rate = -rate;
                }
                Driver.MoveAxis(axis, rate);
            }
        }
 public GameControllerProgressArgs(GameControllerUpdateNotification notification, GameControllerAxisCommand command, bool reverse, bool highspeed) : this(notification, command)
 {
     this.Reverse   = reverse;
     this.Highspeed = highspeed;
 }
 public GameControllerProgressArgs(GameControllerUpdateNotification notification, GameControllerAxisCommand command)
 {
     this.Notification = notification;
     this.AxisCommand  = command;
 }
 public GameControllerAxisMapping(GameControllerAxisCommand command, bool reverseDirection) : base()
 {
     this.Command          = command;
     this.ReverseDirection = reverseDirection;
 }