Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

"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).

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.

Re: "redeclare record extends" fails

i don't know the company pushes us to use f.... IE and i don't know why but it has some problems with the posting. Now is the entire code.

you can see now the simple code.

Thank you

Re: "redeclare record extends" fails

And I'm using as i mentioned before the latest OM version 1.8 BETA2

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 current/smile

Re: "redeclare record extends" fails

Thank you. I thought it's up to me and my "modeling" current/smile

Cheers,
Filip

Re: "redeclare record extends" fails

Is this with the new nightly build solved or is it a bigger issue?

cheers,
Filip

There are 0 guests and 0 other users also viewing this topic
You are here: