aboutsummaryrefslogtreecommitdiff
path: root/foris/templates/javascript/i2c_collect/i2c_collect.js.tpl
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-08-15 17:57:25 +0200
committerKarel Kočí <karel.koci@nic.cz>2017-08-15 17:57:25 +0200
commit8e8481885d3134e8d994a30fd5254fc6d41df9ea (patch)
treefefb65fec9f438ee319d1c523ccb8e7417ee215b /foris/templates/javascript/i2c_collect/i2c_collect.js.tpl
parent137e9ac603fac87d42a9e383885827a4e769110d (diff)
downloadturris-ups-pfc8591-8e8481885d3134e8d994a30fd5254fc6d41df9ea.tar.gz
turris-ups-pfc8591-8e8481885d3134e8d994a30fd5254fc6d41df9ea.tar.bz2
turris-ups-pfc8591-8e8481885d3134e8d994a30fd5254fc6d41df9ea.zip
Rename from i2c-collect to more suitable ups-pfc8591v0.2
Diffstat (limited to 'foris/templates/javascript/i2c_collect/i2c_collect.js.tpl')
-rw-r--r--foris/templates/javascript/i2c_collect/i2c_collect.js.tpl78
1 files changed, 0 insertions, 78 deletions
diff --git a/foris/templates/javascript/i2c_collect/i2c_collect.js.tpl b/foris/templates/javascript/i2c_collect/i2c_collect.js.tpl
deleted file mode 100644
index 0ca8108..0000000
--- a/foris/templates/javascript/i2c_collect/i2c_collect.js.tpl
+++ /dev/null
@@ -1,78 +0,0 @@
-function graph_init(field) {
- var graph_config = {
- type: 'line',
- data: {
- labels: graph_labels[field],
- datasets: [
- {
- label: field,
- data: graph_data[field],
- },
- ],
- fill: false,
- steppedLine: false,
- },
- options: {
- responsive: true,
- title: {
- display:true,
- text:'{{ trans("Sample") }}'
- },
- tooltips: {
- mode: 'index',
- intersect: false,
- },
- hover: {
- mode: 'nearest',
- intersect: true
- },
- scales: {
- xAxes: [{
- display: true,
- scaleLabel: {
- display: true,
- labelString: '{{ trans("Time") }}'
- }
- }],
- yAxes: [{
- display: true,
- scaleLabel: {
- display: true,
- labelString: '{{ trans("Value") }}'
- }
- }],
- },
- },
- };
- if (field == "voltage") {
- graph_config.options.scales.yAxes[0].ticks = { min: 10, max: 15 }
- } else if (field == "light" || field == "temperature") {
- graph_config.options.scales.yAxes[0].ticks = { min: 0, max: 250 }
- } else if (field == "light" || field == "temperature") {
- graph_config.options.scales.yAxes[0].ticks = { min: 0, max: 100 }
- }
- var graph_ctx = document.getElementById("canvas-" + field).getContext("2d");
- Foris.lineChart[field] = new Chart(graph_ctx, graph_config);
- Foris.lineChartData[field] = graph_config.data;
-}
-
-$(document).ready(function() {
- Foris.lineChart = [];
- Foris.lineChartData = [];
- graph_init("voltage");
- graph_init("light");
- graph_init("temperature");
- graph_init("trimmer");
-});
-
-/*
-Foris.WS["i2c-collect"] = function (data) {
- for (d in data) {
- Foris.lineChartData[d].datasets[0].data.push(data[d][0]);
- Foris.lineChartData[d].datasets[0].data.shift();
- Foris.lineChartData[d].labels.push(data[d][1]);
- Foris.lineChartData[d].labels.shift();
- Foris.lineChart[d].update();
- }
-};
-*/