Opened 9 years ago

Closed 9 years ago

Last modified 8 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: casella Owned by: adeas31
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 casella 9 years ago.
omeditcommunication.zip (231.7 KB) - added by casella 9 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 9 years ago by adeas31

  • Status changed from new to accepted

You forgot to attach the file.

Changed 9 years ago by casella

comment:2 Changed 9 years ago by adeas31

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 adeas31 (previous) (diff)

comment:3 Changed 9 years ago by casella

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 Changed 9 years ago by casella

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 Changed 9 years ago by casella

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 Changed 9 years ago by adeas31

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 Changed 9 years ago by rfranke

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 Changed 9 years ago by casella

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 Changed 9 years ago by adeas31

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

Changed 9 years ago by casella

comment:10 follow-up: Changed 9 years ago by 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? Also do you have any Test.mo at the same location?

comment:11 follow-up: Changed 9 years ago by adeas31

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

comment:12 in reply to: ↑ 10 Changed 9 years ago by casella

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 follow-up: Changed 9 years ago by 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

comment:14 in reply to: ↑ 11 ; follow-up: Changed 9 years ago by 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?

comment:15 in reply to: ↑ 13 ; follow-up: Changed 9 years ago by 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"?

comment:16 in reply to: ↑ 14 Changed 9 years ago by adeas31

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.

comment:17 in reply to: ↑ 15 Changed 9 years ago by adeas31

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 Changed 9 years ago by adeas31

  • Resolution set to fixed
  • Status changed from accepted to closed

Now I have fixed it in 6830f82/OMEdit.

comment:19 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.4-1.9.x

Milestone renamed

comment:20 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4-1.9.x to 1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.