Skip to content

Resolve "Create `AutoSave` class and mechanism"

d.kilic requested to merge 224-create-autosave-class-and-mechanism into master

This PR adds an autosave feature for the trc and pet files.

The pet file is saved each 60 seconds (up for discussions)
The trc file is saved each 10 manual changes on trajectories (up for discussion)

The autosave is saved in a file named .projectName_autosave.trc/pet. When a new project is selected, PeTrack checks if an autosave file exists and if one exists, it asks the user, if they want to load it. This also means we need to delete the old autosave when we close a project. This happens in two cases:

  1. Closing Petrack as a whole
    Autosaves get deleted in Petrack::closeEvent
  2. Changing the project; closing the old one
    Autosaved get deleted in setProFileName

When we have an object model akin to what is described in the comments in #88 (closed), one might take the destruction of an Project-Object as an indicator for closing it. (Need special care for Ctrl-C though, as it should leave an autosave but destructs normally)

  • Autosave for .pet-file is currently every 6 seconds for testing; change to 60 for final version

Closes #224 (closed)

Edited by d.kilic

Merge request reports

Loading