Modelica库使用不同的MSL版本 [英] Modelica libraries use different MSL version
问题描述
我想在Dymola中一起使用两个Modelica库,因此为了方便起见,我编写了一个小脚本loadLibraries.mos
,它只打开了两个库.
但是他们使用的是MSL的不同版本(3.2.1与3.2.2),该版本由顶层package.mo中的uses注释定义.
annotation(uses(Modelica(version="3.2.1")));
我们开发的库使用3.2.2,使用MSL 3.2.1的库由其他人开发. 现在,每当我运行mos脚本时(或当我手动打开两个库时),Dymola都希望运行更新脚本.据我所知,更新脚本没有任何改变,所以我想
-
根本不运行它,例如通过定义一系列可接受的版本,例如
annotation(uses(Modelica(version>="3.2.1")));
-
或始终运行它,而无需先询问,例如通过设置一些标志
AlwaysSilentyAcceptMSLUpgrade
.
在编辑",选项",版本"下,有一个选中标记Force upgrade of models to MSL version
,但是我不确定如何从mos脚本中使用它(适用于所有用户).
不要更改您自己的库,而是将使用Modelica 3.2.1的库设为只读(例如,将文件设为只读).>
这应该跳过提示(至少从Dymola 2016起)-据我了解,您无论如何都不自己编辑该库.
适用于版本之间不需要任何更新的库;这显然适用于Modelica 3.2.1-> 3.2.2,因为没有转换-但如果有不影响此特定库的转换,它也将起作用.
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).
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.
这篇关于Modelica库使用不同的MSL版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!