adding globals and constants
This commit is contained in:
@@ -109,17 +109,19 @@ struct target_data_to_thread_1_structure {
|
||||
* ============================================================ */
|
||||
|
||||
/* Index constants for radar_management[] and current_radar.
|
||||
* Array slot 0 (RADAR_NONE) is unused padding so current_radar
|
||||
* can be used as a direct index into radar_management[]. */
|
||||
constexpr int RADAR_NONE = 0;
|
||||
* Slot 0 (RADAR_NONE) is the management/system entry; its testing field
|
||||
* holds the system-wide test mode. Radar entries are slots 1-4. */
|
||||
constexpr int RADAR_NONE = 0; // management/system entry
|
||||
constexpr int RADAR_CHAIN_HOME = 1;
|
||||
constexpr int RADAR_MARINE_ASCOPE = 2;
|
||||
constexpr int RADAR_MARINE_TRAFFIC = 3;
|
||||
constexpr int RADAR_POLICE_BOAT = 4;
|
||||
constexpr int RADAR_COUNT = 5; // valid indices: 1-4; 0 is unused
|
||||
constexpr int RADAR_COUNT = 5; // total slots: 0 (management) + 1-4 (radars)
|
||||
|
||||
/* Per-radar operational state.
|
||||
* Indexed by RADAR_* constants above; slot 0 is unused.
|
||||
* Indexed by RADAR_* constants above.
|
||||
* Slot 0 (RADAR_NONE) is the management/system entry — its testing field
|
||||
* holds the active TESTING_* mode for the entire exhibit.
|
||||
* Components: Thread 1 (startup init, scope switching),
|
||||
* Traffic Cop (Thread 2, range filtering) */
|
||||
struct radar_management_structure {
|
||||
@@ -127,11 +129,15 @@ struct radar_management_structure {
|
||||
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 selected; // 1 = currently active/displayed, 0 = not active
|
||||
int testing; // TESTING_* constant: component under development (TESTING_NONE = normal operation)
|
||||
// Only radar_management[0].testing is meaningful — it is the system-wide test mode.
|
||||
};
|
||||
|
||||
// Array of radar states, indexed by RADAR_* constants.
|
||||
// radar_management[0] is unused padding.
|
||||
// Components: Thread 1, Traffic Cop (Thread 2)
|
||||
/* Array of radar states, indexed by RADAR_* constants.
|
||||
* radar_management[0] is the management/system entry; its testing field
|
||||
* holds the system-wide TESTING_* mode (see below).
|
||||
* Access the active testing mode via: radar_management[RADAR_NONE].testing
|
||||
* Components: Thread 1, Traffic Cop (Thread 2) */
|
||||
extern radar_management_structure radar_management[RADAR_COUNT];
|
||||
|
||||
// Index of the currently active radar (RADAR_NONE through RADAR_POLICE_BOAT).
|
||||
@@ -139,8 +145,8 @@ extern radar_management_structure radar_management[RADAR_COUNT];
|
||||
// Components: Thread 1, Traffic Cop (Thread 2), all scope renderers
|
||||
extern int current_radar;
|
||||
|
||||
/* Component identifiers for testing_component.
|
||||
* When testing_component is non-zero, only that component is active and
|
||||
/* Component identifiers for radar_management[RADAR_NONE].testing.
|
||||
* When that field is non-zero, only the named 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 */
|
||||
@@ -154,10 +160,9 @@ 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;
|
||||
/* radar_management[RADAR_NONE].testing is initialized from TESTING_COMPONENT in settings.h.
|
||||
* Set TESTING_COMPONENT to TESTING_NONE for normal exhibit operation.
|
||||
* Components: Thread 1 (startup gating), all components */
|
||||
|
||||
/* ============================================================
|
||||
* THREAD MUTEXES
|
||||
|
||||
@@ -42,11 +42,12 @@
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* test mode. Stored in radar_management[RADAR_NONE].testing at startup.
|
||||
* 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_MANAGEMENT = 1 setup and radar selection (02_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
|
||||
@@ -54,6 +55,8 @@
|
||||
* TESTING_TRAFFIC_COP = 6 traffic cop (Thread 2)
|
||||
* TESTING_SIMULATOR = 7 simulator (Thread 3)
|
||||
* TESTING_RASPBERRY_PI = 8 raspberry pi receiver (Thread 5)
|
||||
*
|
||||
* Read the active mode at runtime via: radar_management[RADAR_NONE].testing
|
||||
*/
|
||||
#define TESTING_COMPONENT TESTING_NONE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user