mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
Big changes. Compiling version
This commit is contained in:
@@ -15,7 +15,7 @@ extern void pwmOutSet();
|
||||
extern void buttonIn();
|
||||
extern void buttonInSet();
|
||||
|
||||
extern void inputDigit();
|
||||
extern void input();
|
||||
extern void inputDigitSet();
|
||||
|
||||
extern void inputTime();
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
//#define LAYOUT_IN_RAM
|
||||
//#define UDP_ENABLED
|
||||
//#define SSDP_ENABLED
|
||||
#define SAVE_SETTINGS_TO_FLASH
|
||||
|
||||
//=========Sensors enable/disable=================================================================================================================================
|
||||
#define LEVEL_ENABLED
|
||||
|
||||
@@ -74,6 +74,9 @@ extern int impuls_EnterCounter;
|
||||
extern String buttonOut_KeyList;
|
||||
extern int buttonOut_EnterCounter;
|
||||
//=========================================
|
||||
extern String input_KeyList;
|
||||
extern int input_EnterCounter;
|
||||
//=========================================
|
||||
|
||||
// Sensors
|
||||
extern String sensorReadingMap10sec;
|
||||
|
||||
@@ -16,4 +16,6 @@ String jsonWriteFloat(String& json, String name, float value);
|
||||
|
||||
String jsonWriteBool(String& json, String name, boolean value);
|
||||
|
||||
void saveConfig();
|
||||
void saveConfig();
|
||||
|
||||
void saveLive();
|
||||
@@ -1,41 +0,0 @@
|
||||
//#pragma once
|
||||
//#include <Arduino.h>
|
||||
//
|
||||
//#include "Class/LineParsing.h"
|
||||
//#include "Global.h"
|
||||
//
|
||||
//class ButtonOutClass : public LineParsing {
|
||||
//public:
|
||||
// ButtonOutClass() : LineParsing() {};
|
||||
//
|
||||
// void init() {
|
||||
// if (_pin != "") {
|
||||
// pinMode(_pin.toInt(), OUTPUT);
|
||||
// }
|
||||
// jsonWriteStr(configOptionJson, _key + "_pin", _pin);
|
||||
// jsonWriteStr(configOptionJson, _key + "_inv", _inv);
|
||||
// }
|
||||
//
|
||||
// void pinStateSetDefault() {
|
||||
// pinChange(_key, _state);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// void pinChange(String key, String state) {
|
||||
// String pin = jsonReadStr(configOptionJson, key + "_pin");
|
||||
// String inv = jsonReadStr(configOptionJson, key + "_inv");
|
||||
// int pinInt = pin.toInt();
|
||||
//
|
||||
// if (inv == "") {
|
||||
// digitalWrite(pinInt, state.toInt());
|
||||
// }
|
||||
// else {
|
||||
// digitalWrite(pinInt, !state.toInt());
|
||||
// }
|
||||
// eventGen2(key, state);
|
||||
// jsonWriteInt(configLiveJson, key, state.toInt());
|
||||
// publishStatus(key, state);
|
||||
// }
|
||||
//};
|
||||
//
|
||||
//extern ButtonOutClass myButtonOut;
|
||||
@@ -3,29 +3,29 @@
|
||||
#include "Class/LineParsing.h"
|
||||
#include "Global.h"
|
||||
|
||||
class InputClass : public LineParsing {
|
||||
public:
|
||||
InputClass() : LineParsing(){};
|
||||
|
||||
void inputSetDefaultFloat() {
|
||||
inputSetFloat(_key, _state);
|
||||
}
|
||||
|
||||
void inputSetDefaultStr() {
|
||||
inputSetStr(_key, _state);
|
||||
}
|
||||
|
||||
void inputSetFloat(String key, String state) {
|
||||
eventGen2(key, state);
|
||||
jsonWriteFloat(configLiveJson, key, state.toFloat());
|
||||
publishStatus(key, state);
|
||||
}
|
||||
|
||||
void inputSetStr(String key, String state) {
|
||||
eventGen2(key, state);
|
||||
jsonWriteStr(configLiveJson, key, state);
|
||||
publishStatus(key, state);
|
||||
}
|
||||
};
|
||||
|
||||
extern InputClass myInput;
|
||||
//class InputClass : public LineParsing {
|
||||
// public:
|
||||
// InputClass() : LineParsing(){};
|
||||
//
|
||||
// void inputSetDefaultFloat() {
|
||||
// inputSetFloat(_key, _state);
|
||||
// }
|
||||
//
|
||||
// void inputSetDefaultStr() {
|
||||
// inputSetStr(_key, _state);
|
||||
// }
|
||||
//
|
||||
// void inputSetFloat(String key, String state) {
|
||||
// eventGen2(key, state);
|
||||
// jsonWriteFloat(configLiveJson, key, state.toFloat());
|
||||
// publishStatus(key, state);
|
||||
// }
|
||||
//
|
||||
// void inputSetStr(String key, String state) {
|
||||
// eventGen2(key, state);
|
||||
// jsonWriteStr(configLiveJson, key, state);
|
||||
// publishStatus(key, state);
|
||||
// }
|
||||
//};
|
||||
//
|
||||
//extern InputClass myInput;
|
||||
@@ -14,7 +14,6 @@ class ButtonOut {
|
||||
|
||||
~ButtonOut();
|
||||
|
||||
void init();
|
||||
void execute(String state);
|
||||
|
||||
private:
|
||||
29
include/items/vInput.h
Normal file
29
include/items/vInput.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Global.h"
|
||||
|
||||
class Input;
|
||||
|
||||
typedef std::vector<Input> MyInputVector;
|
||||
|
||||
class Input {
|
||||
public:
|
||||
|
||||
Input(String key);
|
||||
|
||||
~Input();
|
||||
|
||||
void execute(String state);
|
||||
|
||||
private:
|
||||
|
||||
String _key;
|
||||
|
||||
void addNewDelOldData(const String filename, size_t maxPoints, String payload);
|
||||
};
|
||||
|
||||
extern MyInputVector* myInput;
|
||||
|
||||
extern void input();
|
||||
extern void inputExecute();
|
||||
Reference in New Issue
Block a user