Update for radar testing and operation and added first component .md file

This commit is contained in:
2026-06-13 22:14:09 -07:00
parent 3711121e0f
commit 0d95fac945
5 changed files with 101 additions and 21 deletions

View File

@@ -200,26 +200,32 @@ Overall control information
These are knobs on the panel once that is built. Keyboard keys until then These are knobs on the panel once that is built. Keyboard keys until then
1. Intensity - scope overall intensity - Keyboard 3 is lower; 4 is higher - uniform is float intensity; 1. Radar Selection - which radar to run. Selection is done with up or down; the radars are to be
2. Receiver Sensitivity - signal intensity - Keyboard 5 is lower; 6 is higher - uniform is float sensitivity; in the selection order as follows 1, chain_home; 2, marine_ascope; 3, marine_traffic; 4, police boat.
3. STC Sensitivity - sensitivity for closer in targets which can overwhelm When the application is started, chain_home is current selection. You go up, then marine_ascope is
selected. And so on. Then you hit enter to activate the selected radar. The Keyboard is 1 for going
forward; 2 for going backward. Note that when a radar is operating, you can go back to the selection
bt using the 1 key to go back to the selection.
2. Intensity - scope overall intensity - Keyboard 3 is lower; 4 is higher - uniform is float intensity;
3. Receiver Sensitivity - signal intensity - Keyboard 5 is lower; 6 is higher - uniform is float sensitivity;
4. STC Sensitivity - sensitivity for closer in targets which can overwhelm
overall sensitivity - keyboard q for lower; w for higher - uniform is float stc_sensitivity; overall sensitivity - keyboard q for lower; w for higher - uniform is float stc_sensitivity;
4. STC Range - range to which sensitivity to closer targets is effective 5. STC Range - range to which sensitivity to closer targets is effective
keyboard e for lower; r for higher - uniform is float stc_range; keyboard e for lower; r for higher - uniform is float stc_range;
5. Noise filter for rain noise. This is for the ppi scopes. keyboard t for decrease filtering and y 6. Noise filter for rain noise. This is for the ppi scopes. keyboard t for decrease filtering and y
to increase filtering - uniform is float noise_filter; to increase filtering - uniform is float noise_filter;
6. Radiogoniometer knob for Chain Home; keyboard u for left turn; 7. Radiogoniometer knob for Chain Home; keyboard u for left turn;
i for right turn. - uniform is float radiogoniometer; i for right turn. - uniform is float radiogoniometer;
7. Maximum Range for all scopes except for chain home, which is fixed. This control 8. Maximum Range for all scopes except for chain home, which is fixed. This control
will not operate for Chain Home. These maximum will not operate for Chain Home. These maximum
range selections will be defined for each scope; If you try to go beyond the stated range selections will be defined for each scope; If you try to go beyond the stated
maximum ranges, the control will have no effect; note that the default maximum range would maximum ranges, the control will have no effect; note that the default maximum range would
be the highest for that scope; keyboard o for lower; p for higher uniform is float max_range; be the highest for that scope; keyboard o for lower; p for higher uniform is float max_range;
8. Range Cursor (for ppi scopes, not for a scopes) 9. Range Cursor (for ppi scopes, not for a scopes)
keyboard a for lower; s for higher - uniform is float range_cursor; keyboard a for lower; s for higher - uniform is float range_cursor;
9. Bearing Cursor (for all ppi scopes; not for a scopes) 10. Bearing Cursor (for all ppi scopes; not for a scopes)
keyboard d for counterclockwise f for clockwise uniform is float bearing_cursor; keyboard d for counterclockwise f for clockwise uniform is float bearing_cursor;
10. Bearing for Marine A Scope. This is not for a cursor, but this operates the motor 11. Bearing for Marine A Scope. This is not for a cursor, but this operates the motor
that revolves the antenna unit keyboard g for counterclockwise and h for clockwise that revolves the antenna unit keyboard g for counterclockwise and h for clockwise
uniform is float marine_a_bearing; uniform is float marine_a_bearing;
@@ -436,11 +442,21 @@ data structure.
Here is a suggested global data for managing the radars: Here is a suggested global data for managing the radars:
struct radar_management_structure { struct radar_management_structure {
int radar_type // 1 is chain_home; 2 is marine_ascope; 3 = marine_traffic 4 = police_boat
int operatable; // 1 is yes, 0 is no 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 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 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 int current_radar; // 0 is none; 1 is chain_home; 2 is marine_ascope; 3 is marine_traffic; 4 is police_boat

View File

@@ -39,21 +39,27 @@
/* radar_management[] is indexed by RADAR_* constants (1-4). /* radar_management[] is indexed by RADAR_* constants (1-4).
* Slot 0 is unused padding so current_radar works as a direct index. * Slot 0 is unused padding so current_radar works as a direct index.
* All fields start at 0. Set testing=1 when a radar component is under * radar_type mirrors the array index for callers that receive a single
* active development; set operatable=1 when it is built and tested. * struct by value. operatable is set to 1 once a radar is fully built.
* available and selected are set during startup argument parsing. */ * available and selected are set during startup argument parsing. */
radar_management_structure radar_management[RADAR_COUNT] = { radar_management_structure radar_management[RADAR_COUNT] = {
{ 0, 0, 0, 0 }, // [0] unused { RADAR_NONE, 0, 0, 0 }, // [0] unused
{ 0, 0, 0, 0 }, // [1] chain_home — not yet built { RADAR_CHAIN_HOME, 0, 0, 0 }, // [1] chain_home — not yet built
{ 0, 0, 0, 0 }, // [2] marine_ascope — not yet built { RADAR_MARINE_ASCOPE, 0, 0, 0 }, // [2] marine_ascope — not yet built
{ 0, 0, 0, 0 }, // [3] marine_traffic — not yet built { RADAR_MARINE_TRAFFIC, 0, 0, 0 }, // [3] marine_traffic — not yet built
{ 0, 0, 0, 0 }, // [4] police_boat — not yet built { RADAR_POLICE_BOAT, 0, 0, 0 }, // [4] police_boat — not yet built
}; };
// No radar selected on startup; intro screen is displayed. // No radar selected on startup; intro screen is displayed.
// 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;
// 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 * THREAD MUTEXES
* Components: all threads as noted per mutex * Components: all threads as noted per mutex

View File

@@ -123,7 +123,7 @@ constexpr int RADAR_COUNT = 5; // valid indices: 1-4; 0 is unused
* Components: Thread 1 (startup init, scope switching), * Components: Thread 1 (startup init, scope switching),
* Traffic Cop (Thread 2, range filtering) */ * Traffic Cop (Thread 2, range filtering) */
struct radar_management_structure { struct radar_management_structure {
int testing; // 1 = radar component is under development/testing, 0 = not in testing int radar_type; // RADAR_* constant identifying which radar this entry represents
int operatable; // 1 = radar is built and fully functional, 0 = not yet built int operatable; // 1 = radar is built and fully functional, 0 = not yet built
int available; // 1 = enabled by exhibit operator at startup, 0 = disabled int available; // 1 = enabled by exhibit operator at startup, 0 = disabled
int selected; // 1 = currently active/displayed, 0 = not active int selected; // 1 = currently active/displayed, 0 = not active
@@ -139,6 +139,26 @@ extern 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
extern int current_radar; extern int current_radar;
/* Component identifiers for testing_component.
* When testing_component is non-zero, only that component is active and
* no other radars can be made available.
* Values 2-5 correspond to RADAR_* constants for the four radar types.
* Components: Thread 1 (startup), all components that gate on test mode */
constexpr int TESTING_NONE = 0; // normal exhibit operation
constexpr int TESTING_MANAGEMENT = 1; // setup and radar selection (this module)
constexpr int TESTING_CHAIN_HOME = 2; // chain home A-scope
constexpr int TESTING_MARINE_ASCOPE = 3; // marine A-scope
constexpr int TESTING_MARINE_TRAFFIC = 4; // marine traffic control PPI
constexpr int TESTING_POLICE_BOAT = 5; // police boat PPI
constexpr int TESTING_TRAFFIC_COP = 6; // traffic cop (Thread 2)
constexpr int TESTING_SIMULATOR = 7; // simulator (Thread 3)
constexpr int TESTING_RASPBERRY_PI = 8; // raspberry pi receiver (Thread 5)
// Active component under development; initialized from TESTING_COMPONENT in settings.h.
// Set to TESTING_NONE for normal exhibit operation.
// Components: Thread 1 (startup gating), all components
extern int testing_component;
/* ============================================================ /* ============================================================
* THREAD MUTEXES * THREAD MUTEXES
* Defined in global_data.cpp; extern declared here. * Defined in global_data.cpp; extern declared here.

View File

@@ -35,6 +35,28 @@
#pragma once #pragma once
/* ============================================================
* TESTING MODE
* Component: all components (read at startup by Thread 1)
* ============================================================ */
/*
* Set to a TESTING_* constant to put the exhibit in single-component
* test mode. When non-zero, only the named component is active and
* no other radars can be made available.
*
* TESTING_NONE = 0 normal exhibit operation
* TESTING_MANAGEMENT = 1 setup and radar selection
* TESTING_CHAIN_HOME = 2 chain home A-scope
* TESTING_MARINE_ASCOPE = 3 marine A-scope
* TESTING_MARINE_TRAFFIC = 4 marine traffic control PPI
* TESTING_POLICE_BOAT = 5 police boat PPI
* TESTING_TRAFFIC_COP = 6 traffic cop (Thread 2)
* TESTING_SIMULATOR = 7 simulator (Thread 3)
* TESTING_RASPBERRY_PI = 8 raspberry pi receiver (Thread 5)
*/
#define TESTING_COMPONENT TESTING_NONE
/* ============================================================ /* ============================================================
* GENERAL / OPENGL DEBUG * GENERAL / OPENGL DEBUG
* Component: Thread 1 (initialization) * Component: Thread 1 (initialization)

View File

@@ -0,0 +1,16 @@
The setup_and_radar_selection module handles the housekeeping of starting the radar exhibit.
It will use the radar_management_structure, which is in global data, will be used by this
module to manage what radars are available and which one is selected.
The selection of which radars are to be available to the museum visitors is accomplished
my entering the radars that will be available as parameters of the command for example:
radar_simulator chain_home marine_ascope marine_traffic police_boat - all radars
radar_simulator marine_ascope - only the marine ascope radar
Note: if the operator invokes no parameters, then all the radars are to be made available.
When the application is started, it will be in a state where no radar is in use. The visitor
will use the selector to select a radar to operate.