Package edu.wpi.first.wpilibj
Class PneumaticsControlModule
java.lang.Object
edu.wpi.first.wpilibj.PneumaticsControlModule
- All Implemented Interfaces:
PneumaticsBase
,AutoCloseable
public class PneumaticsControlModule extends Object implements PneumaticsBase
Module class for controlling a Cross The Road Electronics Pneumatics Control Module.
-
Constructor Summary
Constructors Constructor Description PneumaticsControlModule()
Constructs a PneumaticsControlModule with the default id (0).PneumaticsControlModule(int module)
Constructs a PneumaticsControlModule. -
Method Summary
Modifier and Type Method Description int
checkAndReserveSolenoids(int mask)
Check to see if the masked solenoids can be reserved, and if not reserve them.boolean
checkSolenoidChannel(int channel)
Check if a solenoid channel is valid.void
clearAllStickyFaults()
void
close()
void
disableCompressor()
void
enableCompressorAnalog(double minPressure, double maxPressure)
void
enableCompressorDigital()
void
enableCompressorHybrid(double minPressure, double maxPressure)
void
fireOneShot(int index)
Fire a single solenoid shot.double
getAnalogVoltage(int channel)
boolean
getCompressor()
CompressorConfigType
getCompressorConfigType()
double
getCompressorCurrent()
boolean
getCompressorCurrentTooHighFault()
boolean
getCompressorCurrentTooHighStickyFault()
boolean
getCompressorNotConnectedFault()
boolean
getCompressorNotConnectedStickyFault()
boolean
getCompressorShortedFault()
boolean
getCompressorShortedStickyFault()
int
getModuleNumber()
Get module number for this module.double
getPressure(int channel)
boolean
getPressureSwitch()
int
getSolenoidDisabledList()
Get the disabled solenoids.int
getSolenoids()
Gets solenoid values.boolean
getSolenoidVoltageFault()
boolean
getSolenoidVoltageStickyFault()
Compressor
makeCompressor()
DoubleSolenoid
makeDoubleSolenoid(int forwardChannel, int reverseChannel)
Solenoid
makeSolenoid(int channel)
boolean
reserveCompressor()
void
setOneShotDuration(int index, int durMs)
Set the duration for a single solenoid shot.void
setSolenoids(int mask, int values)
Sets solenoids on a pneumatics module.void
unreserveCompressor()
void
unreserveSolenoids(int mask)
Unreserve the masked solenoids.
-
Constructor Details
-
PneumaticsControlModule
public PneumaticsControlModule()Constructs a PneumaticsControlModule with the default id (0). -
PneumaticsControlModule
Constructs a PneumaticsControlModule.- Parameters:
module
- module number to construct
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacePneumaticsBase
-
getCompressor
- Specified by:
getCompressor
in interfacePneumaticsBase
-
getPressureSwitch
- Specified by:
getPressureSwitch
in interfacePneumaticsBase
-
getCompressorCurrent
- Specified by:
getCompressorCurrent
in interfacePneumaticsBase
-
getCompressorCurrentTooHighFault
-
getCompressorCurrentTooHighStickyFault
-
getCompressorShortedFault
-
getCompressorShortedStickyFault
-
getCompressorNotConnectedFault
-
getCompressorNotConnectedStickyFault
-
setSolenoids
Description copied from interface:PneumaticsBase
Sets solenoids on a pneumatics module.- Specified by:
setSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- maskvalues
- values
-
getSolenoids
Description copied from interface:PneumaticsBase
Gets solenoid values.- Specified by:
getSolenoids
in interfacePneumaticsBase
- Returns:
- values
-
getModuleNumber
Description copied from interface:PneumaticsBase
Get module number for this module.- Specified by:
getModuleNumber
in interfacePneumaticsBase
- Returns:
- module number
-
getSolenoidDisabledList
Description copied from interface:PneumaticsBase
Get the disabled solenoids.- Specified by:
getSolenoidDisabledList
in interfacePneumaticsBase
- Returns:
- disabled list
-
getSolenoidVoltageFault
-
getSolenoidVoltageStickyFault
-
clearAllStickyFaults
-
fireOneShot
Description copied from interface:PneumaticsBase
Fire a single solenoid shot.- Specified by:
fireOneShot
in interfacePneumaticsBase
- Parameters:
index
- solenoid index
-
setOneShotDuration
Description copied from interface:PneumaticsBase
Set the duration for a single solenoid shot.- Specified by:
setOneShotDuration
in interfacePneumaticsBase
- Parameters:
index
- solenoid indexdurMs
- shot duration
-
checkSolenoidChannel
Description copied from interface:PneumaticsBase
Check if a solenoid channel is valid.- Specified by:
checkSolenoidChannel
in interfacePneumaticsBase
- Parameters:
channel
- Channel to check- Returns:
- True if channel exists
-
checkAndReserveSolenoids
Description copied from interface:PneumaticsBase
Check to see if the masked solenoids can be reserved, and if not reserve them.- Specified by:
checkAndReserveSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- The solenoid mask to reserve- Returns:
- 0 if successful, mask of solenoids that couldn't be allocated otherwise
-
unreserveSolenoids
Description copied from interface:PneumaticsBase
Unreserve the masked solenoids.- Specified by:
unreserveSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- The solenoid mask to unreserve
-
makeSolenoid
- Specified by:
makeSolenoid
in interfacePneumaticsBase
-
makeDoubleSolenoid
- Specified by:
makeDoubleSolenoid
in interfacePneumaticsBase
-
makeCompressor
- Specified by:
makeCompressor
in interfacePneumaticsBase
-
reserveCompressor
- Specified by:
reserveCompressor
in interfacePneumaticsBase
-
unreserveCompressor
- Specified by:
unreserveCompressor
in interfacePneumaticsBase
-
disableCompressor
- Specified by:
disableCompressor
in interfacePneumaticsBase
-
enableCompressorDigital
- Specified by:
enableCompressorDigital
in interfacePneumaticsBase
-
enableCompressorAnalog
- Specified by:
enableCompressorAnalog
in interfacePneumaticsBase
-
enableCompressorHybrid
- Specified by:
enableCompressorHybrid
in interfacePneumaticsBase
-
getCompressorConfigType
- Specified by:
getCompressorConfigType
in interfacePneumaticsBase
-
getAnalogVoltage
- Specified by:
getAnalogVoltage
in interfacePneumaticsBase
-
getPressure
- Specified by:
getPressure
in interfacePneumaticsBase
-