Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3744 closed defect (fixed)

New blocks created by OMEdit cannot be used

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone: 1.9.4
Component: OMEdit Version: v1.9.4-dev-nightly
Keywords: Cc:

Description

Steps to reproduce the problem:

  • Create a new block with OMEdit, keeping the default graphical annotations.
  • Create a new model
  • Drag the new block in the new model: it fills the whole diagram
  • Click and drag one corner of the block in the diagram to resize it: the block disappears, and the graphical annotation shows NaN everywhere

The defaults should be set so that the default size of the blocks corresponds to the one of the MSL blocks

Furthermore, if I then open the package with Dymola, the icon and diagram view of the block are empty, so I guess there is some problem with the block's graphical annotation itself:

  annotation(Icon(coordinateSystem(initialScale = 1), graphics={  Rectangle(origin = {1, -1}, extent = {{-101, 101}, {99, -99}}), Text(origin = {-21, 4}, extent = {{-43, 36}, {83, -40}}, textString = "ON/OFF")}),
             Diagram(graphics = {Rectangle(origin=  {0, 1}, extent=  {{-100, 99}, {100, -101}})}));

I am using OMEdit under Windows 7, v.1.9.4-dev-507-g62c0c86, omc v.1.9.4-dev.beta2-83-g769e528.

If we use the latest Linux nightly, it works fine.

Change History (8)

comment:1 by Francesco Casella, 9 years ago

It seems that the default annotations applied by my Windows installation when creating a new model

  annotation(Icon(coordinateSystem(initialScale = 1)));

are different from those of the Linux one

annotation(Icon(coordinateSystem(
  preserveAspectRatio = false, grid =  {100,100})));

and they are not good.

comment:2 by Adeel Asghar, 9 years ago

The annotations use the default values from Tools->Options->Graphical Views. By default we use the values defined in the Modelica specification,

record CoordinateSystem
  Extent extent;
  Boolean preserveAspectRatio=true;
  Real initialScale = 0.1;
  DrawingUnit grid[2];
end CoordinateSystem;

But you can overwrite them. In your case it seems like you have changed those values. If you want to have default values then remove the file %APPDATA%/openmodelica/omedit.ini. Note that it will remove all your settings instead I recommend just remove the section [iconView] & [DiagramView] from the file. OMEdit should be closed before updating the file.

comment:3 by Adeel Asghar, 9 years ago

I have fixed the NaN issue in cd90f74/OMEdit.

comment:4 by Francesco Casella, 9 years ago

Resolution: fixed
Status: newclosed

In fact I have:

[iconView]
extentLeft=-100
extentBottom=-100
extentRight=100
extentTop=100
gridHorizontal=2
gridVertical=2
scaleFactor=1
preserveAspectRatio=true

in my omedit.ini file. I am positive that I have never changed these settings myself, I wasn't even aware of their existence.

Is it possible that OMEdit changed them for some reason?

Anyway, I fixed the default settings and now I get blocks of the expected size.

in reply to:  4 ; comment:5 by Adeel Asghar, 9 years ago

Replying to casella:

In fact I have:

[iconView]
extentLeft=-100
extentBottom=-100
extentRight=100
extentTop=100
gridHorizontal=2
gridVertical=2
scaleFactor=1
preserveAspectRatio=true

in my omedit.ini file. I am positive that I have never changed these settings myself, I wasn't even aware of their existence.

Is it possible that OMEdit changed them for some reason?

Might be possible. Because we had a bug long time ago when settings got corrupted because of mixing of UTF-8 and non UTF-8 strings. Now everything is UTF-8.

Anyway, I fixed the default settings and now I get blocks of the expected size.

in reply to:  5 comment:6 by Francesco Casella, 9 years ago

Replying to adeas31:

Replying to casella:

Is it possible that OMEdit changed them for some reason?

Might be possible. Because we had a bug long time ago when settings got corrupted because of mixing of UTF-8 and non UTF-8 strings. Now everything is UTF-8.

I still don't get why OMEdit should have changed them to a value different from the default.

Maybe I just changed it under the effect of drugs or alcohol, or very late at night ;)

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

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

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.