REVPHSim

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

Bases: PneumaticsBaseSim

Class to control a simulated Pneumatic Control Module (PCM).

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.REVPHSim) -> None

Constructs with the default PCM module number (CAN ID).

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

Constructs from a PCM module number (CAN ID).

Parameters:

module – module number

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

get_all_solenoid_outputs() int
get_compressor_config_type() int

Check whether the closed loop compressor control is active.

Returns:

compressor config type

get_compressor_current() float
get_compressor_on() bool

Check if the compressor is on.

Returns:

true if the compressor is active

get_initialized() bool
get_pressure_switch() bool
get_solenoid_output(channel: SupportsInt | SupportsIndex) bool
register_compressor_config_type_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 closed loop state 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

register_compressor_current_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore
register_compressor_on_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore
register_initialized_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore
register_pressure_switch_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore
register_solenoid_output_callback(channel: SupportsInt | SupportsIndex, callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore
reset_data() None
set_all_solenoid_outputs(outputs: SupportsInt | SupportsIndex) None
set_compressor_config_type(compressor_config_type: SupportsInt | SupportsIndex) None

Turn on/off the closed loop control of the compressor.

Parameters:

compressor_config_type – compressor config type

set_compressor_current(compressor_current: SupportsFloat | SupportsIndex) None
set_compressor_on(compressor_on: bool) None

Set whether the compressor is active.

Parameters:

compressor_on – the new value

set_initialized(solenoid_initialized: bool) None
set_pressure_switch(pressure_switch: bool) None
set_solenoid_output(channel: SupportsInt | SupportsIndex, solenoid_output: bool) None