PneumaticsBaseSim
- class wpilib.simulation.PneumaticsBaseSim(*args, **kwargs)
Bases:
pybind11_object
Overloaded function.
__init__(self: wpilib.simulation._simulation.PneumaticsBaseSim, index: int) -> None
Constructs a PneumaticsBaseSim with the given index.
- Parameters:
index – The index.
__init__(self: wpilib.simulation._simulation.PneumaticsBaseSim, module: wpilib._wpilib.PneumaticsBase) -> None
Constructs a PneumaticsBaseSim for the given module.
- Parameters:
module – The module.
- getAllSolenoidOutputs() int
Get the current value of all solenoid outputs.
- Returns:
the solenoid outputs (1 bit per output)
- getCompressorCurrent() float
Read the compressor current.
- Returns:
the current of the compressor connected to this module
- getCompressorOn() bool
Check if the compressor is on.
- Returns:
true if the compressor is active
- static getForType(module: int, type: wpilib._wpilib.PneumaticsModuleType) wpilib.simulation._simulation.PneumaticsBaseSim
- getInitialized() bool
Check whether the PCM/PH has been initialized.
- Returns:
true if initialized
- getPressureSwitch() bool
Check the value of the pressure switch.
- Returns:
the pressure switch value
- getSolenoidOutput(channel: int) bool
Check the solenoid output on a specific channel.
- Parameters:
channel – the channel to check
- Returns:
the solenoid output
- registerCompressorCurrentCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
Register a callback to be run whenever the compressor current changes.
- Parameters:
callback – the callback
initialNotify – whether to call the callback with the initial state
- Returns:
the
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.
- registerCompressorOnCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
Register a callback to be run when the compressor activates.
- Parameters:
callback – the callback
initialNotify – whether to run the callback with the initial state
- Returns:
the
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.
- registerInitializedCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
Register a callback to be run when the PCM/PH is initialized.
- Parameters:
callback – the callback
initialNotify – whether to run the callback with the initial state
- Returns:
the
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.
- registerPressureSwitchCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
Register a callback to be run whenever the pressure switch value changes.
- Parameters:
callback – the callback
initialNotify – whether the callback should be called with the initial value
- Returns:
the
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.
- registerSolenoidOutputCallback(channel: int, callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
Register a callback to be run when the solenoid output on a channel changes.
- Parameters:
channel – the channel to monitor
callback – the callback
initialNotify – should the callback be run with the initial value
- Returns:
the
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.
- resetData() None
Reset all simulation data for this object.
- setAllSolenoidOutputs(outputs: int) None
Change all of the solenoid outputs.
- Parameters:
outputs – the new solenoid outputs (1 bit per output)
- setCompressorCurrent(compressorCurrent: float) None
Set the compressor current.
- Parameters:
compressorCurrent – the new compressor current
- setCompressorOn(compressorOn: bool) None
Set whether the compressor is active.
- Parameters:
compressorOn – the new value
- setInitialized(initialized: bool) None
Define whether the PCM/PH has been initialized.
- Parameters:
initialized – true for initialized
- setPressureSwitch(pressureSwitch: bool) None
Set the value of the pressure switch.
- Parameters:
pressureSwitch – the new value
- setSolenoidOutput(channel: int, solenoidOutput: bool) None
Change the solenoid output on a specific channel.
- Parameters:
channel – the channel to check
solenoidOutput – the new solenoid output