fix: hold the TX meters through the gaps between words

A quarter-per-poll decay covers the milliseconds between CW elements but not the
gaps that matter on the air: between the words of a CQ, in CW as in SSB, the
meters genuinely read 0 for most of a second and the bars fell with them.

A peak now stands for 1.5 s before it starts to fall, and still rises instantly —
a needle goes up fast and comes down slow. The SWR RATIO is not updated at all
from a zero reading: showing 1.0 during a word gap is worse than showing a stale
figure, because it looks like good news.

A test caught a real defect on the way: the proportional decay stalls on
integers. With the needle at 13 and the truth at 10, a quarter of the gap rounds
to zero and the meter sat three units high for ever. It now always steps down by
at least one, so it converges.
This commit is contained in:
2026-07-29 13:59:47 +02:00
parent 8e491544dd
commit 113faede14
4 changed files with 93 additions and 17 deletions
+4
View File
@@ -104,6 +104,10 @@ type Yaesu struct {
panelLoaded bool
// Commands this rig answered "?;" to — asked once, then never again.
unsupported map[string]bool
// Needle inertia for the TX meters — see meterPeak.
powerPeak meterPeak
powerWPeak meterPeak
swrPeak meterPeak
// metersLogged counts the RM1..RM6 samples taken during transmission, so the
// survey follows a real carrier instead of catching one instant of it.
metersLogged int