AnalogTriggerSim

class wpilib.simulation.AnalogTriggerSim(analogTrigger: wpilib._wpilib.AnalogTrigger)

Bases: pybind11_object

Class to control a simulated analog trigger.

Constructs from an AnalogTrigger object.

Parameters:

analogTrigger – AnalogTrigger to simulate

static createForChannel(channel: int) wpilib.simulation._simulation.AnalogTriggerSim

Creates an AnalogTriggerSim for an analog input channel.

Parameters:

channel – analog input channel

Returns:

Simulated object @throws std::out_of_range if no AnalogTrigger is configured for that channel

static createForIndex(index: int) wpilib.simulation._simulation.AnalogTriggerSim

Creates an AnalogTriggerSim for a simulated index. The index is incremented for each simulated AnalogTrigger.

Parameters:

index – simulator index

Returns:

Simulated object

getInitialized() bool

Check if this analog trigger has been initialized.

Returns:

true if initialized

getTriggerLowerBound() float

Get the lower bound.

Returns:

the lower bound

getTriggerUpperBound() float

Get the upper bound.

Returns:

the upper bound

registerInitializedCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on whether the analog trigger is initialized.

Parameters:
  • callback – the callback that will be called whenever the analog trigger is initialized

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

registerTriggerLowerBoundCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the lower bound.

Parameters:
  • callback – the callback that will be called whenever the lower bound is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

registerTriggerUpperBoundCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the upper bound.

Parameters:
  • callback – the callback that will be called whenever the upper bound is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

resetData() None

Reset all simulation data for this object.

setInitialized(initialized: bool) None

Change whether this analog trigger has been initialized.

Parameters:

initialized – the new value

setTriggerLowerBound(triggerLowerBound: float) None

Change the lower bound.

Parameters:

triggerLowerBound – the new lower bound

setTriggerUpperBound(triggerUpperBound: float) None

Change the upper bound.

Parameters:

triggerUpperBound – the new upper bound