Skip to main content

Class: NavDataBarFieldEcoModelFactory

Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldTypeModelFactories.ts:419

Creates data models for Fuel Economy navigation data bar fields.

The models calculate fuel economy using the fuel data retrieved from the event bus topics fuel_flow_total (defined in EngineEvents) and ground_speed (defined in GNSSEvents).

Extends

Constructors

Constructor

new NavDataBarFieldEcoModelFactory(bus, fuelUnit): NavDataBarFieldEcoModelFactory

Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldTypeModelFactories.ts:428

Creates a new instance of NavDataBarFieldEcoModelFactory.

Parameters

ParameterTypeDefault valueDescription
busEventBusundefinedThe event bus.
fuelUnitCompoundableUnit<Weight>UnitType.GALLON_FUELThe unit with which to interpret the fuel values retrieved from the event bus. The unit should define the weight equivalent of one U.S. gallon of fuel. Defaults to UnitType.GALLON_FUEL.

Returns

NavDataBarFieldEcoModelFactory

Overrides

EventBusNavDataBarFieldTypeModelFactory.constructor

Properties

fuelEconomyUnit

protected readonly fuelEconomyUnit: Unit<DistancePerWeight>

Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldTypeModelFactories.ts:420


sub

protected readonly sub: EventSubscriber<GNSSEvents & BaseNonIndexedEngineEvents & BaseEngineIndexedEngineEvents & IndexedEngineEvents>

Defined in: src/garminsdk/components/navdatabar/EventBusNavDataBarFieldTypeModelFactory.ts:12

Inherited from

EventBusNavDataBarFieldTypeModelFactory.sub

Methods

create()

create(gpsValidity): NavDataBarFieldModel<NumberUnitInterface<DistancePerWeight, Unit<DistancePerWeight>>>

Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldTypeModelFactories.ts:435

Creates a navigation data bar field data model for this factory's data field type.

Parameters

ParameterTypeDescription
gpsValiditySubscribable<NavDataFieldGpsValidity>The subscribable that provides the validity of the GPS data for the models.

Returns

NavDataBarFieldModel<NumberUnitInterface<DistancePerWeight, Unit<DistancePerWeight>>>

A navigation data bar field data model for this factory's data field type.

Overrides

EventBusNavDataBarFieldTypeModelFactory.create