Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2268 closed defect (fixed)

icons in library browser get displayed wrong

Reported by: maik.wenzler@… Owned by: Adeel Asghar
Priority: high Milestone: 1.9.0
Component: OMEdit Version: trunk
Keywords: Cc:

Description

I created a library in OMEdit (trunk version). Than, I edited this library with an older OMEdit version. Now, the icons in the library browser and the block diagrams get displayed wrong. See attached images.

Attachments (6)

img1.tiff (514.7 KB ) - added by anonymous 12 years ago.
img2.tiff (574.0 KB ) - added by anonymous 12 years ago.
OMEdit_original_model.png (163.5 KB ) - added by Adeel Asghar 12 years ago.
OMEdit showing the original model
Dymola_orginal_model.png (122.2 KB ) - added by Adeel Asghar 12 years ago.
Dymola showing the original model
OMEdit_modified_model.png (137.6 KB ) - added by Adeel Asghar 12 years ago.
OMEdit showing the modified model
Dymola_modified_model.png (128.8 KB ) - added by Adeel Asghar 12 years ago.
Dymola showing the modified model

Download all attachments as: .zip

Change History (15)

by anonymous, 12 years ago

Attachment: img1.tiff added

by anonymous, 12 years ago

Attachment: img2.tiff added

comment:1 by Adeel Asghar, 12 years ago

Is it possible for you to share your library OR atleast the piece of code that we can use for testing?

comment:2 by Lennart Ochel, 12 years ago

Maik is one of our students and we are using OpenModelica 1.9.0 beta4+dev (r15969) for teaching. I guess this is the older version he mentioned.

in reply to:  2 comment:3 by Adeel Asghar, 12 years ago

Replying to lochel:

Maik is one of our students and we are using OpenModelica 1.9.0 beta4+dev (r15969) for teaching. I guess this is the older version he mentioned.

OK. Then resolve the ticket as invalid.

comment:4 by Lennart Ochel, 12 years ago

I guess, the issue occurs using the current trunk version. But to produce the bug, he was using that older version in the middle of his modelling process:

  1. Create Model with current trunk version (correct displayed icons)
  2. Edit model with old version (correct displayed icons)
  3. Edit model with current trunk version (wrong displayed icons)

Am I right?

comment:5 by maik.wenzler@…, 12 years ago

the following model can be used to produce the wrongly displayed icons:

comment:6 by maik.wenzler@…, 12 years ago

package TestIcon
  package Schnitstelle
    connector Pin
      Real v;
      flow Real i;
      annotation(Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(origin = {0,5.46022}, fillColor = {255,0,0}, fillPattern = FillPattern.Solid, extent = {{-99.5319,94.6958},{100.156,-105.616}})}));
    end Pin;
    connector NPin
      Real v;
      flow Real i;
      annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(origin = {-15.7566,25.429}, fillColor = {0,0,255}, fillPattern = FillPattern.Solid, extent = {{-84.0874,74.415},{115.601,-125.897}})}));
    end NPin;
    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 Schnitstelle;
  package Bauteile
    model Erdung
      Pruefung.Schnittstelle.Pin pin1 annotation(Placement(visible = true, transformation(origin = {-14.741,40.6375}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-0.438261,34.3825}, extent = {{-11.1155,-11.1155},{11.1155,11.1155}}, rotation = 0)));
    equation
      pin1.v = 0;
      annotation(Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Line(origin = {20.3187,-17.9283}, points = {{-119.92,4.78088},{78.0876,4.78088}}, thickness = 5),Line(origin = {-5.0996,-40.1594}, points = {{-67.7288,4.78088},{78.0876,4.78088}}, thickness = 5),Line(origin = {-27.7291,-63.1873}, points = {{-13.1471,4.78088},{78.0876,4.78088}}, thickness = 5),Line(origin = {0.605578,-11.7529}, points = {{-1.00398,32.8684},{-1.00398,-0.996111},{-0.605578,-0.597701}}, thickness = 5)}));
    end Erdung;
    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 Bauteile;
  package Beispiele
    model Test
      TestIcon.Bauteile.Erdung erdung1 annotation(Placement(visible = true, transformation(origin = {-39.4366,-44.1315}, extent = {{-10,-10},{10,10}}, rotation = 0)));
      Modelica.Electrical.Analog.Sources.SineVoltage sinevoltage1(V = 5, freqHz = 10) annotation(Placement(visible = true, transformation(origin = {-65.2582,21.5962}, extent = {{-10,-10},{10,10}}, rotation = -90)));
      Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 470) annotation(Placement(visible = true, transformation(origin = {22.0657,19.2488}, extent = {{-10,-10},{10,10}}, rotation = -90)));
    equation
      connect(sinevoltage1.n,erdung1.pin1) annotation(Line(points = {{-65.2582,11.5962},{-65.2582,-9.38967},{-39.4366,-9.38967},{-39.4366,-40.8451},{-39.4366,-40.8451}}));
      connect(resistor1.n,sinevoltage1.n) annotation(Line(points = {{22.0657,9.24883},{22.0657,-8.92019},{-65.2582,-8.92019},{-65.2582,10.7981},{-65.2582,10.7981}}));
      connect(sinevoltage1.p,resistor1.p) annotation(Line(points = {{-65.2582,31.5962},{-65.2582,45.0704},{22.0657,45.0704},{22.0657,28.6385},{22.0657,28.6385}}));
      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 Test;
    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 Beispiele;
  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 TestIcon;

