Files
GoldenCheetah/src/FileIO/FixPyRunner.h
Alejandro Martinez 67136b3cdf Enable Python DPs use Metadata in automatic mode (#4336)
Data Processors running on import are applied before the activity
is added to RideCache and metrics are computed, this behavior is
by design, likely to optimize resource usage on bulk import.
So activityMetrics API is not available; a new getTag API was
added for this case and setTag/delTag/hasTag changed to work
in this context too.
When the Python fix is executed on activities already in the cache
either via Edit menu, Filters or other Python Fix changes are
notified via the corresponding RideItem.
Fixes #4095
[publish binaries]
2023-03-05 16:26:25 -03:00

36 lines
689 B
C++

#ifndef FIXPYRUNNER_H
#define FIXPYRUNNER_H
#include <QObject>
#include <QString>
#include "FixPyScript.h"
#include "Context.h"
struct FixPyRunParams
{
Context *context;
RideFile *rideFile;
RideItem *rideItem;
QString script;
};
class FixPyRunner : public QObject
{
Q_OBJECT
public:
FixPyRunner(Context *context = nullptr, RideFile *rideFile = nullptr, RideItem *rideItem = nullptr, bool useNewThread = true);
int run(QString source, QString scriptKey, QString &errText);
static void execScript(FixPyRunParams *params);
private:
Context *context;
RideFile *rideFile;
RideItem *rideItem;
bool useNewThread;
};
#endif // FIXPYRUNNER_H