phoenix6.sim.canrange_sim_state

Module Contents

class phoenix6.sim.canrange_sim_state.CANrangeSimState(device: phoenix6.hardware.core.core_canrange.CoreCANrange)

Creates an object to control the state of a simulated CANrange.

Note the recommended method of accessing simulation features is to use CANrange.sim_state.

Parameters:

device (CoreCANrange) – Device to which this simulation state is attached

set_supply_voltage(volts: phoenix6.units.volt) phoenix6.status_code.StatusCode

Sets the simulated supply voltage of the CANrange.

The minimum allowed supply voltage is 4 V - values below this will be promoted to 4 V.

Parameters:

volts (volt) – The supply voltage in Volts

Returns:

Status code

Return type:

StatusCode

set_distance(meters: phoenix6.units.meter) phoenix6.status_code.StatusCode

Sets the simulated distance of the CANrange.

Parameters:

meters (meter) – The distance in meters

Returns:

Status code

Return type:

StatusCode