问题
I want to use two Modelica libraries together, in Dymola, so for convenience I wrote a little script, loadLibraries.mos
that just opens the two libraries.
But they use different versions of the MSL (3.2.1 versus 3.2.2), defined by the uses annotation in the top level package.mo:
annotation(uses(Modelica(version="3.2.1")));
The library developed by us uses 3.2.2, the library that uses MSL 3.2.1 is developed by someone else. Now whenever I run the mos script (or when I open the two libraries manually), Dymola wants to run an update script. As far as I can see, nothing gets changed by the update script, so I would like to
either not run it at all, e.g. by defining a range of accepted versions like
annotation(uses(Modelica(version>="3.2.1")));
or always run it, without asking first, e.g. by setting some flag
AlwaysSilentyAcceptMSLUpgrade
.
Under Edit, Options, Version there is a checkmarkForce upgrade of models to MSL version
but I am unsure how to use it from my mos script (for all users).
回答1:
Don't change your own library, but make the library using Modelica 3.2.1 read-only (e.g. by making the files read-only).
That should skip the prompt (at least from Dymola 2016) - and as far as I understand you don't edit that library yourself anyway.
That works for libraries that don't need any update between the versions; which obviously holds for Modelica 3.2.1->3.2.2 since there is no conversion - but it would also work if there were a conversion that didn't influence this particular library.
回答2:
My pragmatic solution would be to ask yourself if your own library really needs anything from 3.2.2 which is not yet present in 3.2.1. Hence change your library to only require 3.2.1. Or the other way round (given you can change the package.mo
of the other library) change the uses
annotation there to 3.2.2
来源:https://stackoverflow.com/questions/42343160/modelica-libraries-use-different-msl-version