by Adeel Asghar, 12 years ago

Attachment: OMEdit_original_model.png added

OMEdit showing the original model

by Adeel Asghar, 12 years ago

Attachment: Dymola_orginal_model.png added

Dymola showing the original model

by Adeel Asghar, 12 years ago

Attachment: OMEdit_modified_model.png added

OMEdit showing the modified model

by Adeel Asghar, 12 years ago

Attachment: Dymola_modified_model.png added

Dymola showing the modified model

comment:7 by Adeel Asghar, 12 years ago

Milestone: 1.9.02.0.0

OK. It looks to me more like a Qt issue. Seems like Qt can't handle the scaling of shapes with high pen thickness. Even Dymola can't handle it. I have attached the images of Dymola and OMEdit with original model you posted and then I modified the Line thickness in the model. The modified model is,

package TestIcon
  package Schnitstelle
    connector Pin
      Real v;
      flow Real i;
      annotation(Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(origin = {0,5.46022}, fillColor = {255,0,0}, fillPattern = FillPattern.Solid, extent = {{-99.5319,94.6958},{100.156,-105.616}})}));
    end Pin;
    connector NPin
      Real v;
      flow Real i;
      annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(origin = {-15.7566,25.429}, fillColor = {0,0,255}, fillPattern = FillPattern.Solid, extent = {{-84.0874,74.415},{115.601,-125.897}})}));
    end NPin;
    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 Schnitstelle;
  package Bauteile
    model Erdung
      Pruefung.Schnittstelle.Pin pin1 annotation(Placement(visible = true, transformation(origin = {-14.741,40.6375}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-0.438261,34.3825}, extent = {{-11.1155,-11.1155},{11.1155,11.1155}}, rotation = 0)));
    equation
      pin1.v = 0;
      annotation(Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Line(origin = {20.3187,-17.9283}, points = {{-119.92,4.78088},{78.0876,4.78088}}, thickness = 0.25),Line(origin = {-5.0996,-40.1594}, points = {{-67.7288,4.78088},{78.0876,4.78088}}, thickness = 0.25),Line(origin = {-27.7291,-63.1873}, points = {{-13.1471,4.78088},{78.0876,4.78088}}, thickness = 0.25),Line(origin = {0.605578,-11.7529}, points = {{-1.00398,32.8684},{-1.00398,-0.996111},{-0.605578,-0.597701}}, thickness = 0.25)}));
    end Erdung;
    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 Bauteile;
  package Beispiele
    model Test
      TestIcon.Bauteile.Erdung erdung1 annotation(Placement(visible = true, transformation(origin = {-39.4366,-44.1315}, extent = {{-10,-10},{10,10}}, rotation = 0)));
      Modelica.Electrical.Analog.Sources.SineVoltage sinevoltage1(V = 5, freqHz = 10) annotation(Placement(visible = true, transformation(origin = {-65.2582,21.5962}, extent = {{-10,-10},{10,10}}, rotation = -90)));
      Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 470) annotation(Placement(visible = true, transformation(origin = {22.0657,19.2488}, extent = {{-10,-10},{10,10}}, rotation = -90)));
    equation
      connect(sinevoltage1.n,erdung1.pin1) annotation(Line(points = {{-65.2582,11.5962},{-65.2582,-9.38967},{-39.4366,-9.38967},{-39.4366,-40.8451},{-39.4366,-40.8451}}));
      connect(resistor1.n,sinevoltage1.n) annotation(Line(points = {{22.0657,9.24883},{22.0657,-8.92019},{-65.2582,-8.92019},{-65.2582,10.7981},{-65.2582,10.7981}}));
      connect(sinevoltage1.p,resistor1.p) annotation(Line(points = {{-65.2582,31.5962},{-65.2582,45.0704},{22.0657,45.0704},{22.0657,28.6385},{22.0657,28.6385}}));
      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 Test;
    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 Beispiele;
  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 TestIcon;

I will try to investigate a bit more about it but for now i suggest using pens with low thickness value.

comment:8 by Adeel Asghar, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r16521.

comment:9 by Martin Sjölund, 11 years ago

Milestone: 2.0.01.9.0

BatchModify: Updating milestone since this ticket was closed in time for the 1.9.0 release

Note: See TracTickets for help on using tickets.