fix(kpa): its own card, and no band-follow it does not need
Two things the wiring got wrong, both visible on screen. A KPA fell through to the PowerGenius branch of the amplifier card and was drawn as one — titled 'POWERGENIUSXL · ELECRAFT KPA1500', with a PowerGenius's meters and none of its own. It has a card now: OPERATE, ON and OFF, band, power, SWR, temperature, supply, and the fault across the end. The OPERATE button carries a tooltip saying it also clears the fault, because that is the button an operator already has under the cursor when they need it. And the band-follow option was offered on it. That option exists because an Acom POLLS a transceiver and has no command to be given a band, so following it needs a second serial port and a rig emulator answering those polls. The KPA has ^BN — OpsLog simply tells it, on the link it is already using, and only when the band CHANGES. The option is gone from the KPA and the telling is automatic. Also: Acom rather than ACOM everywhere it is read, which is how the company writes it. Identifiers, package names and log lines are left alone — renaming those is churn with no reader.
This commit is contained in:
@@ -372,3 +372,41 @@ func (c *Client) pollOnce(n uint64) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SetBand puts the amplifier on a band by its ADIF name.
|
||||
//
|
||||
// The KPA takes its band from the transceiver on its own XCVR connector, but it
|
||||
// also accepts ^BN — so OpsLog can simply say it on the link it is already
|
||||
// using. That is worth knowing: an Acom has no such command, which is why
|
||||
// following it needs a second serial port and a transceiver emulator answering
|
||||
// its polls (internal/catemu). None of that applies here.
|
||||
//
|
||||
// Sent only when it CHANGES. Repeating the current band four times a second
|
||||
// would be traffic on a link with no flow control, in exchange for nothing.
|
||||
func (c *Client) SetBand(adifBand string) error {
|
||||
n, ok := bandNumber(adifBand)
|
||||
if !ok {
|
||||
// Not an error the operator should see: the KPA covers 160-6 m, and
|
||||
// tuning to 23 cm is not a fault, it is simply not this amplifier's
|
||||
// business.
|
||||
return nil
|
||||
}
|
||||
c.statusMu.Lock()
|
||||
same := c.status.Band == adifBand
|
||||
c.statusMu.Unlock()
|
||||
if same {
|
||||
return nil
|
||||
}
|
||||
return c.send(fmt.Sprintf("^BN%02d;", n))
|
||||
}
|
||||
|
||||
// bandNumber is BandName backwards.
|
||||
func bandNumber(adifBand string) (int, bool) {
|
||||
b := strings.ToLower(strings.TrimSpace(adifBand))
|
||||
for n, name := range bandNames {
|
||||
if name == b {
|
||||
return n, true
|
||||
}
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user