small improvements HR gauge
This commit is contained in:
@@ -462,7 +462,7 @@ function copyText() {
|
||||
hroptions.yellowTo = {{ rower.an }}
|
||||
hroptions.redFrom = {{ rower.an }}
|
||||
hroptions.redTo = {{ rower.max }}
|
||||
hroptions.majorTicks = {{ rower.max|round20|majorticks }}
|
||||
hroptions.majorTicks = {{ rower.max|round20|hrmajorticks:rower.rest }}
|
||||
hr_now = hr_values[0];
|
||||
set_athlete();
|
||||
{% endif %}
|
||||
|
||||
@@ -142,6 +142,16 @@ def majorticks(maxval):
|
||||
|
||||
return newticks
|
||||
|
||||
@register.filter
|
||||
def hrmajorticks(maxval,minval):
|
||||
ticks = range(int((maxval-minval)/20.)-1)
|
||||
newticks =[]
|
||||
for t in ticks:
|
||||
newticks.append(100+t*20)
|
||||
|
||||
print(newticks)
|
||||
return newticks
|
||||
|
||||
def strfdeltah(tdelta):
|
||||
hours, rest = divmod(tdelta.seconds,3600)
|
||||
minutes,seconds = divmod(rest,60)
|
||||
|
||||
Reference in New Issue
Block a user