omnetpp.scave.charttemplate

Loading and instantiating chart templates.

Classes

ChartTemplate

Represents a chart template.

Functions

get_chart_template_locations()

Returns a list of locations (directories) where the chart templates that

load_chart_templates([dirs, add_default_locations])

Loads chart templates from the given list of directories, and returns them

load_chart_template(properties_file)

Loads the chart template from the specified .properties file, and

Module Contents

class ChartTemplate(id: str, name: str, type: str, icon: str, script: str, dialog_pages, properties)[source]

Represents a chart template.

id[source]
name[source]
type[source]
icon[source]
script[source]
dialog_pages[source]
properties[source]
__repr__()[source]
create_chart(id: int = None, name: str = None, props=None)[source]

Creates and returns a chart object (org.omnetpp.scave.Chart) from this chart template. Chart properties will be set to the default values defined by the chart template. If a props argument is present, property values in it will overwrite the defaults.

Parameters:

  • id (string): A numeric string that identifies the chart within the Analysis. Auto-assigned if missing.

  • name (string): Name for the chart. If missing, the chart template name will be used.

  • props (string->string dictionary): Chart properties to set. It may not introduce new properties, i.e. the keys must be subset of the property keys defined in the chart template.

get_chart_template_locations()[source]

Returns a list of locations (directories) where the chart templates that come with the IDE can be found.

load_chart_templates(dirs=[], add_default_locations=True)[source]

Loads chart templates from the given list of directories, and returns them in a dictionary. Chart templates are loaded from files with the .properties extension.

Parameters:

  • dirs (string list): A short string that uniquely identifies the chart template.

  • add_default_locations (bool): Whether the directories returned by get_chart_template_locations() should also be searched in addition to the specified directory list.

Returns:

  • A string->ChartTemplate dictionary, with chart template IDs used as keys.

load_chart_template(properties_file)[source]

Loads the chart template from the specified .properties file, and returns it as a ChartTemplate object.