feat: Add stand assignment source tracking with runtime-configurable …#6
feat: Add stand assignment source tracking with runtime-configurable …#6MrAdder wants to merge 24 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds stand-assignment source tracking and uses that source to drive runtime-configurable tag colours via EuroScope user settings.
Changes:
- Track stand assignments as
{standId, source}instead of juststandId. - Register and render a new tag item (ID 200) to display the assignment source shorthand.
- Introduce
StandColourConfigurationto load/save per-source colours from EuroScopeUserSetting.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/plugin/stands/StandModule.cpp | Boots stand colour configuration and registers the new tag item. |
| src/plugin/stands/StandEventHandler.h | Extends assignment state to include source + injects colour configuration. |
| src/plugin/stands/StandEventHandler.cpp | Propagates assignment source from user/system/messages and sets tag colours + new tag item output. |
| src/plugin/stands/StandColourConfiguration.h | Declares configuration object for mapping source → COLORREF with persistence hooks. |
| src/plugin/stands/StandColourConfiguration.cpp | Implements loading/saving colour settings and defaults. |
| src/plugin/stands/StandAssignmentSource.h | Defines the {standId, source} structure and supported source constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR adds stand assignment source tracking (e.g., user vs allocator vs system) and uses that source to drive tag item display and colouring, with colours loaded/saved via EuroScope user settings.
Changes:
- Introduces
StandAssignmentSourcemetadata for each stand assignment (stand ID + source string). - Adds
StandColourConfigurationto map assignment sources toCOLORREFvalues (with UserSetting persistence). - Registers and renders a new tag item (ID 200) to display assignment source shorthand, and colours both stand/source tag items by source.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/plugin/stands/StandEventHandlerTest.cpp | Adds tests for source tag item (200) and source-based colouring. |
| src/plugin/stands/StandModule.cpp | Wires StandColourConfiguration into StandEventHandler and registers tag item 200. |
| src/plugin/stands/StandEventHandler.h | Extends constructor to accept colour configuration; stores assignments with source; defines tag item IDs. |
| src/plugin/stands/StandEventHandler.cpp | Applies source tracking to assignments; adds tag item 200 rendering + colour selection; parses assignment_source. |
| src/plugin/stands/StandColourConfiguration.h | New configuration class for per-source colours with UserSetting persistence. |
| src/plugin/stands/StandColourConfiguration.cpp | Implements UserSetting load/save and per-source colour lookup. |
| src/plugin/stands/StandAssignmentSource.h | New struct to store stand assignment + source constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds stand assignment source tracking to the stands subsystem and exposes it via a new TAG item, with per-source colours loaded from (and persisted to) EuroScope user settings.
Changes:
- Track stand assignments as
{standId, source}and propagateassignment_sourcefrom API/push messages. - Add
StandColourConfigurationto resolve per-source colours (default + user-configurable via UserSetting). - Add new TAG item (id
200) showing a source shorthand and colourize both stand + source TAG items; extend unit tests accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/plugin/stands/StandEventHandlerTest.cpp | Adds tests for new tag item 200 (source shorthand) and colour selection by source. |
| src/plugin/stands/StandModule.cpp | Wires StandColourConfiguration into StandEventHandler and registers the new TAG item. |
| src/plugin/stands/StandEventHandler.h | Extends API to accept colour configuration; changes assignment storage to include source; defines tag item IDs. |
| src/plugin/stands/StandEventHandler.cpp | Implements source parsing/shorthand, colours tags based on source, and logs source on assignment. |
| src/plugin/stands/StandColourConfiguration.h | Introduces configuration object for source→colour mapping with UserSetting persistence. |
| src/plugin/stands/StandColourConfiguration.cpp | Implements load/save and runtime updates of source colours. |
| src/plugin/stands/StandAssignmentSource.h | Defines the {standId, source} struct and canonical source strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…mproved source handling
… stands source group
There was a problem hiding this comment.
Pull request overview
Adds stand-assignment source tracking to the stands subsystem, exposing the source in a new tag item and applying source-specific colouring that can be loaded from EuroScope user settings.
Changes:
- Extend stand assignment storage to include a “source” alongside stand ID, and propagate source through API/push assignment handling.
- Add
StandColourConfigurationto resolve per-source colours (with UserSetting-backed persistence when available). - Register a new tag item (ID 200) to display assignment source shorthand and apply source-based colours; expand unit tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/plugin/stands/StandEventHandlerTest.cpp | Adds coverage for source shorthand tag item (200) and source-based colouring for tag items 110/200. |
| src/plugin/stands/StandModule.cpp | Bootstraps StandColourConfiguration (from user settings when available) and registers the new tag item. |
| src/plugin/stands/StandEventHandler.h | Updates handler API/state to store assignment source and introduces tag item constants for 110/200. |
| src/plugin/stands/StandEventHandler.cpp | Implements source parsing/shorthand, stores source with assignments, and applies source-based tag colours. |
| src/plugin/stands/StandColourConfiguration.h | Introduces configuration class for mapping assignment source → COLORREF (optional persistence). |
| src/plugin/stands/StandColourConfiguration.cpp | Implements loading/saving colours via UserSetting and runtime updates. |
| src/plugin/stands/StandAssignmentSource.h | Defines the stand assignment + source payload and the supported source constants. |
| src/plugin/CMakeLists.txt | Adds new stands source/config files to the build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| auto StandColourConfiguration::ColourrefToHex(COLORREF colour) -> std::string | ||
| { | ||
| // COLORREF is BGR format, convert to RGB for hex | ||
| const auto b = static_cast<uint8_t>((colour >> 0) & 0xFF); | ||
| const auto g = static_cast<uint8_t>((colour >> 8) & 0xFF); | ||
| const auto r = static_cast<uint8_t>((colour >> 16) & 0xFF); | ||
|
|
||
| std::stringstream ss; | ||
| ss << "#" << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(r) << std::setw(2) | ||
| << static_cast<int>(g) << std::setw(2) << static_cast<int>(b); | ||
| return ss.str(); |
| #include "StandColourConfiguration.h" | ||
| #include "StandAssignmentSource.h" | ||
| #include "euroscope/UserSetting.h" | ||
| #include "helper/HelperFunctions.h" |
| tagData.SetTagColour(this->colourConfiguration->GetColourForSource(assignment.source)); | ||
| } | ||
| // Tag item: Show assignment source shorthand | ||
| else if (tagData.GetItemCode() == standAssignmentSourceTagItemId) { | ||
| tagData.SetItemString(GetAssignmentSourceShorthand(assignment.source)); | ||
| tagData.SetTagColour(this->colourConfiguration->GetColourForSource(assignment.source)); |
…ed configuration handling
Push for CI build due to issues with the DevContainer
Restricted color Selector to just User and System Auto for now until functionality is worked in on API end
|



…colours