Class SpectrumState

All Implemented Interfaces:
BooleanSupplier

public class SpectrumState extends Trigger
  • Constructor Details

    • SpectrumState

      public SpectrumState(String name)
      Create a new EventTrigger. This will run on the EventScheduler's event loop, which will be polled any time a path following command is running.
      Parameters:
      name - The name of the event. This will be the name of the event marker in the GUI
    • SpectrumState

      public SpectrumState(edu.wpi.first.wpilibj.event.EventLoop eventLoop, String name)
      Create a new EventTrigger that gets polled by the given event loop instead of the EventScheduler
      Parameters:
      eventLoop - The event loop to poll this trigger
      name - The name of the event. This will be the name of the event marker in the GUI
  • Method Details

    • setState

      public void setState(boolean value)
      Directly set the spectrum state to the specified value
      Parameters:
      value - The value to set the state to
    • setTrueWhileRunning

      public edu.wpi.first.wpilibj2.command.Command setTrueWhileRunning()
      Create a command that will set the state to true while the command is running Then it will set to false once it is cancelled
      Returns:
      the command
    • setTrueForTime

      public edu.wpi.first.wpilibj2.command.Command setTrueForTime(DoubleSupplier time)
    • setFalseForTime

      public edu.wpi.first.wpilibj2.command.Command setFalseForTime(DoubleSupplier time)
    • setTrueForTimeWithCancel

      public edu.wpi.first.wpilibj2.command.Command setTrueForTimeWithCancel(DoubleSupplier time, Trigger cancelCondition)
    • toggleToTrue

      public edu.wpi.first.wpilibj2.command.Command toggleToTrue()
      Command to set state to false, and then to true, ensuring your state will trigger actions
      Returns:
      the command
    • toggleToFalse

      public edu.wpi.first.wpilibj2.command.Command toggleToFalse()
      Command to set state to true, and then to false, ensuring your state will trigger change to false actions
      Returns:
    • set

      public edu.wpi.first.wpilibj2.command.Command set(boolean value)
      Parameters:
      value -
      Returns:
    • setTrue

      public edu.wpi.first.wpilibj2.command.Command setTrue()
    • setFalse

      public edu.wpi.first.wpilibj2.command.Command setFalse()
    • toggle

      public edu.wpi.first.wpilibj2.command.Command toggle()
    • setCondition

      protected static void setCondition(String name, boolean value)
      Set the value of an event condition
      Parameters:
      name - The name of the condition
      value - The value of the condition