mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Progress of renew of class
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "Class/LineParsing.h"
|
||||
#include "Global.h"
|
||||
|
||||
class OutputTextClass : public LineParsing {
|
||||
public:
|
||||
OutputTextClass() : LineParsing(){};
|
||||
|
||||
void OutputModuleStateSetDefault() {
|
||||
if (_state != "") {
|
||||
OutputModuleChange(_key, _state);
|
||||
}
|
||||
}
|
||||
|
||||
void OutputModuleChange(String key, String state) {
|
||||
state.replace("#", " ");
|
||||
eventGen2(key, state);
|
||||
jsonWriteStr(configLiveJson, key, state);
|
||||
publishStatus(key, state);
|
||||
}
|
||||
};
|
||||
extern OutputTextClass myOutputText;
|
||||
@@ -1,31 +0,0 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "Class/LineParsing.h"
|
||||
#include "Global.h"
|
||||
|
||||
class PwmOutClass : public LineParsing {
|
||||
public:
|
||||
PwmOutClass() : LineParsing(){};
|
||||
|
||||
void pwmModeSet() {
|
||||
if (_pin != "") {
|
||||
pinMode(_pin.toInt(), INPUT);
|
||||
}
|
||||
}
|
||||
|
||||
void pwmStateSetDefault() {
|
||||
if (_state != "") {
|
||||
pwmChange(_key, _pin, _state);
|
||||
}
|
||||
}
|
||||
|
||||
void pwmChange(String key, String pin, String state) {
|
||||
int pinInt = pin.toInt();
|
||||
analogWrite(pinInt, state.toInt());
|
||||
eventGen2(key, state);
|
||||
jsonWriteInt(configLiveJson, key, state.toInt());
|
||||
publishStatus(key, state);
|
||||
}
|
||||
};
|
||||
|
||||
extern PwmOutClass myPwmOut;
|
||||
@@ -22,7 +22,6 @@ class ButtonOut {
|
||||
boolean _inv;
|
||||
String _key;
|
||||
|
||||
void addNewDelOldData(const String filename, size_t maxPoints, String payload);
|
||||
};
|
||||
|
||||
extern MyButtonOutVector* myButtonOut;
|
||||
|
||||
27
include/items/vInOutput.h
Normal file
27
include/items/vInOutput.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Global.h"
|
||||
|
||||
class InOutput;
|
||||
|
||||
typedef std::vector<InOutput> MyInOutputVector;
|
||||
|
||||
class InOutput {
|
||||
public:
|
||||
|
||||
InOutput(String key, String widget);
|
||||
~InOutput();
|
||||
|
||||
void execute(String value);
|
||||
|
||||
private:
|
||||
|
||||
String _key;
|
||||
|
||||
};
|
||||
|
||||
extern MyInOutputVector* myInOutput;
|
||||
|
||||
extern void inOutput();
|
||||
extern void inOutputExecute();
|
||||
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Global.h"
|
||||
|
||||
class Input;
|
||||
|
||||
typedef std::vector<Input> MyInputVector;
|
||||
|
||||
class Input {
|
||||
public:
|
||||
|
||||
Input(String key, String widget);
|
||||
~Input();
|
||||
|
||||
void execute(String value);
|
||||
|
||||
private:
|
||||
|
||||
String _key;
|
||||
|
||||
};
|
||||
|
||||
extern MyInputVector* myInput;
|
||||
|
||||
extern void input();
|
||||
extern void inputExecute();
|
||||
@@ -29,6 +29,7 @@ class LoggingClass {
|
||||
|
||||
extern MyLoggingVector* myLogging;
|
||||
|
||||
extern void logging();
|
||||
extern void choose_log_date_and_send();
|
||||
extern void sendLogData(String file, String topic);
|
||||
extern void cleanLogAndData();
|
||||
|
||||
29
include/items/vPwmOut.h
Normal file
29
include/items/vPwmOut.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Global.h"
|
||||
|
||||
class PwmOut;
|
||||
|
||||
typedef std::vector<PwmOut> MyPwmOutVector;
|
||||
|
||||
class PwmOut {
|
||||
public:
|
||||
|
||||
PwmOut(unsigned int pin, String key);
|
||||
|
||||
~PwmOut();
|
||||
|
||||
void execute(String state);
|
||||
|
||||
private:
|
||||
|
||||
unsigned int _pin;
|
||||
String _key;
|
||||
|
||||
};
|
||||
|
||||
extern MyPwmOutVector* myPwmOut;
|
||||
|
||||
extern void pwmOut();
|
||||
extern void pwmOutExecute();
|
||||
Reference in New Issue
Block a user