Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#3179 closed defect (fixed)

Automatic saving after model change in OMEdit destroys libraries

Reported by: bthiele Owned by: adeas31
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 Changed 10 years ago by rfranke

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

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

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

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

comment:5 Changed 9 years ago by adeas31

  • Milestone changed from Future to 1.9.4

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

Last edited 9 years ago by adeas31 (previous) (diff)

comment:6 Changed 9 years ago by adeas31

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

The fix is now available via the nightly build.

comment:7 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.4-1.9.x

Milestone renamed

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