Remember runtime lock-outs, and let a lock-out be a span

Pressing `l` during a scan locked a frequency out for that run only, so the
same birdie had to be locked out again on every later one. It now writes
back to the settings file the run started from -- only that one key, since
a scan's config also holds whatever was passed on the command line for this
run and saving all of it would quietly make those permanent. The file is
read, its lock-outs replaced, the rest left as it was. `save_lockouts`
turns it off for anyone who would rather their config were never touched.

Lock-outs were also single frequencies only. They are now a list of
frequencies and spans -- "162.55M, 450M-455M, 88M to 108M" -- which is what
a pager band or a noisy stretch of spectrum actually is. A point is still
widened by the lock-out width; a span is taken exactly as written, because
whoever typed it already said how wide it is.

The scanner matched lock-outs by rounding a frequency into a bucket of the
lock-out width, which cannot express a span and was never exact at the
edges. It now holds intervals and tests them directly.

Settings files that predate this hold a bare number per lock-out, and still
mean the same thing: Lockout.coerce takes numbers, strings, pairs and dicts,
so old profiles load untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
The Dust Council 2026-08-21 23:44:24 -07:00
parent b69d0b7a26
commit 44c98b11e3
9 changed files with 319 additions and 46 deletions

View file

@ -823,9 +823,31 @@ since that is the command to run when something is wrong, and
| `q` | stop |
| `p` | pause / resume |
| `s` | skip this signal, resume sweeping |
| `l` | lock out this frequency for the rest of the run |
| `l` | lock out this frequency — for this run and every later one |
| `+` / `-` | adjust the squelch threshold |
### Lock-outs
A pager transmitter down the road, or a birdie the receiver makes itself, is
worth shutting out permanently. Pressing `l` writes the frequency back to the
settings file the run started from, so it is still locked out tomorrow. Only
that one setting is written back — options passed on the command line for a
single run stay one-off — and `--no-save-lockouts` keeps a lock-out to the
current run.
Lock-outs can also be given directly, several at a time, as single frequencies
or as spans:
```bash
bandsaunter scan -r 144M-148M --lockout "162.55M, 450M-455M"
bandsaunter config lockout="88M-108M, 146.52M"
```
A single frequency is widened by `--lockout-width` (12.5 kHz by default); a
span is taken exactly as written, since a noisy stretch of spectrum has a
definite width rather than a point with a guess around it. Ranges accept the
same forms as everywhere else — `450M-455M`, `450-455M`, `88M to 108M`.
## Built-in help
Press `h` in the menus for topics covering setup, how the sweep works, why