Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PeTrack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedestrian Dynamics Empiricism
PeTrack
Commits
915c2a34
Commit
915c2a34
authored
3 years ago
by
d.kilic
Committed by
d.kilic
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
License headers and comments
parent
75c8b58b
No related branches found
No related tags found
1 merge request
!154
Resolve "Create `AutoSave` class and mechanism"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/autosave.h
+20
-0
20 additions, 0 deletions
include/autosave.h
src/autosave.cpp
+22
-2
22 additions, 2 deletions
src/autosave.cpp
with
42 additions
and
2 deletions
include/autosave.h
+
20
−
0
View file @
915c2a34
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2021 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef AUTOSAVE_H
#ifndef AUTOSAVE_H
#define AUTOSAVE_H
#define AUTOSAVE_H
...
...
This diff is collapsed.
Click to expand it.
src/autosave.cpp
+
22
−
2
View file @
915c2a34
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2021 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include
"autosave.h"
#include
"autosave.h"
#include
"petrack.h"
#include
"petrack.h"
...
@@ -62,8 +82,6 @@ void Autosave::deleteAutosave()
...
@@ -62,8 +82,6 @@ void Autosave::deleteAutosave()
*/
*/
void
Autosave
::
loadAutosave
()
void
Autosave
::
loadAutosave
()
{
{
// TODO: Rename autosave to name from save and then load it?!?! Needs to have a different name than autosave, or
// does it?
auto
autosaveFiles
=
getAutosave
();
auto
autosaveFiles
=
getAutosave
();
if
(
autosaveFiles
.
empty
())
if
(
autosaveFiles
.
empty
())
{
{
...
@@ -156,6 +174,7 @@ void Autosave::savePet()
...
@@ -156,6 +174,7 @@ void Autosave::savePet()
mPetrack
.
saveProject
(
autosaveName
);
mPetrack
.
saveProject
(
autosaveName
);
mPetrack
.
setProFileName
(
proFileName
);
mPetrack
.
setProFileName
(
proFileName
);
// first save to temp file, so crash during saving doesn't corrupt old autosave
QString
finalAutosaveName
=
buildAutosaveName
(
projectName
,
".pet"
);
QString
finalAutosaveName
=
buildAutosaveName
(
projectName
,
".pet"
);
QFile
tempAutosave
{
autosaveName
};
QFile
tempAutosave
{
autosaveName
};
QFile
autosave
{
finalAutosaveName
};
QFile
autosave
{
finalAutosaveName
};
...
@@ -188,6 +207,7 @@ void Autosave::saveTrc()
...
@@ -188,6 +207,7 @@ void Autosave::saveTrc()
mPetrack
.
exportTracker
(
autosaveName
);
mPetrack
.
exportTracker
(
autosaveName
);
mPetrack
.
setTrackFileName
(
trackFileName
);
mPetrack
.
setTrackFileName
(
trackFileName
);
// first save to temp file, so crash during saving doesn't corrupt old autosave
QString
finalAutosaveName
=
buildAutosaveName
(
projectName
,
".trc"
);
QString
finalAutosaveName
=
buildAutosaveName
(
projectName
,
".trc"
);
QFile
tempAutosave
{
autosaveName
};
QFile
tempAutosave
{
autosaveName
};
QFile
autosave
{
finalAutosaveName
};
QFile
autosave
{
finalAutosaveName
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment