fix(yaesu): the power ceiling is the radio's, not a constant

Reported on an FTDX101MP: the slider sprang back to 100 W. The console
was not wrong about the rig — yaesuMaxPower already answered 200 for
that model, and the slider was drawn to it. The SET path carried its own
hard-coded 100, so asking for 200 W sent PC100, the radio obeyed, and
the next poll read back what had actually been set.

One ceiling now, the one the console draws to, so the two cannot say
different things. Pinned with the model list, including the unknown-rig
case: crediting a radio with power it does not have would be commands it
NAKs, so silence still means 100.
This commit is contained in:
2026-09-04 08:34:28 +02:00
parent 6cbe29fef1
commit b318aa66cc
3 changed files with 41 additions and 3 deletions
+8 -1
View File
@@ -388,7 +388,14 @@ func (y *Yaesu) RefreshYaesu() error {
}
func (y *Yaesu) SetYaesuPower(w int) error {
return y.setAndRefresh(fmt.Sprintf("PC%03d;", clampInt(w, 5, 100)))
// The SAME ceiling the console draws its slider to. It was hard-coded at 100
// here while yaesuMaxPower already answered 200 for an FTDX101MP: asking for
// 200 W sent PC100, the rig obeyed, and the slider sprang back to 100 on the
// next poll — which is how the operator discovered it.
y.mu.Lock()
max := yaesuMaxPower(y.model, y.panel.RFPower)
y.mu.Unlock()
return y.setAndRefresh(fmt.Sprintf("PC%03d;", clampInt(w, 5, max)))
}
func (y *Yaesu) SetYaesuMicGain(p int) error {