-
Notifications
You must be signed in to change notification settings - Fork 169
Changes targeting MSL v4.0.0 requiring conversion
Thomas Beutlich edited this page Oct 6, 2020
·
13 revisions
MSL v4.0.0 enables renaming, moving (and removing) of existing classes and components. In order to not break backwards-compatibility of existing user libraries based on MSL v3.x.y, it is required to provide conversion scripts and unit tests.
First, make yourself familiar with the conversion scripts. The description, that comes with the MSL explains the four main conversion functions convertClass
, convertClassIf
, convertModifiers
and convertElement
.
Secondly, have a look at the changes of #2850, that serve as an example.
Consider also the contributing workflow.
- Rename the actual class/component name.
- In the MSL, adapt all references of that class/component/modifier name.
- Cut the Modelica text of the actual class and move it to the desired new location.
- In the MSL, adapt all references of that class name.
- Cut the Modelica text of the obsolete class and move it to the new location in ObsoleteModelica4.mo.
- In the MSL, adapt all references of that obsolete class name.
- Add your conversion to the conversion script ConvertModelica_from_3.2.3_to_4.0.0.mos.
- Add a simply unit test model to ModelicaTestConversion4.mo relying on the old class/component/modifier name of MSL v3.x.y. Take a look at the existing unit test models ModelicaTestConversion4.Fluid.Dissipation.Issue2780 or ModelicaTestConversion4.Mechanics.MultiBody.Issue2425 for how unit test models should be designed. The unit test model does not need to be physically meaningful, since the only purpose is the test of automatic conversion. If necessary, rebuild the library package structure.
- Load MSL v4.0.0 in your Modelica tool, provided it supports conversion.
- Load ModelicaTestConversion4 in your Modelica tool and run the conversion. Do not save the converted package ModelicaTestConversion4, since we want to have the original version under test.
- Prove that the conversion was succesful by running a model-check, initialization or simulation.
- Commit and push your changes to a new branch and open the pull request as usual. (Note, there will be no CI task testing the automatic conversion).