Private
Public Access
1
0

attaching workout to planned session

This commit is contained in:
Sander Roosendaal
2018-11-26 18:10:14 +01:00
parent 252e343d2a
commit 7e109ed7b4
5 changed files with 64 additions and 5 deletions

View File

@@ -610,6 +610,7 @@ def handle_calctrimp(id,
intensityfactor = normp/float(ftp)
tss = 100.*((duration*normp*intensityfactor)/(3600.*ftp))
if sex == 'male':
f = 1.92
else:
@@ -646,6 +647,24 @@ def handle_calctrimp(id,
if not np.isfinite(normw):
normw = 0
try:
dum = int(tss)
except ValueError:
tss = 0
try:
dum = int(normp)
except ValueError:
normp = 0
try:
dump = int(trimp)
except ValueError:
trimp = 0
try:
dump = int(hrtss)
except ValueError:
hrtss = 0
query = 'UPDATE rowers_workout SET rscore = {tss}, normp = {normp}, trimp={trimp}, hrtss={hrtss}, normv={normv}, normw={normw} WHERE id={id}'.format(
tss = int(tss),
normp = int(normp),