mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
working version
This commit is contained in:
7
.vscode/extensions.json
vendored
Normal file
7
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
|
// for the documentation about the extensions.json format
|
||||||
|
"recommendations": [
|
||||||
|
"platformio.platformio-ide"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
"chipID": "",
|
"chipID": "",
|
||||||
"apssid": "IoTmanager",
|
"apssid": "IoTmanager",
|
||||||
"appass": "",
|
"appass": "",
|
||||||
"routerssid": "VOLODYA",
|
"routerssid": "rise",
|
||||||
"routerpass": "BELCHENKO",
|
"routerpass": "hostel3333",
|
||||||
"timezone": 2,
|
"timezone": 2,
|
||||||
"ntp": "pool.ntp.org",
|
"ntp": "pool.ntp.org",
|
||||||
"mqttServer": "91.204.228.124",
|
"mqttServer": "91.204.228.124",
|
||||||
|
|||||||
@@ -33,13 +33,12 @@ class Scenario {
|
|||||||
void calculate1() {
|
void calculate1() {
|
||||||
_scenBlok = selectToMarker(_scenarioTmp, "end\n");
|
_scenBlok = selectToMarker(_scenarioTmp, "end\n");
|
||||||
_condition = selectToMarker(_scenBlok, "\n");
|
_condition = selectToMarker(_scenBlok, "\n");
|
||||||
_conditionParam = selectFromMarkerToMarker(_condition, " ", 0);
|
|
||||||
_eventParam = selectToMarker(eventBuf, ",");
|
_eventParam = selectToMarker(eventBuf, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isIncommingEventInScenario() {
|
bool isIncommingEventInScenario() {
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
if (_conditionParam == _eventParam) {
|
if (_condition.indexOf(_eventParam) != -1) {
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -49,6 +48,8 @@ class Scenario {
|
|||||||
_scenarioTmp += "\n";
|
_scenarioTmp += "\n";
|
||||||
_scenarioTmp.replace("\r\n", "\n");
|
_scenarioTmp.replace("\r\n", "\n");
|
||||||
_scenarioTmp.replace("\r", "\n");
|
_scenarioTmp.replace("\r", "\n");
|
||||||
|
|
||||||
|
_conditionParam = selectFromMarkerToMarker(_condition, " ", 0);
|
||||||
_conditionSign = selectFromMarkerToMarker(_condition, " ", 1);
|
_conditionSign = selectFromMarkerToMarker(_condition, " ", 1);
|
||||||
_conditionValue = selectFromMarkerToMarker(_condition, " ", 2);
|
_conditionValue = selectFromMarkerToMarker(_condition, " ", 2);
|
||||||
if (!isDigitStr(_conditionValue)) _conditionValue = jsonReadStr(configLiveJson, _conditionValue);
|
if (!isDigitStr(_conditionValue)) _conditionValue = jsonReadStr(configLiveJson, _conditionValue);
|
||||||
@@ -91,7 +92,7 @@ class Scenario {
|
|||||||
}
|
}
|
||||||
this->load(); //после этого мы получили все сценарии
|
this->load(); //после этого мы получили все сценарии
|
||||||
while (_scenarioTmp.length() > 1) {
|
while (_scenarioTmp.length() > 1) {
|
||||||
this->calculate1();
|
this->calculate1(); //расчет необходимый для ответа на следующий вопрос
|
||||||
if (this->isIncommingEventInScenario()) { //если вошедшее событие есть в сценарии
|
if (this->isIncommingEventInScenario()) { //если вошедшее событие есть в сценарии
|
||||||
this->calculate2();
|
this->calculate2();
|
||||||
if (this->isConditionSatisfied()) { //если вошедшее событие выполняет условие сценария
|
if (this->isConditionSatisfied()) { //если вошедшее событие выполняет условие сценария
|
||||||
|
|||||||
Reference in New Issue
Block a user