bug fix duration sporttracks sync
This commit is contained in:
@@ -191,6 +191,10 @@ def createsporttracksworkoutdata(w):
|
|||||||
|
|
||||||
averagehr = int(row.df[' HRCur (bpm)'].mean())
|
averagehr = int(row.df[' HRCur (bpm)'].mean())
|
||||||
maxhr = int(row.df[' HRCur (bpm)'].max())
|
maxhr = int(row.df[' HRCur (bpm)'].max())
|
||||||
|
duration = w.duration.hour*3600
|
||||||
|
duration += w.duration.minute*60
|
||||||
|
duration += w.duration.second
|
||||||
|
duration += +1.0e-6*w.duration.microsecond
|
||||||
|
|
||||||
# adding diff, trying to see if this is valid
|
# adding diff, trying to see if this is valid
|
||||||
#t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
|
#t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
|
||||||
@@ -250,7 +254,7 @@ def createsporttracksworkoutdata(w):
|
|||||||
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
||||||
"start_time": w.startdatetime.isoformat(),
|
"start_time": w.startdatetime.isoformat(),
|
||||||
"total_distance": int(w.distance),
|
"total_distance": int(w.distance),
|
||||||
"duration": int(max(t)),
|
"duration": duration,
|
||||||
"notes": w.notes,
|
"notes": w.notes,
|
||||||
"avg_heartrate": averagehr,
|
"avg_heartrate": averagehr,
|
||||||
"max_heartrate": maxhr,
|
"max_heartrate": maxhr,
|
||||||
@@ -266,7 +270,7 @@ def createsporttracksworkoutdata(w):
|
|||||||
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
||||||
"start_time": w.startdatetime.isoformat(),
|
"start_time": w.startdatetime.isoformat(),
|
||||||
"total_distance": int(w.distance),
|
"total_distance": int(w.distance),
|
||||||
"duration": int(max(t)),
|
"duration": duration,
|
||||||
"notes": w.notes,
|
"notes": w.notes,
|
||||||
"avg_heartrate": averagehr,
|
"avg_heartrate": averagehr,
|
||||||
"max_heartrate": maxhr,
|
"max_heartrate": maxhr,
|
||||||
|
|||||||
Reference in New Issue
Block a user