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
FieldsFields inherited from class xbot.common.command.BaseSubsystem
aKitLog, dataFrameRefreshables, log -
Constructor Summary
ConstructorsConstructorDescriptionCompressorSubsystem(XCompressor.XCompressorFactory compressorFactory, PropertyFactory pf) Create a new CompressorSubsystem. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Disable the compressor.voidenable()Enable the compressor.doubleGets the current consumed by the compressor.final CommandGets a command to disable the compressor.final CommandGets a command to enable the compressor.booleanGets whether the compressor is enabled.voidperiodic()This method is called on eachCommandSchedulerloop.Methods inherited from class xbot.common.command.BaseSubsystem
getPrefix, refreshDataFrame, registerDataFrameRefreshableMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:BaseSubsystemThis method is called on eachCommandSchedulerloop.- Specified by:
periodicin interfaceSubsystem- Overrides:
periodicin classBaseSubsystem
-