fix: the PWR bar stayed at full scale after transmitting

Receiving cleared the two bar percentages but not the values the bars now
actually draw from: the watts and the SWR ratio, added when the meters were
corrected. So the power bar sat pinned across the panel with the rig plainly
receiving — the dash in the label said one thing and the bar another.

Every transmit value is cleared now, and the peak-hold state with them: a peak
left in the holder would have carried the last transmission's reading into the
start of the next one, which is worse, being wrong while it looks live.

The panel also draws both bars from zero unless the rig reports transmitting, so
a value that has not been refreshed yet cannot show as output.
This commit is contained in:
2026-07-29 14:20:58 +02:00
parent e0cefb5c41
commit 8da3a27803
2 changed files with 12 additions and 4 deletions
+2 -2
View File
@@ -352,11 +352,11 @@ export function YaesuPanel({ onReportRST, onKeySpeed }: {
title={onReportRST ? t('yaesu.sToRst') : undefined} />
{/* Watts as MEASURED, not the power setting scaled by a percentage:
the setting says what was asked for, the meter says what left. */}
<MeterBar label="PWR" value={view.power_w ?? 0} unit="W" lo={0} hi={Math.max(100, view.rf_power || 100)} accent="#0ea5e9"
<MeterBar label="PWR" value={view.transmitting ? (view.power_w ?? 0) : 0} unit="W" lo={0} hi={Math.max(100, view.rf_power || 100)} accent="#0ea5e9"
display={view.transmitting ? Math.round(view.power_w ?? 0) + 'W' : '—'} />
{/* The RATIO, as the rig shows it — a percentage of meter travel is
not something an operator can act on. The bar keeps the travel. */}
<MeterBar label="SWR" value={view.swr_meter} lo={0} hi={100} accent="#f59e0b"
<MeterBar label="SWR" value={view.transmitting ? view.swr_meter : 0} lo={0} hi={100} accent="#f59e0b"
display={view.transmitting ? (view.swr && view.swr >= 1 ? view.swr.toFixed(1) : '1.0') : '—'} />
</div>
</Card>