Aggregates LED output mappings and drives controller lighting hardware.
More...
#include <ControllerLED.h>
Aggregates LED output mappings and drives controller lighting hardware.
ControllerLED holds a collection of ControllerLEDMapping instances and fans out SetLEDColor() calls to each one so that a single logical colour change activates the LED on every mapped physical device simultaneously.
Mappings are persisted in Config and applied via the standard load/save helpers.
◆ ControllerLED()
| Ship::ControllerLED::ControllerLED |
( |
uint8_t |
portIndex, |
|
|
std::shared_ptr< ConsoleVariable > |
consoleVariable = nullptr, |
|
|
std::shared_ptr< ControlDeck > |
controlDeck = nullptr |
|
) |
| |
Constructs a ControllerLED for the given port.
- Parameters
-
| portIndex | Zero-based port index. |
◆ ~ControllerLED()
| Ship::ControllerLED::~ControllerLED |
( |
| ) |
|
◆ AddLEDMapping()
Adds an LED mapping to the collection.
- Parameters
-
| mapping | Mapping to add. Its ID must be unique. |
◆ AddLEDMappingFromRawPress()
| bool Ship::ControllerLED::AddLEDMappingFromRawPress |
( |
| ) |
|
Listens for the next raw physical input and creates an LED mapping from it.
- Returns
- true if a mapping was successfully created.
◆ ClearAllMappings()
| void Ship::ControllerLED::ClearAllMappings |
( |
| ) |
|
Removes all in-memory LED mappings.
◆ ClearAllMappingsForDeviceType()
| void Ship::ControllerLED::ClearAllMappingsForDeviceType |
( |
PhysicalDeviceType |
physicalDeviceType | ) |
|
Removes all mappings that target the given device type.
- Parameters
-
| physicalDeviceType | Device type whose mappings should be cleared. |
◆ ClearLEDMapping()
| void Ship::ControllerLED::ClearLEDMapping |
( |
std::string |
id | ) |
|
Removes the mapping with id from both in-memory and Config.
- Parameters
-
◆ ClearLEDMappingId()
| void Ship::ControllerLED::ClearLEDMappingId |
( |
std::string |
id | ) |
|
Removes the mapping ID from Config without destroying the in-memory object.
- Parameters
-
◆ GetAllLEDMappings()
| std::unordered_map< std::string, std::shared_ptr< ControllerLEDMapping > > Ship::ControllerLED::GetAllLEDMappings |
( |
| ) |
|
Returns a copy of the full id → mapping map.
◆ HasMappingsForPhysicalDeviceType()
| bool Ship::ControllerLED::HasMappingsForPhysicalDeviceType |
( |
PhysicalDeviceType |
physicalDeviceType | ) |
|
Returns true if any mapping targets the given device type.
- Parameters
-
| physicalDeviceType | Device type to query. |
◆ LoadLEDMappingFromConfig()
| void Ship::ControllerLED::LoadLEDMappingFromConfig |
( |
std::string |
id | ) |
|
Loads the mapping with id from Config and adds it to the collection.
- Parameters
-
| id | Mapping UUID stored in Config. |
◆ ReloadAllMappingsFromConfig()
| void Ship::ControllerLED::ReloadAllMappingsFromConfig |
( |
| ) |
|
Clears all in-memory mappings and reloads them from Config.
◆ SaveLEDMappingIdsToConfig()
| void Ship::ControllerLED::SaveLEDMappingIdsToConfig |
( |
| ) |
|
Writes the current set of mapping IDs to Config.
◆ SetControlDeck()
| void Ship::ControllerLED::SetControlDeck |
( |
std::shared_ptr< ControlDeck > |
controlDeck | ) |
|
|
inline |
◆ SetLEDColor()
| void Ship::ControllerLED::SetLEDColor |
( |
Color_RGB8 |
color | ) |
|
Sends color to all mapped physical devices.
- Parameters
-
| color | RGB colour to apply to the controller LED(s). |
The documentation for this class was generated from the following file: