MediumVisualizerBase¶
Package: inet.visualizer.base
simple module MediumVisualizerBase
Base module for medium visualizer simple modules. It keeps track of ongoing signal departures, ongoing signal arrivals, and propagating signals.
It subscribes to signalSourceAdded, signalSourceRemoved, signalAdded,
signalRemoved, signalDepartureStarted, signalDepartureEnded, signalArrivalStarted,
signalArrivalEnded simulation signals at the module determined by the mediumModule
parameter. The actual visualization of the medium is done in derived modules.
See also: MediumCanvasVisualizer, MediumOsgVisualizer, IMediumVisualizer, VisualizerBase
Inheritance diagram¶
Known subclasses¶
Name |
Type |
Description |
|---|---|---|
simple module |
Visualizes a medium on a 2D canvas. It displays communication ranges and interference ranges as circles around network nodes. It displays an image at network nodes which are currently transmitting, and a different image at other network nodes which are currently receiving. It also displays radio signals as a 2D ring or a 3D sphere as they propagate through the medium. |
|
simple module |
Visualizes a medium using a 3D osg scene. It displays communication ranges and interference ranges as circles around network nodes. It displays an image at network nodes which are currently transmitting, and a different image at other network nodes which are currently receiving. It also displays radio signals as a growing 2D ring or a 3D sphere as they propagate through the medium. All 2D shapes such as circles, rings, and images can be displayed in 4 different planes: camera, xy, xz, and yz. It’s also possible to use animated images. |
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for visualizer simple modules. It simply provides the visualization target module for derived modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
visualizationTargetModule |
string |
“^” |
Module path relative to the visualizer which determines where the visualization should appear in the user interface, parent module by default |
visualizationSubjectModule |
string |
“^” |
Module path relative to the visualizer which determines what part of the simulation model the visualizer displays in the user interface, parent module by default |
tags |
string |
“” |
Tag added to each visualization for disambiguation in the runtime environment |
mediumModule |
string |
“radioMedium” |
The medium module that is displayed, refers to a top-level submodule by default |
networkNodeVisualizerModule |
string |
“^.networkNodeVisualizer” |
The network node visualizer module, refers to a sibling submodule by default |
nodeFilter |
string |
“*” |
Which nodes are considered, matches all nodes by default |
interfaceFilter |
string |
“*” |
Which interfaces are considered, matches all interfaces by default |
packetFilter |
object |
“*” |
Which packets are considered, matches all packets by default |
displaySignals |
bool |
false |
Display signals propagating through the medium, disabled by default |
signalColor |
string |
“dark” |
Signal color is a list of colors or a color group name (e.g., dark, light), a set of dark colors by default |
signalPropagationAnimationSpeed |
double |
nan |
Animation speed while the very beginning or end of a signal is propagating on the medium, value must be in the range (0, +inf) or NaN, the latter means automatic setting |
signalPropagationAnimationTime |
double |
1s |
Signal propagation animation duration when signalPropagationAnimationSpeed is unspecified |
signalPropagationAdditionalTime |
double |
0s |
Additional simulation time to animate signal propagation after leaving the last receiver |
signalTransmissionAnimationSpeed |
double |
nan |
Animation speed while a signal is being transmitted on the medium, value must be in the range (0, +inf) or NaN, the latter means automatic setting |
signalTransmissionAnimationTime |
double |
1s |
Signal transmission animation duration when signalTransmissionAnimationSpeed is unspecified |
signalAnimationSpeedChangeTimeMode |
string |
“realTime” |
Specifies the time mode for animation speed changes between propagation and transmission animation |
signalAnimationSpeedChangeTime |
double |
1s |
Animation speed changes smoothly from propagationAnimationSpeed to transmissionAnimationSpeed in the specified real time |
displaySignalDepartures |
bool |
false |
Display an image where a signal departure is currently in progress, disabled by default |
signalDepartureImage |
string |
“misc/signal_departure.png” |
Image for ongoing signal departures |
signalDeparturePlacementHint |
string |
“topCenter” |
Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc. |
signalDeparturePlacementPriority |
double |
1 |
Determines the order of annotation positioning |
displaySignalArrivals |
bool |
false |
Display an image where a signal arrival is currently in progress, disabled by default |
signalArrivalImage |
string |
“misc/signal_arrival.png” |
Image for ongoing signal arrivals |
signalArrivalPlacementHint |
string |
“topCenter” |
Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc. |
signalArrivalPlacementPriority |
double |
-1 |
Determines the order of annotation positioning |
displayCommunicationRanges |
bool |
false |
Display communication ranges as circles around radios, enabled by default |
communicationRangeLineColor |
string |
“blue” |
Communication range circle line color, blue by default |
communicationRangeLineStyle |
string |
“solid” |
Communication range circle line style, solid by default |
communicationRangeLineWidth |
double |
1 |
Communication range circle line width, 1 by default |
displayInterferenceRanges |
bool |
false |
Display interference ranges as circles around radios, disabled by default |
interferenceRangeLineColor |
string |
“gray” |
Interference range circle color, gray by default |
interferenceRangeLineStyle |
string |
“solid” |
Interference range circle line style, solid by default |
interferenceRangeLineWidth |
double |
1 |
Interference range circle line width, 1 by default |
autoPowerAxis |
bool |
true |
Enables automatic power axis configuration |
signalMinPower |
double |
inf dBmW |
Minimum signal power if the axis is not automatic |
signalMaxPower |
double |
0 dBmW |
Maximum signal power if the axis is not automatic |
signalMinPowerDensity |
double |
inf dBmWpMHz |
Minimum signal power density if the axis is not automatic |
signalMaxPowerDensity |
double |
-inf dBmWpMHz |
Maximum signal power density if the axis is not automatic |
autoTimeAxis |
bool |
true |
Enables automatic time axis configuration |
signalMinTime |
double |
0 s |
Relative to the current simulation time |
signalMaxTime |
double |
0 s |
Relative to the current simulation time |
autoFrequencyAxis |
bool |
true |
Enables automatic frequency axis configuration |
signalMinFrequency |
double |
inf Hz |
Minimum signal frequency if the axis is not automatic |
signalMaxFrequency |
double |
-inf Hz |
Maximum signal frequency if the axis is not automatic |
displayMainPowerDensityMap |
bool |
false |
Display a power density map for the transmission medium, can be enabled with dimensional analog models only |
mainPowerDensityMapPixmapDensity |
double |
1 |
Pixmap relative resolution |
mainPowerDensityMapMinX |
double |
0 |
Minimum X coordinate |
mainPowerDensityMapMaxX |
double |
nan |
Maximum X coordinate, compound module size by default |
mainPowerDensityMapMinY |
double |
0 |
Minimum Y coordinate |
mainPowerDensityMapMaxY |
double |
nan |
Maximum Y coordinate, compound module size by default |
mainPowerDensityMapZ |
double |
0 |
Z coordinate |
mainPowerDensityMapFigureXTickCount |
int |
3 |
Number of ticks along the X-axis |
mainPowerDensityMapFigureYTickCount |
int |
3 |
Number of ticks along the Y-axis |
displayPowerDensityMaps |
bool |
false |
Display power density maps at the nodes, can be enabled with dimensional analog models only |
powerDensityMapMode |
string |
“auto” |
Total means total transmission medium, signal means transmitted or received signal, auto means total or signal and noise if transmission or reception is in progress |
powerDensityMapPixelMode |
string |
“mean” |
Specifies the method used to determine the color of each pixel, the sample method is the least accurate but the fastest (sample < partition < mean) |
powerDensityMapApproximationSize |
int |
10 |
Medium power density function approximation along the X and Y axes |
powerDensityMapCenterFrequency |
double |
nan Hz |
Center frequency of medium power density sampling or integration |
powerDensityMapBandwidth |
double |
0 Hz |
Bandwidth of medium power density integration, 0 means sampling, inf means total integrated power |
powerDensityMapFigureWidth |
double |
200 |
Plot figure width in pixels |
powerDensityMapFigureHeight |
double |
120 |
Plot figure height in pixels |
powerDensityMapPixmapWidth |
double |
powerDensityMapFigureWidth |
Pixmap resolution width |
powerDensityMapPixmapHeight |
double |
powerDensityMapFigureHeight |
Pixmap resolution height |
powerDensityMapZ |
double |
0 |
Z coordinate |
powerDensityMapFigureXTickCount |
int |
3 |
Number of ticks along the X-axis |
powerDensityMapFigureYTickCount |
int |
3 |
Number of ticks along the Y-axis |
displaySpectrums |
bool |
false |
Display power spectral density at the nodes, can be enabled with dimensional analog models only |
spectrumMode |
string |
“auto” |
Total means total transmission medium, signal means transmitted or received signal, auto means total or signal and noise if transmission or reception is in progress |
spectrumFigureWidth |
double |
200 |
Plot figure width in pixels |
spectrumFigureHeight |
double |
120 |
Plot figure height in pixels |
spectrumFigureXTickCount |
int |
3 |
Number of ticks along the X-axis |
spectrumFigureYTickCount |
int |
5 |
Number of ticks along the Y-axis |
spectrumFigureInterpolationSize |
double |
5 |
Power spectrum density interpolation distance along the frequency axis |
spectrumPlacementHint |
string |
“bottomCenter” |
Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc. |
spectrumPlacementPriority |
double |
-1 |
Determines the order of annotation positioning |
displaySpectrograms |
bool |
false |
Display power density spectrograms at the nodes, can be enabled with dimensional analog models only |
spectrogramMode |
string |
“auto” |
Total means total transmission medium, signal means transmitted or received signal, auto means total or signal and noise if transmission or reception is in progress |
spectrogramPixelMode |
string |
“mean” |
Specifies the method used to determine the color of each pixel, sample method is the least accurate but the fastest (sample < partition < mean) |
spectrogramFigureWidth |
double |
200 |
Plot figure width in pixels |
spectrogramFigureHeight |
double |
120 |
Plot figure height in pixels |
spectrogramPixmapWidth |
double |
spectrogramFigureWidth |
Pixmap resolution width |
spectrogramPixmapHeight |
double |
spectrogramFigureHeight |
Pixmap resolution height |
spectrogramFigureXTickCount |
int |
3 |
Number of ticks along the X-axis |
spectrogramFigureYTickCount |
int |
5 |
Number of ticks along the Y-axis |
spectrogramPlacementHint |
string |
“bottomCenter” |
Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc. |
spectrogramPlacementPriority |
double |
-1 |
Determines the order of annotation positioning |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
MediumVisualizerBase |
|
display |
i=block/app |
Source code¶
//
// Base module for medium visualizer simple modules. It keeps track
// of ongoing signal departures, ongoing signal arrivals, and propagating signals.
//
// It subscribes to `signalSourceAdded`, `signalSourceRemoved`, `signalAdded`,
// `signalRemoved`, `signalDepartureStarted`, `signalDepartureEnded`, `signalArrivalStarted`,
// `signalArrivalEnded` simulation signals at the module determined by the `mediumModule`
// parameter. The actual visualization of the medium is done in derived modules.
//
// @see ~MediumCanvasVisualizer, ~MediumOsgVisualizer, ~IMediumVisualizer, ~VisualizerBase
//
simple MediumVisualizerBase extends VisualizerBase
{
parameters:
string mediumModule = default("radioMedium"); // The medium module that is displayed, refers to a top-level submodule by default
string networkNodeVisualizerModule = default("^.networkNodeVisualizer"); // The network node visualizer module, refers to a sibling submodule by default
string nodeFilter @mutable = default("*"); // Which nodes are considered, matches all nodes by default
string interfaceFilter @mutable = default("*"); // Which interfaces are considered, matches all interfaces by default
object packetFilter @mutable = default("*"); // Which packets are considered, matches all packets by default
bool displaySignals = default(false); // Display signals propagating through the medium, disabled by default
string signalColor = default("dark"); // Signal color is a list of colors or a color group name (e.g., dark, light), a set of dark colors by default
double signalPropagationAnimationSpeed @mutable = default(nan); // Animation speed while the very beginning or end of a signal is propagating on the medium, value must be in the range (0, +inf) or NaN, the latter means automatic setting
double signalPropagationAnimationTime @unit(s) = default(1s); // Signal propagation animation duration when signalPropagationAnimationSpeed is unspecified
double signalPropagationAdditionalTime @unit(s) = default(0s); // Additional simulation time to animate signal propagation after leaving the last receiver
double signalTransmissionAnimationSpeed @mutable = default(nan); // Animation speed while a signal is being transmitted on the medium, value must be in the range (0, +inf) or NaN, the latter means automatic setting
double signalTransmissionAnimationTime @unit(s) = default(1s); // Signal transmission animation duration when signalTransmissionAnimationSpeed is unspecified
string signalAnimationSpeedChangeTimeMode @enum("realTime", "animationTime", "simulationTime") = default("realTime"); // Specifies the time mode for animation speed changes between propagation and transmission animation
double signalAnimationSpeedChangeTime @unit(s) = default(1s); // Animation speed changes smoothly from propagationAnimationSpeed to transmissionAnimationSpeed in the specified real time
bool displaySignalDepartures = default(false); // Display an image where a signal departure is currently in progress, disabled by default
string signalDepartureImage = default("misc/signal_departure.png"); // Image for ongoing signal departures
string signalDeparturePlacementHint = default("topCenter"); // Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc.
double signalDeparturePlacementPriority = default(1); // Determines the order of annotation positioning
bool displaySignalArrivals = default(false); // Display an image where a signal arrival is currently in progress, disabled by default
string signalArrivalImage = default("misc/signal_arrival.png"); // Image for ongoing signal arrivals
string signalArrivalPlacementHint = default("topCenter"); // Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc.
double signalArrivalPlacementPriority = default(-1); // Determines the order of annotation positioning
bool displayCommunicationRanges = default(false); // Display communication ranges as circles around radios, enabled by default
string communicationRangeLineColor = default("blue"); // Communication range circle line color, blue by default
string communicationRangeLineStyle = default("solid"); // Communication range circle line style, solid by default
double communicationRangeLineWidth = default(1); // Communication range circle line width, 1 by default
bool displayInterferenceRanges = default(false); // Display interference ranges as circles around radios, disabled by default
string interferenceRangeLineColor = default("gray"); // Interference range circle color, gray by default
string interferenceRangeLineStyle = default("solid"); // Interference range circle line style, solid by default
double interferenceRangeLineWidth = default(1); // Interference range circle line width, 1 by default
// parameters shared between power density maps, spectrums, and spectrograms
bool autoPowerAxis = default(true); // Enables automatic power axis configuration
double signalMinPower @unit(dBmW) = default(inf dBmW); // Minimum signal power if the axis is not automatic
double signalMaxPower @unit(dBmW) = default(0 dBmW); // Maximum signal power if the axis is not automatic
double signalMinPowerDensity @unit(dBmWpMHz) = default(inf dBmWpMHz); // Minimum signal power density if the axis is not automatic
double signalMaxPowerDensity @unit(dBmWpMHz) = default(-inf dBmWpMHz); // Maximum signal power density if the axis is not automatic
bool autoTimeAxis = default(true); // Enables automatic time axis configuration
double signalMinTime @unit(s) = default(0 s); // Relative to the current simulation time
double signalMaxTime @unit(s) = default(0 s); // Relative to the current simulation time
bool autoFrequencyAxis = default(true); // Enables automatic frequency axis configuration
double signalMinFrequency @unit(Hz) = default(inf Hz); // Minimum signal frequency if the axis is not automatic
double signalMaxFrequency @unit(Hz) = default(-inf Hz); // Maximum signal frequency if the axis is not automatic
// parameters for the main power density map
bool displayMainPowerDensityMap = default(false); // Display a power density map for the transmission medium, can be enabled with dimensional analog models only
double mainPowerDensityMapPixmapDensity = default(1); // Pixmap relative resolution
double mainPowerDensityMapMinX = default(0); // Minimum X coordinate
double mainPowerDensityMapMaxX = default(nan); // Maximum X coordinate, compound module size by default
double mainPowerDensityMapMinY = default(0); // Minimum Y coordinate
double mainPowerDensityMapMaxY = default(nan); // Maximum Y coordinate, compound module size by default
double mainPowerDensityMapZ = default(0); // Z coordinate
int mainPowerDensityMapFigureXTickCount = default(3); // Number of ticks along the X-axis
int mainPowerDensityMapFigureYTickCount = default(3); // Number of ticks along the Y-axis
// parameters for power density maps
bool displayPowerDensityMaps = default(false); // Display power density maps at the nodes, can be enabled with dimensional analog models only
string powerDensityMapMode @enum("total", "signal", "auto") = default("auto"); // Total means total transmission medium, signal means transmitted or received signal, auto means total or signal and noise if transmission or reception is in progress
string powerDensityMapPixelMode @enum("sample", "partition", "mean") = default("mean"); // Specifies the method used to determine the color of each pixel, the sample method is the least accurate but the fastest (sample < partition < mean)
int powerDensityMapApproximationSize = default(10); // Medium power density function approximation along the X and Y axes
double powerDensityMapCenterFrequency @mutable @unit(Hz) = default(nan Hz); // Center frequency of medium power density sampling or integration
double powerDensityMapBandwidth @mutable @unit(Hz) = default(0 Hz); // Bandwidth of medium power density integration, 0 means sampling, inf means total integrated power
double powerDensityMapFigureWidth = default(200); // Plot figure width in pixels
double powerDensityMapFigureHeight = default(120); // Plot figure height in pixels
double powerDensityMapPixmapWidth = default(powerDensityMapFigureWidth); // Pixmap resolution width
double powerDensityMapPixmapHeight = default(powerDensityMapFigureHeight); // Pixmap resolution height
double powerDensityMapZ = default(0); // Z coordinate
int powerDensityMapFigureXTickCount = default(3); // Number of ticks along the X-axis
int powerDensityMapFigureYTickCount = default(3); // Number of ticks along the Y-axis
// parameters for spectrum figures
bool displaySpectrums = default(false); // Display power spectral density at the nodes, can be enabled with dimensional analog models only
string spectrumMode @enum("total", "signal", "auto") = default("auto"); // Total means total transmission medium, signal means transmitted or received signal, auto means total or signal and noise if transmission or reception is in progress
double spectrumFigureWidth = default(200); // Plot figure width in pixels
double spectrumFigureHeight = default(120); // Plot figure height in pixels
int spectrumFigureXTickCount = default(3); // Number of ticks along the X-axis
int spectrumFigureYTickCount = default(5); // Number of ticks along the Y-axis
double spectrumFigureInterpolationSize = default(5); // Power spectrum density interpolation distance along the frequency axis
string spectrumPlacementHint = default("bottomCenter"); // Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc.
double spectrumPlacementPriority = default(-1); // Determines the order of annotation positioning
// parameters for the spectrogram figures
bool displaySpectrograms = default(false); // Display power density spectrograms at the nodes, can be enabled with dimensional analog models only
string spectrogramMode @enum("total", "signal", "auto") = default("auto"); // Total means total transmission medium, signal means transmitted or received signal, auto means total or signal and noise if transmission or reception is in progress
string spectrogramPixelMode @enum("sample", "partition", "mean") = default("mean"); // Specifies the method used to determine the color of each pixel, sample method is the least accurate but the fastest (sample < partition < mean)
double spectrogramFigureWidth = default(200); // Plot figure width in pixels
double spectrogramFigureHeight = default(120); // Plot figure height in pixels
double spectrogramPixmapWidth = default(spectrogramFigureWidth); // Pixmap resolution width
double spectrogramPixmapHeight = default(spectrogramFigureHeight); // Pixmap resolution height
int spectrogramFigureXTickCount = default(3); // Number of ticks along the X-axis
int spectrogramFigureYTickCount = default(5); // Number of ticks along the Y-axis
string spectrogramPlacementHint = default("bottomCenter"); // Annotation placement hint, space-separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc.
double spectrogramPlacementPriority = default(-1); // Determines the order of annotation positioning
@class(MediumVisualizerBase);
}