Skip to content

visualizer: name the observer in a title above each sky view plot - #1401

Open
adamgeorge309 wants to merge 3 commits into
masterfrom
topic/gy/skyview-observer-titles
Open

adamgeorge309 wants to merge 3 commits into
masterfrom
topic/gy/skyview-observer-titles

Conversation

@adamgeorge309

Copy link
Copy Markdown
Contributor

Closes #1400

The problem

GeoSkyViewCanvasVisualizer drew one sky plot per observer with no title. A comment in buildPlotDecorations() explained the choice: the observer's icon sits next to the plot. With the default plotOffsetX and plotOffsetY (infinite), the plots are tiled in a grid below the map in observer order instead. In examples/mobility SatelliteMobility the two plots below the world map belong to Lima and Los Angeles, and the canvas did not say which is which. The Network Description (NED) documentation of labelColor already calls it the "Color of the title and elevation labels".

The change

  • buildPlotDecorations() adds a label above the N label of each plot, in labelColor: the observer node's display name, or its full name if no display name is set.
  • In the grid layout each row is one title line (14 pixels) taller. Without that, the titles of a second row touch the S labels of the row above at the default plotRadius of 70 (see the images below).
  • New parameter displayTitles, default true, because grid mode is the default layout. false restores the old canvas and the old row spacing.
  • New parameter titleFormat, default "%N": %n full name, %N display name (the full name if none is set), %p full path of the observer's network node. The directives resolve as in InfoVisualizerBase, so the title is configured like the labels of other visualizers. The default gives the same text as the fix commit. Why a format: the display name hides the module name that the configuration uses. SatelliteMobility configures each ground station by index (*.gs[0].display-name = "Lima", *.gs[0].mobility.initialLatitude, ...), and with %n or %p the plot shows gs[0], the name in those lines. An observerFilter such as "**.gs[*].mobility" can also match nodes with the same name in different compound modules; %p tells their plots apart. No configuration in the repository sets a format other than the default yet.
  • The User's Guide (§Visualizing the Sky View) said the plot is drawn "next to each observer node", which is true only with finite offsets. It now describes the default grid layout and the title.

The risk: the canvas changes for every user of the module. Each plot gains a title, and in grid mode the plots move down by 14 pixels per row. With finite offsets the plot sits next to the observer icon, which already shows the name, so the name appears twice. displayTitles = false restores the old canvas. In the grid layout the columns are 2.5 × plotRadius apart (175 pixels at the default), so a title wider than that overlaps its neighbour; the NED documentation now says so, and the column pitch is not changed. The only user of the module in the repository is examples/mobility (IntegratedCanvasVisualizer leaves its geoSkyViewVisualizer empty by default, and IntegratedMultiCanvasVisualizer creates none by default, numGeoSkyViewVisualizers = 0).

Commits

  1. tests: change: re-record the SatelliteMobility tyf fingerprint for the new fake GUI probabilities is a baseline-only commit on origin/master. opp_repl commit 5049cc8fbe changed the fake graphical user interface (GUI) probabilities of the tyf runs from 0.1 to 0.001, which moves the stored SatelliteMobility tyf row from 772e-b194 to 332a-ea89 with no INET change. The same commit (17a67ca) is also the first commit of pull requests examples: the Europe map image lines up with the latitudes drawn on it #1397 (the Europe map image) and examples: draw the Óbuda street map in the SatelliteMobility config #1399 (the Óbuda street map), which move the same row; whichever of the three pull requests merges first brings it in.
  2. visualizer: fix: name the observer in a title above each sky view plot moves the canvas (not the simulation): the title with the display name, displayTitles, the row spacing, the module test for the titles and the layout, the User's Guide sentence, the release note in fixes/, and the re-recorded tyf fingerprint of SatelliteMobility (332a-ea89 → 9471-891b).
  3. visualizer: add: a titleFormat parameter for the sky view plot titles adds titleFormat and the protected virtual getObserverTitle() that resolves it, the module test case for the format, and the release note in compatible/. It changes no canvas figure with the default format.

Architectural surface

  • Configuration: displayTitles (commit 2) and titleFormat (commit 3) on GeoSkyViewCanvasVisualizer.
  • C++: a new protected virtual GeoSkyViewCanvasVisualizer::getObserverTitle() (commit 3). It is virtual like every protected helper of the class: a subclass can override it to name the observer from data that the directives do not reach, as getTargetLabel() reads the satelliteName parameter of a target. The header now includes inet/common/StringFormat.h.
  • No packet content or feature descriptor changes.

Verification

Base: origin/master = a40c4ffcdc3b05619999411023a916214e2c0fde (build: fix: the description of the INET package names the Testing chapter as text). The series starts with the baseline commit 17a67ca, which changes only tests/fingerprint/store.json, so "base" below means either of the two for the canvas. Release build unless stated. opp_repl: omnetpp/opp_repl main at 39e15bc (it has opp_run_module_tests, --ingredients and --append-args). Commands run from the repository root unless a cd is shown. Each one passed except the tyf runs that are listed as mismatches.

