Cover every option in the help, the manual and the readme, and say what to install
An audit rather than a feature, prompted by wanting this fit to hand to somebody else. Five options had no command-line flag written down in the table the manual is generated from -- location, hold, schedules, tile_url and speed_unit -- so five flags that exist were missing from the manual. Four of them did exist under other names and are now recorded; hold had no flag at all and has one. Four switches could be turned off from the command line and not back on: --no-lookup, --no-basemap, --no-airports and --no-labels had no positive halves, so an option turned off in the saved settings could not be turned on again for one run. All four now have both. And adsb, which opens the window and draws a map when it stops, could not be given any of the settings that decide what those look like: no --at, no --radius, no --tiles, no --map-brightness, no --width, --fps, --trail, --fade, --stale, --airports or --labels. It takes all of them now. The manual had no list of the aircraft options at all -- the ADS-B sections were hand-written prose -- so five of them appeared nowhere in it. It now generates an AIRCRAFT OPTIONS section from the same table the menu and the flags come from, and the readme carries a table of all thirty-four with their flags and defaults. Three tests hold the three of them together: one that every option records its flag, one that every flag the table claims actually exists on a command, and one that the readme names them all. The installing instructions now list every dependency rather than only the optional ones: the four Python packages with their names in Debian, Fedora and Arch, and librtlsdr, which is a C library and therefore the one thing pip cannot bring and a virtual environment cannot supply. What reaches a network is written down too -- which host, when, and which file it is cached in -- since somebody installing this on a metered or air-gapped machine has to be able to see that nothing is fetched behind their back. build-repo.sh needs dpkg-dev and apt-utils, which a minimal system does not have, and now says so. Verified rather than asserted: a clean virtual environment, pip install from this tree, and a real log read back through the installed command. It pulls seven wheels rather than the four the page claimed, the other three being what Rich brings with it. Also: matplotlib is gone from the readme's dependency table, nothing having imported it; ffmpeg and Qt are in it, both having been missing; ffmpeg is a Suggests on the package; and resume.sh is ignored. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PsWPTweCT6pwxKngvVxcg
This commit is contained in:
parent
6d2436cde1
commit
8ed01f991f
16 changed files with 1012 additions and 46 deletions
|
|
@ -1843,3 +1843,79 @@ def test_the_ring_labels_are_in_the_unit_the_rest_of_the_window_uses():
|
|||
["30 mi", "60 mi", "90 mi"]
|
||||
assert [text for _nm, text in ring_labels(100.0, "kph")] == \
|
||||
["46 km", "93 km", "139 km"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# The card behind a box, and the flag over everything
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@qt
|
||||
def test_the_card_behind_a_box_is_as_solid_as_it_was_asked_to_be(app):
|
||||
"""The words beside an aircraft are readable over water and not over a
|
||||
city, so a card goes behind them; how much of the map it hides is the
|
||||
setting."""
|
||||
from bandsaunter.livemap import SkyView
|
||||
|
||||
from bandsaunter.flightmap import PALETTE, PANEL
|
||||
|
||||
want = PALETTE[PANEL]
|
||||
|
||||
def solid(part):
|
||||
"""Pixels that came out the panel colour exactly, which only a card
|
||||
drawn at full strength does."""
|
||||
view = SkyView(a_sky(a_blip(), box_opacity=part))
|
||||
view.show_ground = False
|
||||
picture = _rendered(view)
|
||||
return int(((picture[:, :, 2] == want[0])
|
||||
& (picture[:, :, 1] == want[1])
|
||||
& (picture[:, :, 0] == want[2])).sum())
|
||||
|
||||
# Measured against the picture with no card at all: the header strip is
|
||||
# drawn in the panel colour too, and that is not a card.
|
||||
none = solid(0.0)
|
||||
assert solid(1.0) - none > 500, "no solid card was drawn"
|
||||
# Half way is neither one nor the other: the map shows through it, so
|
||||
# hardly a pixel comes out the panel colour exactly.
|
||||
assert solid(0.5) - none < (solid(1.0) - none) / 4
|
||||
|
||||
|
||||
@qt
|
||||
def test_a_box_with_no_card_lets_the_map_through(app):
|
||||
from bandsaunter.livemap import SkyView
|
||||
|
||||
sky = a_sky(a_blip(), box_opacity=0.0)
|
||||
assert sky.box_opacity == 0.0
|
||||
view = SkyView(sky)
|
||||
view.show_ground = False
|
||||
assert _rendered(view) is not None # it draws, and does not fail
|
||||
|
||||
|
||||
def test_the_card_setting_is_kept_inside_its_range():
|
||||
assert Sky(box_opacity=-2.0).box_opacity == 0.0
|
||||
assert Sky(box_opacity=9.0).box_opacity == 1.0
|
||||
|
||||
|
||||
@qt
|
||||
def test_nothing_in_the_window_is_drawn_over_the_flag(app):
|
||||
"""It says where the receiver is standing, which is the one thing on
|
||||
the picture that must never end up behind an aeroplane that happened to
|
||||
fly over it, or behind the box belonging to one."""
|
||||
from bandsaunter.flightmap import HOME_POLE, HOME_RED
|
||||
from bandsaunter.livemap import SkyView
|
||||
|
||||
home = (32.4325, -111.0841)
|
||||
# An aircraft sitting exactly on the receiver, with a solid box.
|
||||
sky = a_sky(a_blip(lat=home[0], lon=home[1]), home=home, box_opacity=1.0)
|
||||
view = SkyView(sky)
|
||||
view.show_ground = False
|
||||
picture = _rendered(view)
|
||||
projection = view.projection()
|
||||
x, y = projection.xy(*home)
|
||||
|
||||
def is_flag(px, py):
|
||||
pixel = picture[py, px]
|
||||
return (int(pixel[2]), int(pixel[1]), int(pixel[0])) == HOME_RED
|
||||
|
||||
assert is_flag(x, y), "the foot of the pole was painted over"
|
||||
assert all(is_flag(x, y - up) for up in range(HOME_POLE)), \
|
||||
"part of the pole was painted over"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue