API Documentation v0.0.1
Loading...
Searching...
No Matches
4A1_LC_Flood.h
1/**********************************************************************************************************************
2 * ____ _ _ _
3 * / __ \ | | | | | |
4 * | | | |_ __ ___ _ __ | |__| | ___ _ __ _ __ ___| |_
5 * | | | | '_ \ / _ \ '_ \| __ |/ _ \| '__| '_ \ / _ \ __|
6 * | |__| | |_) | __/ | | | | | | (_) | | | | | | __/ |_
7 * \____/| .__/ \___|_| |_|_| |_|\___/|_| |_| |_|\___|\__|
8 * | |
9 * |_|
10 * ----------------------------------------------------------------------------------
11 *
12 * @file 4A1_LC_Flood.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 flood lighting for the Left Console. Assumes all lights are connected to the same WS2812 strip.
18 *********************************************************************************************************************/
19
20
21#ifndef __LC_FLOOD_H
22#define __LC_FLOOD_H
23
24#include "DcsBios.h"
25#include "../helpers/Panel.h"
26
27/********************************************************************************************************************
28 * @brief This table defines the panel's LEDs.
29 * @details "Role" in this context refers to the LED role enum in the Panel.h file (enum used for memory efficiency).
30 * @remark This table is stored in PROGMEM for memory efficiency.
31 ********************************************************************************************************************/
32const int LCF_LED_COUNT = 40; // Total number of LEDs in the panel
33const Led lcFloodLedTable[LCF_LED_COUNT] PROGMEM = {
34 {0, LED_FLOOD}, {1, LED_FLOOD}, {2, LED_FLOOD}, {3, LED_FLOOD}, {4, LED_FLOOD},
35 {5, LED_FLOOD}, {6, LED_FLOOD}, {7, LED_FLOOD}, {8, LED_FLOOD}, {9, LED_FLOOD},
36 {10, LED_FLOOD}, {11, LED_FLOOD}, {12, LED_FLOOD}, {13, LED_FLOOD}, {14, LED_FLOOD},
37 {15, LED_FLOOD}, {16, LED_FLOOD}, {17, LED_FLOOD}, {18, LED_FLOOD}, {19, LED_FLOOD},
38 {20, LED_FLOOD}, {21, LED_FLOOD}, {22, LED_FLOOD}, {23, LED_FLOOD}, {24, LED_FLOOD},
39 {25, LED_FLOOD}, {26, LED_FLOOD}, {27, LED_FLOOD}, {28, LED_FLOOD}, {29, LED_FLOOD},
40 {30, LED_FLOOD}, {31, LED_FLOOD}, {32, LED_FLOOD}, {33, LED_FLOOD}, {34, LED_FLOOD},
41 {35, LED_FLOOD}, {36, LED_FLOOD}, {37, LED_FLOOD}, {38, LED_FLOOD}, {39, LED_FLOOD}
42};
43
44/********************************************************************************************************************
45 * @brief Left Console Flood Lighting class
46 * @details Backlighting controller for the Left Console flood lighting.
47 * Total LEDs: 55
48 * Backlight LEDs: 55 (all LEDs are backlights)
49 * Indicator LEDs: 0 (no indicators in this panel)
50 * @remark This class inherits from the "basic" Panel class in panels/Panel.h
51 * It also enforces a singleton pattern; this is required to use DCS-BIOS callbacks in class methods.
52 ********************************************************************************************************************/
53class LcFloodLights : public Panel {
54public:
62 static LcFloodLights* getInstance(int startIndex = 0, CRGB* ledStrip = nullptr) {
63 if (!instance) {
64 instance = new LcFloodLights(startIndex, ledStrip);
65 }
66 return instance;
67 }
68
69private:
76 LcFloodLights(int startIndex, CRGB* ledStrip) {
77 panelStartIndex = startIndex;
78 this->ledStrip = ledStrip;
79 ledCount = LCF_LED_COUNT;
80 ledTable = lcFloodLedTable;
81 }
82
83 // Instance data
84 // Note: Flood dimmer callback is handled centrally in Board.h
85 static LcFloodLights* instance;
86};
87
88// Initialize static instance pointer
89LcFloodLights* LcFloodLights::instance = nullptr;
90
91#endif
static LcFloodLights * getInstance(int startIndex=0, CRGB *ledStrip=nullptr)
Gets the singleton instance of the LcFloodLights class.
Definition Panel.h:41