доработки логирования

This commit is contained in:
Dmitry Borisenko
2022-09-08 18:48:27 +02:00
parent 12ef79c558
commit 5da6b61b36
9 changed files with 127 additions and 86 deletions

View File

@@ -11,7 +11,7 @@ class Loging : public IoTItem {
int points;
int keepdays;
int interval;
unsigned long interval;
bool firstTime = true;
public:
@@ -24,6 +24,7 @@ class Loging : public IoTItem {
SerialPrint("E", F("Loging"), "'" + id + "' user set more points than allowed, value reset to 300");
}
jsonRead(parameters, F("int"), interval);
interval = interval * 1000 * 60;
jsonRead(parameters, F("keepdays"), keepdays);
}
@@ -31,6 +32,17 @@ class Loging : public IoTItem {
return "";
}
void loop() {
if (enableDoByInt) {
currentMillis = millis();
difference = currentMillis - prevMillis;
if (difference >= interval) {
prevMillis = millis();
this->doByInterval();
}
}
}
void doByInterval() {
//если объект логгирования не был создан
if (!isItemExist(logid)) {
@@ -267,6 +279,8 @@ class Loging : public IoTItem {
int calculateMaxCount() {
return 86400 / interval;
}
// new Variable(param);
};
void *getAPI_Loging(String subtype, String param) {