Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3683 closed defect (fixed)

Sometimes OMEdit does not delete connect equations

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

Description

In OMEdit, when you delete a model, also the related connecting lines must be deleted.
Deleting the connecting lines must be associated to the deletion of the corresponding connect equations.

In OMEdit, however, frequently happens that when one deletes a model (in diagram view) even though connecting lines are deleted, not all the related connect equations are deleted. When checking the resulting model, therefore, errors occur.

Unfortunately this behaviour is rather erratic, and, although it happens rather frequently, I never succeeded to create a repetitive procedure to reproduce it.
I've seen this behaviour at least during a the whole last year.

Finally I decided to open this ticket, just in case the developers, looking at the code, are able to find something strange about deleting connect equations as a consequence of the user's deletion (in diagram view) of a model.

Attachments (3)

circuit.png (70.3 KB ) - added by anonymous 9 years ago.
RenaTest.mo (1.4 KB ) - added by anonymous 9 years ago.
omeditcommunication.log (2.3 MB ) - added by anonymous 9 years ago.

Change History (17)

comment:1 by Adeel Asghar, 9 years ago

Never faced this issue before. Would be nice if you could provide a test-case.

by anonymous, 9 years ago

Attachment: circuit.png added

by anonymous, 9 years ago

Attachment: RenaTest.mo added

comment:2 by anonymous, 9 years ago

Finally I succeeded in finding a sequence showing the issue!

1) load and open "RenaTest.mo" in diagram view
2) rename "constantVoltage1" into "fem". Now check model ->ok
3) add another resistor in the circuit (for instance you can obtain the circuit shown in the enclosed png)
4) check the model again -> error! OMEdit complains something about"constantVoltage1"

that indeed is not part of the circuit anymore. In the text view an extra connect equation regarding constantVoltage1 appears.

comment:3 by Adeel Asghar, 9 years ago

I can't reproduce it :). I followed all your steps. For step 3 I added a new resistor and then deleted the existing connection between resistor1 and resistor2, and then made a connection between resistor1 and resistor3 and a connection between resistor3 and resistor2.

comment:4 by Adeel Asghar, 9 years ago

Post your omeditcommunication.log file. You can find it in %TEMP%/OpenModelica/OMEdit.

by anonymous, 9 years ago

Attachment: omeditcommunication.log added

comment:5 by anonymous, 9 years ago

here you are

comment:6 by Adeel Asghar, 9 years ago

Resolution: fixed
Status: newclosed

Fixed in 538f96a/OMEdit.

The problem was that, after renaming constantVoltage1 if user moves resistor1 then updateConnection is called which was using the old names. So the fix was to update the names to new when user do the renaming.

comment:7 by Adeel Asghar, 9 years ago

Milestone: Future1.9.4

comment:8 by anonymous, 9 years ago

A simpler procedure to showing the issue
1) load and open "RenaTest.mo" in diagram view
2) rename "constantVoltage1" into "fem". Now check model ->ok
3) move resistor2 (e.g. with a single using right-arrow click on the keyboard). Now check model. Error

Error message:
[1] 08:27:28 Translation Error
Variable constantVoltage1.n not found in scope RenaTest.

[2] 08:27:28 Translation Error
Error occurred while flattening model RenaTest

comment:9 by anonymous, 9 years ago

Sorry for the message of a minute a go.
I did not see that you already fixed it!

comment:10 by anonymous, 9 years ago

The issue is still present.
Steps:
1) load RenaTest.mo; check->ok
2) delete resistor1
3) connect constantVoltage1.p with resistor2.p check->ok
4) move resistor2 check-> error!

comment:11 by anonymous, 9 years ago

Resolution: fixed
Status: closedreopened

comment:12 by Adeel Asghar, 9 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in af41062/OMEdit.
Btw, thanks for testing and reporting such issues!

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:14 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.