Revealing Hidden Content in Dymola

Modelica and Dymola provide library developers with methods to hide content from their users; some of which were discussed in this previous post Dymola Library Concealment – How to, and why? – Claytex. As developers we may use these concealment methods to protect our intellectual property, or we may use it to clean-up the user experience by not showing them everything. However if you’re trying to understand how a model is constructed or troubleshoot an error, this concealment can be a hinderance. So in this post I’m going to show you a couple of ways that you can reveal some of this hidden content in Dymola.

There are 3 settings in Dymola which can help you see:

  • Concealed parameter definitions
  • Hidden libraries
  • Invisible connections in the diagram

However, if the developer has used concealment methods in encrypted libraries to protect their intellectual property then that content is truly hidden.

Where is that Parameter Set?

In Modelica code, you can use the final keyword to prevent parameters settings from being edited when a model is used, for example when parameters are propagated.

The example in figure 1 shows the double wishbone linkage in our VeSyMA – Suspensions library. You can see in the code that parameters in the lower outer joint component have been finalised to prevent editing.

Figure 1: Diagram and code of Suspensions.QuarterCar.Front.DoubleWishbone showing finalised parameters so parameters are hidden
Figure 1: Diagram and code of Suspensions.QuarterCar.Front.DoubleWishbone showing finalised parameters

This linkage is used in the front double wishbone example. By default, if we looked at the parameterisation of the lower outer joint component in the suspension model the highlighted finalised parameters would not appear in its parameter dialog. However, if you select the setting Options > Show final parameters in Dymola these finalised parameters would then appear in the parameter dialog, as demonstrated in the video below. The finalised parameters can’t be edited but the parameterisation can now be understood.

Video 1: Revealing finalised parameters in the parameter dialog

Where is that Library?

It’s possible to hide libraries in the package browser, as described in the earlier library concealment blog post using protection annotations. But this can make things a bit confusing.

For example, the Modelica Standard Library has uses annotations for the ModelicaServices and Complex libraries but these libraries won’t be in the package browser as you’d expect.

The ModelicaServices library is concealed because it contains annotation Protection(access=Access.hide). But as the library isn’t encrypted we can make it visible using the flag:

Advanced.IncludeProtectedInBrowser = true;

This flag can also be set using Options >Package Browser > Show protected classes in the GUI, as illustrated in the video below.

Video 2: Showing hidden libraries in the package browser

Where’s that Connection in the Diagram?

When a models diagram is cluttered a developer can choose to hide connections. When the flag Advanced.InvisibleConnections=true, an additional Visible option appears in the connection context menu which allows the connection to be hidden in the diagram.

If there is a hidden connection but the user has the default Advanced.InvisibleConnections=false setting, they won’t be able to see anything to suggest the connection exists graphically. To reveal these invisible connections you can select Tools >Options > Graphical Editor tab > Show hidden graphical objects, as demonstrated in the video.

Video 3: Displaying invisible connections

Making the Invisible Visible

Go ahead and use the three settings covered in this post to see what hidden content becomes visible to you in Dymola. Use them to help you understand other peoples models more clearly.

Written by: Hannah Hammond-Scott – Modelica Project Leader

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

CONTACT US

Got a question? Just fill in this form and send it to us and we'll get back to you shortly.

Sending

© Copyright 2010-2023 Claytex Services Ltd All Rights Reserved

Log in with your credentials

Forgot your details?