mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
доработки логирования
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user