#4152 closed defect (fixed)
OMEdit removes constants from package.order file
Reported by: | Martin Sjölund | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | critical | Milestone: | 1.11.0 |
Component: | OMEdit | Version: | |
Keywords: | Cc: |
Description
OMEdit corrputs the parsing of libraries in some cases. For example, open Modelica_DeviceDrivers.Utilities (a package containing a constant, and other elements stored in separate files).
Edit the class (any legal edit), save the package. The package.order file now no longer contains RootDir (the constant in the package), which makes the directory structure invalid.
Change History (11)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
If we return constants from getClassNames
then we don't have this issue.
However, we might have other issues like handling constants in Libraries Browser but I can fix them.
comment:3 by , 8 years ago
Well, it's not a class so getClassNames
should not return it... I guess you need to get all constants in a separate call? Or something similar to getElementName
?
comment:4 by , 8 years ago
I think I can also use getComponents
and then can filter out constants from it. As far as I understood from the specification we only need to consider constants.
Classes and constants that are stored in package.mo are also present in package.order but their relative order should be identical to the one in package.mo (this ensures that the relative order between classes and constants stored in different ways is preserved).
The only thing worries me a package.mo like this,
package Utilities model M end M; constant String constant1=""; model N end N; constant String constant2=""; end Utilities;
Its difficult to generate a correct order if I get classes from one API and constants from the other API. That is why I said we should have constants as part of getClassNames
. I think dymola is doing exactly like this. For example try opening the above package in Dymola, you will see constant1
and constant2
in the Package Browser.
comment:5 by , 8 years ago
Then add a new API call or a new flag to getClassName(includeConstants=true)
, or a getElementNames
, which returns all element names (which could then be filtered).
comment:6 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in a475e18/OMCompiler and e824f37/OMEdit.
comment:8 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
comment:9 by , 8 years ago
Milestone: | 1.12.0 → 1.11.0 |
---|
Would be good to have this UI bug fixed in 1.11...