OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
environmental.barometric_controller_stub.BarometricControllerStub Class Reference

Provide configurable barometric state for demos and UI development. More...

Inheritance diagram for environmental.barometric_controller_stub.BarometricControllerStub:
environmental.barometric_controller_if.BarometricControllerIf

Public Member Functions

bool is_started (self)
 Return whether the controller is ready to read state.
 
bool is_available (self)
 Return whether barometric support is configured and available.
 
str|None status_message (self)
 Return an availability message, if one applies.
 
float sea_level_pressure_pa (self)
 Return the sea-level pressure reference in pascals.
 
BarometricState|None latest_state (self)
 Return the latest state, or None before the first read.
 
None start (self)
 Start the controller and its environmental source.
 
None stop (self)
 Stop the controller and its environmental source.
 
BarometricState read_state (self)
 Read and return the current processed environmental state.
 
None set_state (self, BarometricState state)
 Replace the deterministic state returned by future reads.
 
None set_sea_level_pressure_pa (self, float pressure_pa)
 Set the pressure reference used for absolute altitude.
 
float calibrate_altitude (self, float known_altitude_m, *float|None pressure_pa=None)
 Calibrate sea-level pressure at a known altitude.
 
None reset_relative_altitude (self)
 Set the current altitude as the relative-altitude zero point.
 

Detailed Description

Provide configurable barometric state for demos and UI development.

Member Function Documentation

◆ calibrate_altitude()

float environmental.barometric_controller_stub.BarometricControllerStub.calibrate_altitude (   self,
float  known_altitude_m,
*float | None   pressure_pa = None 
)

Calibrate sea-level pressure at a known altitude.

Parameters
known_altitude_mKnown altitude in meters above sea level.
pressure_paMeasured pressure in pascals, or None to read the current pressure from the configured source.
Returns
Calibrated sea-level pressure reference in pascals.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.

◆ is_available()

bool environmental.barometric_controller_stub.BarometricControllerStub.is_available (   self)

Return whether barometric support is configured and available.

Return values
TrueBarometric support is available.
FalseBarometric support is unavailable.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.

◆ is_started()

bool environmental.barometric_controller_stub.BarometricControllerStub.is_started (   self)

Return whether the controller is ready to read state.

Return values
TrueThe controller has been started.
FalseThe controller has not been started.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.

◆ latest_state()

BarometricState | None environmental.barometric_controller_stub.BarometricControllerStub.latest_state (   self)

Return the latest state, or None before the first read.

Returns
Latest processed state, or None before the first read.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.

◆ read_state()

BarometricState environmental.barometric_controller_stub.BarometricControllerStub.read_state (   self)

Read and return the current processed environmental state.

Returns
Current pressure, temperature, and altitude state.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.

◆ sea_level_pressure_pa()

float environmental.barometric_controller_stub.BarometricControllerStub.sea_level_pressure_pa (   self)

Return the sea-level pressure reference in pascals.

Returns
Active sea-level pressure reference in pascals.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.

◆ set_sea_level_pressure_pa()

None environmental.barometric_controller_stub.BarometricControllerStub.set_sea_level_pressure_pa (   self,
float  pressure_pa 
)

Set the pressure reference used for absolute altitude.

Parameters
pressure_paSea-level pressure reference in pascals.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.

◆ status_message()

str | None environmental.barometric_controller_stub.BarometricControllerStub.status_message (   self)

Return an availability message, if one applies.

Returns
Human-readable status, or None when no message applies.

Reimplemented from environmental.barometric_controller_if.BarometricControllerIf.


The documentation for this class was generated from the following file: