Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3145 closed defect (fixed)

saving issues

Reported by: benoitbride@… Owned by: Adeel Asghar
Priority: high Milestone: 1.9.4
Component: OMEdit Version: trunk
Keywords: Cc:

Description

Hello,

Using OMEdit 192 beta 2 I had some problems to save new models in a package. For instance if I do :

  • right click on a model
  • copy
  • type name "newmodel"
  • choose the package in which I want to keep it
  • modify newmodel
  • save it

Then the file newmodel.mo never appears in my package directory, so I cannot figure out how to save it effectively from OME...

Switching to code in OME, it even always remain empty (no text even though the graphical model appears).

B BRIDE

Change History (14)

comment:1 by Per Östlund, 10 years ago

Component: UnknownOMEdit
Owner: changed from somebody to Adeel Asghar

comment:2 by Adeel Asghar, 10 years ago

Tested with r25177. Seems to work as expected.

comment:3 by benoitbride@…, 10 years ago

Hello,

I tested it on r25177 but it still does not work for me.
I may be mis-using the editor...

I discovered that if I do a "save complete model", then the save button begins to work correctly.

Perhaps I it is not allowed to use separate files in a package directory, but I usually work this way with ThermoSysPro.

I have just seen that OME gives me error messages when saving : here they are :

[44] 16:08:18 Ecriture Erreur
Failed to load package Travail () using MODELICAPATH D:\donnees\Modelica\;C:/OpenModelica1.9.2/lib/omlibrary.

[45] 16:08:18 Grammaire Erreur
[D:\donnees\Modelica\/Travail/uii.mo: 0:0-0:0]: Modelica library files should contain exactly one package, but found the following classes: Travail, ThermoSysPro, ModelicaServices, Modelica, TAV_total.

Thanks anyway if you have advices.
B BRIDE

comment:4 by Adeel Asghar, 10 years ago

I followed the steps you mentioned in the bug description and I was able to save newmodel successfully. What I did was,

  • Created a package p1 (makesure you uncheck Save contents in one file).
  • Click save. (It should create a folder <name of folder depends on what you choose> with file package.mo)
  • Then I created a new model M. (Create the model at top-level, do not select any insert in class).
  • Right click model M and choose copy.
  • Enter name newmodel.
  • Enter p1 in path. (this is create a copy of model M as name newmodel in p1).
  • Open newmodel and click on save.
  • Now I have a folder p1 with 2 files i.e package.mo & newmodel.mo

The error you mention now is a know bug which is already reported here #3179.

comment:5 by benoitbride@…, 10 years ago

Hello,

Thanks for your help.
I tested on my computer the actions you listed, here is the result:

Created a package p1 (makesure you uncheck Save contents in one file).
Click save. (It should create a folder <name of folder depends on what you choose> with file package.mo)

OK:
Indeed these 2 steps created a folder with a correct package.mo file inside.

Then I created a new model M. (Create the model at top-level, do not select any insert in class).
Right click model M and choose copy.
Enter name newmodel.
Enter p1 in path. (this is create a copy of model M as name newmodel in p1).
Open newmodel and click on save.
Now I have a folder p1 with 2 files i.e package.mo & newmodel.mo

NOT OK:
The newmodel.mo file is not created in the folder. Besides when I click on "save" the star (*) does not disappear from the name of the model in the main window of the OME.

Then if I do "save in a complete model" for my newmodel, it gives the error messages:

[285] 08:58:31 Traduction Erreur
Class p1.newmodel not found in scope .

[286] 08:58:31 Traduction Erreur
[D:/donnees/Modelica/p1/package.mo: 1:1-3:12]: Class newmodel not found in scope Travail.

At exiting the OME, it asks to "save the changes in class" p1. If I answer yes, nothing happens and the OME remains open. If I answer No the OME closes, and when I re-open it p1 is empty.

I confess that I am a bit puzzled about saving issues in OME... I cannot understand why it is not working on my computer the same way as you.

B

comment:6 by Adrian Pop, 10 years ago

Do you by any chance have the paths (directory names) where you try to save with special French characters in them? I don't think that works yet.

comment:7 by benoitbride@…, 10 years ago

I do not have special french characters in the path.
The main package directory is: D:\donnees\Modelica\Travail

In my first tests, I wondered wether the slash or antislash in the path names has an influence, so I tried several versions of the working directory pathname (in tools/options/general), but I found no solutions there.

I am now trying other ways of saving, I will tell you what works and do not works.

b

comment:8 by benoitbride@…, 10 years ago

I have just made a new test, varying a bit the steps, here is what I have done :

1) Create a package p1 (unchecking Save contents in one file).
2) Click save.
3) In the saving window create and choose a "p1" folder
4) The folder p1 is correctly created with a file package.mo inside
5) Create a new model M at top-level (no insert in class)
6) NEW STEP HERE: Save M, OME asks a directory, select p1
7) Right click model M and choose copy.
8) Enter name newmodel.
9) Enter p1 in path
10) Open newmodel and click on save.

It works!
I now have a newmodel.mo file in the p1 directory.

However I had two error messages at step 10 :

[2] 11:13:29 Ecriture Erreur
Failed to load package p1 () using MODELICAPATH D:\donnees\Modelica\;C:/OpenModelica1.9.2/lib/omlibrary.


[3] 11:13:29 Grammaire Erreur
[D:/donnees/Modelica/p1/M.mo: 1:1-3:6]: Expected the package to have within p1; but got within ;.

I could then Right click on model M and choose remove, and this messages do not appear anymore when saving newmodel.

But after that, the saving does not work anymore, since I could not find my changes in the newmodel.mo file when opening it in a notepad.

I am progressing... But it is not completely solved.

b

comment:9 by benoitbride@…, 10 years ago

I made a mistake in my statement above,

The newmodel savings still work after "Right click on model M and choose remove", and the error messages still appear.

It is when I erase M.mo from p1 directory that the newmodel savings cease to work and the error messages disappear.

sorry.
b

comment:10 by Adeel Asghar, 10 years ago

I suppose then we can close this ticket and follow on #3179 for other errors.

comment:11 by benoitbride@…, 10 years ago

I still do not see clearly how to use OME and avoid saving problems but I will try it out by myself.

Thanks a lot for all your answers.

b

comment:12 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: newclosed

comment:13 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:14 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.