From cb8a634b425c3cfe76ecce2a0fcb39b0f614a24b Mon Sep 17 00:00:00 2001 From: Mark Allyn Date: Wed, 17 Jun 2026 09:45:23 -0700 Subject: [PATCH] Made corrections. --- .gitignore | 31 ++++++++++++++++++ 01_classes.md | 3 +- 02_text_description.md | 6 ++++ CLAUDE.md | 12 +------ global_data.cpp | 6 ++++ todo | 73 ------------------------------------------ 6 files changed, 45 insertions(+), 86 deletions(-) create mode 100644 .gitignore delete mode 100644 todo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44c30b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# Build output +build/ +*.o +*.a +*.so + +# CMake generated +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +Makefile +install_manifest.txt +CTestTestfile.cmake + +# Compiled GLSL (if any cached/binary shaders are generated) +*.spv + +# GDAL/LIDAR processed output +map/lidar_processed/ + +# Editor and OS artifacts +.vscode/ +.idea/ +*.swp +*.swo +*~ +.DS_Store +Thumbs.db + +# Local session artifacts +todo diff --git a/01_classes.md b/01_classes.md index e5d6e57..15a9a98 100644 --- a/01_classes.md +++ b/01_classes.md @@ -52,7 +52,7 @@ Examples of data and functions for this class and it subordinates: for the police boat will be the police boat's location and heading. This affects the radar display for the police boat. Perhaps I can suggest that the these three values should be furnished as uniforms to the shaders for the police boat: 1. int police_boat; - 1 is police boat and 0 is not, 2. flost police_location; in local coordinate space, + 1 is police boat and 0 is not, 2. vec2 police_location; in local coordinate space, and 3. float police_boat heading. Please note that this is running in thread 1. The data input to this is being provided by the traffic_cop, which is running on thread 2. The traffic_cop needs @@ -69,7 +69,6 @@ Examples of data and functions for this class and it subordinates: float beam; // Vessel beam bounds (meters) float course; // Course over ground vector (radians relative to True North) float altitude; // Target altitude profile (meters = 0 for boats) - time_t timestamp; // Data aging tracking identifier float current_reflectivity; // derivied from vessel_type (see table below) float height_estimate; // derived from vessel_type (see table below) float noiseglint; // derived from vessel_type (see table below) diff --git a/02_text_description.md b/02_text_description.md index db15fde..653a79d 100644 --- a/02_text_description.md +++ b/02_text_description.md @@ -63,3 +63,9 @@ field: that is part of Boulevard Park. It is also at the foot of Taylor Street. We call this the Taylor Dock. The Police boat will cruise around Bellingham Bay, showing a radar on a moving boat. + + 5. The intro scene (introduction) + This shall appear when the application is started. It introductes the exhibit and + instructs the user to use the 1 and 2 keyboard keys to select the radar. The 1 key + steps forward in a circle and the 2 key steps backward and the enter key makes the + selection diff --git a/CLAUDE.md b/CLAUDE.md index 6fbc873..eb12bf3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -115,7 +115,7 @@ of the component, for example 01_classes, 02_management, 03_chain_Home, and so o TEMPORARY TESTING FILES As each component if built, I may ask for temporary files to be created -for testing of the component. For example, I may ask for targets on a radar +for construction component. For example, I may ask for targets on a radar before any target handling code is made. I will indicated what is needed to be built. And when I am done testing, I will @@ -279,7 +279,6 @@ ssbo_target_information { // This is what is sent to the shaders as SSBO float beam; // Vessel beam bounds (meters) float course; // Course over ground vector (radians relative to True North) float altitude; // Target altitude profile (meters = 0 for boats) - time_t timestamp; // Data aging tracking identifier float current_reflectivity; // derivied from vessel_type (see table below) float height_estimate; // derived from vessel_type (see table below) float noiseglint; // derived from vessel_type (see table below) @@ -456,18 +455,9 @@ struct radar_management_structure { int operatable; // 1 is yes, 0 is no int available; // 1 is yes, 0 is no - this is the one controled by the exhibit owner int selected; // 1 is currently operating, 0 is not operating - int testing; // What is being developed and tested; 1 = overall management - including startup and radar selectionr, - 2 = chain_home, 3 = marine_ascope, 4 = marine_traffic, 5 = police_boat, 6 = traffic_cop, - 7 = simulator, and 8 = raspberry pi receiver }; -Note that if a radar is in testing, no other radars can be available. Also testing code can be used -to work on the radar being tested and developed -In the global data, we need these items: - struct radar_management_structure radar_management; -int current_radar; // 0 is none; 1 is chain_home; 2 is marine_ascope; 3 is marine_traffic; 4 is police_boat =========================================================================== diff --git a/global_data.cpp b/global_data.cpp index 56a1b73..2e5e7ed 100644 --- a/global_data.cpp +++ b/global_data.cpp @@ -54,6 +54,12 @@ 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; + /* ============================================================ * THREAD MUTEXES * Components: all threads as noted per mutex diff --git a/todo b/todo deleted file mode 100644 index 938e862..0000000 --- a/todo +++ /dev/null @@ -1,73 +0,0 @@ -● Let me survey the project structure and key files before sharing concerns. - - Searched for 1 pattern, read 7 files, listed 1 directory (ctrl+o to expand) - -● Good. I have a thorough picture now. Here are the concerns, ordered by severity: - - --- - Compile Blocker - - global_data.cpp will not compile. It uses TESTING_COMPONENT (line 51) which is defined in settings.h, - but the file only includes data_structure_and_constants.h. Neither that header nor global_data.cpp - includes settings.h. This is a straightforward fix — add #include "include/settings.h" to - global_data.cpp. - - --- - Design Concerns - - 1. time_t in ssbo_target_information cannot go to GLSL without an extension. - time_t on Linux 64-bit is int64_t (8 bytes). Standard GLSL std430 has no 64-bit integer type — it would - require the GL_ARB_gpu_shader_int64 extension. The Radeon 780M does support it, but it's non-standard - and requires explicit enablement in the shader source. The simpler fix: since the Traffic Cop already - discards targets older than 1 hour on the CPU, the timestamp serves no GPU-side purpose. Remove time_t - timestamp from ssbo_target_information — it belongs only in target_data_to_thread_1_structure. - - 2. Dual state for "which radar is active" risks going out of sync. - Both current_radar (an int) and radar_management[i].selected (a per-entry flag) track the active radar. - Any code that changes one must change the other, and it's easy to miss one. I'd recommend a setter - function (e.g., set_active_radar(int)) that updates both atomically. Otherwise you'll eventually have - current_radar == RADAR_MARINE_TRAFFIC while radar_management[3].selected == 0. - - 3. uniform_max_range is a single float, but range selection is discrete steps. - The settings define 4–5 discrete range values per scope (MARINE_A_SCOPE_RANGE_STEP_1 through _4, etc.), - but there's no index variable to track which step is currently selected. The keyboard handler for o/p - keys will need a per-scope step index that it increments/decrements, then looks up the appropriate step - value to write into uniform_max_range. That index variable doesn't exist anywhere yet. - - 4. Thread safety gap on uniform globals. - The uniform_* globals are written by Thread 6 (future physical controls) protected by - mutex_control_data_to_shaders, but Thread 1 reads them during the render loop without acquiring that - mutex. When Thread 6 is eventually built, this will be a data race. Worth designing the read-side - locking now so you don't have to retrofit it across all scopes later. - - --- - Missing Infrastructure - - 5. No CMakeLists.txt. Nothing will compile without it. It needs to link against: OpenGL, GLFW3, - FreeType, GDAL, and link in glad/src/glad.c. This should be built before any component .cpp file. - - 6. No main.cpp / Thread 1 entry point. Expected at this stage since components are being built - piecemeal, but the CMakeLists.txt will need a placeholder main.cpp to have an executable. - - --- - Minor - - 7. Misleading comment in global_data.cpp (line 48). It says "The testing field in slots 1-4 mirrors slot - 0 for convenient access" — but the initialization hardcodes TESTING_NONE in slots 1-4; there's no - mirror. Either remove that sentence or actually initialize them to radar_management[0].testing (which - can't be done in a static initializer anyway). Simplest fix: just delete that sentence from the comment. - - 8. police_location in 01_classes.md is described as float police_location. A position in 2D local - Cartesian space needs two components (x, y). When you get to the police boat shader uniform, that will - need to be a vec2 (two floats), not a single float. - - 9. simulation_data/simulation_journey is a placeholder. It has no values for target_x/target_y and a - non-parseable timestamp. This is fine for now, but the format needs to be defined when the simulator - component (Thread 3) is built. - - --- - Summary: The one item to fix immediately before writing code is the settings.h missing include in - global_data.cpp. The SSBO time_t issue should be resolved before the first shader is written. The rest - can be addressed as the relevant components are built. Want me to fix the global_data.cpp include now? - -✻ Cooked for 1m 46s