The Settings page (page ID set) is composed of cards of content. The page is defined in common/page/settings.js. There are two categories of cards supplied by the system: standard and aeronautical. An app chooses and orders the cards it displays with settings.setCards() and can add its own cards with settings.defineCard().
Cards are identified by an ID string. Each card is defined by an object that contains any of the following properties:
computeInfoinitrenderrenderHelpstateVarInfotipInfoThe values are used the same way as the equivalent properties in a Page. The Settings page's info is composed by concatenating the equivalent properties of the displayed cards, in order. init() is called after the page's saved state is restored.
The standard cards are defined in common/page/settings.js. The default displayed list is ui, email, developer, numericInput, support. The provided card IDs are:
uiemaildevelopernumericInputsupportThe aeronautical cards are defined in common/page/aeroSettingsCards.js. An app makes them available by importing that file for its side effect (usually in app.js):
import './common/page/aeroSettingsCards.js';
The provided card IDs are:
unitsset_runwayUnits, set_altimeterUnits, set_fuelUnits, set_weightUnits, set_armUnits, set_fuelEffUnits).safetyset_tkoSafetyFactor, set_ldgSafetyFactor, set_obsSafetyFactor).rwySurfaceairportDbThe Settings page's state variables have the prefix set_. Pages and apps rely on the following ones. The input state variables use the default save mode (saved on the device and in the cloud) unless noted. A card's state variables exist only if the app displays that card with settings.setCards(), so code that reads an aeronautical setting requires the app to include the card.
| State variable | Card | Description |
|---|---|---|
set_fuelUnits |
units |
unitSelector for the fuel unit class. Default gal; options gallons and liters. See fuelUnitsSvInfo. |
set_altimeterUnits |
units |
selectorInput, inhg (default) or hpa. Used when the METAR altimeter can't be fetched. |
set_runwayUnits |
units |
unitSelector for runway length, ft (default) or m. |
set_weightUnits |
units |
unitSelector for weight, lb or kg. |
set_armUnits |
units |
unitSelector for payload arm, in or cm. |
set_fuelEffUnits |
units |
Derived output unitSelector, nmpg or nmpl. It follows set_fuelUnits (gal or lbf gives nmpg; l or kgf gives nmpl) and is not set by the user. The same computation sets set_fuelFlowUnits and set_fuelFlowWeightUnits. |
set_tkoSafetyFactor, set_ldgSafetyFactor |
safety |
The percentage added to the takeoff and landing ground roll. Based on safetyFactorInputSvInfo, default 50. |
set_obsSafetyFactor |
safety |
The percentage added to the obstacle clearance distance. Default 15. |
set_noHeadwind |
safety |
booleanInput, default false. If set, takeoff and landing performance is not reduced by headwind (tailwind is included). |
set_tkoRollAdjHardWet, set_ldgRollAdjHardWet |
rwySurface |
The takeoff and landing roll adjustment (percent) for a hard wet runway. Defaults 0 and 15. |
set_tkoRollAdjHardIcy, set_ldgRollAdjHardIcy |
rwySurface |
The adjustments for a hard icy runway. Defaults 25 and 25. |
set_tkoRollAdjUnpavedDry, set_ldgRollAdjUnpavedDry |
rwySurface |
The adjustments for a dry unpaved runway. Defaults 20 and 15. |
set_useTabFooter |
ui |
selectorInput: tablet (default), large (tablets and desktops), or none. The tabFooter computation turns it into the nav_tabFooter state variable according to the device type. |
set_email |
email |
emailInput, saved on the device only. The user's email address, also the cloud sync account and the address that the weight and balance page mails the flight planning results to. An invalid address is stored as ''. |
set_password |
email |
textInput (at most 19 characters), saved on the device only. The Cloud Sync security word. A value without at least two word characters is stored as ''. The page also uses this field to toggle developer mode. |
set_allowContact |
email |
booleanInput, default true. Whether the user allows being contacted. Nothing outside the card reads it. |
set_disableSave |
developer |
booleanInput, default false. While developer mode is shown, changing it disables or enables saving for the Settings page's state (storage.disable('set')). |
set_showDeveloper |
developer |
modelValue, default false. True while the developer card contents are shown. |
set_stayDeveloper |
developer |
booleanInput, default false. If true, set_showDeveloper is set whenever the app starts. Clearing developer mode also clears it. |
set_numInputTypeTablet, set_numInputTypePhone, set_numInputTypeDesktop |
numericInput |
selectorInput with keypad, thumbwheel and keyboard. The numeric input type for each device type. Defaults: keypad for tablets and phones, keyboard for desktops. |
set_numInputType |
numericInput |
The numeric input type for the current device: the value of set_numInputType<deviceType>. Numeric input and the wind input components read it. |
settingscommon/page/settings.js
An object with the methods used to define and select Settings page cards.
safetyFactorInputSvInfocommon/page/aeroSettingsCards.js
The numericInput state variable info (format 3T?|?|?|%, 0–200, increment 5, default 50) used by the safety factor inputs. Apps can reuse it for their own safety factor inputs.
fuelUnitsSvInfocommon/page/aeroSettingsCards.js
The unitSelector info for set_fuelUnits (default gal, options gallons and liters). Apps that fuel by weight can adjust its default and options in app.js before app startup.
settings methodsdefineCard()settings.defineCard(id, info)
idinfocomputeInfo, init, render, renderHelp, stateVarInfo, and tipInfo.Defines or replaces a card. See common/page/aeroSettingsCards.js for examples.
setCards()settings.setCards(cards)
cardsSets the cards displayed on the Settings page. Each app normally calls this in app.js.