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
All Methods Instance Methods Concrete Methods 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 Detail
-
PneumaticsControlModule
public PneumaticsControlModule()
Constructs a PneumaticsControlModule with the default id (0).
-
PneumaticsControlModule
public PneumaticsControlModule(int module)
Constructs a PneumaticsControlModule.- Parameters:
module
- module number to construct
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacePneumaticsBase
-
getCompressor
public boolean getCompressor()
- Specified by:
getCompressor
in interfacePneumaticsBase
-
getPressureSwitch
public boolean getPressureSwitch()
- Specified by:
getPressureSwitch
in interfacePneumaticsBase
-
getCompressorCurrent
public double getCompressorCurrent()
- Specified by:
getCompressorCurrent
in interfacePneumaticsBase
-
getCompressorCurrentTooHighFault
public boolean getCompressorCurrentTooHighFault()
-
getCompressorCurrentTooHighStickyFault
public boolean getCompressorCurrentTooHighStickyFault()
-
getCompressorShortedFault
public boolean getCompressorShortedFault()
-
getCompressorShortedStickyFault
public boolean getCompressorShortedStickyFault()
-
getCompressorNotConnectedFault
public boolean getCompressorNotConnectedFault()
-
getCompressorNotConnectedStickyFault
public boolean getCompressorNotConnectedStickyFault()
-
setSolenoids
public void setSolenoids(int mask, int values)
Description copied from interface:PneumaticsBase
Sets solenoids on a pneumatics module.- Specified by:
setSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- maskvalues
- values
-
getSolenoids
public int getSolenoids()
Description copied from interface:PneumaticsBase
Gets solenoid values.- Specified by:
getSolenoids
in interfacePneumaticsBase
- Returns:
- values
-
getModuleNumber
public int getModuleNumber()
Description copied from interface:PneumaticsBase
Get module number for this module.- Specified by:
getModuleNumber
in interfacePneumaticsBase
- Returns:
- module number
-
getSolenoidDisabledList
public int getSolenoidDisabledList()
Description copied from interface:PneumaticsBase
Get the disabled solenoids.- Specified by:
getSolenoidDisabledList
in interfacePneumaticsBase
- Returns:
- disabled list
-
getSolenoidVoltageFault
public boolean getSolenoidVoltageFault()
-
getSolenoidVoltageStickyFault
public boolean getSolenoidVoltageStickyFault()
-
clearAllStickyFaults
public void clearAllStickyFaults()
-
fireOneShot
public void fireOneShot(int index)
Description copied from interface:PneumaticsBase
Fire a single solenoid shot.- Specified by:
fireOneShot
in interfacePneumaticsBase
- Parameters:
index
- solenoid index
-
setOneShotDuration
public void setOneShotDuration(int index, int durMs)
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
public boolean checkSolenoidChannel(int channel)
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
public int checkAndReserveSolenoids(int mask)
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
public void unreserveSolenoids(int mask)
Description copied from interface:PneumaticsBase
Unreserve the masked solenoids.- Specified by:
unreserveSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- The solenoid mask to unreserve
-
makeSolenoid
public Solenoid makeSolenoid(int channel)
- Specified by:
makeSolenoid
in interfacePneumaticsBase
-
makeDoubleSolenoid
public DoubleSolenoid makeDoubleSolenoid(int forwardChannel, int reverseChannel)
- Specified by:
makeDoubleSolenoid
in interfacePneumaticsBase
-
makeCompressor
public Compressor makeCompressor()
- Specified by:
makeCompressor
in interfacePneumaticsBase
-
reserveCompressor
public boolean reserveCompressor()
- Specified by:
reserveCompressor
in interfacePneumaticsBase
-
unreserveCompressor
public void unreserveCompressor()
- Specified by:
unreserveCompressor
in interfacePneumaticsBase
-
disableCompressor
public void disableCompressor()
- Specified by:
disableCompressor
in interfacePneumaticsBase
-
enableCompressorDigital
public void enableCompressorDigital()
- Specified by:
enableCompressorDigital
in interfacePneumaticsBase
-
enableCompressorAnalog
public void enableCompressorAnalog(double minPressure, double maxPressure)
- Specified by:
enableCompressorAnalog
in interfacePneumaticsBase
-
enableCompressorHybrid
public void enableCompressorHybrid(double minPressure, double maxPressure)
- Specified by:
enableCompressorHybrid
in interfacePneumaticsBase
-
getCompressorConfigType
public CompressorConfigType getCompressorConfigType()
- Specified by:
getCompressorConfigType
in interfacePneumaticsBase
-
getAnalogVoltage
public double getAnalogVoltage(int channel)
- Specified by:
getAnalogVoltage
in interfacePneumaticsBase
-
getPressure
public double getPressure(int channel)
- Specified by:
getPressure
in interfacePneumaticsBase
-
-