Private
Public Access
1
0

playing with gauges

This commit is contained in:
Sander Roosendaal
2019-12-10 22:07:19 +01:00
parent db7c224beb
commit 557a7fa6e2
3 changed files with 136 additions and 46 deletions

View File

@@ -254,7 +254,7 @@ function copyText() {
// catchangle = ctch[Math.round(datatime)];
{% for id, metric in metrics.items %}
{{ id }}_now = {{ id }}_values[Math.round(datatime)];
// console.log(datatime,{{ id }}_now, "{{ metric.name }}")
// console.log(datatime,{{ id }},{{ id }}_now, "{{ metric.name }}")
{% endfor %}
@@ -374,11 +374,21 @@ function copyText() {
</span> {{ metric.unit }}
</li>
{% endfor %}
{% for group in metricsgroups %}
<li class="grid_2">
<div id="{{ group }}"></div>
</ul>
<ul class="main-content">
{% if 'basic' in metricsgroups %}
<li class="grid_1">
<div id="basic_spm"></div>
</li>
{% endfor %}
<li class="grid_1">
<div id="basic_boatspeed"></div>
</li>
{% endif %}
{% if 'forcepower' in metricsgroups %}
<li class="grid_1">
<div id="forcepower_power"></div>
</li>
{% endif %}
</ul>
</li>
<li class="grid_2">
@@ -394,6 +404,22 @@ function copyText() {
<script>
$(document).ready( function() {
// gauge settings
{% if workout.workouttype != 'water' %}
speedoptions.max = 7;
speedoptions.redTo = 7;
speedoptions.majorTicks = ['0','1','2','3','4','5','6','7'];
{% endif %}
{% if 'forcepower' in metricsgroups %}
poweroptions.max = {{ rower.pw_an|add:100|round100 }};
poweroptions.greenFrom = {{ rower.pw_ut2 }};
poweroptions.greenTo = {{ rower.pw_at }};
poweroptions.yellowFrom = {{ rower.pw_at }};
poweroptions.yellowTo = {{ rower.pw_an }};
poweroptions.redFrom = {{ rower.pw_an }};
poweroptions.redTo = {{ rower.pw_an|add:200|round100 }};
{% endif %}
// cookie reader
function createCookie(name,value,days) {
if (days) {