Canvas images

Qtenv, run to 600 s over the simulation's Model Context Protocol (MCP) server, captured with the canvas image of the network (get_canvas_image, all elements, zoom 1):

cd examples/mobility && inet -u Qtenv -c SatelliteMobility --mcp-server-address=localhost:8795

Before (base): the two plots below the map have no title.

skyview-satellitemobility-before

After (head): the plots are titled "Lima" and "Los Angeles".

skyview-satellitemobility-after

After, with titleFormat = "%p (%n)" and plotOffsetX = plotOffsetY = 0 (plots anchored to the icons): the titles read "SatelliteNetwork.gs[0] (gs[0])" and "SatelliteNetwork.gs[1] (gs[1])".

skyview-satellitemobility-anchored-path-titles-after

Grid layout with more than one row: a scratch network that adds six ground stations to SatelliteNetwork (eight plots, four per row below the 720-pixel-wide map). The scratch files are not part of the pull request; they are evidence/scratch-config/SkyViewGridTest.ned and evidence/scratch-config/grid.ini, run with -n ../../src:../../examples:<scratch dir> -f omnetpp.ini -f <scratch dir>/grid.ini -c SkyViewGrid (or -c SkyViewGridPath for titleFormat = "%p (%n)").

Base, no titles:

skyview-grid-8-observers-master

Titles without the row spacing (an intermediate build, not a commit of this branch): the titles of the second row touch the S labels of the first row.

skyview-grid-8-observers-before-layout-fix

skyview-grid-8-observers-path-titles-before-layout-fix

Head: the second row is 14 pixels lower, and the titles are clear of the row above. The 31-character %p (%n) titles ("SkyViewGridTest.gsx[2] (gsx[2])") fit in the 175-pixel columns with a few pixels to spare.

skyview-grid-8-observers-after

skyview-grid-8-observers-path-titles-after

Module test

opp_run_module_tests -m release --no-build -l ERROR -f GeoSkyView
GeoSkyViewCanvasVisualizer_titles.test PASS

Run at commits 2 and 3, in release and in debug mode. It runs Cmdenv with cmdenv-fake-gui = true and prints, for each plot, its label texts, its center and the vertical position of each label. Commit 2 checks the texts (a node with a display name, "Lima"; one without, "gs[1]"; displayTitles = false, no title) and the layout: the network's bgb of 300×200 pixels holds one grid column, so the two plots are in two rows. With titles the title is 84 pixels above the plot center (14 above the rim, 13 above the N label at -71) and the centers are at y = 319 and 508, a row pitch of 175 + 14 = 189; with displayTitles = false they are at 305 and 480, the old pitch of 175. With the row spacing removed from the source, the test fails. Commit 3 adds titleFormat = "%p (%n)" ("Test.gs[0] (gs[0])", "Test.gs[1] (gs[1])").

Fingerprints

CI does not run tyf rows: its fingerprint job runs the ingredients of inet.opp ingredients_list (tplx, ~tNl, ~tND) only. The tyf values below come from local runs.

Default ingredients, at each of the three commits:

opp_run_fingerprint_tests -m release --no-build -w examples/mobility
32 PASS

Canvas-figure fingerprint (tyf) of examples/mobility SatelliteMobility, 3600 s:

opp_run_fingerprint_tests -m release --no-build -w examples/mobility -c '^SatelliteMobility$' --ingredients tyf
PASS at each of the three commits (332a-ea89, 9471-891b, 9471-891b)
tyf arguments base commits 2 and 3 commits 2 and 3, displayTitles = false
probabilities 0.001 (opp_repl since 5049cc8fbe) 332a-ea89 9471-891b 332a-ea89
probabilities 0.1 (opp_repl before 5049cc8fbe) 772e-b194 8db3-900b 772e-b194

The 0.1 row was computed with opp_run_release and the same arguments, with the probabilities changed. With displayTitles = false the branch gives the base values under both argument sets, so the titles and the row spacing account for the whole move.

Baseline update: commit 1 re-records the row from 772e-b194 to 332a-ea89 for the runner change alone, and commit 2 from 332a-ea89 to 9471-891b, the value that the tyf run above calculates at commit 2. The user (the branch owner) explicitly approved this re-record on 2026-10-28. Pull requests #1399 (the Óbuda street map) and #1397 (the Europe map image, which is drawn on the canvas) also move this row from 332a-ea89; whichever of the three merges later than another must re-record it again.

Two other tyf rows of examples/mobility fail with the current arguments: AttachedMobility and SuperpositioningMobility. They fail with identical values on origin/master (2562-1da0, stored fa92-f68c; bdf2-06dd, stored 8e2e-8660). Their network (MobileNetwork) has no GeoSkyViewCanvasVisualizer, so this change does not reach them, and they are left as they are.

