Mark the aerodromes in the window, and draw the lot on a vector display
The aerodromes were never on the window at all: only the animation drew them, and the window's map had whatever airport glyphs the tiles happened to carry. They are drawn there now, in the same colour and the same square. The first attempt at that had a bug worth naming, because it would have looked like the feature simply not working. They were fetched inside the same pass of the fetching loop as a piece of map, so they queued behind a hundred and twenty tiles coming off a network -- and once the map was in hand there were no more passes, so they were never fetched again. They are their own question now, asked on the same thread but not behind the tiles, and they arrive whether the tiles do or not. An area that has been asked about and has none in it is remembered as none, rather than asked about again five times a second for the rest of the night. And the thread now starts if either the map or the aerodromes are wanted, so --no-basemap no longer quietly takes the airports with it. Then the themes, which change the window and the animated pictures together because both read their colours out of the same palette. night is what this program has always drawn and is untouched. digital, phosphor, amber and red are the screens the phrase "air defence display" actually calls to mind: a black tube, one phosphor, and thin bright vector lines with a halo round them. Three things follow from having one colour to spend, and they are constraints rather than decoration. Height becomes brightness, since hue is no longer free -- low is dim and high burns, which is the trade those displays made. The map underneath drops to about a quarter of the brightness asked for, because a tinted photograph of a county behind the vectors is the one thing that stops a vector display looking like one. And a country is named in two letters rather than drawn as a flag, a flag being half a dozen colours. The glow is done twice, differently, because the two are different kinds of picture. The window lays each line down two or three times, wider and fainter each pass, with the core last: trails, symbols, leader lines, box borders and the aerodrome squares. The animation cannot blend at all, a GIF being indexed colour, so it dilates what it has drawn and fills the halo with the dimmed copy of the colour underneath -- and the aircraft colours already had dimmed copies, since those are the trail shades, so an aeroplane glows into the colour its own trail is drawn in, which is the colour a phosphor would have spread into. The fixed colours get two rings each in the palette for the purpose. The halo goes over the map, the grid and the background and over nothing else that was drawn, since a halo is what light does to the dark around a line; where two rings meet the nearer wins. It costs about 55 ms a frame at 1400 by 1258 and the default theme skips the pass entirely. The palette is written over in place rather than replaced, because both drawings and every one of their helpers hold a reference to that array and a new one would leave half the program painting in the colours of the theme before. There is a test that every theme keeps the aerodrome colour more than forty units of CIELAB from every altitude colour, stated as the distance rather than as the colour, so that a new theme cannot quietly walk an aircraft back into the airports. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PsWPTweCT6pwxKngvVxcg
This commit is contained in:
parent
f9b21f7e35
commit
2e20c48971
11 changed files with 1342 additions and 50 deletions
|
|
@ -196,6 +196,13 @@ examples:
|
|||
ad.add_argument("--window", action="store_true",
|
||||
help="open a window and show the aircraft on a map as "
|
||||
"they are heard, instead of a table in the terminal")
|
||||
ad.add_argument("--theme", default=None, metavar="NAME",
|
||||
choices=("night", "digital", "phosphor", "amber", "red",
|
||||
"blue", "green", "orange", "wargames", "norad",
|
||||
"p1", "crimson"),
|
||||
help="how the window and the map look: night (the "
|
||||
"default), or the vector-display themes digital, "
|
||||
"phosphor, amber and red")
|
||||
ad.set_defaults(log_frames=True, lookup=True)
|
||||
|
||||
# -- flights --------------------------------------------------------------
|
||||
|
|
@ -248,6 +255,13 @@ examples:
|
|||
fl.add_argument("--map-brightness", type=int, default=None,
|
||||
metavar="PERCENT",
|
||||
help="how bright the map under the aircraft is (10-100)")
|
||||
fl.add_argument("--theme", default=None, metavar="NAME",
|
||||
choices=("night", "digital", "phosphor", "amber", "red",
|
||||
"blue", "green", "orange", "wargames", "norad",
|
||||
"p1", "crimson"),
|
||||
help="how the map looks: night (the default), or the "
|
||||
"vector-display themes digital, phosphor, amber "
|
||||
"and red")
|
||||
fl.add_argument("--no-airports", dest="airports", action="store_false",
|
||||
default=None,
|
||||
help="do not mark the aerodromes under the flight paths")
|
||||
|
|
@ -1095,6 +1109,8 @@ def cmd_adsb(args) -> int:
|
|||
options.basemap = args.basemap
|
||||
if args.schedules is not None:
|
||||
options.schedules = args.schedules
|
||||
if getattr(args, "theme", None):
|
||||
options.theme = args.theme
|
||||
if args.map:
|
||||
options.picture = Path(args.map).suffix.lstrip(".") or options.picture
|
||||
|
||||
|
|
@ -1147,6 +1163,8 @@ def cmd_flights(args) -> int:
|
|||
options.recheck = True
|
||||
if args.schedules is not None:
|
||||
options.schedules = args.schedules
|
||||
if getattr(args, "theme", None):
|
||||
options.theme = args.theme
|
||||
tracks = air.checked(console, options, tracks)
|
||||
book = FlightBook(online=args.lookup,
|
||||
schedules=air.schedule_names(options))
|
||||
|
|
@ -1197,6 +1215,8 @@ def cmd_flights(args) -> int:
|
|||
options.tile_url = args.tiles
|
||||
if args.map_brightness is not None:
|
||||
options.map_brightness = args.map_brightness
|
||||
if getattr(args, "theme", None):
|
||||
options.theme = args.theme
|
||||
if args.airports is not None:
|
||||
options.airports = args.airports
|
||||
if args.radius is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue