mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 21:46:55 +03:00
Rolling 20201204
This commit is contained in:
@@ -66,6 +66,7 @@ std::vector<HTMLInfo*> ClassFlowControll::GetAllAnalog()
|
||||
void ClassFlowControll::SetInitialParameter(void)
|
||||
{
|
||||
AutoStart = false;
|
||||
SetupModeActive = false;
|
||||
AutoIntervall = 10;
|
||||
}
|
||||
|
||||
@@ -309,6 +310,16 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||
xTaskCreate(&task_doTimeSync, "update_time", configMINIMAL_STACK_SIZE * 16, &TimeUpdateIntervall, tskIDLE_PRIORITY, NULL);
|
||||
}
|
||||
|
||||
if ((toUpper(zerlegt[0]) == "SETUPMODE") && (zerlegt.size() > 1))
|
||||
{
|
||||
if (toUpper(zerlegt[1]) == "TRUE")
|
||||
{
|
||||
SetupModeActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ protected:
|
||||
|
||||
bool AutoStart;
|
||||
float AutoIntervall;
|
||||
bool SetupModeActive;
|
||||
void SetInitialParameter(void);
|
||||
std::string aktstatus;
|
||||
int TimeUpdateIntervall;
|
||||
@@ -29,6 +30,7 @@ protected:
|
||||
public:
|
||||
void InitFlow(std::string config);
|
||||
bool doFlow(string time);
|
||||
bool getStatusSetupModus(){return SetupModeActive;};
|
||||
string getReadout(bool _rawvalue, bool _noerror);
|
||||
string UpdatePrevalue(std::string _newvalue);
|
||||
string GetPrevalue();
|
||||
|
||||
@@ -313,7 +313,6 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
||||
|
||||
ReturnRawValue = ShiftDecimal(ReturnRawValue, DecimalShift);
|
||||
|
||||
|
||||
if (!PreValueUse || !PreValueOkay)
|
||||
{
|
||||
ReturnValue = ReturnRawValue;
|
||||
@@ -391,6 +390,9 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue, bool _noerror)
|
||||
|
||||
string ClassFlowPostProcessing::RundeOutput(float _in, int _anzNachkomma){
|
||||
std::stringstream stream;
|
||||
if (_anzNachkomma < 0) {
|
||||
_anzNachkomma = 0;
|
||||
}
|
||||
stream << std::fixed << std::setprecision(_anzNachkomma) << _in;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@ bool flowisrunning = false;
|
||||
long auto_intervall = 0;
|
||||
bool auto_isrunning = false;
|
||||
|
||||
bool isSetupModusActive() {
|
||||
return tfliteflow.getStatusSetupModus();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void KillTFliteTasks()
|
||||
{
|
||||
printf("Handle: xHandleblink_task_doFlow: %ld\n", (long) xHandleblink_task_doFlow);
|
||||
@@ -418,6 +424,7 @@ void task_autodoFlow(void *pvParameter)
|
||||
doInit();
|
||||
|
||||
auto_isrunning = tfliteflow.isAutoStart(auto_intervall);
|
||||
auto_isrunning = auto_isrunning && (!isSetupModusActive());
|
||||
|
||||
while (auto_isrunning)
|
||||
{
|
||||
|
||||
@@ -10,4 +10,6 @@ void register_server_tflite_uri(httpd_handle_t server);
|
||||
|
||||
void KillTFliteTasks();
|
||||
|
||||
void TFliteDoAutoStart();
|
||||
void TFliteDoAutoStart();
|
||||
|
||||
bool isSetupModusActive();
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include "esp_wifi.h"
|
||||
|
||||
#include "server_tflite.h"
|
||||
|
||||
|
||||
httpd_handle_t server = NULL;
|
||||
|
||||
@@ -152,7 +154,9 @@ esp_err_t hello_main_handler(httpd_req_t *req)
|
||||
|
||||
if ((strcmp(req->uri, "/") == 0))
|
||||
{
|
||||
filetosend = filetosend + "/html/index.html";
|
||||
{
|
||||
filetosend = filetosend + "/html/index.html";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,6 +167,11 @@ esp_err_t hello_main_handler(httpd_req_t *req)
|
||||
}
|
||||
}
|
||||
|
||||
if (filetosend == "/sdcard/html/index.html" && isSetupModusActive()) {
|
||||
printf("System ist im Setupmodus --> index.html --> setup.html");
|
||||
filetosend = "/sdcard/html/setup.html";
|
||||
}
|
||||
|
||||
printf("Filename: %s\n", filename);
|
||||
|
||||
printf("File requested: %s\n", filetosend.c_str());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const char* GIT_REV="c5059b4";
|
||||
const char* GIT_REV="9e85b12";
|
||||
const char* GIT_TAG="";
|
||||
const char* GIT_BRANCH="rolling";
|
||||
const char* BUILD_TIME="2020-12-03 20:31";
|
||||
const char* BUILD_TIME="2020-12-04 22:01";
|
||||
@@ -1,4 +1,4 @@
|
||||
const char* GIT_REV="c5059b4";
|
||||
const char* GIT_REV="9e85b12";
|
||||
const char* GIT_TAG="";
|
||||
const char* GIT_BRANCH="rolling";
|
||||
const char* BUILD_TIME="2020-12-03 20:27";
|
||||
const char* BUILD_TIME="2020-12-04 22:01";
|
||||
Reference in New Issue
Block a user