Tasks such as viewing results, changing parameter values, or viewing animations can be done via this mechanism. Other useful aspects are the ability to display model documentation. More advanced tasks can also be undertaken, such as writing Modelica classes… although I must admit I’m not sure how this would be very useful. What’s more, the report (HTML file) can be stored and sent to anyone with a browser, meaning the reader doesn’t need to actually have Dymola to view the report.
Figure 1: The example HTML report supplied with Dymola offers a range of useful reporting tools.
How do I enable the HTML Report functionality?
To access this functionality, Dymola must first be instructed to act as a server when the executable is launched. Don’t worry, this is much simpler than it sounds! It is easiest to do this by customizing a shortcut to your preferred Dymola.exe file. Either create a shortcut for launching Dymola, or open the properties of an existing one. All that needs to be done is to modify the target path with –serverport 8082 entered after the path, as shown below.
Figure 2: Modifying the Dymola startup command to launch as a server is very simple.
What underpins the HTML Report?
What can the HTML Report do?
insertXXXX(result_block, model, …);
Where result_block denotes the id of the block in the webpage, and the model path is contained in the ‘model’ variable. Further function specific arguments follow. To summarize the functions are their usage:
- insertDiagram: Displays the diagram for the model path supplied.
- insertIcon: Displays the icon for the model path supplied.
- insertText: Displays the Modelica text for the model path supplied.
- insertClass: Displays the Modelica text of the model path specified.
- insertEquations: Displays the equation view of the model path specified.
- insertDocumentation: Displays the documentation layer of the model specified.
- insertParameterDialog: Enables the editing of the top-level parameter values of the model specified
- insertCommand: Enables entries to be made into the command window.
- insertPlot: Displays a plot of the specified variables present within a model on the path specified.
- insertVariableValue: At a specified time, the value of a specific variable from the model the path points to is displayed.
- insertSignalOperatorValue: This command enables result signal operators (such a max/min) to be applied to a specified variable in the model the path points towards.
- insertAnimation: An animation window of the specified model path is displayed, which is interactive.
- setClassTest: Enables the creation or editing of a Modelica class.
How can I distribute a HTML Report?
Distribution of the generated HTML report is relatively straightforward. If you don’t mind losing animation capability you can just print the webpage to a pdf file. Or, if the user you plan to send the report to has a licensed version of Dymola, you can just send them the HTML file you’ve created.
As I alluded to in the previous paragraph, several of the commands utilized in this mechanism (insertAnimation, insertCommand, insertVariableValue and setClassText) are dynamically linked to Dymola (i.e. they interact with it) so they cannot be included in a report which has been distributed to a user without Dymola licensed/installed.
Utilizing HTML reports may be an effective way of distributing results or models in your day to day life. I hope this post piqued your interest enough that you dig in and check out this functionality.
Nate Horn – Vice President
Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion.