- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Code flattening inner/outer failure
Page Start Prev 1 Next End
Code flattening inner/outer failure
Code flattening inner/outer failure
Feb-22-13 03:43:21
Flattening of the model results in losing aliases of inner/outer variables.
Here's a test case:
Code:
model teststate3
block Common
Integer b;
end Common;
model Hookup
outer Common global;
Boolean active;
parameter Integer m;
algorithm
when (active) then
global.b := m;
end when;
end Hookup;
inner Common global;
Hookup fred (m = 0, active = true);
Hookup ginger (m = 1, active = false);
end teststate3;
This produces (output of instantiateModel()):
Code:
class teststate3
Integer global.b;
Boolean fred.active = true;
parameter Integer fred.m = 0;
Boolean ginger.active = false;
parameter Integer ginger.m = 1;
algorithm
when fred.active then
fred.global.b := fred.m;
end when;
when ginger.active then
ginger.global.b := ginger.m;
end when;
end teststate3;
In this example, "ginger.global.b" should be "global.b" etc.
Re: Code flattening inner/outer failure
Feb-22-13 11:06:59
Please consider creating tickets for bug reports instead of forum posts: https://trac.openmodelica.org/OpenModelica/newticket. Most of our developers don't read the forums.
If you want to subscribe to the ticket, CC yourself on https://trac.openmodelica.org/OpenModelica/ticket/2078
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Code flattening inner/outer failure
There are 0 guests and 0 other users also viewing this topic