Files
TelemetryMonitor/lib/config/app_config.dart
2026-04-21 19:38:20 -03:00

75 lines
2.7 KiB
Dart

/// Compile-time constants and defaults.
///
/// Anything here that the user can override at runtime appears as a default
/// value in `Settings` or `LayoutController`. Anything that's truly fixed
/// (channel count, status count, severity list) lives only here.
class AppConfig {
AppConfig._();
/// Total channels supported by the proto schema. Don't change without
/// updating messages.proto in lockstep.
static const int channelCount = 16;
/// Total status indicators supported by the proto schema.
static const int statusCount = 8;
/// Default per-channel display names.
static const List<String> defaultChannelNames = [
'CH1', 'CH2', 'CH3', 'CH4',
'CH5', 'CH6', 'CH7', 'CH8',
'CH9', 'CH10', 'CH11', 'CH12',
'CH13', 'CH14', 'CH15', 'CH16',
];
/// Default per-status-field display names.
static const List<String> defaultStatusNames = [
'status1', 'status2', 'status3', 'status4',
'status5', 'status6', 'status7', 'status8',
];
/// Default Y range when a channel is fixed-mode and the user hasn't set one.
static const double defaultYMin = 0.0;
static const double defaultYMax = 1.0;
/// Default grid shape on first launch.
static const int defaultGridRows = 2;
static const int defaultGridCols = 2;
/// Default packet buffer capacity (≈ 10 minutes at 1 kHz on native).
static const int defaultPacketBufferCapacityNative = 600000;
/// Reduced default for Web (browser heap pressure).
static const int defaultPacketBufferCapacityWeb = 120000;
/// Default log buffer capacity.
static const int defaultLogBufferCapacity = 5000;
/// Default WebSocket URL on first launch.
static const String defaultWsUrl = 'ws://localhost:9000';
/// Default lookback for the per-frame status snapshot.
static const int defaultStatusLookback = 1000;
/// Default decoder batch interval (native only).
static const Duration defaultDecoderBatchInterval =
Duration(milliseconds: 8);
/// Default reconnect parameters.
static const Duration defaultReconnectInitialDelay =
Duration(milliseconds: 500);
static const Duration defaultReconnectMaxDelay = Duration(seconds: 30);
static const double defaultReconnectBackoffFactor = 2.0;
/// Default mini-log severity filter (Dashboard tab). ERROR + FATAL.
static const Set<int> defaultMiniLogSeverities = {4, 5};
/// Default theme mode on first launch.
static const bool defaultDarkMode = false;
/// Default chart x-window on launch and after Reset View.
static const Duration defaultWindowWidth = Duration(seconds: 10);
/// Hard floor on the x-window — below this, charts become a handful of
/// samples and the UI gets confusing.
static const Duration minWindowWidth = Duration(milliseconds: 10);
}