Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3723 closed defect (fixed)

When creating new model in multi-file package with OMEdit, the model is empty and not saved

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

Load the attached test package. Right-click on Test, select New Modelica class and add a model C. The model shows up empty.

Hit Save. The asterisk on C goes away, but C is not saved to any file.

Now expand the Test tree. C shows up and is added to the package.order file, but yet its code is not added to package.mo, nor to a C.mo file.

Similar to #3635, which had a package contained in a single file and was fixed. Unfortunately, if the package resides on multiple files, the problem is still there, as reported in #3635.

Attachments (2)

Test.zip (801 bytes ) - added by Francesco Casella 9 years ago.
omeditcommunication.zip (231.7 KB ) - added by Francesco Casella 9 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 by Adeel Asghar, 9 years ago

Status: newaccepted

You forgot to attach the file.

by Francesco Casella, 9 years ago

Attachment: Test.zip added

comment:2 by Adeel Asghar, 9 years ago

Works perfectly fine for me. I can't reproduce it. Maybe because I have some fixes in my working copy so you could try tomorrow with the latest nightly.

I made a small video about it http://www.ida.liu.se/~adeas31/Ticket3723.swf

Last edited 9 years ago by Adeel Asghar (previous) (diff)

comment:3 by Francesco Casella, 9 years ago

OK, I downloaded the latest Windows nightly (omc v1.9.4-dev.beta2-66-g5fd29e6). The reported problem is gone, i.e., I now see the code of class C.

However, if now click on Test and save the package, the package.mo file is removed, and the library becomes invalid.

comment:4 by Francesco Casella, 9 years ago

It seems that this nightly is not really up-to-date, due to the usual failure of the OM_WIN_NIGHTLY_BUILD job.

I'll restart it and I'll check again

comment:5 by Francesco Casella, 9 years ago

I tried OMEdit v1.9.4-dev-507-g62c0c86 with OMC v1.9.4-dev.beta2-83-g769e528. This should contain all your commits to master so far.

I still have the same problem as in comment:3

Please check with the latest nightly, maybe there is something wrong in the installation package for Windows.

comment:6 by Adeel Asghar, 9 years ago

Unfortunately I still can't reproduce it. I downloaded OpenModelica-v1.9.4-dev.beta2-120-g09c0222.exe the latest nightly build available at the moment and installed it on my virtual box. OMEdit v1.9.4-dev-507-g62c0c86 with OMC v1.9.4-dev.beta2-83-g769e528. So I have the same version as yours.

I again made a small screencast http://www.ida.liu.se/~adeas31/2016-03-02_Ticket3723.swf

comment:7 by Rüdiger Franke, 9 years ago

I tried with 1.9.4beta2 under Windows 7. Hit Save (see description above) generates the following file C.mo in the Test folder:

within Test;

model C
  annotation(Icon, Diagram);
end C;

comment:8 by Francesco Casella, 9 years ago

Retried once more with a clean copy of the package I got from the attachment.

The package.mo file is no longer removed when I select Test and hit Save. However, I can't see any C.mo file.

Rueediger, can you be more specific on the specific revision of omc and omedit are using?

Thanks

comment:9 by Adeel Asghar, 9 years ago

So basically you are having the same issue you reported in the ticket description. Can you provide your %TEMP%/OpenModelica/OMEdit/omeditcommunication.log file?

by Francesco Casella, 9 years ago

Attachment: omeditcommunication.zip added

comment:10 by Adeel Asghar, 9 years ago

Alright I can see the difference between yours and my log files but somehow I can't produce it. Could you again make a video with exact steps? Also do you have any Test.mo at the same location?

comment:11 by Adeel Asghar, 9 years ago

I think you have Test.C as file in your working directory.

in reply to:  10 comment:12 by Francesco Casella, 9 years ago

Replying to adeas31:

Alright I can see the difference between yours and my log files but somehow I can't produce it. Could you again make a video with exact steps?

http://screencast.com/t/ceIYPTDksFC

Also do you have any Test.mo at the same location?

No, as you can see in the video.

comment:13 by Adrian Pop, 9 years ago

As far as I can see from your video you don't have the latest nightly build:
https://build.openmodelica.org/omc/builds/windows/nightly-builds/
Latest version: OpenModelica-v1.9.4-dev.beta2-120
Your version: OpenModelica-v1.9.4-dev.beta2-83

in reply to:  11 ; comment:14 by Francesco Casella, 9 years ago

Replying to adeas31:

I think you have Test.C as file in your working directory.

Yes! I removed it, and everything started to work as expected. Pretty hard to find out myself :)

Why should this happen? Is it a bug or a feature?

in reply to:  13 ; comment:15 by Francesco Casella, 9 years ago

Replying to adrpo:

As far as I can see from your video you don't have the latest nightly build:
https://build.openmodelica.org/omc/builds/windows/nightly-builds/
Latest version: OpenModelica-v1.9.4-dev.beta2-120
Your version: OpenModelica-v1.9.4-dev.beta2-83

This is a bit misleading: it is not OpenModelica v1.9.4-dev.beta2-83, but rather OMCompiler v1.9.4-dev.beta2-83, that is https://github.com/OpenModelica/OMCompiler/commit/769e528bb8fff75a44a90435087c590ba8c3ba8b

Adeel, would you mind changing "Connected to OpenModelica" to "Connected to OMC"?

in reply to:  14 comment:16 by Adeel Asghar, 9 years ago

Replying to casella:

Replying to adeas31:

I think you have Test.C as file in your working directory.

Yes! I removed it, and everything started to work as expected. Pretty hard to find out myself :)

Why should this happen? Is it a bug or a feature?

Well I was using QFile::exists("Test.C") to check if we already have a valid file to save contents into and Qt is trying to be over intelligent and thinks its a relative path from the working directory. So the file contents are actually being saved into your %TEMP%/OpenModelica/OMEdit/Test.C.

in reply to:  15 comment:17 by Adeel Asghar, 9 years ago

Replying to casella:

Replying to adrpo:

As far as I can see from your video you don't have the latest nightly build:
https://build.openmodelica.org/omc/builds/windows/nightly-builds/
Latest version: OpenModelica-v1.9.4-dev.beta2-120
Your version: OpenModelica-v1.9.4-dev.beta2-83

This is a bit misleading: it is not OpenModelica v1.9.4-dev.beta2-83, but rather OMCompiler v1.9.4-dev.beta2-83, that is https://github.com/OpenModelica/OMCompiler/commit/769e528bb8fff75a44a90435087c590ba8c3ba8b

Adeel, would you mind changing "Connected to OpenModelica" to "Connected to OMC"?

I can't change it. It is coming from getVersion() which returns something like OpenModelica xxx-xx-xxxx

comment:18 by Adeel Asghar, 9 years ago

Resolution: fixed
Status: acceptedclosed

Now I have fixed it in 6830f82/OMEdit.

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

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