From beda88654512c982491ae4f5027ec686dd0603c2 Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Thu, 15 Oct 2026 18:10:27 +0200 Subject: [PATCH] visualizer: fix: read the dy parameter of PacketDropCanvasVisualizer PacketDropCanvasVisualizer::initialize() read the dx parameter into both dx and dy, so the dy parameter had no effect, and the drop animation turned over at the height dx: 32 pixels with the defaults instead of the documented 64. setAlpha() moves the icon along a parabola whose turning point is at (dx, dy), as the Network Description (NED) comments of the two parameters say. The line dates from 2525087caf. initialize() now reads dy from the dy parameter. Every canvas packet drop animation turns over at dy, 64 pixels with the defaults. Simulation results do not change: setAlpha() uses the value only to place the figure, during refreshDisplay(). In a run with Cmdenv's fake graphical user interface and fadeOutMode set to simulationTime, the canvas figure fingerprint (ingredient f) of showcases/visualizer/canvas/packetdrop QueueOverflow is the same for dy = 64 and dy = 1 before this commit and differs after it. The fingerprints recorded in tests/fingerprint do not change: their fake graphical user interface runs (ingredients tyf: simulation time, display strings, canvas figures) set fadeOutMode to animationTime, and the 22 tyf rows of the five showcases that display packet drops compute the same fingerprints before and after this commit. Change: src.visualizer.canvas.PacketDropCanvasVisualizer | behavior.change.fix | whatsnew --- WHATSNEW | 4 ++++ .../visualizer/canvas/common/PacketDropCanvasVisualizer.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index 68c0405dbb7..208fdd7f31c 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -490,6 +490,10 @@ Notable bug fixes are the following: The HT mode factory now includes band and preamble format in its cache key. A 5 GHz request after an equivalent 2.4 GHz request therefore receives the requested band and timing. Previously, that request could receive the earlier mode. Identical complete requests still reuse one object. +2. The packet drop animation uses the dy parameter + + PacketDropCanvasVisualizer read its dx parameter into dy as well, so dy had no effect and the dropped packet's icon turned over at the height dx, 32 pixels with the defaults instead of the documented 64. The visualizer now reads dy, so the canvas packet drop animation, for example in showcases/visualizer/canvas/packetdrop, rises twice as high with the defaults. Simulation results do not change. + INET-4.7 (July 2026) — feature release -------------------------------------- diff --git a/src/inet/visualizer/canvas/common/PacketDropCanvasVisualizer.cc b/src/inet/visualizer/canvas/common/PacketDropCanvasVisualizer.cc index 0adb196c503..18733787db0 100644 --- a/src/inet/visualizer/canvas/common/PacketDropCanvasVisualizer.cc +++ b/src/inet/visualizer/canvas/common/PacketDropCanvasVisualizer.cc @@ -34,7 +34,7 @@ void PacketDropCanvasVisualizer::initialize(int stage) if (stage == INITSTAGE_LOCAL) { zIndex = par("zIndex"); dx = par("dx"); - dy = par("dx"); + dy = par("dy"); auto canvas = visualizationTargetModule->getCanvas(); canvasProjection = CanvasProjection::getCanvasProjection(canvas); packetDropGroup = new cGroupFigure("packet drops");