нормализация расположения методов

This commit is contained in:
Dmitry Borisenko
2022-08-11 15:21:12 +02:00
parent 125eaa78ec
commit 97ac17c466

View File

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