Class SolenoidSubsystem

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
lib.subsystems.SolenoidSubsystem
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Subsystem

public class SolenoidSubsystem extends edu.wpi.first.wpilibj2.command.SubsystemBase
A class that wraps multiple DoubleSolenoid objects with subsystem functionality. Allows for easy inversion and setting of default state of solenoids
  • Field Details

  • Constructor Details

    • SolenoidSubsystem

      public SolenoidSubsystem(String name, boolean isInverted, SolenoidSubsystem.SolenoidState defaultState, edu.wpi.first.wpilibj.DoubleSolenoid... solenoids)
      A class that wraps multiple DoubleSolenoid objects with subsystem functionality. Allows for easy inversion and setting of default state of solenoids
      Parameters:
      name - Name of the subsystem
      isInverted - True if the solenoids should be inverted
      defaultState - Set the default state of the SolenoidSystem
      solenoids - Double solenoids of the system
    • SolenoidSubsystem

      public SolenoidSubsystem(boolean isInverted, SolenoidSubsystem.SolenoidState defaultState, edu.wpi.first.wpilibj.DoubleSolenoid... solenoids)
      A class that wraps multiple DoubleSolenoid objects with subsystem functionality. Allows for easy inversion and setting of default state of solenoids
      Parameters:
      isInverted - True if the solenoids should be inverted
      defaultState - Set the default state of the SolenoidSystem
      solenoids - Double solenoids of the system
    • SolenoidSubsystem

      public SolenoidSubsystem(boolean isInverted, edu.wpi.first.wpilibj.DoubleSolenoid... solenoids)
      A class that wraps multiple DoubleSolenoid objects with subsystem functionality. Allows for easy inversion and setting of default state of solenoids
      Parameters:
      isInverted - True if the solenoids should be inverted
      solenoids - Double solenoids of the system
    • SolenoidSubsystem

      public SolenoidSubsystem(SolenoidSubsystem.SolenoidState defaultState, edu.wpi.first.wpilibj.DoubleSolenoid... solenoids)
      A class that wraps multiple DoubleSolenoid objects with subsystem functionality. Allows for easy inversion and setting of default state of solenoids
      Parameters:
      defaultState - Set the default state of the SolenoidSystem
      solenoids - Double solenoids of the system
    • SolenoidSubsystem

      public SolenoidSubsystem(edu.wpi.first.wpilibj.DoubleSolenoid... solenoids)
      A class that wraps multiple DoubleSolenoid objects with subsystem functionality. Allows for easy inversion and setting of default state of solenoids
      Parameters:
      solenoids - Double solenoids of the system
  • Method Details

    • getState

      Returns:
      Returns the current state of the system
    • invertState

      Inverts the state given
      Parameters:
      state - SolenoidState to be inverted
      Returns:
      SolenoidState Inverted state
    • set

      public void set(SolenoidSubsystem.SolenoidState state)
      Sets the state of the system. Only sets if current state is not equal to state to be set
      Parameters:
      state - State to set system
    • setOverride

      public void setOverride(SolenoidSubsystem.SolenoidState state)
      Sets the state of the system regardless of current state
      Parameters:
      state - State to set
    • getSolenoids

      public edu.wpi.first.wpilibj.DoubleSolenoid[] getSolenoids()
      Returns:
      solenoids DoubleSolenoid objects of the system
    • isExtended

      public boolean isExtended()
      Returns whether the solenoid is extended.
      Returns:
      extended