RelaySim¶
- class wpilib.simulation.RelaySim(*args, **kwargs)¶
Bases:
pybind11_object
Class to control a simulated relay.
Overloaded function.
__init__(self: wpilib.simulation._simulation.RelaySim, relay: wpilib._wpilib.Relay) -> None
Constructs from a Relay object.
- Parameters:
relay – Relay to simulate
__init__(self: wpilib.simulation._simulation.RelaySim, channel: int) -> None
Constructs from a relay channel number.
- Parameters:
channel – Channel number
- getForward() bool ¶
Check whether the forward direction is active.
- Returns:
true if active
- getInitializedForward() bool ¶
Check whether the forward direction has been initialized.
- Returns:
true if initialized
- getInitializedReverse() bool ¶
Check whether the reverse direction has been initialized.
- Returns:
true if initialized
- getReverse() bool ¶
Check whether the reverse direction is active.
- Returns:
true if active
- registerForwardCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore ¶
Register a callback to be run when the forward direction changes state.
- Parameters:
callback – the callback
initialNotify – whether to run the callback with the initial state
- Returns:
the CallbackStore object associated with this callback
- registerInitializedForwardCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore ¶
Register a callback to be run when the forward direction is initialized.
- Parameters:
callback – the callback
initialNotify – whether to run the callback with the initial state
- Returns:
the CallbackStore object associated with this callback
- registerInitializedReverseCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore ¶
Register a callback to be run when the reverse direction is initialized.
- Parameters:
callback – the callback
initialNotify – whether to run the callback with the initial state
- Returns:
the CallbackStore object associated with this callback
- registerReverseCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore ¶
Register a callback to be run when the reverse direction changes state.
- Parameters:
callback – the callback
initialNotify – whether to run the callback with the initial state
- Returns:
the CallbackStore object associated with this callback
- resetData() None ¶
Reset all simulation data.
- setForward(forward: bool) None ¶
Set whether the forward direction is active.
- Parameters:
forward – true to make active
- setInitializedForward(initializedForward: bool) None ¶
Define whether the forward direction has been initialized.
- Parameters:
initializedForward – whether this object is initialized
- setInitializedReverse(initializedReverse: bool) None ¶
Define whether the reverse direction has been initialized.
- Parameters:
initializedReverse – whether this object is initialized
- setReverse(reverse: bool) None ¶
Set whether the reverse direction is active.
- Parameters:
reverse – true to make active