mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-28 07:02:17 +03:00
Var changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/ButtonInClass.h"
|
||||
//==========================================Модуль физических кнопок========================================
|
||||
//button-in switch1 toggle Кнопки Свет 1 pin[2] db[20]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ButtonOutClass.h"
|
||||
|
||||
#include "items/ItemsGlobal.h"
|
||||
//==========================================Модуль кнопок===================================================
|
||||
//button-out light toggle Кнопки Свет 1 pin[12] inv[1] st[1]
|
||||
//==========================================================================================================
|
||||
@@ -10,22 +11,13 @@ void buttonOut() {
|
||||
String pin = myButtonOut.gpin();
|
||||
String inv = myButtonOut.ginv();
|
||||
sCmd.addCommand(key.c_str(), buttonOutSet);
|
||||
jsonWriteStr(configOptionJson, key + "_pin", pin);
|
||||
jsonWriteStr(configOptionJson, key + "_inv", inv);
|
||||
myButtonOut.pinModeSet();
|
||||
myButtonOut.init();
|
||||
myButtonOut.pinStateSetDefault();
|
||||
myButtonOut.pinStateSetInvDefault();
|
||||
myButtonOut.clear();
|
||||
}
|
||||
|
||||
void buttonOutSet() {
|
||||
String key = sCmd.order();
|
||||
String state = sCmd.next();
|
||||
String pin = jsonReadStr(configOptionJson, key + "_pin");
|
||||
String inv = jsonReadStr(configOptionJson, key + "_inv");
|
||||
if (inv == "") {
|
||||
myButtonOut.pinChange(key, pin, state, true);
|
||||
} else {
|
||||
myButtonOut.pinChange(key, pin, state, false);
|
||||
}
|
||||
myButtonOut.pinChange(key, state);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/InputClass.h"
|
||||
//==========================================Модуль ввода цифровых значений==================================
|
||||
//input-digit digit1 inputDigit Ввод Введите.цифру 4 st[60]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/InputClass.h"
|
||||
//==========================================Модуль ввода времени============================================
|
||||
//input-time time1 inputTime Ввод Введите.время 4 st[10-00-00]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/OutputTextClass.h"
|
||||
//===============================================Модуль вывода текста============================================
|
||||
//output-text;id;anydata;Вывод;Сигнализация;order;st[Обнаружено.движение]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/PwmOutClass.h"
|
||||
//==========================================Модуль управления ШИМ===================================================
|
||||
//pwm-out volume range Кнопки Свет 1 pin[12] st[500]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/SensorAnalogClass.h"
|
||||
#ifdef ANALOG_ENABLED
|
||||
//==============================================Модуль аналогового сенсора===========================================================================================
|
||||
|
||||
20
src/items/SensorDallasClass.cpp
Normal file
20
src/items/SensorDallasClass.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/SensorDallasClass.h"
|
||||
//#ifdef SensorDallasEnabled
|
||||
//=========================================Модуль ультрозвукового дальномера==================================================================
|
||||
//dallas-temp;id;anydata;Сенсоры;Температура;order;pin;c[1]
|
||||
//=========================================================================================================================================
|
||||
SensorDallasClass mySensorDallas;
|
||||
void dallasTemp() {
|
||||
mySensorDallas.update();
|
||||
String key = mySensorDallas.gkey();
|
||||
sCmd.addCommand(key.c_str(), dallasReading);
|
||||
mySensorDallas.SensorDallasInit();
|
||||
mySensorDallas.clear();
|
||||
}
|
||||
|
||||
void dallasReading() {
|
||||
String key = sCmd.order();
|
||||
mySensorDallas.SensorDallasRead(key);
|
||||
}
|
||||
//#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "items/ItemsGlobal.h"
|
||||
#include "items/SensorUltrasonicClass.h"
|
||||
//#ifdef LEVEL_ENABLED
|
||||
//#ifdef SensorUltrasonicEnabled
|
||||
//=========================================Модуль ультрозвукового дальномера==================================================================
|
||||
//ultrasonic-cm;id;anydata;Сенсоры;Расстояние;order;pin[12,13];map[1,100,1,100];c[1]
|
||||
//=========================================================================================================================================
|
||||
@@ -9,94 +9,13 @@ void ultrasonicCm() {
|
||||
mySensorUltrasonic.update();
|
||||
String key = mySensorUltrasonic.gkey();
|
||||
String pin = mySensorUltrasonic.gpin();
|
||||
String trig = selectFromMarkerToMarker(pin, ",", 0);
|
||||
String echo = selectFromMarkerToMarker(pin, ",", 1);
|
||||
sCmd.addCommand(key.c_str(), ultrasonicReading);
|
||||
sensorReadingMap += key + ",";
|
||||
jsonWriteStr(configOptionJson, key + "_trig", trig);
|
||||
jsonWriteStr(configOptionJson, key + "_echo", echo);
|
||||
jsonWriteStr(configOptionJson, key + "_map", mySensorUltrasonic.gmap());
|
||||
jsonWriteStr(configOptionJson, key + "_с", mySensorUltrasonic.gc());
|
||||
mySensorUltrasonic.init();
|
||||
mySensorUltrasonic.clear();
|
||||
}
|
||||
|
||||
void ultrasonicReading() {
|
||||
String key = sCmd.order();
|
||||
String trig = jsonReadStr(configOptionJson, key + "_trig");
|
||||
String echo = jsonReadStr(configOptionJson, key + "_echo");
|
||||
String pin = trig + "," + echo;
|
||||
mySensorUltrasonic.SensorUltrasonicRead(key, pin);
|
||||
mySensorUltrasonic.SensorUltrasonicRead(key);
|
||||
}
|
||||
//#endif
|
||||
|
||||
//void levelPr() {
|
||||
// String value_name = sCmd.next();
|
||||
// String trig = sCmd.next();
|
||||
// String echo = sCmd.next();
|
||||
// String widget_name = sCmd.next();
|
||||
// String page_name = sCmd.next();
|
||||
// String type = sCmd.next();
|
||||
// String empty_level = sCmd.next();
|
||||
// String full_level = sCmd.next();
|
||||
// String page_number = sCmd.next();
|
||||
// levelPr_value_name = value_name;
|
||||
// jsonWriteStr(configOptionJson, "e_lev", empty_level);
|
||||
// jsonWriteStr(configOptionJson, "f_lev", full_level);
|
||||
// jsonWriteStr(configOptionJson, "trig", trig);
|
||||
// jsonWriteStr(configOptionJson, "echo", echo);
|
||||
// pinMode(trig.toInt(), OUTPUT);
|
||||
// pinMode(echo.toInt(), INPUT);
|
||||
// createWidgetByType(widget_name, page_name, page_number, type, value_name);
|
||||
// sensors_reading_map[0] = 1;
|
||||
//}
|
||||
////ultrasonicCm cm 14 12 Дистанция,#см Датчики fillgauge 1
|
||||
//void ultrasonicCm() {
|
||||
// String value_name = sCmd.next();
|
||||
// String trig = sCmd.next();
|
||||
// String echo = sCmd.next();
|
||||
// String widget_name = sCmd.next();
|
||||
// String page_name = sCmd.next();
|
||||
// String type = sCmd.next();
|
||||
// String empty_level = sCmd.next();
|
||||
// String full_level = sCmd.next();
|
||||
// String page_number = sCmd.next();
|
||||
// ultrasonicCm_value_name = value_name;
|
||||
// jsonWriteStr(configOptionJson, "trig", trig);
|
||||
// jsonWriteStr(configOptionJson, "echo", echo);
|
||||
// pinMode(trig.toInt(), OUTPUT);
|
||||
// pinMode(echo.toInt(), INPUT);
|
||||
// createWidgetByType(widget_name, page_name, page_number, type, value_name);
|
||||
// sensors_reading_map[0] = 1;
|
||||
//}
|
||||
//
|
||||
//void ultrasonic_reading() {
|
||||
// long duration_;
|
||||
// int distance_cm;
|
||||
// int level;
|
||||
// static int counter;
|
||||
// int trig = jsonReadInt(configOptionJson, "trig");
|
||||
// int echo = jsonReadInt(configOptionJson, "echo");
|
||||
// distance_cm = medianFilter.filtered(distance_cm); //отсечение промахов медианным фильтром
|
||||
// counter++;
|
||||
// if (counter > TANK_LEVEL_SAMPLES) {
|
||||
// counter = 0;
|
||||
// level = map(distance_cm,
|
||||
// jsonReadInt(configOptionJson, "e_lev"),
|
||||
// jsonReadInt(configOptionJson, "f_lev"), 0, 100);
|
||||
//
|
||||
// jsonWriteInt(configLiveJson, levelPr_value_name, level);
|
||||
// eventGen(levelPr_value_name, "");
|
||||
//
|
||||
// MqttClient::publishStatus(levelPr_value_name, String(level));
|
||||
//
|
||||
// Serial.println("[I] sensor '" + levelPr_value_name + "' data: " + String(level));
|
||||
//
|
||||
// jsonWriteInt(configLiveJson, ultrasonicCm_value_name, distance_cm);
|
||||
// eventGen(ultrasonicCm_value_name, "");
|
||||
//
|
||||
// MqttClient::publishStatus(ultrasonicCm_value_name, String(distance_cm));
|
||||
//
|
||||
// Serial.println("[I] sensor '" + ultrasonicCm_value_name + "' data: " + String(distance_cm));
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//#endif
|
||||
Reference in New Issue
Block a user