Class CompressorSubsystem
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
xbot.common.command.BaseSubsystem
xbot.common.subsystems.compressor.CompressorSubsystem
- All Implemented Interfaces:
Sendable
,Subsystem
,DataFrameRefreshable
,IPropertySupport
Subsystem for managing compressor state.
-
Field Summary
Fields inherited from class xbot.common.command.BaseSubsystem
aKitLog, dataFrameRefreshables, log
-
Constructor Summary
ConstructorDescriptionCompressorSubsystem
(XCompressor.XCompressorFactory compressorFactory, PropertyFactory pf) Create a new CompressorSubsystem. -
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
Disable the compressor.void
enable()
Enable the compressor.double
Gets the current consumed by the compressor.final Command
Gets a command to disable the compressor.final Command
Gets a command to enable the compressor.boolean
Gets whether the compressor is enabled.void
periodic()
This method is called on eachCommandScheduler
loop.Methods inherited from class xbot.common.command.BaseSubsystem
getPrefix, refreshDataFrame, registerDataFrameRefreshable
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
compressor
-
-
Constructor Details
-
CompressorSubsystem
@Inject public CompressorSubsystem(XCompressor.XCompressorFactory compressorFactory, PropertyFactory pf) Create a new CompressorSubsystem.- Parameters:
compressorFactory
- The compressor factory.pf
- The property 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
Gets a command to enable the compressor.- Returns:
- The command.
-
getDisableCommand
Gets a command to disable the compressor.- Returns:
- The command.
-
periodic
public void periodic()Description copied from class:BaseSubsystem
This method is called on eachCommandScheduler
loop.- Specified by:
periodic
in interfaceSubsystem
- Overrides:
periodic
in classBaseSubsystem
-