Fix for mode recalculation

This commit is contained in:
Szymon Porwolik
2025-11-21 12:44:32 +01:00
parent dce7fd7508
commit 8892ae826e
2 changed files with 27 additions and 14 deletions

View File

@@ -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

View File

@@ -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 */