omnetpp.scave.charttemplate¶
Loading and instantiating chart templates.
Classes¶
Represents a chart template. |
Functions¶
Returns a list of locations (directories) where the chart templates that |
|
|
Loads chart templates from the given list of directories, and returns them |
|
Loads the chart template from the specified |
Module Contents¶
- class ChartTemplate(id: str, name: str, type: str, icon: str, script: str, dialog_pages, properties)[source]¶
Represents a chart template.
-
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 apropsargument 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.
-
create_chart(id: int =
- 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
.propertiesextension.Parameters:
dirs(string list): A short string that uniquely identifies the chart template.add_default_locations(bool): Whether the directories returned byget_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
.propertiesfile, and returns it as aChartTemplateobject.