diff --git a/app.go b/app.go index 9e6fde0..674202c 100644 --- a/app.go +++ b/app.go @@ -180,6 +180,8 @@ const ( keyMotorCOM = "ultrabeam.com" // serial device name (COM3, /dev/ttyUSB0) keyMotorBaud = "ultrabeam.baud" // serial baud (SteppIR default 9600) keyMotorTXInhibit = "ultrabeam.tx_inhibit" // "1" → block Flex TX while the antenna is moving + keyMotorFreqMin = "ultrabeam.freq_min" // SteppIR tunable range low edge (MHz); out-of-range = don't follow/inhibit + keyMotorFreqMax = "ultrabeam.freq_max" // SteppIR tunable range high edge (MHz) keyStationDevices = "station.devices" // JSON list of relay boards for the Station Control tab // Antenna Genius (4O3A) antenna switch — Hardware → Antenna Genius. TCP @@ -12214,7 +12216,10 @@ func (a ubAdapter) Status() motorStatus { return motorStatus{Connected: st.Connected, Direction: st.Direction, Frequency: st.Frequency, Band: st.Band, Moving: st.MotorsMoving != 0, FreqMin: st.FreqMin, FreqMax: st.FreqMax} } -type steppirAdapter struct{ c *steppir.Client } +type steppirAdapter struct { + c *steppir.Client + freqMin, freqMax int // MHz; tunable range (the SteppIR can't report its own) +} func (a steppirAdapter) Start() error { return a.c.Start() } func (a steppirAdapter) Stop() { a.c.Stop() } @@ -12234,7 +12239,7 @@ func (a steppirAdapter) Status() motorStatus { if err != nil || st == nil { return motorStatus{} } - return motorStatus{Connected: st.Connected, Direction: st.Direction, Frequency: st.Frequency, Band: st.Band, Moving: st.MotorsMoving != 0} + return motorStatus{Connected: st.Connected, Direction: st.Direction, Frequency: st.Frequency, Band: st.Band, Moving: st.MotorsMoving != 0, FreqMin: a.freqMin, FreqMax: a.freqMax} } // UltrabeamSettings is the JSON shape for the Hardware → Antenna panel. The name @@ -12250,6 +12255,12 @@ type UltrabeamSettings struct { Follow bool `json:"follow"` // re-tune the antenna to the rig's frequency StepKHz int `json:"step_khz"` // re-tune only when the freq moved this far (25/50/100) TXInhibit bool `json:"tx_inhibit"` // block Flex transmission while the elements are moving + // SteppIR tunable range (MHz). The follow loop skips frequencies outside it — + // no tune command AND no TX inhibit — so a band the antenna can't cover (e.g. + // 30 m on a 20 m–6 m SteppIR) never traps TX. Ignored for the Ultrabeam, which + // reports its own per-band coverage. 0 = defaults filled in on load for SteppIR. + FreqMinMHz int `json:"freq_min_mhz"` + FreqMaxMHz int `json:"freq_max_mhz"` } // GetUltrabeamSettings returns the persisted motorized-antenna config, defaulting @@ -12261,7 +12272,7 @@ func (a *App) GetUltrabeamSettings() (UltrabeamSettings, error) { return out, fmt.Errorf("db not initialized") } m, err := a.settings.GetMany(a.ctx, keyUltrabeamEnabled, keyUltrabeamHost, keyUltrabeamPort, keyUltrabeamFollow, keyUltrabeamStep, - keyMotorType, keyMotorTransport, keyMotorCOM, keyMotorBaud, keyMotorTXInhibit) + keyMotorType, keyMotorTransport, keyMotorCOM, keyMotorBaud, keyMotorTXInhibit, keyMotorFreqMin, keyMotorFreqMax) if err != nil { return out, err } @@ -12285,6 +12296,20 @@ func (a *App) GetUltrabeamSettings() (UltrabeamSettings, error) { if st, _ := strconv.Atoi(m[keyUltrabeamStep]); st == 25 || st == 50 || st == 100 { out.StepKHz = st } + out.FreqMinMHz, _ = strconv.Atoi(m[keyMotorFreqMin]) + out.FreqMaxMHz, _ = strconv.Atoi(m[keyMotorFreqMax]) + // A SteppIR doesn't report its coverage, so default to the standard 20 m–6 m + // range (13–54 MHz) when unset — the common model. Widen it (e.g. min 6 for a + // 40 m-equipped SteppIR) in Settings. This is what lets the follow loop leave + // TX alone on a band the antenna can't reach. + if out.Type == "steppir" { + if out.FreqMinMHz <= 0 { + out.FreqMinMHz = 13 + } + if out.FreqMaxMHz <= 0 { + out.FreqMaxMHz = 54 + } + } return out, nil } @@ -12309,6 +12334,16 @@ func (a *App) SaveUltrabeamSettings(s UltrabeamSettings) error { if s.Baud < 1200 || s.Baud > 115200 { s.Baud = 9600 } + // Sanity: keep the range ordered; 0 = "no limit" (stored as-is). + if s.FreqMinMHz < 0 { + s.FreqMinMHz = 0 + } + if s.FreqMaxMHz < 0 { + s.FreqMaxMHz = 0 + } + if s.FreqMinMHz > 0 && s.FreqMaxMHz > 0 && s.FreqMinMHz > s.FreqMaxMHz { + s.FreqMinMHz, s.FreqMaxMHz = s.FreqMaxMHz, s.FreqMinMHz + } for k, v := range map[string]string{ keyUltrabeamEnabled: boolStr(s.Enabled), keyUltrabeamHost: strings.TrimSpace(s.Host), @@ -12320,6 +12355,8 @@ func (a *App) SaveUltrabeamSettings(s UltrabeamSettings) error { keyMotorCOM: strings.TrimSpace(s.COM), keyMotorBaud: strconv.Itoa(s.Baud), keyMotorTXInhibit: boolStr(s.TXInhibit), + keyMotorFreqMin: strconv.Itoa(s.FreqMinMHz), + keyMotorFreqMax: strconv.Itoa(s.FreqMaxMHz), } { if err := a.settings.Set(a.ctx, k, v); err != nil { return err @@ -12341,7 +12378,7 @@ func newMotorClient(s UltrabeamSettings) motorAntenna { if tr.Mode != "serial" && tr.Host == "" { return nil } - return steppirAdapter{steppir.New(tr)} + return steppirAdapter{c: steppir.New(tr), freqMin: s.FreqMinMHz, freqMax: s.FreqMaxMHz} } // Ultrabeam is TCP only. if strings.TrimSpace(s.Host) == "" { diff --git a/changelog.json b/changelog.json index 6a1c7f0..0bcf06d 100644 --- a/changelog.json +++ b/changelog.json @@ -3,7 +3,7 @@ "version": "0.20.12", "date": "2026-07-23", "en": [ - "Fixed a motorized-antenna bug that could leave a FlexRadio permanently unable to transmit (‘Interlock is preventing transmission’). With a SteppIR whose status frequency reads intermittently (it flipped between the commanded frequency and its home value), the ‘follow the rig’ loop re-sent a tune command on almost every poll, and each command re-armed the ‘block TX while the antenna moves’ window — so the interlock never released. The follow loop now keys its deadband off the rig’s frequency (only re-tuning when the RADIO actually QSYs), immune to a flaky antenna status. Also dropped an ‘interlock set reason=’ command that SmartSDR rejects (it’s read-only) and only produced a harmless error line — the transmit-inhibit itself is unchanged and still holds TX safely while the elements move.", + "Fixed a motorized-antenna bug that could leave a FlexRadio permanently unable to transmit (‘Interlock is preventing transmission’). With a SteppIR whose status frequency reads intermittently (it flipped between the commanded frequency and its home value), the ‘follow the rig’ loop re-sent a tune command on almost every poll, and each command re-armed the ‘block TX while the antenna moves’ window — so the interlock never released. The follow loop now keys its deadband off the rig’s frequency (only re-tuning when the RADIO actually QSYs), immune to a flaky antenna status. Also dropped an ‘interlock set reason=’ command that SmartSDR rejects (it’s read-only) and only produced a harmless error line — the transmit-inhibit itself is unchanged and still holds TX safely while the elements move. New: a SteppIR ‘Tunable range’ setting (Settings → Hardware → Antenna, default 13–54 MHz = 20 m–6 m) — on a band outside it OpsLog leaves the antenna and TX completely alone, so tuning to 30 m on a 20 m–6 m SteppIR no longer tries to move it or touches the interlock.", "New built-in award: The Helvetia 26 Award (H26) — the 26 cantons of Switzerland (USKA). Ships with the full canton reference list; matches the canton from the QSO's address or QTH, on HF, for Swiss (HB) contacts. Enable it in Awards and rescan to see your standings.", "FlexRadio panel: the RECEIVE card is shorter again. All the noise controls added recently made it tower, so only the everyday ones — NB, NR, ANF — now stay visible; WNB and the SmartSDR v4 DSP block (NRL/NRS/NRF/ANFL and the AI/FFT RNN & ANFT) tuck behind a 'DSP' button you expand when you need them. The button carries a dot and highlights when one of the hidden controls is switched on, so nothing active is ever out of sight, and its open/closed state is remembered.", "ADIF export can now pick exactly which fields to write. The global 'Export to ADIF' dialog gains a third choice, 'Choose fields…', alongside 'Standard ADIF fields' and 'All OpsLog fields'; and right-clicking selected QSOs adds 'Export selected — choose fields…'. The picker separates the official ADIF 3.1.7 fields (grouped by category) from OpsLog / non-standard tags actually present in your log, with All/None per group and a one-click reset to defaults. Your selection is remembered for next time.", @@ -16,7 +16,7 @@ "Fixed the colour theme sometimes resetting to light after an update/relaunch: an update can clear the WebView's localStorage, and the fallback that restores the theme from the local settings database gave up after ~2.4s — occasionally too soon during the brief startup window before that store is ready. It now keeps retrying until the store actually answers, so a dark theme is reliably restored." ], "fr": [ - "Correction d'un bug d'antenne motorisée qui pouvait laisser un FlexRadio définitivement incapable d'émettre (« Interlock is preventing transmission »). Avec une SteppIR dont la fréquence de statut se lit par intermittence (elle alternait entre la fréquence commandée et sa valeur de repos), la boucle de suivi renvoyait un ordre d'accord à presque chaque cycle, et chaque ordre réarmait la fenêtre « bloquer l'émission pendant que l'antenne bouge » — l'interlock ne se relâchait donc jamais. La boucle de suivi se base maintenant sur la fréquence de la RADIO (elle ne réaccorde que quand le poste change réellement de fréquence), insensible à un statut d'antenne erratique. Retrait aussi d'une commande « interlock set reason= » que SmartSDR refuse (champ en lecture seule) et qui ne produisait qu'une ligne d'erreur sans effet — l'inhibition d'émission elle-même est inchangée et protège toujours pendant le mouvement des éléments.", + "Correction d'un bug d'antenne motorisée qui pouvait laisser un FlexRadio définitivement incapable d'émettre (« Interlock is preventing transmission »). Avec une SteppIR dont la fréquence de statut se lit par intermittence (elle alternait entre la fréquence commandée et sa valeur de repos), la boucle de suivi renvoyait un ordre d'accord à presque chaque cycle, et chaque ordre réarmait la fenêtre « bloquer l'émission pendant que l'antenne bouge » — l'interlock ne se relâchait donc jamais. La boucle de suivi se base maintenant sur la fréquence de la RADIO (elle ne réaccorde que quand le poste change réellement de fréquence), insensible à un statut d'antenne erratique. Retrait aussi d'une commande « interlock set reason= » que SmartSDR refuse (champ en lecture seule) et qui ne produisait qu'une ligne d'erreur sans effet — l'inhibition d'émission elle-même est inchangée et protège toujours pendant le mouvement des éléments. Nouveau : un réglage « Plage accordable » pour la SteppIR (Réglages → Matériel → Antenne, défaut 13-54 MHz = 20 m-6 m) — sur une bande hors de cette plage, OpsLog laisse totalement l'antenne et l'émission tranquilles, donc passer sur 30 m avec une SteppIR 20 m-6 m ne tente plus de la bouger ni ne touche à l'interlock.", "Nouveau diplôme intégré : The Helvetia 26 Award (H26) — les 26 cantons de Suisse (USKA). Livré avec la liste complète des cantons ; il reconnaît le canton depuis l'adresse ou le QTH du QSO, en HF, pour les contacts suisses (HB). Active-le dans les Diplômes et relance un scan pour voir ton avancement.", "Panneau FlexRadio : la carte RÉCEPTION est de nouveau plus compacte. Tous les contrôles de bruit ajoutés récemment la faisaient s'allonger, donc seuls ceux du quotidien — NB, NR, ANF — restent visibles ; le WNB et le bloc DSP SmartSDR v4 (NRL/NRS/NRF/ANFL ainsi que RNN & ANFT IA/FFT) se replient derrière un bouton « DSP » que tu déplies au besoin. Le bouton porte un point et s'illumine quand l'un des contrôles masqués est activé, pour ne jamais perdre de vue quelque chose d'actif, et son état ouvert/fermé est mémorisé.", "L'export ADIF permet maintenant de choisir précisément les champs à écrire. La fenêtre globale « Exporter en ADIF » gagne un troisième choix, « Choisir les champs… », à côté de « Champs ADIF standard » et « Tous les champs OpsLog » ; et le clic droit sur des QSO sélectionnés ajoute « Exporter la sélection — choisir les champs… ». Le sélecteur sépare les champs ADIF 3.1.7 officiels (regroupés par catégorie) des balises OpsLog / non standard réellement présentes dans ton log, avec Tout/Aucun par groupe et un retour aux valeurs par défaut en un clic. Ta sélection est mémorisée pour la prochaine fois.", diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index 1696ed7..dc96f24 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -1055,8 +1055,8 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan const [rotatorTest, setRotatorTest] = useState<{ ok: boolean; msg: string } | null>(null); // Motorized antenna (Ultrabeam TCP or SteppIR TCP/serial) settings. - const [ultrabeam, setUltrabeam] = useState<{ enabled: boolean; type: string; transport: string; host: string; port: number; com: string; baud: number; follow: boolean; step_khz: number; tx_inhibit: boolean }>({ - enabled: false, type: 'ultrabeam', transport: 'tcp', host: '', port: 23, com: '', baud: 9600, follow: false, step_khz: 50, tx_inhibit: false, + const [ultrabeam, setUltrabeam] = useState<{ enabled: boolean; type: string; transport: string; host: string; port: number; com: string; baud: number; follow: boolean; step_khz: number; tx_inhibit: boolean; freq_min_mhz: number; freq_max_mhz: number }>({ + enabled: false, type: 'ultrabeam', transport: 'tcp', host: '', port: 23, com: '', baud: 9600, follow: false, step_khz: 50, tx_inhibit: false, freq_min_mhz: 13, freq_max_mhz: 54, }); const [ubTesting, setUbTesting] = useState(false); const [ubTest, setUbTest] = useState<{ ok: boolean; msg: string } | null>(null); @@ -2639,6 +2639,22 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan )} + {isSteppir && ( +
{t('hw.steppirRangeHint')}
+