#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)
Change History (15)
by , 10 years ago
Attachment: | Rectifier.png added |
---|
comment:1 by , 10 years ago
Cc: | added |
---|---|
Status: | new → accepted |
follow-up: 4 comment:2 by , 10 years ago
comment:3 by , 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.
comment:4 by , 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 , 10 years ago
Summary: | Moving a complete model disassemble everything → Moving a complete model disassembles everything |
---|
comment:7 by , 10 years ago
Milestone: | Future → 1.9.2 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
comment:8 by , 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!
comment:9 by , 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 , 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?
follow-up: 12 comment:11 by , 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 thin it is realistic to have it fixed by mid February?
comment:12 by , 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:14 by , 10 years ago
WOW!
I expected this so much.
Tomorrow will make my checks.Thanks a lot.
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?