Private
Public Access
1
0

upgrading static plots with flexible HR zone names

This commit is contained in:
Sander Roosendaal
2021-01-26 08:11:24 +01:00
parent fdd7622af4
commit 1ea99a8101
3 changed files with 10 additions and 4 deletions

View File

@@ -2123,13 +2123,15 @@ def handle_makeplot(f1, f2, t, hrdata, plotnr, imagename,
hran = hrdata['hran'] hran = hrdata['hran']
ftp = hrdata['ftp'] ftp = hrdata['ftp']
powerzones = deserialize_list(hrdata['powerzones']) powerzones = deserialize_list(hrdata['powerzones'])
hrzones = deserialize_list(hrdata['hrzones'])
powerperc = np.array(deserialize_list(hrdata['powerperc'])).astype(float) powerperc = np.array(deserialize_list(hrdata['powerperc'])).astype(float)
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, ftp=ftp, powerperc=powerperc,
powerzones=powerzones) powerzones=powerzones,
hrzones=hrzones)
try: try:
row = rdata(csvfile=f2, rower=rr) row = rdata(csvfile=f2, rower=rr)
except IOError: except IOError:

View File

@@ -433,6 +433,7 @@ def make_plot(r,w,f1,f2,plottype,title,imagename='',plotnr=0):
'ftp':ftp, 'ftp':ftp,
'powerperc':serialize_list(powerperc), 'powerperc':serialize_list(powerperc),
'powerzones':serialize_list(r.powerzones), 'powerzones':serialize_list(r.powerzones),
'hrzones':serialize_list(r.hrzones),
} }
# make plot - asynchronous task # make plot - asynchronous task

View File

@@ -1290,7 +1290,8 @@ def remove_power_view(request,id=0):
rr = rrower(hrmax=r.max, hrut2=r.ut2, rr = rrower(hrmax=r.max, hrut2=r.ut2,
hrut1=r.ut1, hrat=r.at, hrut1=r.ut1, hrat=r.at,
hrtr=r.tr, hran=r.an, ftp=r.ftp, hrtr=r.tr, hran=r.an, ftp=r.ftp,
powerperc=powerperc, powerzones=r.powerzones) powerperc=powerperc, powerzones=r.powerzones,
hrzones=r.hrzones)
row = rdata(f,rower=rr) row = rdata(f,rower=rr)
row.df[' Power (watts)'] = 0 row.df[' Power (watts)'] = 0
row.write_csv(f) row.write_csv(f)
@@ -5837,7 +5838,8 @@ def workout_summary_restore_view(request,id,message="",successmessage=""):
rr = rrower(hrmax=r.max,hrut2=r.ut2, rr = rrower(hrmax=r.max,hrut2=r.ut2,
hrut1=r.ut1,hrat=r.at, hrut1=r.ut1,hrat=r.at,
hrtr=r.tr,hran=r.an,ftp=ftp, hrtr=r.tr,hran=r.an,ftp=ftp,
powerperc=powerperc,powerzones=r.powerzones) powerperc=powerperc,powerzones=r.powerzones,
hrzones=r.hrzones)
rowdata = rdata(f1,rower=rr) rowdata = rdata(f1,rower=rr)
if rowdata == 0: if rowdata == 0:
raise Http404("Error: CSV Data File Not Found") raise Http404("Error: CSV Data File Not Found")
@@ -6094,7 +6096,8 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
rr = rrower(hrmax=r.max,hrut2=r.ut2, rr = rrower(hrmax=r.max,hrut2=r.ut2,
hrut1=r.ut1,hrat=r.at, hrut1=r.ut1,hrat=r.at,
hrtr=r.tr,hran=r.an,ftp=ftp, hrtr=r.tr,hran=r.an,ftp=ftp,
powerperc=powerperc,powerzones=r.powerzones) powerperc=powerperc,powerzones=r.powerzones,
hrzones=r.hrzones)
rowdata = rdata(f1,rower=rr) rowdata = rdata(f1,rower=rr)
if rowdata == 0: if rowdata == 0:
return HttpResponse("Error: CSV Data File Not Found") return HttpResponse("Error: CSV Data File Not Found")