93 lines
3.2 KiB
C++
93 lines
3.2 KiB
C++
/*
|
|
* 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.
|
|
*/
|
|
|
|
/*
|
|
* 01_classes.h
|
|
* Author: Mark Allyn
|
|
* Component: 01_classes
|
|
*
|
|
* Abstract RadarBase class and four stub subclasses.
|
|
* Each stub renders its name and description in the three screen panels.
|
|
* No real radar simulation is performed here; this is for testing
|
|
* the initialization and radar-management/selection flow.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "data_structure_and_constants.h"
|
|
#include "settings.h"
|
|
|
|
/* Abstract base — one instance per radar type. */
|
|
class RadarBase {
|
|
public:
|
|
/* Render radar description and control list into the left panel viewport. */
|
|
virtual void render_left_panel() = 0;
|
|
|
|
/* Render scope content (stub: radar name only) into the scope viewport. */
|
|
virtual void render_scope() = 0;
|
|
|
|
/* Render current control values into the status bar viewport. */
|
|
virtual void render_status_bar() = 0;
|
|
|
|
virtual ~RadarBase() = default;
|
|
};
|
|
|
|
/* Chain Home radar (1940s A-scope) — Ventnor, Isle of Wight. */
|
|
class ChainHomeRadar : public RadarBase {
|
|
public:
|
|
void render_left_panel() override;
|
|
void render_scope() override;
|
|
void render_status_bar() override;
|
|
};
|
|
|
|
/* Marine A-Scope radar — Community Boating Center, Bellingham Bay. */
|
|
class MarineAScopeRadar : public RadarBase {
|
|
public:
|
|
void render_left_panel() override;
|
|
void render_scope() override;
|
|
void render_status_bar() override;
|
|
};
|
|
|
|
/* Marine Traffic Control PPI radar — center of Bellingham Bay. */
|
|
class MarineTrafficRadar : public RadarBase {
|
|
public:
|
|
void render_left_panel() override;
|
|
void render_scope() override;
|
|
void render_status_bar() override;
|
|
};
|
|
|
|
/* Police Boat PPI radar — Taylor Dock / Boulevard Park, Bellingham Bay. */
|
|
class PoliceboatRadar : public RadarBase {
|
|
public:
|
|
void render_left_panel() override;
|
|
void render_scope() override;
|
|
void render_status_bar() override;
|
|
};
|
|
|
|
/* One global instance per radar — indexed by RADAR_* constants in main.cpp. */
|
|
extern ChainHomeRadar g_chain_home;
|
|
extern MarineAScopeRadar g_marine_ascope;
|
|
extern MarineTrafficRadar g_marine_traffic;
|
|
extern PoliceboatRadar g_police_boat;
|