mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Big changes. Compiling version
This commit is contained in:
@@ -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