- Index
- » Developer
- » OpenModelica development
- » Enumeration problem
Enumeration problem
Enumeration problem
I’m not sure about if it is a bug or a normal behaviour, but it is affecting the use of at least the HelmholtzMedia package. When using a constant enumeration inside a package it is impossible, but only in certain circumstances, to change its value while inheriting. The problem is shown in the attached file: models EnumerationTest1 and EnumerationTest3 run, but not EnumerationTest2. The problem is that media models are normally used as in EnumerationTest2. The problem doesn’t appear if the definition of the enumeration is outside the package.
Re: Enumeration problem
That is because you have
Code:
package Enu=EnumerationBase1(option=Options.B);
. Options is not available in the scope of ModelicaTests2.EnumerationTest2. It works if you have it as option=EnumerationBase1.Options.B
- sjoelund.se
- 1700 Posts
Re: Enumeration problem
Thanks, and yes it works. I didn’t expect that option were inside the scope and Options not, as both are at root level inside the same package.
- Index
- » Developer
- » OpenModelica development
- » Enumeration problem