/*
 * MIT License
 *
 * Copyright (c) 2026 Mark Allyn
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/*
 * settings.h
 * Author: Mark Allyn
 *
 * System-wide configuration and debug toggles.
 * Include this file in ALL components.
 * Change a value and recompile — no AI rewrite needed.
 *
 * Each section is labeled with the component name it governs.
 */

#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
 * Component: Thread 1 (initialization)
 * ============================================================ */

// 1 = enable GL_DEBUG_OUTPUT and glDebugMessageCallback at startup
#define ENABLE_GL_DEBUG_OUTPUT 1

/* ============================================================
 * THREAD 1 - OpenGL / Shader Init / Keyboard / Main Loop
 * ============================================================ */

// 1 = print shader compile and link status to stdout
#define DEBUG_SHADER_COMPILE 1

/* ============================================================
 * THREAD 2 - Traffic Cop
 * ============================================================ */

// 1 = print each target record received from simulator or Raspberry Pi
#define DEBUG_TRAFFIC_COP_INPUT 0

// 1 = print each target record handed off to Thread 1
#define DEBUG_TRAFFIC_COP_OUTPUT 0

/* ============================================================
 * THREAD 3 - Simulator
 * ============================================================ */

// 1 = print simulated target positions each update cycle
#define DEBUG_SIMULATOR_OUTPUT 0

/* ============================================================
 * SCOPE RENDERING - ISOLATION TOGGLES
 * Use these to isolate subsystems during development.
 * ============================================================ */

// 1 = disable P7 phosphor persistence layer (see raw target hits only)
#define DISABLE_P7_PERSISTENCE 0

// 1 = disable land and terrain rendering (see targets without background)
#define DISABLE_LAND_TERRAIN 0

// 1 = disable target rendering (see terrain/land background alone)
#define DISABLE_TARGETS 0

/* ============================================================
 * CHAIN HOME A-SCOPE
 * Component: Chain Home scope (1940s, World War 2)
 * ============================================================ */

// Fixed maximum range in km; the max_range control has no effect for this scope
#define CHAIN_HOME_MAX_RANGE_KM 200.0f

/* ============================================================
 * MARINE A-SCOPE
 * Component: 1940s marine A-scope (pre-PPI)
 * ============================================================ */

// Selectable maximum range steps in nautical miles (o/p keys cycle through these)
#define MARINE_A_SCOPE_NUM_RANGES   4
#define MARINE_A_SCOPE_RANGE_STEP_1  3.0f
#define MARINE_A_SCOPE_RANGE_STEP_2  6.0f
#define MARINE_A_SCOPE_RANGE_STEP_3 12.0f
#define MARINE_A_SCOPE_RANGE_STEP_4 24.0f

/* ============================================================
 * PPI SCOPE - MARINE TRAFFIC CONTROL
 * Component: PPI scope, marine traffic control station
 * ============================================================ */

// Selectable maximum range steps in nautical miles
#define PPI_MTC_NUM_RANGES   5
#define PPI_MTC_RANGE_STEP_1  3.0f
#define PPI_MTC_RANGE_STEP_2  6.0f
#define PPI_MTC_RANGE_STEP_3 12.0f
#define PPI_MTC_RANGE_STEP_4 24.0f
#define PPI_MTC_RANGE_STEP_5 48.0f

/* ============================================================
 * PPI SCOPE - ON-BOARD BOAT
 * Component: PPI scope, on-board boat view
 * ============================================================ */

// Selectable maximum range steps in nautical miles
#define PPI_BOAT_NUM_RANGES   5
#define PPI_BOAT_RANGE_STEP_1  1.5f
#define PPI_BOAT_RANGE_STEP_2  3.0f
#define PPI_BOAT_RANGE_STEP_3  6.0f
#define PPI_BOAT_RANGE_STEP_4 12.0f
#define PPI_BOAT_RANGE_STEP_5 24.0f
