Class CompressorSubsystem
java.lang.Object
org.wpilib.command2.SubsystemBase
xbot.common.command.BaseSubsystem
xbot.common.subsystems.compressor.CompressorSubsystem
- All Implemented Interfaces:
org.wpilib.command2.Subsystem, org.wpilib.telemetry.TelemetryLoggable, TunablePrefixProvider
Subsystem for managing compressor state.
-
Field Summary
FieldsFields inherited from class BaseSubsystem
aKitLog, log -
Constructor Summary
ConstructorsConstructorDescriptionCompressorSubsystem(XCompressor.XCompressorFactory compressorFactory, TunableFactory tunableFactory) Create a new CompressorSubsystem. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Disable the compressor.voidenable()Enable the compressor.doubleGets the current consumed by the compressor.final org.wpilib.command2.CommandGets a command to disable the compressor.final org.wpilib.command2.CommandGets a command to enable the compressor.booleanGets whether the compressor is enabled.voidperiodic()This method is called on eachCommandSchedulerloop.Methods inherited from class BaseSubsystem
getPrefixMethods inherited from class org.wpilib.command2.SubsystemBase
getName, getTelemetryType, logTo, setNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wpilib.command2.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
compressor
-
-
Constructor Details
-
CompressorSubsystem
@Inject public CompressorSubsystem(XCompressor.XCompressorFactory compressorFactory, TunableFactory tunableFactory) Create a new CompressorSubsystem.- Parameters:
compressorFactory- The compressor factory.tunableFactory- The tunable factory.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Gets whether the compressor is enabled.- Returns:
- True if enabled, false if not.
-
enable
public void enable()Enable the compressor. -
disable
public void disable()Disable the compressor. -
getCompressorCurrent
public double getCompressorCurrent()Gets the current consumed by the compressor.- Returns:
- The current in amps.
-
getEnableCommand
public final org.wpilib.command2.Command getEnableCommand()Gets a command to enable the compressor.- Returns:
- The command.
-
getDisableCommand
public final org.wpilib.command2.Command getDisableCommand()Gets a command to disable the compressor.- Returns:
- The command.
-
periodic
public void periodic()Description copied from class:BaseSubsystemThis method is called on eachCommandSchedulerloop.- Specified by:
periodicin interfaceorg.wpilib.command2.Subsystem- Overrides:
periodicin classBaseSubsystem
-