fix(meters): voltage gauge label now shows live radio voltage#2362
Merged
jensenpat merged 1 commit intoten9876:mainfrom May 5, 2026
Merged
Conversation
The supply voltage HGauge was constructed with a static "+13.8V" label that never updated. The bar fill moved correctly via setValue(), but the centred text always displayed the nominal 13.8 V regardless of actual radio-reported voltage (e.g. 13.28 V). Added HGauge::setLabel() — a lightweight setter that updates m_label and triggers a repaint only when the string changes. MeterApplet now calls it inside the hwTelemetryChanged handler alongside setValue(), formatting the live voltage as "+XX.XXV" (2 decimal places, matching radio precision). The static "+13.8V" tick label on the scale is intentional — it marks the nominal target voltage on the bar, not the current reading. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
There was a problem hiding this comment.
Looks good — small, focused fix that does exactly what it says.
A few nice things worth calling out:
HGauge::setLabel()mirrors the existingsetValue()pattern (early-out on no-op, thenupdate()). Consistent with how the rest of the widget is written.- Formatting
+%1Vwith'f', 2matches the radio's reported voltage precision and lines up with the existing+13.8Vtick label style on the scale. - The PR description correctly clarifies that the tick label
13.8on the scale stays static (it marks the nominal target) while the centered label now tracks live voltage — that distinction is right and worth keeping in the commit history. - No null-pointer or lifetime concerns — the lambda captures
thisand the gauge is owned by the applet, andsetLabel/setValueonly fire from thehwTelemetryChangedsignal.
No issues found. Thanks @chibondking — clean fix.
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.
The supply voltage HGauge was constructed with a static "+13.8V" label that never updated. The bar fill moved correctly via setValue(), but the centred text always displayed the nominal 13.8 V regardless of actual radio-reported voltage (e.g. 13.28 V).
Added HGauge::setLabel() — a lightweight setter that updates m_label and triggers a repaint only when the string changes. MeterApplet now calls it inside the hwTelemetryChanged handler alongside setValue(), formatting the live voltage as "+XX.XXV" (2 decimal places, matching radio precision).
The static "+13.8V" tick label on the scale is intentional — it marks the nominal target voltage on the bar, not the current reading.