Skip to main content

Class: WeightFuelUserSettings

Utility class for retrieving weight and fuel user settings managers.

Hierarchy

Constructors

constructor

new WeightFuelUserSettings(bus, settingDefs, keepLocal?): WeightFuelUserSettings

Constructor.

Parameters

NameTypeDefault valueDescription
busEventBusundefinedThe bus used by this manager to publish setting change events.
settingDefsreadonly UserSettingDefinition<number>[]undefinedThe setting definitions used to initialize this manager's settings.
keepLocalbooleanfalseIf present and true, values will be kept local to the instrument on which they're set.

Returns

WeightFuelUserSettings

Inherited from

DefaultUserSettingManager<WeightFuelUserSettingTypes>.constructor

Defined in

src/sdk/settings/UserSetting.ts:191

Properties

bus

Protected Readonly bus: EventBus

The bus used by this manager to publish setting change events.

Inherited from

DefaultUserSettingManager.bus

Defined in

src/sdk/settings/UserSetting.ts:192


publisher

Protected Readonly publisher: Publisher<WeightFuelUserSettingTypes>

Inherited from

DefaultUserSettingManager.publisher

Defined in

src/sdk/settings/UserSetting.ts:177


settings

Protected Readonly settings: Map<string, UserSettingManagerEntry<number>>

Inherited from

DefaultUserSettingManager.settings

Defined in

src/sdk/settings/UserSetting.ts:175


subscriber

Protected Readonly subscriber: EventSubscriber<WeightFuelUserSettingTypes>

Inherited from

DefaultUserSettingManager.subscriber

Defined in

src/sdk/settings/UserSetting.ts:178


syncPublisher

Protected Readonly syncPublisher: Publisher<UserSettingManagerSyncEvents>

Inherited from

DefaultUserSettingManager.syncPublisher

Defined in

src/sdk/settings/UserSetting.ts:180


syncSubscriber

Protected Readonly syncSubscriber: EventSubscriber<UserSettingManagerSyncEvents>

Inherited from

DefaultUserSettingManager.syncSubscriber

Defined in

src/sdk/settings/UserSetting.ts:181

Methods

getAllSettings

getAllSettings(): UserSetting<UserSettingValue>[]

Returns

UserSetting<UserSettingValue>[]

Inherit Doc

Inherited from

DefaultUserSettingManager.getAllSettings

Defined in

src/sdk/settings/UserSetting.ts:270


getSetting

getSetting<K>(name): UserSetting<NonNullable<WeightFuelUserSettingTypes[K]>>

Type parameters

NameType
Kextends "weightFuelBasicEmpty" | "weightFuelCrewStores" | "weightFuelNumberPax" | "weightFuelAvgPax" | "weightFuelCargo" | "weightFuelInitialFob" | "weightFuelReserves" | "weightFuelEstHoldingTime" | "weightFuelBasicOperating" | "weightFuelTotalPassenger" | "weightFuelZeroFuel"

Parameters

NameType
nameK

Returns

UserSetting<NonNullable<WeightFuelUserSettingTypes[K]>>

Inherit Doc

Inherited from

DefaultUserSettingManager.getSetting

Defined in

src/sdk/settings/UserSetting.ts:260


mapTo

mapTo<M>(map): MappedUserSettingManager<M, WeightFuelUserSettingTypes>

Type parameters

NameType
Mextends UserSettingRecord

Parameters

NameType
mapUserSettingMap<M, WeightFuelUserSettingTypes>

Returns

MappedUserSettingManager<M, WeightFuelUserSettingTypes>

Inherit Doc

Inherited from

DefaultUserSettingManager.mapTo

Defined in

src/sdk/settings/UserSetting.ts:285


onSettingValueChanged

onSettingValueChanged<K>(entry, value): void

A callback which is called when one of this manager's settings has its value changed locally.

Type parameters

NameType
Kextends keyof WeightFuelUserSettingTypes

Parameters

NameTypeDescription
entryUserSettingManagerEntry<WeightFuelUserSettingTypes[K]>The entry for the setting that was changed.
valueWeightFuelUserSettingTypes[K]The new value of the setting.

Returns

void

Inherited from

DefaultUserSettingManager.onSettingValueChanged

Defined in

src/sdk/settings/UserSetting.ts:294


onSettingValueSynced

onSettingValueSynced<K>(entry, data): void

A callback which is called when a setting changed event is received over the event bus.

Type parameters

NameType
Kextends keyof WeightFuelUserSettingTypes

Parameters

NameTypeDescription
entryUserSettingManagerEntry<WeightFuelUserSettingTypes[K]>The entry for the setting that was changed.
dataUserSettingManagerSyncData<WeightFuelUserSettingTypes[K]>The sync data.

Returns

void

Inherited from

DefaultUserSettingManager.onSettingValueSynced

Defined in

src/sdk/settings/UserSetting.ts:304


syncSettingFromEvent

syncSettingFromEvent<K>(entry, data): void

Syncs a setting using data received from a sync event.

Type parameters

NameType
Kextends keyof WeightFuelUserSettingTypes

Parameters

NameTypeDescription
entryUserSettingManagerEntry<WeightFuelUserSettingTypes[K]>The entry for the setting to sync.
dataUserSettingManagerSyncData<WeightFuelUserSettingTypes[K]>The sync event data.

Returns

void

Inherited from

DefaultUserSettingManager.syncSettingFromEvent

Defined in

src/sdk/settings/UserSetting.ts:323


tryGetSetting

tryGetSetting<K>(name): undefined | UserSetting<NonNullable<WeightFuelUserSettingTypes[K]>>

Type parameters

NameType
Kextends string

Parameters

NameType
nameK

Returns

undefined | UserSetting<NonNullable<WeightFuelUserSettingTypes[K]>>

Inherit Doc

Inherited from

DefaultUserSettingManager.tryGetSetting

Defined in

src/sdk/settings/UserSetting.ts:255


whenSettingChanged

whenSettingChanged<K>(name): Consumer<NonNullable<WeightFuelUserSettingTypes[K]>>

Type parameters

NameType
Kextends "weightFuelBasicEmpty" | "weightFuelCrewStores" | "weightFuelNumberPax" | "weightFuelAvgPax" | "weightFuelCargo" | "weightFuelInitialFob" | "weightFuelReserves" | "weightFuelEstHoldingTime" | "weightFuelBasicOperating" | "weightFuelTotalPassenger" | "weightFuelZeroFuel"

Parameters

NameType
nameK

Returns

Consumer<NonNullable<WeightFuelUserSettingTypes[K]>>

Inherit Doc

Inherited from

DefaultUserSettingManager.whenSettingChanged

Defined in

src/sdk/settings/UserSetting.ts:275


getManager

getManager(bus): DefaultUserSettingManager<WeightFuelUserSettingTypes>

Gets an instance of the weight and fuel user settings manager.

Parameters

NameTypeDescription
busEventBusThe event bus.

Returns

DefaultUserSettingManager<WeightFuelUserSettingTypes>

An instance of the weight and fuel user settings manager.

Defined in

src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Settings/WeightFuelUserSettings.ts:53