Added ScriptContext for Python APIs called from DataFilter scripts

Carry RideItem, Specification and Metrics to consider the cases when
the script is part of a UserMetric or an LTMPlot formula
Python series, activityWbal and activityXdata honor RideItem and Specification
Python activityMetrics honors ScriptContext RideItem and Metrics
Python activityMeanMax honors ScriptContext RideItem
Force recomputation of metrics just in case Python Scripts were used before
This commit is contained in:
Ale Martinez
2018-04-08 10:51:26 -03:00
parent 1d4fd41404
commit 698ea4eb0b
10 changed files with 173 additions and 118 deletions

View File

@@ -287,7 +287,7 @@ PythonEmbed::PythonEmbed(const bool verbose, const bool interactive) : verbose(v
}
// run on called thread
void PythonEmbed::runline(Context *context, QString line)
void PythonEmbed::runline(ScriptContext scriptContext, QString line)
{
PyGILState_STATE gstate;
gstate = PyGILState_Ensure();
@@ -301,7 +301,7 @@ void PythonEmbed::runline(Context *context, QString line)
Py_DECREF(ident);
// add to the thread/context map
contexts.insert(threadid, context);
contexts.insert(threadid, scriptContext);
// run and generate errors etc
messages.clear();