PneumaticsBaseSim

class wpilib.simulation.PneumaticsBaseSim(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.PneumaticsBaseSim, index: typing.SupportsInt | typing.SupportsIndex) -> None

Constructs a PneumaticsBaseSim with the given index.

Parameters:

index – The index.

  1. __init__(self: wpilib.simulation._simulation.PneumaticsBaseSim, module: wpilib._wpilib.PneumaticsBase) -> None

Constructs a PneumaticsBaseSim for the given module.

Parameters:

module – The module.

get_all_solenoid_outputs() int

Get the current value of all solenoid outputs.

Returns:

the solenoid outputs (1 bit per output)

get_compressor_current() float

Read the compressor current.

Returns:

the current of the compressor connected to this module

get_compressor_on() bool

Check if the compressor is on.

Returns:

true if the compressor is active

static get_for_type(module: SupportsInt | SupportsIndex, type: wpilib._wpilib.PneumaticsModuleType) wpilib.simulation._simulation.PneumaticsBaseSim
get_initialized() bool

Check whether the PCM/PH has been initialized.

Returns:

true if initialized

get_pressure_switch() bool

Check the value of the pressure switch.

Returns:

the pressure switch value

get_solenoid_output(channel: SupportsInt | SupportsIndex) bool

Check the solenoid output on a specific channel.

Parameters:

channel – the channel to check

Returns:

the solenoid output

register_compressor_current_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the compressor current changes.

Parameters:
  • callback – the callback

  • initial_notify – 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.

register_compressor_on_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run when the compressor activates.

Parameters:
  • callback – the callback

  • initial_notify – 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.

register_initialized_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run when the PCM/PH is initialized.

Parameters:
  • callback – the callback

  • initial_notify – 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.

register_pressure_switch_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the pressure switch value changes.

Parameters:
  • callback – the callback

  • initial_notify – 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.

register_solenoid_output_callback(channel: SupportsInt | SupportsIndex, callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: 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

  • initial_notify – 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.

reset_data() None

Reset all simulation data for this object.

set_all_solenoid_outputs(outputs: SupportsInt | SupportsIndex) None

Change all of the solenoid outputs.

Parameters:

outputs – the new solenoid outputs (1 bit per output)

set_compressor_current(compressor_current: SupportsFloat | SupportsIndex) None

Set the compressor current.

Parameters:

compressor_current – the new compressor current

set_compressor_on(compressor_on: bool) None

Set whether the compressor is active.

Parameters:

compressor_on – the new value

set_initialized(initialized: bool) None

Define whether the PCM/PH has been initialized.

Parameters:

initialized – true for initialized

set_pressure_switch(pressure_switch: bool) None

Set the value of the pressure switch.

Parameters:

pressure_switch – the new value

set_solenoid_output(channel: SupportsInt | SupportsIndex, solenoid_output: bool) None

Change the solenoid output on a specific channel.

Parameters:
  • channel – the channel to check

  • solenoid_output – the new solenoid output