Opened 8 years ago
Closed 7 years ago
#4378 closed defect (fixed)
OpenModelica seems to not support correctly packages saved in directories (as opposed to “single-file”), especially in case of model duplication
Reported by: | Owned by: | Adeel Asghar | |
---|---|---|---|
Priority: | blocker | Milestone: | Future |
Component: | OMEdit | Version: | v1.11.0 |
Keywords: | Package, directories | Cc: | audrey.jardin@…, daniel.bouskela@… |
Description
I got some errors doing the following (it shows some random behavior, so the error messages may change):
- Create a package “Test” and uncheck the “save in single file” option.
- Create a connector “c1” within the package.
- Duplicate “c1” to “c2”. The “within Test;” line is not copied and the following error message is prompt:
[1] 15:16:46 Syntaxe Erreur
[Test.c2: 1:12-1:18]: Parser error: Unexpected token near: within (WITHIN)
- Adding the “within” text by hand leads (generally) to errors not accepted by the text editor.
- Create a model “test” using the two connectors.
- Checking the model leads to the following error messages:
[1] 15:22:08 Traduction Erreur
[Test: 1:1-9:9]: Class c1 not found in scope Test.
[2] 15:22:08 Traduction Erreur
[Test.test: 0:0-0:0]: Class Test.c1 not found in scope Test.test.
[3] 15:22:08 Traduction Erreur
Error occurred while flattening model Test.test
Closing and loading back the package I got the following message:
[1] 15:27:37 Grammaire Avertissement
[C:\Users\D24676\Desktop\/Test/package.order: 0:0-0:0]: The package.order file does not list all .mo files and directories (containing package.mo) present in its directory.
Missing names are:
c1
Hi Giorgio,
I also had a lot of trouble to duplicate models and packages. Doing it with OMEdit screwed up my library also from time to time. Some things do work but some do not. So the only save way to do it is by hand. I mean copy the files using Explorer, edit the package.order file and edit the within statements.
Remember that in OMEdit you also have to right-click your package and choose "save" in the Libraries Browser until the red font vanishes.
Further, I opened a ticket two weeks ago which is a bit related to that issue: #4350