Корректируем время жизни временного ошибочного элемента

This commit is contained in:
2022-11-04 16:45:17 +03:00
parent 67c9340f0f
commit 5c5c36e25d
3 changed files with 10 additions and 8 deletions

View File

@@ -89,7 +89,7 @@ void setup() {
iotScen.loadScenario("/scenario.txt");
// создаем событие завершения конфигурирования для возможности выполнения блока кода при загрузке
createItemFromNet("onStart", "1", 1);
createItemFromNet("onStart", "1", -4);
stInit();
@@ -105,6 +105,8 @@ void setup() {
// проверяем все элементы на тухлость
for (std::list<IoTItem *>::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) {
(*it)->checkIntFromNet();
Serial.printf("[ITEM] size: %d, id: %s, int: %d, intnet: %d\n", sizeof(**it), (*it)->getID(), (*it)->getInterval(), (*it)->getIntFromNet());
}
},
nullptr, true);
@@ -162,10 +164,10 @@ void loop() {
handleOrder();
handleEvent();
#ifdef LOOP_DEBUG
loopPeriod = millis() - st;
if (loopPeriod > 2) Serial.println(loopPeriod);
#endif
// #ifdef LOOP_DEBUG
// loopPeriod = millis() - st;
// if (loopPeriod > 2) Serial.println(loopPeriod);
// #endif
}
//отправка json

View File

@@ -113,7 +113,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
configure("/config.json");
iotScen.loadScenario("/scenario.txt");
// создаем событие завершения конфигурирования для возможности выполнения блока кода при загрузке
createItemFromNet("onStart", "1", 1);
createItemFromNet("onStart", "1", -4);
}
//----------------------------------------------------------------------//

View File

@@ -23,9 +23,9 @@ void SerialPrint(const String& errorLevel, const String& module, const String& m
cleanString(tosend);
// создаем событие об ошибке для возможной реакции в сценарии
if (itemId != "") {
createItemFromNet(itemId + "_onError", tosend, 2);
createItemFromNet(itemId + "_onError", tosend, -4);
} else {
createItemFromNet("onError", tosend, 2);
createItemFromNet("onError", tosend, -4);
}
}