OMPython icon indicating copy to clipboard operation
OMPython copied to clipboard

Make "ModelicaSystem" aware of "uses" annotation

Open dietmarw opened this issue 6 years ago • 5 comments

When filing #63 I thought rather than having to rely on manually specifying the used libraries in the ModelicaSystem call like:

mod=ModelicaSystem("BouncingBall.mo","BouncingBall","Modelica")

OMPython should be clever enough to interpret the uses annotation inside the loaded model library.

dietmarw avatar May 02 '18 16:05 dietmarw

This is related to trac ticket 2926. ModelicaSystem relies on OMC API loadFile.

adeas31 avatar May 02 '18 20:05 adeas31

That ticket you are pointing to seems to indicate that OMC API already supports this. Just the loading from packages from the same working dir is not working currently. However not providing the third argument will make the ModelicaSystem call fail if the opened class uses any other library. Even if that library is on the MODELICAPATH (which Modelica most definitely is).

dietmarw avatar May 02 '18 21:05 dietmarw

Just made a simple model with uses annotation and it worked fine.

adeas31 avatar May 03 '18 10:05 adeas31

OK let me check this once again and come back to you.

dietmarw avatar May 03 '18 11:05 dietmarw

Hello, related to this issue, I was wondering if there was ever a feature introduced to allow the running of models without manually specifying the used libraries in the third argument.

FinChristie avatar Jul 29 '20 10:07 FinChristie