Skip to content

feat: Add stand assignment source tracking with runtime-configurable …#6

Closed
MrAdder wants to merge 24 commits into
mainfrom
issue-604a
Closed

feat: Add stand assignment source tracking with runtime-configurable …#6
MrAdder wants to merge 24 commits into
mainfrom
issue-604a

Conversation

@MrAdder

@MrAdder MrAdder commented Mar 16, 2026

Copy link
Copy Markdown
Owner

…colours

Copilot AI review requested due to automatic review settings March 16, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 just standId.
  • Register and render a new tag item (ID 200) to display the assignment source shorthand.
  • Introduce StandColourConfiguration to load/save per-source colours from EuroScope UserSetting.

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.

Comment thread src/plugin/stands/StandEventHandler.cpp
Comment thread src/plugin/stands/StandEventHandler.cpp
Comment thread src/plugin/stands/StandColourConfiguration.h Outdated
Comment thread src/plugin/stands/StandColourConfiguration.cpp Outdated
Comment thread src/plugin/stands/StandModule.cpp Outdated
Comment thread src/plugin/stands/StandModule.cpp Outdated
Comment thread src/plugin/stands/StandModule.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StandAssignmentSource metadata for each stand assignment (stand ID + source string).
  • Adds StandColourConfiguration to map assignment sources to COLORREF values (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.

Comment thread test/plugin/stands/StandEventHandlerTest.cpp Outdated
Comment thread src/plugin/stands/StandEventHandler.cpp Outdated
Comment thread src/plugin/stands/StandColourConfiguration.h
Comment thread src/plugin/stands/StandAssignmentSource.h

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 propagate assignment_source from API/push messages.
  • Add StandColourConfiguration to 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.

Comment thread src/plugin/stands/StandColourConfiguration.cpp
Comment thread src/plugin/stands/StandEventHandler.cpp
Comment thread src/plugin/stands/StandEventHandler.h Outdated
Repository owner deleted a comment from sonarqubecloud Bot Mar 16, 2026
@MrAdder MrAdder requested a review from Copilot March 16, 2026 20:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StandColourConfiguration to 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.

Comment on lines +146 to +156
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"
Comment on lines +316 to +321
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));
@sonarqubecloud

Copy link
Copy Markdown

@MrAdder MrAdder closed this Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants