mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
модуль логгирования, начало
This commit is contained in:
32
src/Main.cpp
32
src/Main.cpp
@@ -132,20 +132,20 @@ void loop() {
|
||||
handleEvent();
|
||||
|
||||
// сохраняем значения IoTItems в файл каждую секунду, если были изменения (установлены маркеры на сохранение)
|
||||
currentMillis = millis();
|
||||
if (currentMillis - prevMillis >= 1000) {
|
||||
prevMillis = millis();
|
||||
volStrForSave = "";
|
||||
for (std::list<IoTItem *>::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) {
|
||||
if ((*it)->needSave) {
|
||||
(*it)->needSave = false;
|
||||
volStrForSave = volStrForSave + (*it)->getID() + "=" + (*it)->getValue() + ";";
|
||||
}
|
||||
}
|
||||
|
||||
if (volStrForSave != "") {
|
||||
Serial.print("volStrForSave: ");
|
||||
Serial.println(volStrForSave.c_str());
|
||||
}
|
||||
}
|
||||
// currentMillis = millis();
|
||||
// if (currentMillis - prevMillis >= 1000) {
|
||||
// prevMillis = millis();
|
||||
// volStrForSave = "";
|
||||
// for (std::list<IoTItem *>::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) {
|
||||
// if ((*it)->needSave) {
|
||||
// (*it)->needSave = false;
|
||||
// volStrForSave = volStrForSave + (*it)->getID() + "=" + (*it)->getValue() + ";";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (volStrForSave != "") {
|
||||
// Serial.print("volStrForSave: ");
|
||||
// Serial.println(volStrForSave.c_str());
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user