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:
@@ -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" />
|
||||
|
||||
@@ -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)',
|
||||
|
||||
Vendored
+2
@@ -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>;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user