Class: WeightBalanceUserSettingManager
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:36
A manager for weight and balance user settings.
Implements
Constructors
Constructor
new WeightBalanceUserSettingManager(
bus,config):WeightBalanceUserSettingManager
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:53
Creates a new instance of WeightBalanceSettingManager.
Parameters
| Parameter | Type | Description |
|---|---|---|
bus | EventBus | The event bus. |
config | WeightBalanceConfig | A weight and balance configuration object. |
Returns
WeightBalanceUserSettingManager
Properties
activeEnvelopeDef
readonlyactiveEnvelopeDef:Subscribable<Readonly<WeightBalanceEnvelopeDef>>
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:44
The definition for the active envelope.
envelopeDefs
readonlyenvelopeDefs: readonlyReadonly<WeightBalanceEnvelopeDef>[]
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:41
An array of definitions for the envelopes supported by this manager.
loadStationDefs
readonlyloadStationDefs: readonlyReadonly<WeightBalanceLoadStationDef>[]
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:38
An array of definitions for the load stations supported by this manager.
Methods
getAllSettings()
getAllSettings():
UserSetting<UserSettingValue>[]
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:114
Gets an array of all settings of this manager.
Returns
UserSetting<UserSettingValue>[]
an array of all settings of this manager.
Implementation of
UserSettingManager.getAllSettings
getSetting()
getSetting<
K>(name):UserSettingFromManager<WeightBalanceUserSettingTypes,K>
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:104
Gets a setting from this manager.
Type Parameters
| Type Parameter |
|---|
K extends `weightBalanceLoadStationEmptyWeight_${string}` | `weightBalanceLoadStationEmptyArm_${string}` | `weightBalanceLoadStationLoadArm_${string}` | `weightBalanceLoadStationEnabled_${string}` | `weightBalanceLoadStationLoadWeight_${string}` | "weightBalanceActiveEnvelopeIndex" |
Parameters
| Parameter | Type | Description |
|---|---|---|
name | K | The name of the setting to get. |
Returns
UserSettingFromManager<WeightBalanceUserSettingTypes, K>
The requested setting.
Throws
Error if no setting with the specified name exists.
Implementation of
mapTo()
mapTo<
M>(map):UserSettingManager<M&WeightBalanceUserSettingTypes>
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:119
Maps a subset of this manager's settings to ones with aliased names, and creates a new setting manager which supports accessing the settings using their aliases.
Type Parameters
| Type Parameter |
|---|
M extends UserSettingRecord |
Parameters
| Parameter | Type | Description |
|---|---|---|
map | UserSettingMap<M, WeightBalanceUserSettingTypes> | A map defining the aliases of a subset of this manager's settings, with aliased setting names as keys and original setting names as values. |
Returns
UserSettingManager<M & WeightBalanceUserSettingTypes>
A new setting manager which supports accessing a subset of this manager's settings using aliased names.
Implementation of
tryGetSetting()
tryGetSetting<
K>(name):OptionalUserSettingFromManager<WeightBalanceUserSettingTypes,K>
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:99
Attempts to get a setting from this manager.
Type Parameters
| Type Parameter |
|---|
K extends string |
Parameters
| Parameter | Type | Description |
|---|---|---|
name | K | The name of the setting to get. |
Returns
OptionalUserSettingFromManager<WeightBalanceUserSettingTypes, K>
The requested setting, or undefined if no such setting exists.
Implementation of
UserSettingManager.tryGetSetting
whenSettingChanged()
whenSettingChanged<
K>(name):UserSettingConsumerFromManager<WeightBalanceUserSettingTypes,K>
Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Settings/WeightBalanceUserSettings.ts:109
Gets a consumer which notifies handlers when the value of a setting changes.
Type Parameters
| Type Parameter |
|---|
K extends `weightBalanceLoadStationEmptyWeight_${string}` | `weightBalanceLoadStationEmptyArm_${string}` | `weightBalanceLoadStationLoadArm_${string}` | `weightBalanceLoadStationEnabled_${string}` | `weightBalanceLoadStationLoadWeight_${string}` | "weightBalanceActiveEnvelopeIndex" |
Parameters
| Parameter | Type | Description |
|---|---|---|
name | K | The name of a setting. |
Returns
UserSettingConsumerFromManager<WeightBalanceUserSettingTypes, K>
a consumer which notifies handlers when the value of the setting changes.
Throws
Error if no setting with the specified name exists.
Deprecated
Please use getSetting(name).sub() instead.