From 40122a2b21abe81b5c301521e60d95bd9dbda753 Mon Sep 17 00:00:00 2001 From: IoT Manager <67171972+IoTManagerProject@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:19:27 +0100 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B2=D0=B5=D0=BB=D0=B8=D1=87=D0=B8?= =?UTF-8?q?=D0=B2=D0=B0=D0=B5=D0=BC=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=20=D1=81=D0=B2=D0=BE=D0=B1=D0=BE=D0=B4=D0=BD=D0=BE=D0=B9?= =?UTF-8?q?=20=D0=BF=D0=B0=D0=BC=D1=8F=D1=82=D0=B8=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D1=84=D0=B8=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/virtual/Loging/Loging.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/modules/virtual/Loging/Loging.cpp b/src/modules/virtual/Loging/Loging.cpp index fa8d4c48..362fcdeb 100644 --- a/src/modules/virtual/Loging/Loging.cpp +++ b/src/modules/virtual/Loging/Loging.cpp @@ -16,7 +16,7 @@ class Loging : public IoTItem { int _wsNum = -1; int points; - //int keepdays; + // int keepdays; IoTItem *dateIoTItem; @@ -35,9 +35,9 @@ class Loging : public IoTItem { SerialPrint("E", F("Loging"), "'" + id + "' user set more points than allowed, value reset to 300"); } long interval; - jsonRead(parameters, F("int"), interval); // в минутах + jsonRead(parameters, F("int"), interval); // в минутах setInterval(interval * 60); - //jsonRead(parameters, F("keepdays"), keepdays, false); + // jsonRead(parameters, F("keepdays"), keepdays, false); // создадим экземпляр класса даты dateIoTItem = (IoTItem *)getAPI_Date("{\"id\": \"" + id + "-date\",\"int\":\"20\",\"subtype\":\"date\"}"); @@ -276,7 +276,7 @@ class Loging : public IoTItem { void deleteLastFile() { IoTFSInfo tmp = getFSInfo(); SerialPrint("i", "Loging", String(tmp.freePer) + " % free flash remaining"); - if (tmp.freePer <= 20.00) { + if (tmp.freePer <= 50.00) { String dir = "/lg/" + id; filesList = getFilesList(dir); int i = 0; @@ -300,9 +300,7 @@ class Loging : public IoTItem { _wsNum = wsNum; } - String getValue() { - return ""; - } + String getValue() { return ""; } // void loop() { // if (enableDoByInt) { @@ -331,14 +329,10 @@ class Loging : public IoTItem { } // просто максимальное количество точек - int calculateMaxCount() { - return 86400; - } + int calculateMaxCount() { return 86400; } // путь вида: /lg/log/1231231.txt - unsigned long getFileUnixLocalTime(String path) { - return gmtTimeToLocal(selectToMarkerLast(deleteToMarkerLast(path, "."), "/").toInt() + START_DATETIME); - } + unsigned long getFileUnixLocalTime(String path) { return gmtTimeToLocal(selectToMarkerLast(deleteToMarkerLast(path, "."), "/").toInt() + START_DATETIME); } void setValue(const IoTValue &Value, bool genEvent = true) { value = Value; this->SetDoByInterval(String(value.valD)); @@ -400,6 +394,4 @@ class Date : public IoTItem { } }; -void *getAPI_Date(String param) { - return new Date(param); -} +void *getAPI_Date(String param) { return new Date(param); }