adding globals and constants

This commit is contained in:
2026-06-15 10:42:45 -07:00
parent fe417fe743
commit d0616ac523
3 changed files with 40 additions and 33 deletions

View File

@@ -37,29 +37,28 @@
* Components: Thread 1 (startup, scope switching), Traffic Cop (Thread 2)
* ============================================================ */
/* radar_management[] is indexed by RADAR_* constants (1-4).
* Slot 0 is unused padding so current_radar works as a direct index.
* radar_type mirrors the array index for callers that receive a single
* struct by value. operatable is set to 1 once a radar is fully built.
* available and selected are set during startup argument parsing. */
/* radar_management[] is indexed by RADAR_* constants (0-4).
* Slot 0 (RADAR_NONE) is the management/system entry.
* Its testing field holds the system-wide TESTING_* mode, initialized
* from TESTING_COMPONENT in settings.h — change that define and recompile.
* When testing is non-zero, no other radars can be made available.
* Slots 1-4 are per-radar entries. operatable is set to 1 once a radar is
* fully built. available and selected are set during startup argument parsing.
* The testing field in slots 1-4 mirrors slot 0 for convenient access but
* slot 0 is authoritative.
* Components: Thread 1, Traffic Cop (Thread 2) */
radar_management_structure radar_management[RADAR_COUNT] = {
{ RADAR_NONE, 0, 0, 0 }, // [0] unused
{ RADAR_CHAIN_HOME, 0, 0, 0 }, // [1] chain_home — not yet built
{ RADAR_MARINE_ASCOPE, 0, 0, 0 }, // [2] marine_ascope — not yet built
{ RADAR_MARINE_TRAFFIC, 0, 0, 0 }, // [3] marine_traffic — not yet built
{ RADAR_POLICE_BOAT, 0, 0, 0 }, // [4] police_boat — not yet built
{ RADAR_NONE, 0, 0, 0, TESTING_COMPONENT }, // [0] management — testing mode lives here
{ RADAR_CHAIN_HOME, 0, 0, 0, TESTING_NONE }, // [1] chain_home — not yet built
{ RADAR_MARINE_ASCOPE, 0, 0, 0, TESTING_NONE }, // [2] marine_ascope — not yet built
{ RADAR_MARINE_TRAFFIC, 0, 0, 0, TESTING_NONE }, // [3] marine_traffic — not yet built
{ RADAR_POLICE_BOAT, 0, 0, 0, TESTING_NONE }, // [4] police_boat — not yet built
};
// No radar selected on startup; intro screen is displayed.
// Components: Thread 1, Traffic Cop (Thread 2), all scope renderers
int current_radar = RADAR_NONE;
// Component currently under development (TESTING_* constant).
// Initialized from TESTING_COMPONENT in settings.h; change that define and recompile.
// When non-zero, no other radars can be made available.
// Components: Thread 1 (startup gating), all components
int testing_component = TESTING_COMPONENT;
/* ============================================================
* THREAD MUTEXES
* Components: all threads as noted per mutex