Private
Public Access
1
0

add FTP and power to makeplot

This commit is contained in:
Sander Roosendaal
2017-01-25 21:24:36 +01:00
parent c8ad85868e
commit 3cec874a84
2 changed files with 84 additions and 10 deletions

View File

@@ -177,11 +177,15 @@ def handle_makeplot(f1,f2,t,hrdata,plotnr,imagename):
hrat = hrdata['hrat'] hrat = hrdata['hrat']
hrtr = hrdata['hrtr'] hrtr = hrdata['hrtr']
hran = hrdata['hran'] hran = hrdata['hran']
ftp = hrdata['ftp']
powerzones = hrdata['powerzones']
powerperc = hrdata['powerperc']
rr = rowingdata.rower(hrmax=hrmax,hrut2=hrut2, rr = rowingdata.rower(hrmax=hrmax,hrut2=hrut2,
hrut1=hrut1,hrat=hrat, hrut1=hrut1,hrat=hrat,
hrtr=hrtr,hran=hran) hrtr=hrtr,hran=hran,
ftp=ftp,powerperc=powerperc,
powerzones=powerzones)
try: try:
row = rdata(f2,rower=rr) row = rdata(f2,rower=rr)
except IOError: except IOError:

View File

@@ -3135,6 +3135,12 @@ def workout_add_otw_powerplot_view(request,id):
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
r = Rower.objects.get(user=u) r = Rower.objects.get(user=u)
powerperc = 100*np.array([r.pw_ut2,
r.pw_ut1,
r.pw_at,
r.pw_tr,r.pw_an])/r.ftp
hrpwrdata = { hrpwrdata = {
'hrmax':r.max, 'hrmax':r.max,
'hrut2':r.ut2, 'hrut2':r.ut2,
@@ -3143,6 +3149,8 @@ def workout_add_otw_powerplot_view(request,id):
'hrtr':r.tr, 'hrtr':r.tr,
'hran':r.an, 'hran':r.an,
'ftp':r.ftp, 'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
} }
# make plot - asynchronous task # make plot - asynchronous task
@@ -3180,6 +3188,13 @@ def workout_add_piechart_view(request,id):
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
r = Rower.objects.get(user=u) r = Rower.objects.get(user=u)
powerperc = 100*np.array([r.pw_ut2,
r.pw_ut1,
r.pw_at,
r.pw_tr,r.pw_an])/r.ftp
hrpwrdata = { hrpwrdata = {
'hrmax':r.max, 'hrmax':r.max,
'hrut2':r.ut2, 'hrut2':r.ut2,
@@ -3188,6 +3203,8 @@ def workout_add_piechart_view(request,id):
'hrtr':r.tr, 'hrtr':r.tr,
'hran':r.an, 'hran':r.an,
'ftp':r.ftp, 'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
} }
# make plot - asynchronous task # make plot - asynchronous task
@@ -3225,6 +3242,13 @@ def workout_add_power_piechart_view(request,id):
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
r = Rower.objects.get(user=u) r = Rower.objects.get(user=u)
powerperc = 100*np.array([r.pw_ut2,
r.pw_ut1,
r.pw_at,
r.pw_tr,r.pw_an])/r.ftp
hrpwrdata = { hrpwrdata = {
'hrmax':r.max, 'hrmax':r.max,
'hrut2':r.ut2, 'hrut2':r.ut2,
@@ -3233,6 +3257,8 @@ def workout_add_power_piechart_view(request,id):
'hrtr':r.tr, 'hrtr':r.tr,
'hran':r.an, 'hran':r.an,
'ftp':r.ftp, 'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
} }
# make plot - asynchronous task # make plot - asynchronous task
@@ -3268,6 +3294,12 @@ def workout_add_timeplot_view(request,id):
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
r = Rower.objects.get(user=u) r = Rower.objects.get(user=u)
powerperc = 100*np.array([r.pw_ut2,
r.pw_ut1,
r.pw_at,
r.pw_tr,r.pw_an])/r.ftp
hrpwrdata = { hrpwrdata = {
'hrmax':r.max, 'hrmax':r.max,
'hrut2':r.ut2, 'hrut2':r.ut2,
@@ -3276,6 +3308,8 @@ def workout_add_timeplot_view(request,id):
'hrtr':r.tr, 'hrtr':r.tr,
'hran':r.an, 'hran':r.an,
'ftp':r.ftp, 'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
} }
# make plot - asynchronous task # make plot - asynchronous task
@@ -3313,6 +3347,12 @@ def workout_add_distanceplot_view(request,id):
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
r = Rower.objects.get(user=u) r = Rower.objects.get(user=u)
powerperc = 100*np.array([r.pw_ut2,
r.pw_ut1,
r.pw_at,
r.pw_tr,r.pw_an])/r.ftp
hrpwrdata = { hrpwrdata = {
'hrmax':r.max, 'hrmax':r.max,
'hrut2':r.ut2, 'hrut2':r.ut2,
@@ -3321,6 +3361,8 @@ def workout_add_distanceplot_view(request,id):
'hrtr':r.tr, 'hrtr':r.tr,
'hran':r.an, 'hran':r.an,
'ftp':r.ftp, 'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
} }
# make plot - asynchronous task # make plot - asynchronous task
@@ -3356,6 +3398,12 @@ def workout_add_distanceplot2_view(request,id):
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
r = Rower.objects.get(user=u) r = Rower.objects.get(user=u)
powerperc = 100*np.array([r.pw_ut2,
r.pw_ut1,
r.pw_at,
r.pw_tr,r.pw_an])/r.ftp
hrpwrdata = { hrpwrdata = {
'hrmax':r.max, 'hrmax':r.max,
'hrut2':r.ut2, 'hrut2':r.ut2,
@@ -3363,6 +3411,9 @@ def workout_add_distanceplot2_view(request,id):
'hrat':r.at, 'hrat':r.at,
'hrtr':r.tr, 'hrtr':r.tr,
'hran':r.an, 'hran':r.an,
'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
} }
# make plot - asynchronous task # make plot - asynchronous task
@@ -3400,6 +3451,12 @@ def workout_add_timeplot2_view(request,id):
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
r = Rower.objects.get(user=u) r = Rower.objects.get(user=u)
powerperc = 100*np.array([r.pw_ut2,
r.pw_ut1,
r.pw_at,
r.pw_tr,r.pw_an])/r.ftp
hrpwrdata = { hrpwrdata = {
'hrmax':r.max, 'hrmax':r.max,
'hrut2':r.ut2, 'hrut2':r.ut2,
@@ -3407,6 +3464,9 @@ def workout_add_timeplot2_view(request,id):
'hrat':r.at, 'hrat':r.at,
'hrtr':r.tr, 'hrtr':r.tr,
'hran':r.an, 'hran':r.an,
'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
} }
# make plot - asynchronous task # make plot - asynchronous task
@@ -3956,14 +4016,24 @@ def workout_upload_view(request,message=""):
imagename = f1[:-4]+'.png' imagename = f1[:-4]+'.png'
fullpathimagename = 'static/plots/'+imagename fullpathimagename = 'static/plots/'+imagename
u = request.user u = request.user
hrpwrdata = { r = Rower.objects.get(user=request.user)
'hrmax':r.max, powerperc = 100*np.array([r.pw_ut2,
'hrut2':r.ut2, r.pw_ut1,
'hrut1':r.ut1, r.pw_at,
'hrat':r.at, r.pw_tr,r.pw_an])/r.ftp
'hrtr':r.tr,
'hran':r.an,
} hrpwrdata = {
'hrmax':r.max,
'hrut2':r.ut2,
'hrut1':r.ut1,
'hrat':r.at,
'hrtr':r.tr,
'hran':r.an,
'ftp':r.ftp,
'powerperc':powerperc,
'powerzones':r.powerzones,
}
# make plot - asynchronous task # make plot - asynchronous task
plotnrs = { plotnrs = {