Private
Public Access
1
0

goede veranderingen

This commit is contained in:
Sander Roosendaal
2019-12-02 21:44:15 +01:00
parent 05d8218175
commit b9fd31d679

View File

@@ -160,7 +160,7 @@
if (lock.checked) {
sliderpos = Math.round(videotime) + Math.round(delay);
slider.value = sliderpos;
}
}
// gauge.set(catch_now);
@@ -179,10 +179,48 @@
var lock = document.getElementById("lock");
videotime = player.getCurrentTime();
var delay = document.getElementById("id_delay").value;
var output = document.getElementById("id_delay");
datatime = slider.value;
if (lock.checked) {
sliderpos = Math.round(videotime) + Math.round(delay);
slider.value = sliderpos;
// Setting Data
// velo = boatspeed[Math.round(datatime)];
lat = latitude[Math.round(datatime)];
lon = longitude[Math.round(datatime)];
// strokerate = spm[Math.round(datatime)];
// 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 }}")
{% endfor %}
document.getElementById("time").innerHTML = Math.round(videotime);
document.getElementById("datatime").innerHTML = Math.round(datatime);
// document.getElementById("speed").innerHTML = velo;
// document.getElementById("spm").innerHTML = strokerate;
// document.getElementById("catch").innerHTML = catchangle;
{% for id, metric in metrics.items %}
document.getElementById("{{ id }}").innerHTML = {{ id }}_now;
document.getElementById("{{ id }}").className = 'bold';
{% endfor %}
{% for group in metricsgroups %}
try {
set_{{ group }}();
} catch (e) {}
{% endfor %}
try {
var newLatLng = new L.LatLng(lat, lon);
// console.log(newLatLng);
marker.setLatLng(newLatLng);
} catch (e) {
}
} else {
output.value = Math.round(datatime)-Math.round(videotime);
}
}
function stopVideo() {
@@ -292,9 +330,12 @@
// Update the current slider value (each time you drag the slider handle)
slider.oninput = function() {
clearInterval(timeupdater)
var datatime = this.value
var videotime = Math.round(player.getCurrentTime());
if (lock.checked) {
if (this.value-output.value > 0) {
player.seekTo(this.value-output.value);
videotime = this.value-output.value;
} else {
if (playing) {
player.seekTo(0);
@@ -306,12 +347,10 @@
}
}
} else {
console.log('changing, not checked');
// console.log('changing, not checked');
output.value = this.value-Math.round(player.getCurrentTime());
}
var datatime = this.value
var videotime = Math.round(player.getCurrentTime());
//
// Setting Data
// velo = boatspeed[Math.round(datatime)];
lat = latitude[Math.round(datatime)];
@@ -342,9 +381,7 @@
// console.log(newLatLng);
marker.setLatLng(newLatLng);
} catch (e) {
console.log('error')
}
console.log('changed all')
timeupdater = setInterval(updateTime, 1000);
}