且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Dymola 中的库启动脚本

更新时间:2022-06-26 04:47:22

Dymola 2022 有一个新的(特定于工具的)功能,正好涵盖了这个用例.Dymola 2022 版本中提到了它库启动脚本"部分中的注释第 24 页.

Dymola 2022 has a new (tool-specific) feature that covers exactly this use-case. It is mentioned in the Dymola 2022 release notes in the section "Library startup script" on page 24.

它基本上引入了一个新的注释,它允许指定一个 .mos 脚本的路径,该脚本在加载相应的库时执行.以下是发行说明中的​​示例:

It basically introduces the a new annotation, which allows to specify a path to a .mos script, which is executed, when the respective library is loaded. Here is the example from the release notes:

package ThisPack
 annotation(__Dymola_startup =
 "modelica://ThisPack/Resources/Scripts/Dymola/startup.mos");
end ThisPack;

也可以通过 UI 设置注释...

The annotation can also be set via the UI...