Frontend  0.4.1
Loading...
Searching...
No Matches
Constants

The app uses a lot of constants which are listed here in no particular order.

Current limits

The four current limits are part of the firmware settings. The index of the current value ​​can be read or written as cur_lim at the /settings/ endpoint.

DCC BiDi durations

The five DCC BiDi durations are part of the firmware settings. Using the first value (0) BiDi can be switched off. The current value ​​can be read or written as dcc_bidibit_dur at the /settings/ endpoint.

DCC programming types

The four DCC programming types are part of the firmware settings. The index of the current value ​​can be read or written as dcc_prog_type at the /settings/ endpoint.

Default settings

This map of default settings is used in the program screen to restore the defaults. The defaults ​​should match those of the firmware.

Note
Unfortunately the map cannot be const because Dart does not support method calls at compile time.

Fake initial CVs

Fake initial loco CVs

A list of initial CVs for locomotives for use with fake services.

Fake initial accessory CVs

A list of initial CVs for accessories for use with fake services.

Fake services provider container

This is a global container for providers. Please not that this is bad practice, but we need a common provider container for all fake services. This is the only way we can inject this container to fake services as well as the entire widget tree.

When faking services this container gets injected into runApp.

// Expose global `ProviderContainer` to widget tree for fake services
if (const String.fromEnvironment('OPENREMISE_FRONTEND_FAKE_SERVICES') ==
'true') {
runApp(
UncontrolledProviderScope(
child: const MyApp(),
),
);
}
Definition main.dart:84
final fakeServicesProviderContainer
Fake services provider container.
Definition fake_services_provider_container.dart:41

See also #295 and #1387.

Key codes

The KeyCodes class contains constant integer values ​​that are used when throttle buttons are pressed. The values have the following scheme:

  • <0 for special inputs
  • 0-63 for the function keys
  • 100-109 for long presses of the function keys

OpenRemiseIcons

An icon set with specific OpenRemise icons created using fluttericon.com.

Small screen width

This is the width over which a large screen is assumed. The app changes its layout depending on the screen size. This value is therefore often compared to MediaQuery.of(context).size.width.

Throttle size

The throttle size is the size of the Throttle widget on larger screens. In !kIsWeb builds, this value is also used to set the minimum window size.

WebSocket batch size

This is the maximum number of WebSocket messages grouped and sent at once.

Warning
Extreme caution is advised when increasing this value. Many small messages Many small packets quickly overload the input buffers of the ESP32.

See also #45.

ZIMO

MS decoder IDs

A (not complete) list of ZIMO MS decoder IDs. This list is used exclusively for fake services.

MX decoder IDs

A list of ZIMO MX decoder IDs.

Previous Next
Models Utilities