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

How do you modify the parameter icon text?

How do you modify the parameter icon text?

I am trying to extend the Modelica.Thermal.HeatTransfer.Components.HeatCapacitor class so that the mass and specific heat are specified as parameters and are displayed in the Icon.  I tried

Code:

model SolidHeatCapacitor

  extends Modelica.Thermal.HeatTransfer.Components.HeatCapacitor(C = mass*specific_heat_capacity);
  parameter Modelica.SIunits.Mass mass(start = 1.0) "Mass of the lumped capacitance";
  parameter Modelica.SIunits.SpecificHeatCapacity specific_heat_capacity(start = 502.0) "Specific Heat Capacity of the mass";
equation

annotation(
    Icon(graphics = {
    Text(origin = {1, 39}, extent = {{-81, 11}, {81, -11}}, textString = "Mass %mass"),
    Text(origin = {13, -46}, extent = {{-97, 8}, {97, -8}}, textString = "Cp %specific_heat_capacity")}));
end SolidHeatCapacitor;

When I do this, the “%C” text in the annotation icon shows “mass*specific_heat_capacity” instead of the product of the two.  The icon on the left is from the Modelica.Thermal library and the one on the right is from the above code.

http://boardsailor.com/pictures/20200724_Modelica_Icon.png

The "%C" text is filled with "5.5 J/K" in the left icon and "mass*specific_heat_capacity" in the right icon.  How do I modify the Modelica.Thermal.HeatTransfer.Components.HeatCapacitor class icon text to remove the “%C” text?  Alternatively, how can the "%C" text be filled with the value rather than the "mass*specific_heat_capacity" text?

I spent hours trying to find documentation on how to do these things without success.  Where can I find documentation that talks about this?

Thanks,
   Michael

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