Пример #1
0
      private void SetMovementButtons(ValueCycleButton stateButton, ValueToggleButton directionButton, ValueToggleButton axialButton, ValueToggleButton circumferentialButton, ValueToggleButton cornerAxialButton, ValueToggleButton launchAxialButton, MovementMotorParameters parameters)
      {
         int stateOption = 0;

         if (MotorStates.Enabled == parameters.State)
         {
            stateOption = 1;
         }
         else if (MotorStates.Disabled == parameters.State)
         {
            stateOption = 2;
         }
         else if (MotorStates.Locked == parameters.State)
         {
            stateOption = 3;
         }

         stateButton.SelectedOption = stateOption;


         bool directionOption = false;

         if (MotorDirections.Normal == parameters.Direction)
         {
            directionOption = true;
         }
         else
         {
            directionOption = false;
         }

         directionButton.OptionASelected = directionOption;


         bool axialOption = false;

         if (MovementForwardControls.velocity == parameters.AxialMode)
         {
            axialOption = true;
         }
         else
         {
            axialOption = false;
         }

         axialButton.OptionASelected = axialOption;


         bool circumferentialOption = false;

         if (MovementForwardControls.velocity == parameters.CircumferentialMode)
         {
            circumferentialOption = true;
         }
         else
         {
            circumferentialOption = false;
         }

         circumferentialButton.OptionASelected = circumferentialOption;


         bool cornerAxialOption = false;

         if (MovementForwardControls.velocity == parameters.CornerAxialMode)
         {
            cornerAxialOption = true;
         }
         else
         {
            cornerAxialOption = false;
         }

         cornerAxialButton.OptionASelected = cornerAxialOption;


         bool launchAxialOption = false;

         if (MovementForwardControls.velocity == parameters.LaunchAxialMode)
         {
            launchAxialOption = true;
         }
         else
         {
            launchAxialOption = false;
         }

         launchAxialButton.OptionASelected = launchAxialOption;
      }
Пример #2
0
      private void SetFeederButtons(ValueCycleButton stateButton, ValueToggleButton directionButton, FeederMotorParameters parameters)
      {         
         int stateOption = 0;

         if (MotorStates.Enabled == parameters.State)
         {
            stateOption = 1;
         }
         else if (MotorStates.Disabled == parameters.State)
         {
            stateOption = 2;
         }
         else if (MotorStates.Locked == parameters.State)
         {
            stateOption = 3;
         }

         stateButton.SelectedOption = stateOption;


         bool directionOption = false;

         if (MotorDirections.Normal == parameters.Direction)
         {
            directionOption = true;
         }
         else 
         {
            directionOption = false;
         }

         directionButton.OptionASelected = directionOption;
      }