Files
GoldenCheetah/src/FileIO/CsvRideFile.h
Alejandro Martinez 0b0f99889e Enable import of XDATA series from CSV files (#3179)
* Enable import of XDATA series from CSV files
Since XDATA series are preserved across merges this allows to add
arbitrary XDATA series to any activity.
Sample WEATHER file is included for testing.
Sample swim file is also included, once imported set Sport=Swim and use
Fix Lap Swim with pool length=25 to rebuild standard series and laps
Fixes #2010 item 4.

* FixLapSwim - Alternative way to store pauses in XData
Some devices s.t. Moov Now generates a CSV with REST field
after each length. FixLapSwim now can use this alternative
way to express pauses and to mark end of laps.
This is intended to be used together with XDATA csv import.
A Moov Now csv file modified to comply with our format is
added as an example to test folder.
2019-10-10 23:16:22 -03:00

42 lines
1.6 KiB
C

/*
* Copyright (c) 2007 Sean C. Rhea (srhea@srhea.net)
*
* 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 2 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, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CsvRideFile_h
#define _CsvRideFile_h
#include "GoldenCheetah.h"
#include "RideFile.h"
struct CsvFileReader : public RideFileReader {
enum csvtypes { generic, gc, powertap, joule, ergomo, motoactv, ibike, xtrain, moxy, freemotion, peripedal, cpexport, bsx, rowpro, wprime, wahooMA, rp3, opendata, xdata };
typedef enum csvtypes CsvType;
virtual RideFile *openRideFile(QFile &file, QStringList &errors, QList<RideFile*>* = 0) const;
// standard calling semantics - will write as powertap csv
bool writeRideFile(Context *context, const RideFile *ride, QFile &file) const
{ return writeRideFile(context, ride, file, powertap); }
// write but able to select format
bool writeRideFile(Context *context, const RideFile *ride, QFile &file, CsvType format) const;
bool hasWrite() const { return true; }
};
#endif // _CsvRideFile_h