Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#3179 closed defect (fixed)

Automatic saving after model change in OMEdit destroys libraries

Reported by: Bernhard Thiele Owned by: Adeel Asghar
Priority: high Milestone: 1.9.4
Component: OMEdit Version: trunk
Keywords: Cc:

Description

I experienced a bad problem when trying to work with the Modelica_DeviceDrivers library using OMEdit.

Changing a parameter in an example model, e.g., Modelica_DeviceDrivers.Blocks.Examples.TestSerialPackager, and pressing the simulate button will save not only the file to be simulated but resaves the whole library. What is even worse is that it saves it in a different directory structure, i.e., it introduces new directories for packages and their classes that before were saved in package files. As a result the library is broken and messed up (it cannot be reloaded by OMEdit).

If testing with Modelica_DeviceDrivers please make sure to use the master branch (https://github.com/modelica/Modelica_DeviceDrivers/tree/master) and not the release branch, since the master branch contains some compatibility related fixes that are not yet in the release version.

Change History (8)

comment:1 by Rüdiger Franke, 10 years ago

There finds a checkbox in OMEdit -> Tools -> Options under Simulation saying "Save class before simulation". I'm always unchecking it to avoid unintended surprises. Shouldn't this be the default setting, in particular as saving of multi-file packages does not work yet?

comment:2 by Adeel Asghar, 10 years ago

No. The only intention to have this checkbox is to keep it enabled by default. So that if OMEdit crash during simulation then the user data is not lost. However, we need to fix the file saving. There are 2-3 tickets already related to it. We need to use local buffers inside OMEdit to file saving instead of asking OMC to save it.

comment:3 by Dietmar Winkler, 10 years ago

The problem is that it is no use that the model is saved anew since the changes are rendered unusable after the automatic save. I.e., OMEdit is not able to load the library again when it has crashed since the newly saved version conflicts with the old structure which is still present. So disabling this would at least allow one to WORK with OMedit. That changes get lost if one does not save is the normal behaviour on most tools. But having it destroy your library automatically is not. So I strongly recommend to change that default to False until the save issue is fixed.

comment:4 by Francesco Casella, 9 years ago

See also #3466 for a much smaller test case that reproduces the problem

comment:5 by Adeel Asghar, 9 years ago

Milestone: Future1.9.4

This issue has now been fixed in a development branch ​https://github.com/adeas31/OMEdit/commit/1d15d3b6f76a55c8fd4e3a2e5797dbddc2b60261 for OpenModelica 1.9.4 final release.

Version 0, edited 9 years ago by Adeel Asghar (next)

comment:6 by Adeel Asghar, 9 years ago

Resolution: fixed
Status: newclosed

The fix is now available via the nightly build.

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

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