Skip to content

DymolaMode

Jens Möckel edited this page Jan 4, 2016 · 4 revisions

This instance provides the possibility to apply automatically Dymolas checkModel() to a Modelica library (some of its subpackages) and break down the results up to chosen level.

Note

This will only work with Dymola 2016 and newer as the Dymola fuction getLastError does not provide necesary information in older versions.

Attributes

  • modelica_lib_path (string):
    Path to a Modelica library
  • dymola_path (string):
    Path to the Dymola installation, e.g. dymola.exe

Optional Attributes

  • dymola_pedantic (bool, default=False):
    If true, checkModel() is executed in pedantic mode

  • modelica_lib_firstlevel (string, default=''):
    A subpackage of the library. checkModel() is applied to this package (and all packages/models in this one). Note, that if your chosen Top-Level package is e.g. a third-level package, modelica_lib_firstlevel must include the complete path in the library.
    Example:
    Given structure: lib > A > B. Then:
    modelica_lib_path = '...\lib' and modelica_lib_firstlevel = 'A\B'

  • modelica_lib_depth (int, default=1):
    How many levels should be listet in the report, e.g. level 1 will list all top-level packages/models, level 2 additionally all second-level packages/models and so on.
    Note1:
    Level of displayed packageshas no influence on how many levels are actually checked - checkModel() is always applied to all packages/models in modelica_lib_firstlevel.
    Note2:
    Setting modelica_lib_depth to '-1' will show all packages/models in the report.

  • report_path(string, default=[chosen first level]):
    path attribute of a Report instance

  • report_name (string, default='report'):
    name attribute of a Report instance

  • report_mode (string, default='full'):
    mode attribute of a Report instance

  • report_disp (list of dictionaries, default= [{'Key':'Checked Library', 'Val':[chosen first level in Modelica syntax]}, {'Key':'Pedantic Mode', 'Val': self.dymola_pedantic}, {'Key':'Level of Detail', 'Val': self.modelica_lib_depth}])): {'Key':Branch', 'Val': [Either name of branch or 'no git']}
    disp attribute of a Report instance

  • report_colors (dictionary, default= {'cTrue':'white','cFalse':'red','cNF':'yellow','cErr':'red', 'cWrn':'yellow'}):
    colors attribute of a Report instance

For more detailled informations regardings the Report attributes, take a look a the documentation of the Report class.

Functions

  • execute_check():
    Applies Dymolas checkModel() on given library (modelica_lib_path) or respectively chosen top level package (modelica_lib_firstlevel).

  • get_report():
    Returns the current Report instance.