API Documentation v0.0.1
Loading...
Searching...
No Matches
2A2A1A4_Jett_Placard_Panel.h
1/**********************************************************************************************************************
2 * ____ _ _ _
3 * / __ \ | | | | | |
4 * | | | |_ __ ___ _ __ | |__| | ___ _ __ _ __ ___| |_
5 * | | | | '_ \ / _ \ '_ \| __ |/ _ \| '__| '_ \ / _ \ __|
6 * | |__| | |_) | __/ | | | | | | (_) | | | | | | __/ |_
7 * \____/| .__/ \___|_| |_|_| |_|\___/|_| |_| |_|\___|\__|
8 * | |
9 * |_|
10 * ----------------------------------------------------------------------------------
11 *
12 * @file 2A2A1A4_Jett_Placard_Panel.h
13 * @author Ulukaii
14 * @date 24.05.2025
15 * @version t 0.3.2
16 * @copyright Copyright 2016-2025 OpenHornet. See 2A13-BACKLIGHT_CONTROLLER.ino for details.
17 * @brief Implements backlighting for the Jett Placard panel.
18 * It consists of two parts:
19 * - An array with the LEDs and their roles (LED_INSTR_BL)
20 * - A class that implements the panel's functionality
21 *********************************************************************************************************************/
22
23
24#ifndef __JETT_PLACARD_PANEL_H
25#define __JETT_PLACARD_PANEL_H
26
27#include "DcsBios.h"
28#include "../helpers/Panel.h"
29
30
31/********************************************************************************************************************
32 * @brief This table defines the panel's LEDs.
33 * @details "Role" in this context refers to the LED role enum in the LedRole.h file (enum used for memory efficiency).
34 * @remark This table is stored in PROGMEM for memory efficiency.
35 * @see LedRole.h for the list of LED roles and LedStruct.h for the Led structure.
36 ********************************************************************************************************************/
37const int JETT_PLACARD_LED_COUNT = 8; // Total number of LEDs in the panel
38const Led jettPlacardLedTable[JETT_PLACARD_LED_COUNT] PROGMEM = {
39 {0, LED_INSTR_BL}, {1, LED_INSTR_BL}, {2, LED_INSTR_BL}, {3, LED_INSTR_BL},
40 {4, LED_INSTR_BL}, {5, LED_INSTR_BL}, {6, LED_INSTR_BL}, {7, LED_INSTR_BL}
41};
42
43/********************************************************************************************************************
44 * @brief Jett Placard Panel class
45 * @details Backlighting controller for the Jett Placard panel.
46 * Total LEDs: 8
47 * Backlight LEDs: 8 (all LEDs are backlights)
48 * Indicator LEDs: 0 (no indicators in this panel)
49 * @remark This class inherits from the "basic" Panel class in panels/Panel.h
50 * It also enforces a singleton pattern; this is required to use DCS-BIOS callbacks in class methods.
51 * @see Panel.h for the base class implementation
52 ********************************************************************************************************************/
53class JettPlacardPanel : public Panel {
54public:
62 static JettPlacardPanel* getInstance(int startIndex = 0, CRGB* ledStrip = nullptr) {
63 if (!instance) {
64 instance = new JettPlacardPanel(startIndex, ledStrip);
65 }
66 return instance;
67 }
68
69private:
76 JettPlacardPanel(int startIndex, CRGB* ledStrip) {
77 panelStartIndex = startIndex;
78 this->ledStrip = ledStrip;
79 ledCount = JETT_PLACARD_LED_COUNT;
80 ledTable = jettPlacardLedTable;
81 }
82
83 // Static callback functions for DCS-BIOS
84 // NIL
85
86 // Instance data
87 static JettPlacardPanel* instance;
88};
89
90// Initialize static instance pointer
91JettPlacardPanel* JettPlacardPanel::instance = nullptr;
92
93#endif
static JettPlacardPanel * getInstance(int startIndex=0, CRGB *ledStrip=nullptr)
Gets the singleton instance of the JettPlacardPanel class.
Definition Panel.h:41