chore: sample the Yaesu meters throughout a transmission, not at its start

The one-shot survey fired as the transmission began and caught the meters still
at rest — RM4=13 and everything else zero, which identifies nothing. And the
operator's reading points the other way: the bar showing 81 tracks his 100 W,
while the one labelled power sat at 8.

What names a meter is which index FOLLOWS the power over a few seconds of steady
carrier, so the survey now samples on every poll while transmitting, capped at a
dozen lines. Two seconds of tune will settle it.

Still not guessing at the mapping: the numbers will say which index is power and
which is SWR on this radio, and it gets corrected then.
This commit is contained in:
2026-07-29 13:38:09 +02:00
parent 48d92ff547
commit a89c6e0df8
2 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -104,8 +104,9 @@ type Yaesu struct {
panelLoaded bool panelLoaded bool
// Commands this rig answered "?;" to — asked once, then never again. // Commands this rig answered "?;" to — asked once, then never again.
unsupported map[string]bool unsupported map[string]bool
// metersSurveyed: the one-shot RM1..RM6 dump during the first transmission. // metersLogged counts the RM1..RM6 samples taken during transmission, so the
metersSurveyed bool // survey follows a real carrier instead of catching one instant of it.
metersLogged int
} }
func NewYaesu(portName string, baud int, digital string) *Yaesu { func NewYaesu(portName string, baud int, digital string) *Yaesu {
+6 -2
View File
@@ -128,8 +128,12 @@ func (y *Yaesu) readPanel(mode string, split bool, txHz int64) {
// of reading the wrong index (ALC, say) rather than of a scaling error. // of reading the wrong index (ALC, say) rather than of a scaling error.
// Guessing again would just move the wrong number; this prints all six // Guessing again would just move the wrong number; this prints all six
// once, and the log then says which is which on THIS radio. // once, and the log then says which is which on THIS radio.
if !y.metersSurveyed { // Sampled on EVERY poll while transmitting, capped — one snapshot taken as
y.metersSurveyed = true // the transmission starts catches the meters still at rest (RM4=13, the
// rest zero), which says nothing. What identifies a meter is which index
// TRACKS the power over a few seconds of steady carrier.
if y.metersLogged < 12 {
y.metersLogged++
raw := make([]string, 0, 6) raw := make([]string, 0, 6)
for i := 1; i <= 6; i++ { for i := 1; i <= 6; i++ {
cmd := fmt.Sprintf("RM%d;", i) cmd := fmt.Sprintf("RM%d;", i)