Working with packages: disabling storing packages as one file, refreshing packages, locking and unlocking packages

This blog post shows how to disable storing packages as one file so that packages are stored in individual folders automatically each time they are created or renamed. This will be useful when using SVN for model versioning and revision control. Additional features on refreshing packages and locking and unlocking packages, introduced by Dymola 2017 FD01 are also described.

  • Disabling storing packages as one file

When using SVN for model versioning and revision control, model developers often update and commit their changes to maintain history of every version of their models. It is desirable to save packages and their contents as individual files on the hard drive, rather than lumped within a single file, so that version control can be applied individually to the packages and their contents. This article shows this can be done in Dymola by automatically disabling storing contents of packages as one file each time a new package is created or renamed. To automatically store contents of the package as multiple files, firstly open Dymola and go to Edit>Options, then go to Version tab and deselect “As default store packages as one file”, see Figure 1. This will eliminate the need to explicitly deselect it for every package to be created.

Figure 1: setting in Edit-option-Version to enable or disable saving packages as one file

  • New feature from Dymola 2017 FD01: refreshing packages, locking and unlocking of packages

To update to a package, users no longer need to unload a library and open it again to view the updated package. They can instead right-click on the package in the package browser and select Refresh, see figure 2.

Figure 2: refreshing a package for update

Users can now lock or unlock any Modelica classes (packages, models, blocks, functions, etc) displayed in the package browser by right-clicking on the classes and choosing Lock, Figure 3. The models then become read-only; this is indicated in the window header bar and with a hanglock icon on the model in the package browser, Figure 4. However, any sub-classes from which locked classes are extended are still editable, unless they are also locked. The models then will require the user to explicitly unlock the models for editing. For Dymola versions prior to 2017 FD01, the locked models or packages created in Dymola FD01 or later would still be editable however.

Figure 3: locking a model

Figure 4: icon of locked model and its unlocking

Written by: Xiaoran Han – Project Engineer

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


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


© Copyright 2010-2024 Claytex Services Ltd All Rights Reserved

Log in with your credentials

Forgot your details?