mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 00:49:55 +00:00
Ride editor and tools
A new tab 'Editor' for manually editing ride file data points and associated menu options under 'Tools' for fixing spikes, gaps, GPS errors and adjusting torque values. A revert to saved ride option is also included to 'undo' all changes. The ride editor supports undo/redo as well as cut and paste and "paste special" (to append points or swap columns/overwrite selected data series). The editor also supports search and will automatically highlight anomalous data. When a file is saved, the changes are recorded in a new metadata special field called "Change History" which can be added as a Textbox in the metadata config. The data processors can be run manually or automatically when a ride is opened - these are configured on the ride data tab in the config pane. Significant changes have been introduced in the codebase, the most significant of which are; a RideFileCommand class for modifying ride data has been introduced (as a member of RideFile) and the RideItem class is now a QObject as well as QTreeWidgetItem to enable signalling. The Ride Editor uses a RideFileTableModel that can be re-used in other parts of the code. LTMoutliers class has been introduced in support of anomaly detection in the editor (which highlights anomalies with a wiggly red line). Fixes #103.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "GcRideFile.h"
|
||||
#include "RideItem.h"
|
||||
#include "RideFile.h"
|
||||
#include "RideFileCommand.h"
|
||||
#include "Settings.h"
|
||||
#include "SaveDialogs.h"
|
||||
|
||||
@@ -175,6 +176,13 @@ MainWindow::saveSilent(RideItem *rideItem)
|
||||
savedFile.setFileName(currentFile.fileName());
|
||||
}
|
||||
|
||||
// update the change history
|
||||
QString log = rideItem->ride()->getTag("Change History", "");
|
||||
log += tr("Changes on ");
|
||||
log += QDateTime::currentDateTime().toString() + ":";
|
||||
log += '\n' + rideItem->ride()->command->changeLog();
|
||||
rideItem->ride()->setTag("Change History", log);
|
||||
|
||||
// save in GC format
|
||||
GcFileReader reader;
|
||||
reader.writeRideFile(rideItem->ride(), savedFile);
|
||||
@@ -190,7 +198,7 @@ MainWindow::saveSilent(RideItem *rideItem)
|
||||
}
|
||||
|
||||
// mark clean as we have now saved the data
|
||||
rideItem->setDirty(false);
|
||||
rideItem->ride()->emitSaved();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user