StatisticVisualizerBase

Package: inet.visualizer.base

StatisticVisualizerBase

simple module

This is a 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 subscriptionModule 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.

The format string can contain the following directives:

  • %s signal name
  • %n statistic name
  • %v statistic value
  • %u statistic unit

See also: StatisticCanvasVisualizer, StatisticOsgVisualizer, IStatisticVisualizer, VisualizerBase

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Known subclasses

Name Type Description
StatisticCanvasVisualizer simple module

This module 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 is wrapped in a filled white rectangle.

StatisticOsgVisualizer simple module

This module visualizes a statistic on a 3D osg scene. See the base module for how to configure which statistic is displayed. If configured properly, then it displays the last value of the statistic just above the visualization of the corresponding network node. The value and the unit is wrapped in a filled rectangle.

Extends

Name Type Description
VisualizerBase simple module

This is a base module for visualizer simple modules. It simply provides the visualization target module for derived modules.

Parameters

Name Type Default value Description
visualizerTargetModule string ""

module path relative to the visualizer where the visualization should appear in the user interface, root 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

subscriptionModule string ""

module where the visualizer subscribes for the signal, root module by default

displayStatistics bool true
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

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 this unit, statistic unit by default

font string ""

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

Properties

Name Value Description
class StatisticVisualizerBase
display i=block/app_s

Source code

//
// This is a 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 subscriptionModule 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.
//
// The format string can contain the following directives:
//  - %s signal name
//  - %n statistic name
//  - %v statistic value
//  - %u statistic unit
//
// @see ~StatisticCanvasVisualizer, ~StatisticOsgVisualizer, ~IStatisticVisualizer, ~VisualizerBase
//
simple StatisticVisualizerBase extends VisualizerBase
{
    parameters:
        string networkNodeVisualizerModule = default("^.networkNodeVisualizer"); // the network node visualizer module, refers to a sibling submodule by default
        string subscriptionModule = default("<root>"); // module where the visualizer subscribes for the signal, root module by default

        bool displayStatistics = default(true);

        string signalName = default(""); // signal name to subscribe, no signal name by default
        string statisticName = default(signalName); // statistic name to get the value, signal name by default
        string statisticUnit = default(""); // statistic unit, undefined by default
        string sourceFilter @mutable = default("**"); // pattern that must match the signal source, no source filter by default

        string format @mutable = default("%n: %v %u"); // determines what is displayed, info by default
        string unit = default(""); // display the value in this unit, statistic unit by default

        string font = default("<default>"); // statistic value font, automatic by default
        string textColor = default("black"); // statistic value font color, black by default
        string backgroundColor = default("white"); // statistic value background color, white by default
        double opacity = default(1.0); // opacity of the visualization
        string placementHint = default("top"); // annotation placement hint, space separated list of any, top, bottom, left, right, topLeft, topCenter, topRight, etc.
        double placementPriority = default(0); // determines the order of annotation positioning

        @class(StatisticVisualizerBase);
}
File: src/inet/visualizer/base/StatisticVisualizerBase.ned