mirror of https://github.com/espruino/BangleApps
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
|
||||
logData[logData.length - 1].hrv = calcSDNN();
|
||||
drawScreen();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ function drawScreen(message) {
|
|||
}
|
||||
|
||||
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
|
||||
|
||||
// Check if the file is empty (i.e., newly created)
|
||||
|
|
|
@ -17,7 +17,7 @@ function getData() {
|
|||
Util.showModal("Loading...");
|
||||
// get the data
|
||||
dataElement.innerHTML = "";
|
||||
Util.readStorageFile(`heart_rate_data.csv`,data=>{
|
||||
Util.readStorageFile(`phystrax_hrm.csv`,data=>{
|
||||
csvData = data.trim();
|
||||
// remove window
|
||||
Util.hideModal();
|
||||
|
@ -45,12 +45,12 @@ function getData() {
|
|||
|
||||
// You can call a utility function to save the data
|
||||
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
|
||||
document.getElementById("btnDelete").addEventListener("click", function() {
|
||||
Util.showModal("Deleting...");
|
||||
Util.eraseStorageFile("heart_rate_data.csv", function() {
|
||||
Util.eraseStorageFile("phystrax_hrm.csv", function() {
|
||||
Util.hideModal();
|
||||
getData();
|
||||
});
|
||||
|
|
|
@ -12,5 +12,5 @@
|
|||
{"name":"phystrax.app.js","url":"app.js"},
|
||||
{"name":"phystrax.img","url":"app-icon.js","evaluate":true}
|
||||
],
|
||||
"data": [{"wildcard":"phystrax_hrm.?.csv"}]
|
||||
}
|
||||
"data": [{"name":"phystrax_hrm.csv"}]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue