Put APRS stations on the live map, where they stay
The same window the aircraft use, given marks that are not aeroplanes. It already knew how to fetch a map, place an information box where it covers nothing, glide it when its owner moves, draw range rings, put a flag where the aerial stands and a scale along the bottom -- and not one of those has anything to do with aviation. What it did not know is that a mark might not fade, might not point anywhere, and might be coloured by what it is rather than by how high it is. Those are three hooks rather than a second window, and the aircraft map is untouched: every one of them defaults to exactly what an aeroplane does. Nothing fades, which is the difference asked for and the right one. An aeroplane that stops transmitting has flown out of range, and drawing it an hour later where it was would be drawing something that is certainly not there. A fixed amateur station that stops transmitting is still exactly where it was -- it beacons every half hour, and the gaps are silence rather than absence. So the picture accumulates and an evening of listening fills a map. Marks are ordered most-recently-heard first, because that is the order the boxes are laid out in and an accumulating map has more marks on it than it has room for boxes. Marks are drawn by what they are: something moving as a body with a stalk pointing where it is going, and anything fixed as a diamond, which is the one shape on the picture with no front -- a house that beacons twice an hour is a place, and a triangle would have it pointing north for no reason. Colours come off the altitude ramp, not because a station has an altitude but because that ramp is the one set of colours all five themes define: warm to cold on the default map, dim to bright on the phosphor ones, so a digipeater stays distinguishable from a car everywhere without a colour being named here. The box says what the station is, how far off and in which bearing, what it is doing if it is moving, its altitude, its weather, its status, the digipeaters it came through, how many packets and how many of those arrived directly, and how strongly. The heading prints the callsign once: an aeroplane has two names and the heading was built for that. Reachable both ways, as everything here is -- --window on the command line, w in the menu -- with the same eight map settings the aircraft side has. Forty new tests against nine deliberately broken builds. Two of them survived the first attempt, and both for the same reason: they asked whether the rendered frames differed rather than whether the symbol did, and the strip along the top carries a running clock, so two frames taken a millisecond apart differ by a few hundred pixels whatever is on the map. They now crop to the mark. That is the second time this session that a ticking header has made a test pass for the wrong reason. Full suite 2652 passed. Built as 2026-09-21_01. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PsWPTweCT6pwxKngvVxcg
This commit is contained in:
parent
14ba77da9a
commit
2c7b1ba25e
10 changed files with 1049 additions and 19 deletions
|
|
@ -1033,9 +1033,13 @@ def aprs_menu(console: Console, cfg: ScanConfig) -> None:
|
|||
logs = ap.logs_in(cfg.output_dir)
|
||||
kept = "no logs yet" if not logs else \
|
||||
f"{len(logs)} log{'s' if len(logs) != 1 else ''}"
|
||||
window = "opens a window" if ap.windowed() else "needs Qt \u2014 see ?"
|
||||
console.print(
|
||||
f"\n [cyan]l[/cyan] [bold green]Listen[/bold green]"
|
||||
f" [grey62]{ap.describe(options)}[/grey62]\n"
|
||||
f" [cyan]w[/cyan] [bold green]Realtime map[/bold green]"
|
||||
f" [grey62]{window}, the stations on it, and they stay"
|
||||
f"[/grey62]\n"
|
||||
# The channel is the setting that decides whether anything is
|
||||
# heard at all, and it cannot be discovered from the air on any
|
||||
# one frequency, so it sits here rather than a level down among
|
||||
|
|
@ -1058,6 +1062,8 @@ def aprs_menu(console: Console, cfg: ScanConfig) -> None:
|
|||
return
|
||||
if answer in ("l", "listen", "p"):
|
||||
_aprs_listen(console, cfg, options)
|
||||
elif answer in ("w", "window", "map", "realtime"):
|
||||
_aprs_watch(console, cfg, options)
|
||||
elif answer in ("c", "channel", "region"):
|
||||
_aprs_channel(console, options)
|
||||
elif answer in ("f", "find", "search", "scan"):
|
||||
|
|
@ -1083,8 +1089,8 @@ def aprs_menu(console: Console, cfg: ScanConfig) -> None:
|
|||
found = _find_options(answer, ap)
|
||||
if not found:
|
||||
console.print(f" [yellow]nothing matches {answer!r} \u2014 "
|
||||
f"enter a group number, or l, c, f, r, s, d "
|
||||
f"or b[/yellow]")
|
||||
f"enter a group number, or l, w, c, f, r, s, "
|
||||
f"d or b[/yellow]")
|
||||
elif len(found) == 1:
|
||||
_edit_option(console, options,
|
||||
str(ap.OPTIONS.index(found[0]) + 1), ap)
|
||||
|
|
@ -1094,6 +1100,25 @@ def aprs_menu(console: Console, cfg: ScanConfig) -> None:
|
|||
_pick_option(console, options, ap)
|
||||
|
||||
|
||||
def _aprs_watch(console: Console, cfg: ScanConfig, options) -> None:
|
||||
"""Open the window, and come back to the menu when it is closed."""
|
||||
from . import aprs as ap
|
||||
|
||||
errs = options.validate()
|
||||
if errs:
|
||||
for e in errs:
|
||||
console.print(f" [red]{e}[/red]")
|
||||
return
|
||||
console.print("[grey62]closing the window stops the listening and "
|
||||
"writes the log and the report, exactly as listening "
|
||||
"without one does. Stations stay on the map once they have "
|
||||
"been heard \u2014 they do not fade off it.[/grey62]")
|
||||
try:
|
||||
ap.watch(console, options, cfg.output_dir)
|
||||
except Exception as exc: # a menu must survive it
|
||||
console.print(f" [red]{exc}[/red]")
|
||||
|
||||
|
||||
def _aprs_channel(console: Console, options) -> None:
|
||||
"""Choose the region, which sets the frequency with it.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue