From 9d30e1ffcd74f422e5113f122dfb9d4807a2c1dc Mon Sep 17 00:00:00 2001 From: Szymon Porwolik Date: Thu, 20 Nov 2025 18:50:04 +0100 Subject: [PATCH 1/5] Fix for CAT changing the edit form --- application/views/qso/edit_ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index e93cf1cb2..0ab7b78af 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -119,7 +119,7 @@
- result() as $mode) { var_dump($mode); From 51ce9a97051d631c041c864c57dd770179837cd8 Mon Sep 17 00:00:00 2001 From: Szymon Porwolik Date: Thu, 20 Nov 2025 20:32:38 +0100 Subject: [PATCH 2/5] Fix for default rst --- assets/js/cat.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/cat.js b/assets/js/cat.js index 5e67075f3..3b85f530b 100644 --- a/assets/js/cat.js +++ b/assets/js/cat.js @@ -791,6 +791,11 @@ $(document).ready(function() { cat2UI($mode,newMode,false,false); + // Update RST fields when mode is set via CAT (including first time) + if (newMode && typeof setRst === 'function' && (modeChanged || !previousMode)) { + setRst(newMode); + } + // Notify DX Waterfall of mode change for sideband display update // Only refresh if mode actually changed (not on initial undefined → value transition) if (modeChanged && typeof dxWaterfall !== 'undefined' && dxWaterfall.refresh) { From 26a00da5e1df068557e12fc6378e2e194e2fa865 Mon Sep 17 00:00:00 2001 From: Szymon Porwolik Date: Thu, 20 Nov 2025 21:15:09 +0100 Subject: [PATCH 3/5] Too good to be true? - removed mode cache --- assets/js/cat.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/assets/js/cat.js b/assets/js/cat.js index 3b85f530b..25f82e8bc 100644 --- a/assets/js/cat.js +++ b/assets/js/cat.js @@ -744,7 +744,6 @@ $(document).ready(function() { // Force update by clearing catValue (prevents cat2UI from blocking updates) $frequency.removeData('catValue'); - $mode.removeData('catValue'); // Also clear mode cache cat_updating_frequency = true; // Set flag before CAT update // Check if DX Waterfall's CAT frequency handler is available @@ -786,13 +785,20 @@ $(document).ready(function() { var previousMode = $mode.data('catValue'); var newMode = catmode(data.mode); + console.log('[CAT RST Debug] previousMode:', previousMode, 'newMode:', newMode); + // Only refresh waterfall if mode actually changed (and both values are defined) var modeChanged = previousMode && previousMode !== newMode; cat2UI($mode,newMode,false,false); - // Update RST fields when mode is set via CAT (including first time) - if (newMode && typeof setRst === 'function' && (modeChanged || !previousMode)) { + // Update RST fields when mode changes + // Check if mode was actually updated (catValue changed after cat2UI call) + var currentMode = $mode.data('catValue'); + console.log('[CAT RST Debug] After cat2UI - currentMode:', currentMode, 'previousMode:', previousMode, 'changed:', (currentMode !== previousMode)); + + if (currentMode !== previousMode && typeof setRst === 'function') { + console.log('[CAT RST Debug] Calling setRst with mode:', newMode); setRst(newMode); } From dce7fd7508af118b0192cb0139a89db9f43a41f1 Mon Sep 17 00:00:00 2001 From: Szymon Porwolik Date: Thu, 20 Nov 2025 21:24:12 +0100 Subject: [PATCH 4/5] Remove debug logs --- assets/js/cat.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/assets/js/cat.js b/assets/js/cat.js index 25f82e8bc..9b00b0ff2 100644 --- a/assets/js/cat.js +++ b/assets/js/cat.js @@ -785,8 +785,6 @@ $(document).ready(function() { var previousMode = $mode.data('catValue'); var newMode = catmode(data.mode); - console.log('[CAT RST Debug] previousMode:', previousMode, 'newMode:', newMode); - // Only refresh waterfall if mode actually changed (and both values are defined) var modeChanged = previousMode && previousMode !== newMode; @@ -795,10 +793,7 @@ $(document).ready(function() { // Update RST fields when mode changes // Check if mode was actually updated (catValue changed after cat2UI call) var currentMode = $mode.data('catValue'); - console.log('[CAT RST Debug] After cat2UI - currentMode:', currentMode, 'previousMode:', previousMode, 'changed:', (currentMode !== previousMode)); - if (currentMode !== previousMode && typeof setRst === 'function') { - console.log('[CAT RST Debug] Calling setRst with mode:', newMode); setRst(newMode); } From 8892ae826e2e7bc04b48d4b51f0df18083f33736 Mon Sep 17 00:00:00 2001 From: Szymon Porwolik Date: Fri, 21 Nov 2025 12:44:32 +0100 Subject: [PATCH 5/5] Fix for mode recalculation --- assets/js/cat.js | 12 ++++++++++++ assets/js/sections/qso.js | 29 +++++++++++++++-------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/assets/js/cat.js b/assets/js/cat.js index 9b00b0ff2..f69e344fc 100644 --- a/assets/js/cat.js +++ b/assets/js/cat.js @@ -756,6 +756,10 @@ $(document).ready(function() { // Auto-update band based on frequency if ($band.val() != newBand) { $band.val(newBand).trigger('change'); // Trigger band change + // Update callsign status when band changes via CAT + if ($('#callsign').val().length >= 3) { + $('#callsign').blur(); + } } }); }); @@ -766,6 +770,10 @@ $(document).ready(function() { // Auto-update band based on frequency if ($band.val() != frequencyToBand(d)) { $band.val(frequencyToBand(d)).trigger('change'); + // Update callsign status when band changes via CAT + if ($('#callsign').val().length >= 3) { + $('#callsign').blur(); + } } }); } @@ -795,6 +803,10 @@ $(document).ready(function() { var currentMode = $mode.data('catValue'); if (currentMode !== previousMode && typeof setRst === 'function') { setRst(newMode); + // Update callsign status when mode changes via CAT + if ($('#callsign').val().length >= 3) { + $('#callsign').blur(); + } } // Notify DX Waterfall of mode change for sideband display update diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index cad646487..b245a148d 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -2372,6 +2372,21 @@ $('#band').on('change', function () { if ($('#radio').val() == 0) { $.get(base_url + 'index.php/qso/band_to_freq/' + $(this).val() + '/' + $('.mode').val(), function (result) { $('#frequency').val(result).trigger("change"); + + // Update virtual CAT state when not using CAT + if (typeof isCATAvailable === 'function' && !isCATAvailable()) { + if (typeof window.catState === 'undefined' || window.catState === null) { + window.catState = {}; + } + window.catState.frequency = parseFloat(result); // Hz + window.catState.mode = $('.mode').val(); + window.catState.lastUpdate = Date.now(); + + // Update relevant spots for the new band/frequency + if (typeof dxWaterfall !== 'undefined' && dxWaterfall && typeof dxWaterfall.collectAllBandSpots === 'function') { + dxWaterfall.collectAllBandSpots(true); + } + } }); } $('#frequency_rx').val(""); @@ -2382,20 +2397,6 @@ $('#band').on('change', function () { set_qrg(); $("#callsign").blur(); stop_az_ele_ticker(); - if (typeof isCATAvailable === 'function' && !isCATAvailable()) { - // Update virtual CAT state - if (typeof window.catState === 'undefined' || window.catState === null) { - window.catState = {}; - } - window.catState.frequency = parseFloat(result); // Hz - window.catState.mode = currentMode; - window.catState.lastUpdate = Date.now(); - - // Update relevant spots for the new band/frequency - if (typeof dxWaterfall !== 'undefined' && dxWaterfall && typeof dxWaterfall.collectAllBandSpots === 'function') { - dxWaterfall.collectAllBandSpots(true); - } - } }); /* On Key up Calculate Bearing and Distance */