mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
добавил смену даты во всех графиках при смене даты
This commit is contained in:
@@ -21,7 +21,7 @@ class Loging : public IoTItem {
|
||||
IoTItem *dateIoTItem;
|
||||
|
||||
String prevDate = "";
|
||||
bool firstTimeDate = true;
|
||||
bool firstTimeInit = true;
|
||||
|
||||
long interval;
|
||||
|
||||
@@ -188,12 +188,10 @@ class Loging : public IoTItem {
|
||||
bool hasDayChanged() {
|
||||
bool changed = false;
|
||||
String currentDate = getTodayDateDotFormated();
|
||||
if (!firstTimeDate) {
|
||||
if (!firstTimeInit) {
|
||||
if (prevDate != currentDate) {
|
||||
changed = true;
|
||||
SerialPrint("i", F("NTP"), "Change day event");
|
||||
//установим дату на изменившуюся при смене суток
|
||||
dateIoTItem->setTodayDate();
|
||||
SerialPrint("i", F("NTP"), F("Change day event"));
|
||||
#if defined(ESP8266)
|
||||
FileFS.gc();
|
||||
#endif
|
||||
@@ -201,7 +199,7 @@ class Loging : public IoTItem {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
firstTimeDate = false;
|
||||
firstTimeInit = false;
|
||||
prevDate = currentDate;
|
||||
return changed;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class LogingDaily : public IoTItem {
|
||||
IoTItem *dateIoTItem;
|
||||
|
||||
String prevDate = "";
|
||||
bool firstTimeDate = true;
|
||||
bool firstTimeInit = true;
|
||||
|
||||
long interval;
|
||||
|
||||
@@ -138,7 +138,7 @@ class LogingDaily : public IoTItem {
|
||||
bool hasDayChanged() {
|
||||
bool changed = false;
|
||||
String currentDate = getTodayDateDotFormated();
|
||||
if (!firstTimeDate) {
|
||||
if (!firstTimeInit) {
|
||||
if (prevDate != currentDate) {
|
||||
changed = true;
|
||||
SerialPrint("i", F("NTP"), "Change day event");
|
||||
@@ -149,7 +149,7 @@ class LogingDaily : public IoTItem {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
firstTimeDate = false;
|
||||
firstTimeInit = false;
|
||||
prevDate = currentDate;
|
||||
return changed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user