Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2956 closed defect (fixed)

Moving a complete model disassembles everything

Reported by: Adeel Asghar Owned by: Adeel Asghar
Priority: high Milestone: 1.9.2
Component: OMEdit Version: trunk
Keywords: Cc: massimo ceraolo

Description

Consider the following step-by-step procedure.
1) Open the component Modelica.Electrical.Analog.Examples.Rectifier.
2) Copy it in a user location so that it can be edited
3) In the diagram perspective select all (Ctr-A)
4) click on the arrow-down to move everything down.
RESULT: the model is totally disassembled! (see enclosed Rectifier.png)

If the movement is made using the mouse on a component icon (e.g. an inductor or a diode) the result is a bit better but still wrong.
Tested on r23134.

Attachments (1)

Rectifier.png (14.3 KB ) - added by Adeel Asghar 10 years ago.

Download all attachments as: .zip

Change History (15)

by Adeel Asghar, 10 years ago

Attachment: Rectifier.png added

comment:1 by Adeel Asghar, 10 years ago

Cc: massimo ceraolo added
Status: newaccepted

comment:2 by Adam Dershowitz <dersh@…>, 10 years ago

How does one complete step 2) above? The more general question is how can someone make any edits to an existing, but locked model?
If I open the Rectifier model, and copy, then move to a user package, and select paste, nothing happens. I have also tried moving the mouse to highlight all the parts of the Rectifier model, then doing a copy, then a paste in a user package, but again, that doesn't work.
It seems that copy and paste does work if all changes are done in the text view. Is that the intent here?

comment:3 by massimo ceraolo, 10 years ago

You can do as follows:

  • find Rectifier in the Modelica tree
  • switch to text mode
  • select and copy everything;
  • create a new model; while still in text mode paste what you previously copied
  • save the model.

I suggested this procedure just to be sure that the readers can reproduce the behaviour I had, using a standard model.
So the intent was to show an issue using a model from MSL.

in reply to:  2 comment:4 by Adeel Asghar, 10 years ago

Replying to Adam Dershowitz <dersh@…>:

How does one complete step 2) above? The more general question is how can someone make any edits to an existing, but locked model?
If I open the Rectifier model, and copy, then move to a user package, and select paste, nothing happens. I have also tried moving the mouse to highlight all the parts of the Rectifier model, then doing a copy, then a paste in a user package, but again, that doesn't work.
It seems that copy and paste does work if all changes are done in the text view. Is that the intent here?

Yeah the step 2 only works through text mode. What you mentioned is an already reported enhancement #2190.

comment:5 by massimo ceraolo, 10 years ago

Summary: Moving a complete model disassemble everythingMoving a complete model disassembles everything

comment:6 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in r23306.

comment:7 by massimo ceraolo, 10 years ago

Milestone: Future1.9.2
Resolution: fixed
Status: closedreopened

comment:8 by massimo ceraolo, 10 years ago

I've discovered that the fix to this ticket has a serious problem.
Consider the following step-by-step procedure:

1) Open the component Modelica.Electrical.Analog.Examples.Rectifier.
2) Copy it in a user location so that it can be edited
3) In the diagram perspective select all (Ctr-A)
4) click on the arrow-down to move everything down.
5) save and unload the model
6) reload the model
RESULT: again the model is disassembled!

Last edited 10 years ago by massimo ceraolo (previous) (diff)

comment:9 by Adeel Asghar, 10 years ago

The problem is not trivial. According to Modelica specification if a component doesn't have origin then its extent points should be used to find the position, scale and origin for rotation. OMC always returns origin, if the origin value is not defined in the actual modelica code then OMC returns default value as 0 for origin which is true for most of the cases but wrong in this case. Most of the components in the rectifier model only have extent points.

The good thing is I know what to fix and I will try to fix it soon.
This is indeed a serious bug!

comment:10 by massimo ceraolo, 10 years ago

Thanks a lot for deciding to work on this.
Since you compute the new origins when the user moves the model, it seems that the issue can be solved just saving these new origin values in the mo file. Am I wrong?

Last edited 10 years ago by massimo ceraolo (previous) (diff)

comment:11 by massimo ceraolo, 10 years ago

Adeel,

I'm starting teaching a course at next semester, that will begin around mid February.
It would be great if I can use OM for my simulations.
Consider the good impact it will be to have 20 MS students (near to their MS degree) learning OM!

I've checked and all important simulations that I plan simulate well in OM.
Naturally students cannot live with this issue 2956.
Do you think it is realistic to have it fixed by mid February?

Last edited 10 years ago by massimo ceraolo (previous) (diff)

in reply to:  11 comment:12 by Adeel Asghar, 10 years ago

Replying to ceraolo:

Adeel,

I'm starting teaching a course at next semester, that will begin around mid February.
It would be great if I can use OM for my simulations.
Consider the good impact it will be to have 20 MS students (near to their MS degree) learning OM!

I've checked and all important simulations that I plan simulate well in OM.
Naturally students cannot live with this issue 2956.
Do you think it is realistic to have it fixed by mid February?

Hopefully it will be fixed in few minutes. I almost done :).

comment:13 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in r24017.

comment:14 by massimo ceraolo, 10 years ago

WOW!
I expected this so much.
Tomorrow will make my checks.Thanks a lot.

Note: See TracTickets for help on using tickets.