StatisticCanvasVisualizer

Package: inet.visualizer.canvas.common

simple module StatisticCanvasVisualizer

Visualizes statistics on a 2D canvas. See the base module for how to configure which statistic is displayed. If configured properly, then it displays the last value of the statistic to the right of the visualization of the corresponding network node. The value and the unit are wrapped in a filled white rectangle.

The statistic value is displayed with a label by default. Alternatively, any indicator figure can be used by configuring the property parameters and providing a figure template along the module path of the statistic visualizer.

See also: StatisticOsgVisualizer, StatisticVisualizer, StatisticVisualizerBase, IStatisticVisualizer

inet.visualizer.canvas.common.StatisticCanvasVisualizerStatisticCanvasVisualizersimple

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

IntegratedCanvasVisualizer

compound module

Integrates all canvas visualizers into a single module. It supports disabling any submodule visualizer by providing an empty string as its type.

IntegratedMultiCanvasVisualizer

compound module

Integrates all canvas visualizers into a single module. It supports disabling any submodule visualizer by providing an empty string as its type.

StatisticVisualizer

compound module

Integrates canvas and osg statistic visualizers into a single module.

Extends

Name

Type

Description

StatisticVisualizerBase

simple module

Base module for statistic visualizer simple modules. It keeps track of the last value of a statistic for multiple network nodes. The actual visualization of statistic values is done in derived modules. It subscribes for the signal determined by the signalName parameter at the module specified by the visualizationSubjectModule parameter. If the visualizer receives such a signal, it checks if the source matches the sourceFilter parameter. If the signal passes the check, it determines the last value of the statistic specified by the statisticName parameter.

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

networkNodeVisualizerModule

string

“^.networkNodeVisualizer”

The network node visualizer module, refers to a sibling submodule by default

displayStatistics

bool

false

signalName

string

“”

Signal name to subscribe, no signal name by default

statisticName

string

signalName

Statistic name to get the value, signal name by default

statisticUnit

string

“”

Statistic unit, undefined by default

statisticExpression

string

“”

Statistic expression, received value by default

sourceFilter

string

“**”

Pattern that must match the signal source, no source filter by default

format

string

“%n: %v %u”

Determines what is displayed, info by default

unit

string

“”

Display the value in one of the specified units, statistic unit by default

font

string

“<default>”

Statistic value font, automatic by default

textColor

string

“black”

Statistic value font color, black by default

backgroundColor

string

“white”

Statistic value background color, white by default

opacity

double

1.0

Opacity of the visualization

placementHint

string

“top”

Annotation placement hint, space separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc.

placementPriority

double

0

Determines the order of annotation positioning

zIndex

double

10

Determines the drawing order of figures relative to other visualizers

propertyName

string

“”

Optional property name of a figure template along the module path of the visualizer

propertyIndex

string

“”

Optional property index of a figure template along the module path of the visualizer

Properties

Name

Value

Description

class

StatisticCanvasVisualizer

display

i=block/app

Source code

//
// Visualizes statistics on a 2D canvas. See the base module for
// how to configure which statistic is displayed. If configured properly, then
// it displays the last value of the statistic to the right of the visualization
// of the corresponding network node. The value and the unit are wrapped in a
// filled white rectangle.
//
// The statistic value is displayed with a label by default. Alternatively, any
// indicator figure can be used by configuring the property parameters and
// providing a figure template along the module path of the statistic visualizer.
//
// @see ~StatisticOsgVisualizer, ~StatisticVisualizer, ~StatisticVisualizerBase, ~IStatisticVisualizer
//
simple StatisticCanvasVisualizer extends StatisticVisualizerBase like IStatisticVisualizer
{
    parameters:
        double zIndex = default(10); // Determines the drawing order of figures relative to other visualizers
        string propertyName = default(""); // Optional property name of a figure template along the module path of the visualizer
        string propertyIndex = default(""); // Optional property index of a figure template along the module path of the visualizer
        @class(StatisticCanvasVisualizer);
}

File: src/inet/visualizer/canvas/common/StatisticCanvasVisualizer.ned