phystrax: rename CSV, heart_rate_data -> phystrax_hrm
parent
d9e51ddbde
commit
261776b3cb
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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"}]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue