feat(k3): a mode row on the Elecraft console — CW/USB/LSB/DATA/DATA-RTTY

The report: switching the K3 to a data mode 'does not work for FT8 — the K3
does not go into DATA'. The mode digit is only half the answer on that radio:
MD6 keeps whatever DT submode the previous session left, and with FSK D still
armed the rig keys FT8 with no rear-audio modulation.

The panel buttons say the whole thing: DATA is MD6+DT0 (DATA A, the soundcard
path), DATA RTTY is MD6+DT2 (FSK D). The DT submode is also read on the
settings beat — Elecraft only, a plain Kenwood would '?;' it — so the active
DATA button follows what the rig is actually in, front-panel changes included.
A dedicated SetKenwoodPanelMode rather than the logger's SetMode: a panel
button is the operator saying exactly what the rig should do, not an ADIF mode
to be mapped through preferences.
This commit is contained in:
2026-08-28 23:35:25 +02:00
parent 0f4e31853b
commit 7e7ad50f60
8 changed files with 127 additions and 4 deletions
+6
View File
@@ -24,6 +24,12 @@ func (a *App) GetKenwoodState() cat.KenwoodTXState {
return st
}
// SetKenwoodPanelMode sets the operating mode from the panel's mode row —
// CW / USB / LSB / DATA (soundcard, DT0) / RTTY (FSK D, DT2).
func (a *App) SetKenwoodPanelMode(mode string) error {
return a.kenwoodPanelDo(func(k cat.KenwoodPanelController) error { return k.SetKenwoodPanelMode(mode) })
}
func (a *App) SetKenwoodPower(w int) error {
return a.kenwoodPanelDo(func(k cat.KenwoodPanelController) error { return k.SetKenwoodPower(w) })
}
+4 -2
View File
@@ -5,12 +5,14 @@
"en": [
"TCI (SunSDR): the meter subscription is renewed when the radio announces it is ready — sent only at connect, it could fall inside the initial state dump and be ignored, which left the transmit power and SWR empty. The log now also records the subscription and the first sensor frames, so a report can tell “the radio never sends them” from “they arrived and were dropped”.",
"Sending a spot while in split now pre-fills the RX frequency — where the station actually is — instead of the TX frequency, which spotted the pile-up five up from the DX.",
"Cluster: NEW SLOT gets its own colour — the sky cyan the panadapter palette already uses for it, clearly apart from POTA green and the yellows. The NEW SLOT and NEW COUNTY filter chips now wear the same colours as the badges they select, and the NEW CALL filter works even when the slot-highlight display option is off."
"Cluster: NEW SLOT gets its own colour — the sky cyan the panadapter palette already uses for it, clearly apart from POTA green and the yellows. The NEW SLOT and NEW COUNTY filter chips now wear the same colours as the badges they select, and the NEW CALL filter works even when the slot-highlight display option is off.",
"Elecraft console: a mode row — CW, USB, LSB, DATA and DATA RTTY. The two DATA buttons set the K3s submode as well (DATA A for FT8/FT4, FSK D for RTTY): switching to DATA by mode alone kept whatever submode the last session left, which is how a K3 “in DATA” keys FT8 with no audio."
],
"fr": [
"TCI (SunSDR) : l'abonnement aux mesures est renouvelé quand la radio annonce qu'elle est prête — envoyé seulement à la connexion, il pouvait tomber pendant l'envoi initial de l'état et être ignoré, laissant la puissance et le ROS vides en émission. Le journal enregistre aussi l'abonnement et les premières trames de mesure, pour distinguer « la radio ne les envoie jamais » de « elles arrivaient et étaient perdues ».",
"Envoyer un spot en split préremplit désormais la fréquence RX — là où la station se trouve réellement — au lieu de la fréquence TX, qui spottait le pile-up cinq au-dessus du DX.",
"Cluster : NOUVEAU SLOT reçoit sa propre couleur — le cyan ciel que la palette du panadapter lui donne déjà, bien distinct du vert POTA et des jaunes. Les puces de filtre NOUVEAU SLOT et NOUVEAU COMTÉ portent désormais les couleurs des badges qu'elles sélectionnent, et le filtre NOUVEAU CALL fonctionne même quand l'option de surlignage par slot est désactivée."
"Cluster : NOUVEAU SLOT reçoit sa propre couleur — le cyan ciel que la palette du panadapter lui donne déjà, bien distinct du vert POTA et des jaunes. Les puces de filtre NOUVEAU SLOT et NOUVEAU COMTÉ portent désormais les couleurs des badges qu'elles sélectionnent, et le filtre NOUVEAU CALL fonctionne même quand l'option de surlignage par slot est désactivée.",
"Console Elecraft : une rangée de modes — CW, USB, LSB, DATA et DATA RTTY. Les deux boutons DATA règlent aussi le sous-mode du K3 (DATA A pour FT8/FT4, FSK D pour le RTTY) : passer en DATA par le seul mode gardait le sous-mode de la session précédente, et un K3 « en DATA » manipulait le FT8 sans audio."
]
},
{
+34 -2
View File
@@ -4,7 +4,7 @@ import {
GetKenwoodState, RefreshKenwood, SetKenwoodPower, SetKenwoodAFGain, SetKenwoodTX, TuneKenwoodATU,
SetKenwoodRFGain, SetKenwoodMicGain, SetKenwoodSquelch, SetKenwoodPreamp, SetKenwoodAtt,
SetKenwoodNB, SetKenwoodNR, SetKenwoodAGC, SetKenwoodFilter, SetKenwoodAntenna,
SetKenwoodRIT, SetKenwoodXIT, ClearKenwoodRIT, SetKenwoodKeySpeed, ToggleKenwoodATU, NudgeKenwoodRIT,
SetKenwoodRIT, SetKenwoodXIT, ClearKenwoodRIT, SetKenwoodKeySpeed, ToggleKenwoodATU, NudgeKenwoodRIT, SetKenwoodPanelMode,
GetCATState,
} from '../../wailsjs/go/main/App';
import { cn } from '@/lib/utils';
@@ -14,7 +14,7 @@ import { MeterBar } from '@/components/MeterBar';
import { WheelRange } from '@/components/WheelRange';
type KenwoodState = {
available: boolean; model?: string; elecraft: boolean; mode?: string;
available: boolean; model?: string; elecraft: boolean; mode?: string; data_sub?: string;
transmitting: boolean; split: boolean; split_tx_hz?: number;
s_meter: number; s_meter_raw: number;
power_meter: number; swr: number; swr_raw: number;
@@ -89,6 +89,16 @@ function Toggle({ label, on, off, onClick }: { label: string; on: boolean; off:
);
}
// isDataMode: what the rig reports for MD6 varies — "DATA", or the configured
// digital default (FT8…) — so the DATA family is "not one of the native modes".
function isDataMode(m?: string): boolean {
switch ((m ?? '').toUpperCase()) {
case '': case 'CW': case 'USB': case 'LSB': case 'SSB': case 'FM': case 'AM': case 'RTTY':
return false;
}
return true;
}
export function ElecraftPanel({ onReportRST }: { onReportRST?: (rst: string) => void }) {
const { t } = useI18n();
const [st, setSt] = useState<KenwoodState>(ZERO);
@@ -149,6 +159,28 @@ export function ElecraftPanel({ onReportRST }: { onReportRST?: (rst: string) =>
{freqHz > 0 ? (freqHz / 1e6).toFixed(6) : '—'}
</div>
</div>
{/* Mode row. The two DATA buttons are why it exists: MD6 alone keeps
whatever submode the last session left, and a K3 "in DATA" with FSK D
still armed keys FT8 with no audio. DATA sends MD6+DT0 (DATA A, the
soundcard path), RTTY sends MD6+DT2 (FSK D). The active DATA button
follows the rig's own DT answer. */}
<div className="inline-flex rounded-md border border-border overflow-hidden">
{([
['CW', 'CW', view.mode === 'CW'],
['USB', 'USB', view.mode === 'USB'],
['LSB', 'LSB', view.mode === 'LSB'],
['DATA', t('k3.modeData'), isDataMode(view.mode) && view.data_sub !== 'FSK D' && view.data_sub !== 'PSK D'],
['RTTY', t('k3.modeRtty'), (isDataMode(view.mode) && (view.data_sub === 'FSK D' || view.data_sub === 'PSK D')) || view.mode === 'RTTY'],
] as [string, string, boolean][]).map(([cmd, label, on]) => (
<button key={cmd} type="button" disabled={off}
title={cmd === 'DATA' ? t('k3.modeDataHint') : cmd === 'RTTY' ? t('k3.modeRttyHint') : label}
onClick={() => SetKenwoodPanelMode(cmd).catch((e: any) => setErr(String(e?.message ?? e)))}
className={cn('px-2.5 py-1.5 text-xs font-bold border-l border-border first:border-l-0',
on ? 'bg-primary text-primary-foreground' : 'bg-card text-muted-foreground hover:bg-muted')}>
{label}
</button>
))}
</div>
<button type="button" className="text-[11px] text-muted-foreground hover:text-foreground flex items-center gap-1"
onClick={() => RefreshKenwood().catch(() => {})} title={t('k3.refreshHint')}>
<SlidersHorizontal className="size-3.5" />
+6
View File
@@ -130,6 +130,9 @@ const en: Dict = {
'icmp.scopeNoStream': 'This radio does not send its scope over CI-V — its own screen still works.',
'wk.catWarnTci': 'The CW keyer is set to the radio, but the CAT backend is "{backend}". Pick TCI in Settings → CAT, or another keying engine.',
'wk.tciHint': "Keying goes through the radio's own macro keyer, over the link already open — no WinKeyer and no second serial port. The radio can stop a message but cannot un-type one, so there is no type-ahead correction here.",
'k3.modeData': 'DATA', 'k3.modeRtty': 'DATA RTTY',
'k3.modeDataHint': 'DATA A (MD6 + DT0) — the soundcard submode FT8/FT4/PSK modulate through',
'k3.modeRttyHint': 'FSK D (MD6 + DT2) — direct-keyed RTTY',
'gen.iaruRegion': 'IARU region', 'gen.iaruHint': '(band plan drawn on the band maps)',
'gen.iaruR1': 'Region 1 — Europe, Africa, Middle East', 'gen.iaruR2': 'Region 2 — Americas', 'gen.iaruR3': 'Region 3 — Asia-Pacific',
'gen.miles': 'Distances in miles', 'gen.milesHint': '(instead of kilometres)',
@@ -633,6 +636,9 @@ const fr: Dict = {
'icmp.scopeNoStream': "Cette radio n'envoie pas son scope en CI-V — son propre écran fonctionne toujours.",
'wk.catWarnTci': "Le manipulateur CW est réglé sur la radio, mais le backend CAT est « {backend} ». Choisissez TCI dans Réglages → CAT, ou un autre moteur de manipulation.",
'wk.tciHint': "La manipulation passe par le keyer à macros de la radio, sur la liaison déjà ouverte — ni WinKeyer ni second port série. La radio sait interrompre un message mais pas en effacer la fin, donc pas de correction en frappe anticipée ici.",
'k3.modeData': 'DATA', 'k3.modeRtty': 'DATA RTTY',
'k3.modeDataHint': 'DATA A (MD6 + DT0) — le sous-mode carte son par lequel FT8/FT4/PSK modulent',
'k3.modeRttyHint': 'FSK D (MD6 + DT2) — RTTY en manipulation directe',
'gen.iaruRegion': 'Région IARU', 'gen.iaruHint': '(plan de bande dessiné sur les cartes de bande)',
'gen.iaruR1': 'Région 1 — Europe, Afrique, Moyen-Orient', 'gen.iaruR2': 'Région 2 — Amériques', 'gen.iaruR3': 'Région 3 — Asie-Pacifique',
'gen.miles': 'Distances en miles', 'gen.milesHint': '(au lieu des kilomètres)',
+2
View File
@@ -1145,6 +1145,8 @@ export function SetKenwoodNB(arg1:boolean):Promise<void>;
export function SetKenwoodNR(arg1:boolean):Promise<void>;
export function SetKenwoodPanelMode(arg1:string):Promise<void>;
export function SetKenwoodPower(arg1:number):Promise<void>;
export function SetKenwoodPreamp(arg1:boolean):Promise<void>;
+4
View File
@@ -2230,6 +2230,10 @@ export function SetKenwoodNR(arg1) {
return window['go']['main']['App']['SetKenwoodNR'](arg1);
}
export function SetKenwoodPanelMode(arg1) {
return window['go']['main']['App']['SetKenwoodPanelMode'](arg1);
}
export function SetKenwoodPower(arg1) {
return window['go']['main']['App']['SetKenwoodPower'](arg1);
}
+2
View File
@@ -1072,6 +1072,7 @@ export namespace cat {
model?: string;
elecraft: boolean;
mode?: string;
data_sub?: string;
transmitting: boolean;
split: boolean;
split_tx_hz: number;
@@ -1108,6 +1109,7 @@ export namespace cat {
this.model = source["model"];
this.elecraft = source["elecraft"];
this.mode = source["mode"];
this.data_sub = source["data_sub"];
this.transmitting = source["transmitting"];
this.split = source["split"];
this.split_tx_hz = source["split_tx_hz"];
+69
View File
@@ -35,6 +35,11 @@ type KenwoodTXState struct {
Model string `json:"model,omitempty"`
Elecraft bool `json:"elecraft"` // a K3/K4 rather than a Kenwood
Mode string `json:"mode,omitempty"`
// DataSub is the K3/K4 DATA submode while in DATA mode (DT): "DATA A",
// "AFSK A", "FSK D" or "PSK D". Empty on a Kenwood, and outside DATA. The
// panel's two DATA buttons need it to show WHICH data mode the rig is in —
// FT8 wants DATA A, RTTY wants FSK D, and MD6 alone cannot say which.
DataSub string `json:"data_sub,omitempty"`
Transmitting bool `json:"transmitting"`
Split bool `json:"split"`
@@ -111,6 +116,7 @@ type KenwoodPanelController interface {
SetKenwoodTX(bool) error
TuneKenwoodATU() error
ToggleKenwoodATU() error
SetKenwoodPanelMode(string) error
}
// kenwoodPanelSlowBeat is how many polls pass between full re-reads of the
@@ -212,6 +218,14 @@ func (k *Kenwood) readPanelSettings() {
if v, ok := k.askNum("NR;", "NR", 1); ok {
k.panel.NR = v != 0
}
// The DATA submode, Elecraft only (a plain Kenwood has no DT and would "?;"
// it). Read every settings beat: the operator changes it from the rig's own
// front panel mid-session, and the two DATA buttons must follow.
if k.elecraft {
if v, ok := k.askNum("DT;", "DT", 1); ok {
k.panel.DataSub = kenwoodDataSubName(v)
}
}
if v, ok := k.askNum("GT;", "GT", 3); ok {
k.panel.AGC = kenwoodAGCName(v)
}
@@ -650,3 +664,58 @@ func (k *Kenwood) askNum(cmd, prefix string, digits int) (int, bool) {
}
return n, true
}
// kenwoodDataSubName decodes DT (K3/K4 programmer's reference).
func kenwoodDataSubName(v int) string {
switch v {
case 0:
return "DATA A"
case 1:
return "AFSK A"
case 2:
return "FSK D"
case 3:
return "PSK D"
}
return ""
}
// SetKenwoodPanelMode is the panel's mode row: CW / USB / LSB / DATA / RTTY.
//
// It exists because SetMode is the LOGGER's path — it maps an ADIF mode and
// honours the data-mode preference — while a panel button is the operator
// saying exactly what the rig should do. The two DATA cases are the point:
// "DATA" is MD6 + DT0 (DATA A, the soundcard submode FT8/FT4 modulate through)
// and "RTTY" is MD6 + DT2 (FSK D, the K3's direct-keyed RTTY). MD6 alone keeps
// whatever submode a prior session left, which is how a K3 "in DATA" transmits
// FT8 with no audio — the report behind this row.
func (k *Kenwood) SetKenwoodPanelMode(mode string) error {
k.mu.Lock()
defer k.mu.Unlock()
if k.port == nil {
return fmt.Errorf("kenwood: not connected")
}
var cmds []string
switch strings.ToUpper(strings.TrimSpace(mode)) {
case "CW":
cmds = []string{"MD3;"}
case "USB":
cmds = []string{"MD2;"}
case "LSB":
cmds = []string{"MD1;"}
case "DATA":
cmds = []string{"MD6;", "DT0;"}
case "RTTY":
cmds = []string{"MD6;", "DT2;"}
default:
return fmt.Errorf("kenwood panel: unknown mode %q", mode)
}
for _, c := range cmds {
if err := k.write(c); err != nil {
return err
}
}
// Re-read the settings on the next poll so Mode and DataSub confirm at once.
k.panelCycle = kenwoodPanelSlowBeat
return nil
}