Private
Public Access
1
0

plans dedicated to rowers if possible

This commit is contained in:
Sander Roosendaal
2021-05-03 15:32:50 +02:00
parent f7a585adb9
commit 04cfc2d915
3 changed files with 51 additions and 20 deletions

View File

@@ -599,13 +599,11 @@ def step_to_time_dist(step,avgspeed = 3.2,ftp=200,ftspm=25,ftv=3.7):
except KeyError: # pragma: no cover
targettype = 0
if durationtype == 'Time':
value = step['durationValue']
seconds = value/1000.
distance = avgspeed*seconds
rscore = 60.*seconds/3600.
if targettype == 'Speed':
value = step.get('targetValue',0)
@@ -663,6 +661,7 @@ def step_to_time_dist(step,avgspeed = 3.2,ftp=200,ftspm=25,ftv=3.7):
value = step['durationValue']
distance = value/100.
seconds = distance/avgspeed
rscore = 60*seconds/3600.
if targettype == 'Speed':
value = step.get('targetValue',0)
@@ -779,13 +778,19 @@ def ps_dict_order_dict(d,short=False):
return sdict2
def ps_dict_order(d,short=False):
def ps_dict_order(d,short=False,rower=None):
sdict = collections.OrderedDict({})
steps = d['steps']
ftp = 200
if rower is not None:
ftp = rower.ftp
# ftv = rower.ftv
# ftspm = rower.ftspm
for step in steps:
sstring, type, stepID, repeatID, repeatValue = step_to_string(step,short=short)
seconds, meters,rscore = step_to_time_dist(step)
seconds, meters,rscore = step_to_time_dist(step,ftp=ftp)
sdict[stepID] = {
'string':sstring,