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:
@@ -9,21 +9,9 @@ extern void loopCmdExecute();
|
||||
extern void addKey(String& key, String& keyNumberTable, int number);
|
||||
extern int getKeyNum(String& key, String& keyNumberTable);
|
||||
|
||||
extern void pwmOut();
|
||||
extern void pwmOutSet();
|
||||
|
||||
extern void buttonIn();
|
||||
extern void buttonInSet();
|
||||
|
||||
extern void input();
|
||||
extern void inputDigitSet();
|
||||
|
||||
extern void inputTime();
|
||||
extern void inputTimeSet();
|
||||
|
||||
extern void textOut();
|
||||
extern void textOutSet();
|
||||
|
||||
extern void analogAdc();
|
||||
extern void analogReading();
|
||||
|
||||
@@ -56,6 +44,4 @@ extern void bmp280ReadingPress();
|
||||
extern void sysUptime();
|
||||
extern void uptimeReading();
|
||||
|
||||
extern void logging();
|
||||
|
||||
extern void impuls();
|
||||
|
||||
@@ -8,7 +8,9 @@ class Scenario {
|
||||
public:
|
||||
|
||||
void loop() {
|
||||
|
||||
if (!jsonReadBool(configSetupJson, "scen")) {
|
||||
return;
|
||||
}
|
||||
String allBlocks = scenario;
|
||||
allBlocks.replace("\r\n", "\n");
|
||||
allBlocks.replace("\r", "\n");
|
||||
|
||||
@@ -117,4 +117,8 @@ enum ConfigType_t {
|
||||
|
||||
//15.11.2020 (SSDP OFF, UDP OFF)
|
||||
//RAM: [===== ] 46.1% (used 37780 bytes from 81920 bytes)
|
||||
//Flash: [===== ] 54.3% (used 566656 bytes from 1044464 bytes)
|
||||
//Flash: [===== ] 54.3% (used 566656 bytes from 1044464 bytes)
|
||||
|
||||
//17.11.2020 (SSDP OFF, UDP OFF)
|
||||
//RAM: [===== ] 45.7% (used 37476 bytes from 81920 bytes)
|
||||
//Flash: [===== ] 54.5% (used 569296 bytes from 1044464 bytes)
|
||||
@@ -75,8 +75,11 @@ extern int impuls_EnterCounter;
|
||||
extern String buttonOut_KeyList;
|
||||
extern int buttonOut_EnterCounter;
|
||||
//=========================================
|
||||
extern String input_KeyList;
|
||||
extern int input_EnterCounter;
|
||||
extern String inOutput_KeyList;
|
||||
extern int inOutput_EnterCounter;
|
||||
//=========================================
|
||||
extern String pwmOut_KeyList;
|
||||
extern int pwmOut_EnterCounter;
|
||||
//=========================================
|
||||
|
||||
// Sensors
|
||||
|
||||
@@ -10,5 +10,5 @@ bool startAPMode();
|
||||
|
||||
boolean RouterFind(String ssid);
|
||||
|
||||
String RSSIquality();
|
||||
uint8_t RSSIquality();
|
||||
|
||||
|
||||
@@ -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