fix(elecraft): the K3 power meter converts to real watts
The operator measured the whole table: 10 W showed 83, 12 W showed 100, 13 W showed 8 — the bargraph is relative to a meter RANGE that flips at 12 W (0-12 QRP, 0-120 above). A bar percentage was never watts; with the PC setting choosing the range, it converts, and the console prints the watts beside the bar.
This commit is contained in:
@@ -52,9 +52,15 @@ type KenwoodTXState struct {
|
||||
SMeterRaw int `json:"s_meter_raw"`
|
||||
// PowerMeter is 0-100 while transmitting. SWR is the ratio; 0 means "not
|
||||
// measured", NOT a perfect match.
|
||||
PowerMeter int `json:"power_meter"`
|
||||
SWR float64 `json:"swr"`
|
||||
SWRRaw int `json:"swr_raw"`
|
||||
PowerMeter int `json:"power_meter"`
|
||||
// PowerW is the transmit power in WATTS, derived from the bargraph and the
|
||||
// meter's RANGE. The K3's bar is relative to a range that flips at 12 W —
|
||||
// calibrated against a real one: 10 W showed 83 (10/12), 100 W showed 83
|
||||
// too (100/120). The bar alone never was watts; with the PC setting to
|
||||
// pick the range, it converts. 0 while receiving.
|
||||
PowerW int `json:"power_w"`
|
||||
SWR float64 `json:"swr"`
|
||||
SWRRaw int `json:"swr_raw"`
|
||||
|
||||
RFPower int `json:"rf_power"` // watts, the PC setting
|
||||
AFGain int `json:"af_gain"` // 0-100
|
||||
@@ -162,6 +168,7 @@ func (k *Kenwood) readPanel(mode string, split bool, txHz int64, txNow bool) {
|
||||
// Cleared, not frozen: a power bar left standing after the carrier drops
|
||||
// reads as a live transmission.
|
||||
k.panel.PowerMeter = 0
|
||||
k.panel.PowerW = 0
|
||||
k.panel.SWR, k.panel.SWRRaw = 0, 0
|
||||
k.powerPeak, k.swrPeak = meterPeak{}, meterPeak{}
|
||||
// The S-meter only means anything while receiving.
|
||||
@@ -341,6 +348,13 @@ func (k *Kenwood) readTXMeters() {
|
||||
defer func() { k.noLatch = false }()
|
||||
if v, ok := k.askNum("BG;", "BG", 2); ok {
|
||||
k.panel.PowerMeter = k.powerPeak.update(kenwoodBargraphPercent(v), now)
|
||||
if k.elecraft {
|
||||
scale := 120
|
||||
if k.panel.RFPower > 0 && k.panel.RFPower <= 12 {
|
||||
scale = 12 // the K3's QRP range
|
||||
}
|
||||
k.panel.PowerW = k.panel.PowerMeter * scale / 100
|
||||
}
|
||||
}
|
||||
// SW; — SETTLED, from Elecraft's own release note: three digits, tenths of a
|
||||
// ratio. "SW023;" is 2.3:1, and "SW999;" is the 99.9:1 it reports instead of
|
||||
|
||||
Reference in New Issue
Block a user