- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » "redeclare record extends" fails
"redeclare record extends" fails
"redeclare record extends" fails
Hi a pretty simple code. I'm not that experienced user but i think, there is nothing wrong in it? I hope you can help. Thank you in advance! Filip
code:
---------------
package test
partial package test2
replaceable record ConstantRecord
extends Modelica.Icons.Record;
String Name "name";
SI.Modelica.ThermalConductivity lambda "ThermalConductivity";
end ConstantRecord;
end test2;
partial package test3
extends test2;
redeclare record extends ConstantRecord;
SI.Modelica.HeatCapacity cp %
Re: "redeclare record extends" fails
I would need to see a full exampl, but this will give a parser error as record extends needs a definition (i.e. ConstantRecord /* defs */ end ConstantRecord).
- sjoelund.se
- 1700 Posts
Re: "redeclare record extends" fails
Using Dymola with this code i don't receive any error or warning. When I try to use it with OM, loading it in the editor it crashes. Trying that in the shell i don't receive any error or warning as well.
In the previous post, i don't know why but the the entire code wasn't posted. As you can see in this code here, the code is a part of the Modelica.Media.Interface.PartialMedium and Modelica.Media.Interface.PartialSimpleMedium
-------
package test
import SI = Modelica.SIunits;
extends Modelica.Icons.Library;
partial package test2
constant Modelica.SIunits.HeatCapacity cp;
replaceable record aaa
"Minimal variable set that is available as input argument to every medium function"
extends Modelica.Icons.Record;
SI.Density rho "Density";
end aaa;
end test2;
partial package test3
extends test2;
redeclare record extends aaa "Thermodynamic state of ideal gas"
SI.Pressure p "Absolute pressure of medium";
SI.Temperature T "Temperature of medium";
end aaa;
end test3;
end test;
Re: "redeclare record extends" fails
Still I can't see the full code, but if your OMEdit crashes on the Media models, you just need a newer version as I think it fixed some of these issues.
- sjoelund.se
- 1700 Posts
Re: "redeclare record extends" fails
Ok, the latest version of OMEdit doesn't crash. It can load the file correctly, but not edit it (it will randomly move classes around or crash when modifying the class). I will forward this to Adeel
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » "redeclare record extends" fails