Fixed errors

This commit is contained in:
2026-06-17 09:50:54 -07:00
parent cb8a634b42
commit b554dbd655
2 changed files with 38 additions and 7 deletions

View File

@@ -54,11 +54,14 @@ radar_management_structure radar_management[RADAR_COUNT] = {
// Components: Thread 1, Traffic Cop (Thread 2), all scope renderers // Components: Thread 1, Traffic Cop (Thread 2), all scope renderers
int current_radar = RADAR_NONE; int current_radar = RADAR_NONE;
// Range settnigs for each radar // Range step indices — 0 = lowest (shortest) range step for each scope.
int chain_home_range_setting; // Incremented/decremented by the o/p keyboard handler in Thread 1.
int ascope_range_setting; // Chain Home is fixed-range; its index exists for consistency but is unused.
int traffic_control_range_setting; // Components: Thread 1 keyboard handler, each scope renderer
int police_boat range_setting; 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 * THREAD MUTEXES

View File

@@ -63,7 +63,9 @@ struct target_data_structure {
}; };
/* Lean SSBO payload uploaded to shaders via SSBO layout(std430). /* 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 */ * Components: Thread 1 (shader upload), all radar scope shaders */
struct ssbo_target_information { struct ssbo_target_information {
float target_x; // Cartesian offset X, meters from radar float target_x; // Cartesian offset X, meters from radar
@@ -72,7 +74,6 @@ struct ssbo_target_information {
float beam; // meters float beam; // meters
float course; // radians, true north float course; // radians, true north
float altitude; // meters; 0 for surface vessels float altitude; // meters; 0 for surface vessels
time_t timestamp;
float current_reflectivity; // derived from vessel_type float current_reflectivity; // derived from vessel_type
float height_estimate; // derived from vessel_type float height_estimate; // derived from vessel_type
float noiseglint; // derived from vessel_type float noiseglint; // derived from vessel_type
@@ -213,3 +214,30 @@ extern float uniform_bearing_cursor;
// Components: Marine A-scope // Components: Marine A-scope
extern float uniform_marine_a_bearing; 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;