feat(tscm): add custom frequency range option to RF sweep

Adds a "Custom Range" sweep type that lets users specify start/end MHz
instead of using a fixed preset. Useful in dense RF environments where
a full or standard sweep returns too many signals and causes slowdown.

UI shows start/end MHz inputs when "Custom Range" is selected. Range is
validated (0 < start < end ≤ 6000 MHz) before the sweep starts.
Backend threads the ranges through to _scan_rf_signals(), which already
supports arbitrary frequency bands.

Closes #172
This commit is contained in:
James Smith
2026-04-05 15:46:01 +01:00
parent fe64dd9c93
commit ea80b5ebc3
4 changed files with 49 additions and 6 deletions
+9 -2
View File
@@ -12082,6 +12082,12 @@
async function startTscmSweep() {
const sweepType = document.getElementById('tscmSweepType').value;
const baselineId = document.getElementById('tscmBaselineSelect').value || null;
const customRanges = sweepType === 'custom' ? [{
start: parseFloat(document.getElementById('tscmCustomStartMhz').value),
end: parseFloat(document.getElementById('tscmCustomEndMhz').value),
step: 0.1,
name: `Custom ${document.getElementById('tscmCustomStartMhz').value}${document.getElementById('tscmCustomEndMhz').value} MHz`
}] : null;
const wifiEnabled = document.getElementById('tscmWifiEnabled').checked;
const btEnabled = document.getElementById('tscmBtEnabled').checked;
const rfEnabled = document.getElementById('tscmRfEnabled').checked;
@@ -12122,7 +12128,8 @@
wifi_interface: wifiInterface,
bt_interface: btInterface,
sdr_device: sdrDevice ? parseInt(sdrDevice) : null,
verbose_results: verboseResults
verbose_results: verboseResults,
custom_ranges: customRanges
})
});
@@ -12891,7 +12898,7 @@
if (tscmSweepStartTime) {
const elapsed = (Date.now() - tscmSweepStartTime) / 1000;
const sweepType = document.getElementById('tscmSweepType')?.value || 'standard';
const durations = { quick: 120, standard: 300, full: 900 };
const durations = { quick: 120, standard: 300, full: 900, custom: 300 };
const maxDuration = durations[sweepType] || 300;
const progress = Math.min(95, (elapsed / maxDuration) * 100);
updateTscmProgress({ progress: Math.round(progress), phase: 'Scanning' });