REVPHSim
- class wpilib.simulation.REVPHSim(*args, **kwargs)
Bases:
PneumaticsBaseSim
Class to control a simulated Pneumatic Control Module (PCM).
Overloaded function.
__init__(self: wpilib.simulation._simulation.REVPHSim) -> None
Constructs with the default PCM module number (CAN ID).
__init__(self: wpilib.simulation._simulation.REVPHSim, module: int) -> None
Constructs from a PCM module number (CAN ID).
- Parameters:
module – module number
__init__(self: wpilib.simulation._simulation.REVPHSim, pneumatics: wpilib._wpilib.PneumaticsBase) -> None
- getAllSolenoidOutputs() int
- getCompressorConfigType() int
Check whether the closed loop compressor control is active.
- Returns:
compressor config type
- getCompressorCurrent() float
- getCompressorOn() bool
Check if the compressor is on.
- Returns:
true if the compressor is active
- getInitialized() bool
- getPressureSwitch() bool
- getSolenoidOutput(channel: int) bool
- registerCompressorConfigTypeCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
Register a callback to be run whenever the closed loop state changes.
- Parameters:
callback – the callback
initialNotify – whether the callback should be called with the initial value
- Returns:
the CallbackStore object associated with this callback
- registerCompressorCurrentCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
- registerCompressorOnCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
- registerInitializedCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
- registerPressureSwitchCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
- registerSolenoidOutputCallback(channel: int, callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
- resetData() None
- setAllSolenoidOutputs(outputs: int) None
- setCompressorConfigType(compressorConfigType: int) None
Turn on/off the closed loop control of the compressor.
- Parameters:
compressorConfigType – compressor config type
- setCompressorCurrent(compressorCurrent: float) None
- setCompressorOn(compressorOn: bool) None
Set whether the compressor is active.
- Parameters:
compressorOn – the new value
- setInitialized(solenoidInitialized: bool) None
- setPressureSwitch(pressureSwitch: bool) None
- setSolenoidOutput(channel: int, solenoidOutput: bool) None