Class BaseParallelDeadlineGroup

java.lang.Object
org.wpilib.command2.Command
xbot.common.command.BaseCommand
xbot.common.command.BaseParallelDeadlineGroup
All Implemented Interfaces:
AutoCloseable, org.wpilib.telemetry.TelemetryLoggable, org.wpilib.tunable.ComplexTunable, TunablePrefixProvider

public class BaseParallelDeadlineGroup extends BaseCommand
A command composition that runs a set of commands in parallel, ending only when a specific command (the "deadline") ends, interrupting all other commands that are still running at that point.

The rules for command compositions apply: command instances that are passed to it cannot be added to any other composition or scheduled individually, and the composition requires all subsystems its components require.

This class is provided by the NewCommands VendorDep

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.wpilib.command2.Command

    org.wpilib.command2.Command.InterruptionBehavior
  • Field Summary

    Fields inherited from class BaseCommand

    aKitLog, log, monitor, runningAlert
  • Constructor Summary

    Constructors
    Constructor
    Description
    BaseParallelDeadlineGroup(org.wpilib.command2.Command deadline, org.wpilib.command2.Command... otherCommands)
    Creates a new ParallelDeadlineGroup.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    addCommands(org.wpilib.command2.Command... commands)
    Adds the given commands to the group.
    final void
    end(boolean interrupted)
     
    final void
     
    org.wpilib.command2.Command.InterruptionBehavior
     
    final void
     
    final boolean
     
    boolean
     
    final void
    setDeadline(org.wpilib.command2.Command deadline)
    Sets the deadline to the given command.

    Methods inherited from class org.wpilib.command2.Command

    addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, finallyDo, finallyDo, getName, getRequirements, getTelemetryType, getTunableType, handleInterrupt, hasRequirement, ignoringDisable, isScheduled, logTo, onlyIf, onlyWhile, publishTunable, raceWith, repeatedly, setName, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.wpilib.tunable.ComplexTunable

    publishChildTunable, publishChildTunable, removeChildTunable, setChildTunableChanged, updateTunable
  • Constructor Details

    • BaseParallelDeadlineGroup

      public BaseParallelDeadlineGroup(org.wpilib.command2.Command deadline, org.wpilib.command2.Command... otherCommands)
      Creates a new ParallelDeadlineGroup. The given commands, including the deadline, will be executed simultaneously. The composition will finish when the deadline finishes, interrupting all other still-running commands. If the composition is interrupted, only the commands still running will be interrupted.
      Parameters:
      deadline - the command that determines when the composition ends
      otherCommands - the other commands to be executed
      Throws:
      IllegalArgumentException - if the deadline command is also in the otherCommands argument
  • Method Details

    • setDeadline

      public final void setDeadline(org.wpilib.command2.Command deadline)
      Sets the deadline to the given command. The deadline is added to the group if it is not already contained.
      Parameters:
      deadline - the command that determines when the group ends
      Throws:
      IllegalArgumentException - if the deadline command is already in the composition
    • addCommands

      public final void addCommands(org.wpilib.command2.Command... commands)
      Adds the given commands to the group.
      Parameters:
      commands - Commands to add to the group.
    • initialize

      public final void initialize()
      Overrides:
      initialize in class BaseCommand
    • execute

      public final void execute()
      Overrides:
      execute in class org.wpilib.command2.Command
    • end

      public final void end(boolean interrupted)
      Overrides:
      end in class BaseCommand
    • isFinished

      public final boolean isFinished()
      Overrides:
      isFinished in class org.wpilib.command2.Command
    • runsWhenDisabled

      public boolean runsWhenDisabled()
      Overrides:
      runsWhenDisabled in class BaseCommand
    • getInterruptionBehavior

      public org.wpilib.command2.Command.InterruptionBehavior getInterruptionBehavior()
      Overrides:
      getInterruptionBehavior in class org.wpilib.command2.Command