Class AutoProgram

java.lang.Object
org.wildstang.framework.auto.AutoProgram
Direct Known Subclasses:
Sleeper

public abstract class AutoProgram extends Object
Represents a collection of AutoSteps used for a single Autonomous period.
  • Field Details

    • programSteps

      protected final List<AutoStep> programSteps
    • currentStep

      protected int currentStep
    • finishedPreviousStep

      protected boolean finishedPreviousStep
    • finished

      protected boolean finished
    • programStarted

      protected boolean programStarted
  • Constructor Details

    • AutoProgram

      public AutoProgram()
  • Method Details

    • defineSteps

      protected abstract void defineSteps()
      Use this method to set the steps for this program. Programs execute the steps in the array programSteps serially. Remember to clear everything before all of your steps are finished, because once they are, it immediately drops into Sleeper.
    • initialize

      public void initialize()
      Collects the defined steps and starts the auto program.
    • cleanup

      public void cleanup()
      Remove all steps from the AutoProgram
    • areStepsDefined

      public boolean areStepsDefined()
      Determines if the program's steps have been defined.
      Returns:
      Returns true if there are any steps.
    • update

      public void update()
      Update the current running step and move on if necessary.
    • getCurrentStep

      public AutoStep getCurrentStep()
      Returns the current running AutoStep within the AutoProgram.
      Returns:
      Current running AutoStep.
    • getNextStep

      public AutoStep getNextStep()
      Returns the next AutoStep to run or null if at the last step.
      Returns:
      Next AutoStep or null if no more steps.
    • loadStopPosition

      protected void loadStopPosition()
      Adds an AutoStepStopAutonomous after a given AutoStep index from config. This allows insertion of a force stop of autonomous into a program via config.
    • isFinished

      public boolean isFinished()
      Returns true if the AutoProgram is complete.
      Returns:
      True if the AutoProgram is complete.
    • addStep

      protected void addStep(AutoStep newStep)
      Adds a new AutoStep to the AutoProgram.
      Parameters:
      newStep - New AutoStep to add.
    • toString

      public abstract String toString()
      Returns the name of the AutoProgram.
      Overrides:
      toString in class Object
      Returns:
      Name of the AutoProgram.