Interface settings
settings.js populates the theme and instrument selectors.
- settings.setup_theme_settings()
Populate and activate the theme selector when present.
Three Ionic segment buttons are appended to #theme-segment. The persisted theme is applied immediately and later ionChange events update it.
- Returns:
void
Example
// HTML: <ion-segment id="theme-segment"></ion-segment> setup_theme_settings();
- settings.setup_instrument_settings(instruments)
Populate and activate the instrument selector when present.
The persisted instrument is selected if its ID is in instruments. Otherwise the first API default, or ultimately the first instrument, is selected. An empty instrument dictionary leaves the selector inactive. Selection changes rebuild the ETC form.
- Arguments:
instruments (object.<string, object>) -- Instruments keyed by identifier.
- Returns:
void
Example
setup_instrument_settings({ demo: {name: 'Demo camera', default: true} });