phystrax: rename CSV, heart_rate_data -> phystrax_hrm

master
Rob Pilling 2024-04-22 20:48:43 +01:00
parent d9e51ddbde
commit 261776b3cb
3 changed files with 7 additions and 7 deletions

View File

@ -46,7 +46,7 @@ function handleHeartRate(hrm) {
// Calculate and add SDNN (standard deviation of NN intervals) to the last log entry // Calculate and add SDNN (standard deviation of NN intervals) to the last log entry
logData[logData.length - 1].hrv = calcSDNN(); logData[logData.length - 1].hrv = calcSDNN();
drawScreen(); drawScreen();
} }
} }
@ -129,7 +129,7 @@ function drawScreen(message) {
} }
function saveDataToCSV() { function saveDataToCSV() {
let fileName = "heart_rate_data.csv"; let fileName = "phystrax_hrm.csv";
let file = require("Storage").open(fileName, "a"); // Open the file for appending let file = require("Storage").open(fileName, "a"); // Open the file for appending
// Check if the file is empty (i.e., newly created) // Check if the file is empty (i.e., newly created)

View File

@ -17,7 +17,7 @@ function getData() {
Util.showModal("Loading..."); Util.showModal("Loading...");
// get the data // get the data
dataElement.innerHTML = ""; dataElement.innerHTML = "";
Util.readStorageFile(`heart_rate_data.csv`,data=>{ Util.readStorageFile(`phystrax_hrm.csv`,data=>{
csvData = data.trim(); csvData = data.trim();
// remove window // remove window
Util.hideModal(); Util.hideModal();
@ -45,12 +45,12 @@ function getData() {
// You can call a utility function to save the data // You can call a utility function to save the data
document.getElementById("btnSave").addEventListener("click", function() { document.getElementById("btnSave").addEventListener("click", function() {
Util.saveCSV("heart_rate_data.csv", csvData); Util.saveCSV("phystrax_hrm.csv", csvData);
}); });
// Or you can also delete the file // Or you can also delete the file
document.getElementById("btnDelete").addEventListener("click", function() { document.getElementById("btnDelete").addEventListener("click", function() {
Util.showModal("Deleting..."); Util.showModal("Deleting...");
Util.eraseStorageFile("heart_rate_data.csv", function() { Util.eraseStorageFile("phystrax_hrm.csv", function() {
Util.hideModal(); Util.hideModal();
getData(); getData();
}); });

View File

@ -12,5 +12,5 @@
{"name":"phystrax.app.js","url":"app.js"}, {"name":"phystrax.app.js","url":"app.js"},
{"name":"phystrax.img","url":"app-icon.js","evaluate":true} {"name":"phystrax.img","url":"app-icon.js","evaluate":true}
], ],
"data": [{"wildcard":"phystrax_hrm.?.csv"}] "data": [{"name":"phystrax_hrm.csv"}]
} }