From b41f4c77de69c2674296ff193f77f4cb7b73773a Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 29 Aug 2018 09:55:02 +0200 Subject: [PATCH] bike erg export to C2 --- rowers/c2stuff.py | 3 +++ rowers/templates/document_form.html | 1 + rowers/templates/manualadd.html | 1 + rowers/templates/workout_form.html | 1 + 4 files changed, 6 insertions(+) diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index bcec60b4..7ecea39e 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -394,6 +394,8 @@ def createc2workoutdata(w): d[0] = d[1] p = abs(10*row.df.ix[:,' Stroke500mPace (sec/500m)'].values) p = np.clip(p,0,3600) + if w.workouttype == 'bike': + p = 2.0*p t = t.astype(int) d = d.astype(int) p = p.astype(int) @@ -834,6 +836,7 @@ def add_workout_from_data(user,importid,data,strokedata, velo = 500./pace if workouttype == 'bike': velo = 1000./pace + pace = 500./velo power = 2.8*velo**3 diff --git a/rowers/templates/document_form.html b/rowers/templates/document_form.html index 67e38300..ab8a59f3 100644 --- a/rowers/templates/document_form.html +++ b/rowers/templates/document_form.html @@ -87,6 +87,7 @@ $( document ).ready(function() { || $(this).val() == 'dynamic' || $(this).val() == 'slides' || $(this).val() == 'paddle' + || $(this).val() == 'bike' || $(this).val() == 'snow' ) { $('#id_boattype').toggle(false); diff --git a/rowers/templates/manualadd.html b/rowers/templates/manualadd.html index b5dff315..ef7ecc78 100644 --- a/rowers/templates/manualadd.html +++ b/rowers/templates/manualadd.html @@ -21,6 +21,7 @@ $( document ).ready(function() { || $(this).val() == 'dynamic' || $(this).val() == 'slides' || $(this).val() == 'paddle' + || $(this).val() == 'bike' || $(this).val() == 'snow' ) { $('#id_boattype').toggle(false); diff --git a/rowers/templates/workout_form.html b/rowers/templates/workout_form.html index fcd4b1d7..9cdb027c 100644 --- a/rowers/templates/workout_form.html +++ b/rowers/templates/workout_form.html @@ -29,6 +29,7 @@ $( document ).ready(function() { || $(this).val() == 'slides' || $(this).val() == 'paddle' || $(this).val() == 'snow' + || $(this).val() == 'bike' ) { $('#id_boattype').toggle(false); $('#id_boattype').val('1x');