User manual

32
…\Dymola.exe" –serverport 8082
Note! The report generator is currently only supported on Windows.
The report generator has been tested on Firefox, Google Chrome, and Internet Explorer 11.
JavaScript functions
A set of special report JavaScript functions has been developed which are suitable to include
in the HTML code. When the HTML page is opened, the browser communicates with
Dymola to retrieve various information, such as model diagrams, plots, and animations. This
information is inserted in the HTML page. It is possible to save the HTML code including
this information for use without having Dymola running. It is also possible to re-execute a
function call, for example to re-run a simulation after changing parameters.
The functions add content (innerHTML) of HTML div-blocks. The structure of the
functions is:
insertXXX(result_block, model, ...);
The id of the div-block is a parameter block-_id. The model path is given as the
parameter
model. A typical structure of a HTML page is thus:
<p>Text</p>
<div id="diagram"></div>
<script type="text/javascript">insertDiagram(diagram, "MyModel", "svg");
</script>
The functions are:
insertDiagram(result_block, model, format, width, height)
Inserts a Modelica diagram.
The
format is either "PNG" or "SVG". The dimensions in pixels are given by width and
height.
insertIcon(result_block, model, format, width, height)
Inserts a Modelica icon.
The
format is either "PNG" or "SVG". The dimensions in pixels are given by width and
height.
insertText(result_block, model)
Inserts pretty printed Modelica text.
The annotations are omitted from the Modelica text.
insertClass(result_block, model, width, height)
Inserts a Modelica text editor for a given model.