diff --git a/src/classes/IoTItem.cpp b/src/classes/IoTItem.cpp index 77c99ca7..e36a6b50 100644 --- a/src/classes/IoTItem.cpp +++ b/src/classes/IoTItem.cpp @@ -33,20 +33,19 @@ IoTItem::IoTItem(String parameters) { } } -// IoTItem::~IoTItem() {} - -String IoTItem::getSubtype() { - return _subtype; -} - -String IoTItem::getID() { - return _id; -}; - -void IoTItem::setInterval(unsigned long interval) { - _interval = interval; +//луп выполняющий переодическое дерганье +void IoTItem::loop() { + if (enableDoByInt) { + currentMillis = millis(); + difference = currentMillis - prevMillis; + if (difference >= _interval) { + prevMillis = millis(); + this->doByInterval(); + } + } } +//получить String IoTItem::getValue() { if (value.isDecimal) if (_round >= 0 && _round <= 6) { @@ -59,15 +58,14 @@ String IoTItem::getValue() { return value.valS; } -void IoTItem::loop() { - if (enableDoByInt) { - currentMillis = millis(); - difference = currentMillis - prevMillis; - if (difference >= _interval) { - prevMillis = millis(); - this->doByInterval(); - } +//установить +void IoTItem::setValue(String valStr) { + if (value.isDecimal = isDigitDotCommaStr(valStr)) { + value.valD = valStr.toFloat(); + } else { + value.valS = valStr; } + setValue(value); } void IoTItem::regEvent(String value, String consoleInfo = "") { @@ -121,13 +119,18 @@ void IoTItem::setValue(IoTValue Value) { regEvent(value.valS, ""); } -void IoTItem::setValue(String valStr) { - if (value.isDecimal = isDigitDotCommaStr(valStr)) { - value.valD = valStr.toFloat(); - } else { - value.valS = valStr; - } - setValue(value); +//==========================всякая херня============================================================================================== +//захрена эта хрень? +// String IoTItem::getSubtype() { +// return _subtype; +//} + +String IoTItem::getID() { + return _id; +}; + +void IoTItem::setInterval(unsigned long interval) { + _interval = interval; } externalVariable::externalVariable(String parameters) : IoTItem(parameters) { @@ -144,6 +147,10 @@ void externalVariable::doByInterval() { // для данного класса d iAmDead = true; } +//========================================================================================================================================= + +IoTItem::~IoTItem() {} + IoTItem* myIoTItem; IoTItem* findIoTItem(String name) { // поиск элемента модуля в существующей конфигурации