feat(tci): a control console for the SunSDR
TCI already carries the frequency, the mode, the meters and now the audio. It also carries everything else about the radio — and OpsLog was logging most of it once as '(unhandled once)' and throwing it away. The console is mostly a place to put what was already arriving. That makes it the cheapest panel here, and it is worth saying why. A K3 console costs a command and a reply for every value it shows, which is why it reads its settings in a rotation and its meters only while on screen. TCI PUSHES: the radio announces its drive, its filters, its noise blanker and the rest on connect, and again whenever any of them changes — including when the operator changes them in ExpertSDR3's own window, which this panel therefore follows without asking anything. What it drives: drive and tune drive, mic gain, TUNE, volume, mute, squelch and its threshold, NB, NR, ANF, APF, AGC speed, the passband, RIT and XIT with their offsets, and the VFO lock. The S-meter is a real dBm reading, so its S units are arithmetic rather than the calibration guess a K3's meter needs. Setters never update the cached state. The radio answers with the new value, and taking its word is what keeps the panel honest when a setting is refused, clamped, or changed at the radio a second later — the one exception being a slider mid-drag, held for 900 ms so it is not dragged back by its own echo. Capped width and centred, like the other consoles. Also offered as a docked pane — and the Elecraft console is offered there too now: App has always had that pane, Settings simply never listed it.
This commit is contained in:
+19
-2
@@ -34,6 +34,10 @@ type TCI struct {
|
||||
OnSpotClick func(callsign string, freqHz int64)
|
||||
unhandledSeen map[string]bool // log each unknown TCI message type once
|
||||
|
||||
// panel is the control-console state — everything the radio announces about
|
||||
// itself that is not frequency or mode. See tci_panel.go.
|
||||
panel tciPanel
|
||||
|
||||
// audio holds the receive-audio stream — see tci_audio.go. TCI carries it
|
||||
// on this same WebSocket, which is what lets a SunSDR record and decode
|
||||
// without a virtual audio cable in the way.
|
||||
@@ -457,7 +461,20 @@ func (t *TCI) handle(msg string) {
|
||||
}
|
||||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
switch strings.ToLower(name) {
|
||||
lower := strings.ToLower(name)
|
||||
// The console's own messages first. Most of them were being logged once as
|
||||
// unhandled and thrown away — the radio has been announcing its drive, its
|
||||
// filters and its noise blanker since the first connection.
|
||||
if t.handlePanel(lower, get, args) {
|
||||
// Still falls through for the few the rig state also needs (split, tune),
|
||||
// which is why this does not return.
|
||||
switch lower {
|
||||
case "split_enable", "trx", "modulation", "vfo":
|
||||
default:
|
||||
return
|
||||
}
|
||||
}
|
||||
switch lower {
|
||||
case "device":
|
||||
t.device = strings.TrimSpace(args)
|
||||
// The radio ANNOUNCES its audio format at connect —
|
||||
@@ -524,7 +541,7 @@ func (t *TCI) handle(msg string) {
|
||||
t.txAllowed, t.txAllowedKnown = allowed, true
|
||||
}
|
||||
default:
|
||||
lname := strings.ToLower(name)
|
||||
lname := lower
|
||||
// A click on one of our panorama spots comes back as
|
||||
// CLICKED_ON_SPOT:<call>,<hz> (legacy)
|
||||
// RX_CLICKED_ON_SPOT:<rx>,<ch>,<call>,<hz>
|
||||
|
||||
Reference in New Issue
Block a user