fix: carry LED segment mask to GUI preview via FrameSent#180
Open
kali-urs wants to merge 1 commit into
Open
Conversation
The GUI simulated LED display was showing all segments lit because FrameSent only carried display_colors but not the on/off mask computed by compute_mask(). This meant the preview never knew which segments should actually be lit for segment-display styles (TEMP_LINKED, etc.). - Add field to FrameSent event (list of bool, default empty) - Pass mask from RenderLed.execute() when publishing FrameSent - Wire mask through TRCCApp._on_bus_frame_sent → LEDHandler.handle_frame - Add UCLedControl.set_led_colors() optional mask parameter - Add UCScreenLED.set_mask() to update on/off state per tick - Check _is_on in _paint_led_rects() so masked-off segments stay dim Fixes the GUI preview on macOS where all segments appeared lit regardless of the actual hardware mask.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The GUI simulated LED segment display was showing all segments lit regardless of mode. This happened because
FrameSentonly carrieddisplay_colorsbut not themask(on/off boolean list) computed bycompute_mask(). For segment-display styles likeTEMP_LINKED,LOAD_LINKED, etc., the preview would show all segments illuminated even though only specific segments should be lit.Fix
mask: listfield toFrameSentevent (default empty, backward compatible)maskfromRenderLed.execute()when publishingFrameSentTRCCApp._on_bus_frame_sent→LEDHandler.handle_framemaskparameter toUCLedControl.set_led_colors()UCScreenLED.set_mask()to update on/off state per tick_is_onin_paint_led_rects()so masked-off segments stay dim (grey underlay only)Files changed
src/trcc/core/events.py— add mask fieldsrc/trcc/core/commands/led.py— publish mask with FrameSentsrc/trcc/ui/gui/trcc_app.py— bridge mask from eventsrc/trcc/ui/gui/led_handler.py— extract and forward masksrc/trcc/ui/gui/uc_led_control.py— accept optional masksrc/trcc/ui/gui/uc_screen_led.py— set_mask() + render checkTesting
Tested on macOS 26.6 (Intel x86_64) with PA120 Digital (0416:8001):