From 645e7e3c635fbb924dd384083f77fc44cc900335 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sat, 14 Jan 2017 09:30:00 +0100 Subject: [PATCH] set total distance and time to Concept2 data --- rowers/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rowers/views.py b/rowers/views.py index 548218b9..118fdcde 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -468,6 +468,14 @@ def add_workout_from_strokedata(user,importid,data,strokedata, totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min() totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)'] + # with Concept2 + if source=='c2': + try: + totaldist = data['distance'] + totaltime = data['time']/10. + except KeyError: + pass + hours = int(totaltime/3600.) minutes = int((totaltime - 3600.*hours)/60.)