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

New Icons?

New Icons?

I want to bild a new model which is extended from Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe.
The model works, but it should have a competely new icon.  When I draw the icon in th IconView of OMEdit then everything looks OK.
But if I place the model in an othe rmodel then it will be drawn with the icon defined Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe in the background.
How can i prevent the drawing of the inherited icon annotation.

Re: New Icons?

Try primitivesVisible:

Code:

model A

  extends B annotation(
    IconMap(extent={{-100,-100}, {100,100}},primitivesVisible=false),
    DiagramMap(extent={{-50,-50}, {0,0}},primitivesVisible=true)
  );
end A;

Re: New Icons?

Thanks for thew answer but it does not work  current/sad

Re: New Icons?

Then make a detailed bug report and maybe it will become part of the next release: https://trac.openmodelica.org/OpenModelica/newticket

Re: New Icons?

Hello
I find in trac that this bug is closed https://trac.openmodelica.org/OpenModelica/ticket/1131

But i have OpenModelica 1.9.4~dev-94-ge7263fe and code

Code:


model PartialTwoPort
  extends Modelica.Fluid.Interfaces.PartialTwoPort annotation(Icon(primitivesVisible = false));
  annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end PartialTwoPort;

and it didn't work.

My be I do something wrong?
I need to hide arrow Icon layer of PartialTwoPort from on Icon layer in my model?!

Re: New Icons?

I try to change annotation according Modelica Specification 3.3. rev 1
so I have code with "IconMap":

Code:


model PartialTwoPort
  import Modelica.Icons.Model;
  extends Modelica.Icons.Model;
  extends Modelica.Fluid.Interfaces.PartialTwoPort annotation(IconMap(extent = {{-100, -100}, {100, 100}}, primitivesVisible = false), DiagramMap(extent = {{-100, -100}, {0, 0}}, primitivesVisible = true));
  annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end PartialTwoPort;

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