diff --git a/global_data.cpp b/global_data.cpp index 2e5e7ed..89a2be4 100644 --- a/global_data.cpp +++ b/global_data.cpp @@ -54,11 +54,14 @@ radar_management_structure radar_management[RADAR_COUNT] = { // Components: Thread 1, Traffic Cop (Thread 2), all scope renderers int current_radar = RADAR_NONE; -// Range settnigs for each radar -int chain_home_range_setting; -int ascope_range_setting; -int traffic_control_range_setting; -int police_boat range_setting; +// Range step indices — 0 = lowest (shortest) range step for each scope. +// Incremented/decremented by the o/p keyboard handler in Thread 1. +// Chain Home is fixed-range; its index exists for consistency but is unused. +// Components: Thread 1 keyboard handler, each scope renderer +int chain_home_range_setting = 0; +int ascope_range_setting = 0; +int traffic_control_range_setting = 0; +int police_boat_range_setting = 0; /* ============================================================ * THREAD MUTEXES diff --git a/include/data_structure_and_constants.h b/include/data_structure_and_constants.h index c167fce..1451769 100644 --- a/include/data_structure_and_constants.h +++ b/include/data_structure_and_constants.h @@ -63,7 +63,9 @@ struct target_data_structure { }; /* Lean SSBO payload uploaded to shaders via SSBO layout(std430). - * String fields are stripped before upload. + * String fields and timestamp are stripped before upload — the Traffic Cop + * discards stale targets (>1 hour) on the CPU, so the GPU needs no timestamp. + * time_t (int64) has no matching GLSL std430 type without an extension. * Components: Thread 1 (shader upload), all radar scope shaders */ struct ssbo_target_information { float target_x; // Cartesian offset X, meters from radar @@ -72,7 +74,6 @@ struct ssbo_target_information { float beam; // meters float course; // radians, true north float altitude; // meters; 0 for surface vessels - time_t timestamp; float current_reflectivity; // derived from vessel_type float height_estimate; // derived from vessel_type float noiseglint; // derived from vessel_type @@ -213,3 +214,30 @@ extern float uniform_bearing_cursor; // Components: Marine A-scope extern float uniform_marine_a_bearing; +/* ============================================================ + * RANGE STEP INDICES + * Track which discrete range step is currently selected per scope. + * Indexed from 0; map to the MARINE_A_SCOPE_RANGE_STEP_* and + * PPI_*_RANGE_STEP_* constants defined in settings.h. + * Defined in global_data.cpp; extern declared here. + * Components: Thread 1 (keyboard o/p handler), each scope renderer + * ============================================================ */ + +// Chain Home range is fixed (CHAIN_HOME_MAX_RANGE_KM in settings.h); this index +// is defined for structural consistency but the keyboard o/p handler ignores it +// when current_radar == RADAR_CHAIN_HOME. +// Components: Thread 1 keyboard handler (no-op for Chain Home) +extern int chain_home_range_setting; + +// Marine A-scope range step index (0 = 3 nm, 3 = 24 nm) +// Components: Marine A-scope, Thread 1 keyboard handler +extern int ascope_range_setting; + +// Marine traffic control PPI range step index (0 = 3 nm, 4 = 48 nm) +// Components: Marine traffic control scope, Thread 1 keyboard handler +extern int traffic_control_range_setting; + +// Police boat PPI range step index (0 = 1.5 nm, 4 = 24 nm) +// Components: Police boat scope, Thread 1 keyboard handler +extern int police_boat_range_setting; +