Repository navigation
visualizer: name the observer in a title above each sky view plot - #1401
Open
adamgeorge309 wants to merge 3 commits into
Open
adamgeorge309 wants to merge 3 commits into
adamgeorge309 wants to merge 3 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1400
The problem
GeoSkyViewCanvasVisualizerdrew one sky plot per observer with no title. A comment inbuildPlotDecorations()explained the choice: the observer's icon sits next to the plot. With the defaultplotOffsetXandplotOffsetY(infinite), the plots are tiled in a grid below the map in observer order instead. Inexamples/mobilitySatelliteMobilitythe 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 oflabelColoralready calls it the "Color of the title and elevation labels".The change
buildPlotDecorations()adds a label above the N label of each plot, inlabelColor: the observer node's display name, or its full name if no display name is set.plotRadiusof 70 (see the images below).displayTitles, defaulttrue, because grid mode is the default layout.falserestores the old canvas and the old row spacing.titleFormat, default"%N":%nfull name,%Ndisplay name (the full name if none is set),%pfull path of the observer's network node. The directives resolve as inInfoVisualizerBase, 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.SatelliteMobilityconfigures each ground station by index (*.gs[0].display-name = "Lima",*.gs[0].mobility.initialLatitude, ...), and with%nor%pthe plot showsgs[0], the name in those lines. AnobserverFiltersuch as"**.gs[*].mobility"can also match nodes with the same name in different compound modules;%ptells their plots apart. No configuration in the repository sets a format other than the default yet.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 = falserestores the old canvas. In the grid layout the columns are 2.5 ×plotRadiusapart (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 isexamples/mobility(IntegratedCanvasVisualizerleaves itsgeoSkyViewVisualizerempty by default, andIntegratedMultiCanvasVisualizercreates none by default,numGeoSkyViewVisualizers = 0).Commits
tests: change: re-record the SatelliteMobility tyf fingerprint for the new fake GUI probabilitiesis a baseline-only commit onorigin/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 storedSatelliteMobilitytyf 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.visualizer: fix: name the observer in a title above each sky view plotmoves 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 infixes/, and the re-recorded tyf fingerprint ofSatelliteMobility(332a-ea89 → 9471-891b).visualizer: add: a titleFormat parameter for the sky view plot titlesaddstitleFormatand the protected virtualgetObserverTitle()that resolves it, the module test case for the format, and the release note incompatible/. It changes no canvas figure with the default format.Architectural surface
displayTitles(commit 2) andtitleFormat(commit 3) onGeoSkyViewCanvasVisualizer.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, asgetTargetLabel()reads thesatelliteNameparameter of a target. The header now includesinet/common/StringFormat.h.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 onlytests/fingerprint/store.json, so "base" below means either of the two for the canvas. Release build unless stated. opp_repl:omnetpp/opp_replmainat39e15bc(it hasopp_run_module_tests,--ingredientsand--append-args). Commands run from the repository root unless acdis 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):Before (base): the two plots below the map have no title.
After (head): the plots are titled "Lima" and "Los Angeles".
After, with
titleFormat = "%p (%n)"andplotOffsetX = plotOffsetY = 0(plots anchored to the icons): the titles read "SatelliteNetwork.gs[0] (gs[0])" and "SatelliteNetwork.gs[1] (gs[1])".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 areevidence/scratch-config/SkyViewGridTest.nedandevidence/scratch-config/grid.ini, run with-n ../../src:../../examples:<scratch dir> -f omnetpp.ini -f <scratch dir>/grid.ini -c SkyViewGrid(or-c SkyViewGridPathfortitleFormat = "%p (%n)").Base, no titles:
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.
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.Module test
Run at commits 2 and 3, in release and in debug mode. It runs Cmdenv with
cmdenv-fake-gui = trueand 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'sbgbof 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; withdisplayTitles = falsethey are at 305 and 480, the old pitch of 175. With the row spacing removed from the source, the test fails. Commit 3 addstitleFormat = "%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.oppingredients_list(tplx, ~tNl, ~tND) only. The tyf values below come from local runs.Default ingredients, at each of the three commits:
Canvas-figure fingerprint (tyf) of
examples/mobilitySatelliteMobility, 3600 s:displayTitles = falseThe 0.1 row was computed with
opp_run_releaseand the same arguments, with the probabilities changed. WithdisplayTitles = falsethe 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/mobilityfail with the current arguments:AttachedMobilityandSuperpositioningMobility. They fail with identical values onorigin/master(2562-1da0, stored fa92-f68c; bdf2-06dd, stored 8e2e-8660). Their network (MobileNetwork) has noGeoSkyViewCanvasVisualizer, so this change does not reach them, and they are left as they are.Gates
Not verified: titles wider than the 175-pixel column pitch (they overlap their neighbour; documented, not changed).