feat(tci): the transmit meters, and no temperature invented
TX_POWER and TX_SWR are read-only commands the radio answers when asked, so they are asked for on each poll of a KEYED radio and not at all otherwise: a receiving station pays nothing for meters nobody is watching. Both appear next to the S-meter only while transmitting, because showing them the rest of the time would show the last thing that happened as if it were now. An SWR of 0 draws as '—' rather than as 1.0. A perfect match on an antenna nobody has measured is the one reading an operator should never be handed. There is no temperature. The protocol's command list has TX_POWER and TX_SWR and nothing thermal at all — so rather than leave the question hanging, it is written down where the next person will look for it. A temperature invented from something else, on a transmitter, is exactly the kind of number somebody would trust.
This commit is contained in:
@@ -304,6 +304,18 @@ func (t *TCI) ReadState() (RigState, error) {
|
||||
} else {
|
||||
st.FreqHz = t.freqA
|
||||
}
|
||||
// The transmit meters are asked for, not pushed: TX_POWER and TX_SWR are
|
||||
// read-only commands the radio answers when asked, and asking is only worth
|
||||
// anything while it is keyed. Fired and forgotten from here — the answers
|
||||
// arrive on the reader like everything else — and only while transmitting,
|
||||
// so a receiving station pays nothing for a meter nobody is watching.
|
||||
if t.tx {
|
||||
tx := t
|
||||
go func() {
|
||||
_ = tx.send("tx_power;")
|
||||
_ = tx.send("tx_swr;")
|
||||
}()
|
||||
}
|
||||
st.Mode = tciModeToADIF(t.mode, t.digitalDefault)
|
||||
if st.FreqHz > 0 {
|
||||
st.Band = BandFromHz(st.FreqHz)
|
||||
|
||||
Reference in New Issue
Block a user