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
| Parameter | Type | Default value | Description |
|---|---|---|---|
bus | EventBus | undefined | The event bus. |
fuelUnit | CompoundableUnit<Weight> | UnitType.GALLON_FUEL | The 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
protectedreadonlyfuelEconomyUnit:Unit<DistancePerWeight>
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldTypeModelFactories.ts:420
sub
protectedreadonlysub: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
| Parameter | Type | Description |
|---|---|---|
gpsValidity | Subscribable<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.