Skip to content

fix(meters): voltage gauge label now shows live radio voltage#2362

Merged
jensenpat merged 1 commit intoten9876:mainfrom
chibondking:fix/voltage-meter-label-actual-value
May 5, 2026
Merged

fix(meters): voltage gauge label now shows live radio voltage#2362
jensenpat merged 1 commit intoten9876:mainfrom
chibondking:fix/voltage-meter-label-actual-value

Conversation

@chibondking
Copy link
Copy Markdown
Collaborator

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.

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]>
Copy link
Copy Markdown
Contributor

@aethersdr-agent aethersdr-agent Bot left a comment

Choose a reason for hiding this comment

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

Looks good — small, focused fix that does exactly what it says.

A few nice things worth calling out:

  • HGauge::setLabel() mirrors the existing setValue() pattern (early-out on no-op, then update()). Consistent with how the rest of the widget is written.
  • Formatting +%1V with 'f', 2 matches the radio's reported voltage precision and lines up with the existing +13.8V tick label style on the scale.
  • The PR description correctly clarifies that the tick label 13.8 on 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 this and the gauge is owned by the applet, and setLabel/setValue only fire from the hwTelemetryChanged signal.

No issues found. Thanks @chibondking — clean fix.

@jensenpat jensenpat enabled auto-merge (squash) May 5, 2026 03:04
Copy link
Copy Markdown
Collaborator

@jensenpat jensenpat left a comment

Choose a reason for hiding this comment

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

Clean fix.

@jensenpat jensenpat merged commit d31ece1 into ten9876:main May 5, 2026
5 checks passed
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