forked from guilherme-daros/telemetry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateFunctions.js
36 lines (33 loc) · 1.25 KB
/
updateFunctions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function updateCGraph() {
interface.cGraph.data.labels.push(0);
interface.cGraph.data.datasets[0].data.push(boatBattery.cPack);
if (interface.cGraph.data.datasets[0].data.length > 100) {
interface.cGraph.data.datasets[0].data[0] =
interface.cGraph.data.datasets[0].data[1];
interface.cGraph.data.datasets[0].data.splice(1, 1);
interface.cGraph.data.labels.shift();
}
interface.cGraph.update();
}
function updateVGraph() {
interface.vGraph.data.labels.push(0);
interface.vGraph.data.datasets[0].data.push(boatBattery.vPack);
if (interface.vGraph.data.datasets[0].data.length > 100) {
interface.vGraph.data.datasets[0].data[0] =
interface.vGraph.data.datasets[0].data[1];
interface.vGraph.data.datasets[0].data.splice(1, 1);
interface.vGraph.data.labels.shift();
}
interface.vGraph.update();
}
function updateTGraph() {
interface.tGraph.data.labels.push(0);
interface.tGraph.data.datasets[0].data.push(boatBattery.tPack);
if (interface.tGraph.data.datasets[0].data.length > 100) {
interface.tGraph.data.datasets[0].data[0] =
interface.tGraph.data.datasets[0].data[1];
interface.tGraph.data.datasets[0].data.splice(1, 1);
interface.tGraph.data.labels.shift();
}
interface.tGraph.update();
}