From efd4c7699739c72f59e58ea6149956d1d00b9880 Mon Sep 17 00:00:00 2001 From: huskee Date: Tue, 19 Dec 2023 22:28:33 +0200 Subject: [PATCH] Add labels to each channel --- data/index.html | 4 +++- data/script.js | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/data/index.html b/data/index.html index 5c733df..28d8088 100644 --- a/data/index.html +++ b/data/index.html @@ -28,12 +28,14 @@ diff --git a/data/script.js b/data/script.js index 7192c41..c7a8513 100644 --- a/data/script.js +++ b/data/script.js @@ -5,7 +5,8 @@ document.getElementById("stopRec").disabled = true; let data; let record = 0; let filename; -const csvData = ["time, tempA, tempB"]; +let csvData; +let labelA, labelB; const chartAdata = { data: { labels: [], @@ -250,6 +251,9 @@ function startRecording() { date = new Date(); let filedate = date.toISOString().slice(0, -5).replaceAll(":", ""); filename = "therminator-" + filedate + ".csv"; + labelA = document.getElementById("labelA").value; + labelB = document.getElementById("labelB").value; + csvData = ["time,\"" + labelA + "\",\"" + labelB + "\""] record = 1; document.getElementById("startRec").disabled = true; document.getElementById("stopRec").disabled = false;
-

Channel A:

+

Channel A:

+

Channel B:

+