Gates

doc/project/enforcement/check-commits.sh origin/master..HEAD
PASS
doc/project/enforcement/check-classification.sh origin/master..HEAD
PASS
doc/project/enforcement/whatsnew.py check
PASS
doc/project/enforcement/check-pull-request.sh --base origin/master --head HEAD --description-file <this text>
PASS

Not verified: titles wider than the 175-pixel column pitch (they overlap their neighbour; documented, not changed).

…e new fake GUI probabilities

Before this commit, the tyf fingerprint test of the SatelliteMobility configuration of examples/mobility fails on an unchanged INET tree: the stored value is 772e-b194, and the test now calculates 332a-ea89. The stored value was recorded when opp_repl ran the tyf ingredients with fake graphical user interface (GUI) probabilities of 0.1. opp_repl commit 5049cc8fbe changed these probabilities (before event, after event, on hold and on simulation time) to 0.001.

After this commit, the row stores 332a-ea89, and the test passes again. No INET source, configuration or image changes. The y (display strings) and f (canvas figures) ingredients are added on each refreshDisplay() call that the fake GUI makes, and the probabilities decide when those calls happen, so the new arguments alone move the value. The simulation itself does not change: the other ingredient sets of this configuration keep their stored values.

Provenance: opp_run_fingerprint_tests of opp_repl main 39e15bc, -m release -w examples/mobility -c '^SatelliteMobility$' --ingredients tyf, release build of a40c4ff.

Change: tests | behavior.change | fingerprint
GeoSkyViewCanvasVisualizer drew one polar sky plot per observer and gave it no title. A comment in buildPlotDecorations() explained the choice: the observer's icon sits next to the plot and names it, which holds only with finite plotOffsetX and plotOffsetY. With their default (infinite) the plots are tiled in a grid below the map, away from the icons. In examples/mobility SatelliteMobility the two plots below the world map belong to the ground stations Lima and Los Angeles, and nothing on the canvas says which is which. The Network Description (NED) documentation of labelColor already calls it the "Color of the title and elevation labels".

After this commit, each plot has a title above its N label, in labelColor: the observer node's display name, or its full name if none is set. In the grid layout each row is one title line (14 pixels) taller, so that a title clears the S label of the plot above. The new displayTitles parameter turns the titles off and restores the old canvas; it defaults to true because grid mode is the default layout. To see the change, run `inet -u Qtenv -c SatelliteMobility` in examples/mobility. The module test tests/module/GeoSkyViewCanvasVisualizer_titles.test checks the titles, their position above the plot, and the row pitch with and without titles. The User's Guide now describes the grid layout.

Simulation results do not change: the title is a canvas figure, drawn only when the visualizer draws. The fingerprints with the default ingredients of inet.opp (tplx, ~tNl, ~tND) do not change.

The canvas-figure fingerprint (tyf) of SatelliteMobility moves from 332a-ea89 to 9471-891b, because the titles are new figures and the grid rows move down; this commit re-records it in tests/fingerprint/store.json. With displayTitles = false this commit gives 332a-ea89, so the titles and the row spacing account for the whole move.

Change: src.visualizer.canvas.GeoSkyViewCanvasVisualizer | behavior.add.fix | test whatsnew fingerprint
The title above each GeoSkyViewCanvasVisualizer sky plot showed the observer node's display name, or its full name if no display name is set. The display name hides the module name that the configuration uses: examples/mobility SatelliteMobility sets each ground station by index (*.gs[0].display-name = "Lima", *.gs[0].mobility.initialLatitude, ...), and its plots read "Lima" and "Los Angeles", not gs[0] and gs[1]. An observerFilter such as "**.gs[*].mobility" can also match same-named nodes in different compound modules; the full path tells their plots apart. Other visualizers let the user choose the text of their labels with a format string (labelFormat, resolved by InfoVisualizerBase); the sky view had no such choice. No configuration in the repository sets a format other than the default yet.

After this commit, the new titleFormat parameter selects the title text. Its directives are %n (the observer node's full name), %N (its display name, or the full name if none is set) and %p (its full path), the same letters as in InfoVisualizerBase. The default "%N" gives that same title, so the canvas does not change. The new protected virtual getObserverTitle() resolves the format; a subclass can override it to name the observer from data that the directives do not reach, as getTargetLabel() reads the satelliteName parameter of a target. The module test tests/module/GeoSkyViewCanvasVisualizer_titles.test now also checks titleFormat = "%p (%n)".

Simulation results and canvas figures do not change: the default format gives the same text, and the tyf fingerprint of examples/mobility SatelliteMobility stays at 9471-891b.

Change: src.visualizer.canvas.GeoSkyViewCanvasVisualizer | behavior.add | test whatsnew

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

visualizer: GeoSkyViewCanvasVisualizer draws its sky plots without the observer's name

1 participant