Code translation (#1626)

* comment translation

* translation part #2

* code translation from DE to ENG #part3

* translation #4

* dismantled =>splitted

* bereich => range

* Update defines.h

Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>
This commit is contained in:
Nicolas Liaudat
2022-12-19 22:05:45 +01:00
committed by GitHub
parent 67ff06f64e
commit f6369ff237
31 changed files with 686 additions and 750 deletions

View File

@@ -62,7 +62,7 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _
for (int i = 0; i < FlowControll.size(); ++i)
if (FlowControll[i]->name().compare(_classname) == 0){
if (!(FlowControll[i]->name().compare("ClassFlowMakeImage") == 0)) // falls es ein MakeImage ist, braucht das Bild nicht extra aufgenommen zu werden, dass passiert bei html-Abfrage automatisch
if (!(FlowControll[i]->name().compare("ClassFlowMakeImage") == 0)) // if it is a MakeImage, the image does not need to be included, this happens automatically with the html query.
FlowControll[i]->doFlow("");
result = FlowControll[i]->getHTMLSingleStep(_host);
}
@@ -173,7 +173,7 @@ void ClassFlowControll::SetInitialParameter(void)
bool ClassFlowControll::isAutoStart(long &_intervall)
{
_intervall = AutoIntervall * 60 * 1000; // AutoIntervall: Minuten -> ms
_intervall = AutoIntervall * 60 * 1000; // AutoInterval: minutes -> ms
return AutoStart;
}
@@ -220,7 +220,7 @@ ClassFlow* ClassFlowControll::CreateClassFlow(std::string _type)
flowpostprocessing = (ClassFlowPostProcessing*) cfc;
}
if (cfc) // Wird nur angehangen, falls es nicht [AutoTimer] ist, denn dieses ist für FlowControll
if (cfc) // Attached only if it is not [AutoTimer], because this is for FlowControll
FlowControll.push_back(cfc);
if (toUpper(_type).compare("[AUTOTIMER]") == 0)
@@ -292,7 +292,6 @@ void ClassFlowControll::doFlowMakeImageOnly(string time){
for (int i = 0; i < FlowControll.size(); ++i)
{
if (FlowControll[i]->name() == "ClassFlowMakeImage") {
// zw_time = gettimestring("%Y%m%d-%H%M%S");
zw_time = gettimestring("%H:%M:%S");
std::string flowStatus = TranslateAktstatus(FlowControll[i]->name());
aktstatus = flowStatus + " (" + zw_time + ")";
@@ -307,8 +306,6 @@ void ClassFlowControll::doFlowMakeImageOnly(string time){
bool ClassFlowControll::doFlow(string time)
{
// CleanTempFolder(); // dazu muss man noch eine Rolling einführen
bool result = true;
std::string zw_time;
int repeat = 0;
@@ -340,12 +337,12 @@ bool ClassFlowControll::doFlow(string time)
if (!FlowControll[i]->doFlow(time)){
repeat++;
LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Fehler im vorheriger Schritt - wird zum " + to_string(repeat) + ". Mal wiederholt");
if (i) i -= 1; // vorheriger Schritt muss wiederholt werden (vermutlich Bilder aufnehmen)
if (i) i -= 1; // vPrevious step must be repeated (probably take pictures)
result = false;
if (repeat > 5) {
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Wiederholung 5x nicht erfolgreich --> reboot");
doReboot();
// Schritt wurde 5x wiederholt --> reboot
//Step was repeated 5x --> reboot
}
}
else
@@ -474,7 +471,7 @@ std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string
bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
{
std::vector<string> zerlegt;
std::vector<string> splitted;
aktparamgraph = trim(aktparamgraph);
@@ -489,23 +486,23 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
{
zerlegt = ZerlegeZeile(aktparamgraph, " =");
if ((toUpper(zerlegt[0]) == "AUTOSTART") && (zerlegt.size() > 1))
splitted = ZerlegeZeile(aktparamgraph, " =");
if ((toUpper(splitted[0]) == "AUTOSTART") && (splitted.size() > 1))
{
if (toUpper(zerlegt[1]) == "TRUE")
if (toUpper(splitted[1]) == "TRUE")
{
AutoStart = true;
}
}
if ((toUpper(zerlegt[0]) == "INTERVALL") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "INTERVALL") && (splitted.size() > 1))
{
AutoIntervall = std::stof(zerlegt[1]);
AutoIntervall = std::stof(splitted[1]);
}
if ((toUpper(zerlegt[0]) == "DATALOGACTIVE") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "DATALOGACTIVE") && (splitted.size() > 1))
{
if (toUpper(zerlegt[1]) == "TRUE")
if (toUpper(splitted[1]) == "TRUE")
{
LogFile.SetDataLogToSD(true);
}
@@ -514,53 +511,53 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
}
}
if ((toUpper(zerlegt[0]) == "DATALOGRETENTIONINDAYS") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "DATALOGRETENTIONINDAYS") && (splitted.size() > 1))
{
LogFile.SetDataLogRetention(std::stoi(zerlegt[1]));
LogFile.SetDataLogRetention(std::stoi(splitted[1]));
}
if ((toUpper(zerlegt[0]) == "LOGFILE") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "LOGFILE") && (splitted.size() > 1))
{
/* matches esp_log_level_t */
if ((toUpper(zerlegt[1]) == "TRUE") || (toUpper(zerlegt[1]) == "2"))
if ((toUpper(splitted[1]) == "TRUE") || (toUpper(splitted[1]) == "2"))
{
LogFile.setLogLevel(ESP_LOG_WARN);
}
else if ((toUpper(zerlegt[1]) == "FALSE") || (toUpper(zerlegt[1]) == "0") || (toUpper(zerlegt[1]) == "1"))
else if ((toUpper(splitted[1]) == "FALSE") || (toUpper(splitted[1]) == "0") || (toUpper(splitted[1]) == "1"))
{
LogFile.setLogLevel(ESP_LOG_ERROR);
}
else if (toUpper(zerlegt[1]) == "3")
else if (toUpper(splitted[1]) == "3")
{
LogFile.setLogLevel(ESP_LOG_INFO);
}
else if (toUpper(zerlegt[1]) == "4")
else if (toUpper(splitted[1]) == "4")
{
LogFile.setLogLevel(ESP_LOG_DEBUG);
}
}
if ((toUpper(zerlegt[0]) == "LOGFILERETENTIONINDAYS") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "LOGFILERETENTIONINDAYS") && (splitted.size() > 1))
{
LogFile.SetLogFileRetention(std::stoi(zerlegt[1]));
LogFile.SetLogFileRetention(std::stoi(splitted[1]));
}
if ((toUpper(zerlegt[0]) == "TIMEZONE") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "TIMEZONE") && (splitted.size() > 1))
{
string zw = "Set TimeZone: " + zerlegt[1];
setTimeZone(zerlegt[1]);
string zw = "Set TimeZone: " + splitted[1];
setTimeZone(splitted[1]);
}
if ((toUpper(zerlegt[0]) == "TIMESERVER") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "TIMESERVER") && (splitted.size() > 1))
{
string zw = "Set TimeZone: " + zerlegt[1];
reset_servername(zerlegt[1]);
string zw = "Set TimeZone: " + splitted[1];
reset_servername(splitted[1]);
}
if ((toUpper(zerlegt[0]) == "HOSTNAME") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "HOSTNAME") && (splitted.size() > 1))
{
if (ChangeHostName("/sdcard/wlan.ini", zerlegt[1]))
if (ChangeHostName("/sdcard/wlan.ini", splitted[1]))
{
// reboot notwendig damit die neue wlan.ini auch benutzt wird !!!
// reboot necessary so that the new wlan.ini is also used !!!
fclose(pfile);
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Rebooting to activate new HOSTNAME...");
esp_restart();
@@ -569,9 +566,9 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
}
}
if ((toUpper(zerlegt[0]) == "SETUPMODE") && (zerlegt.size() > 1))
if ((toUpper(splitted[0]) == "SETUPMODE") && (splitted.size() > 1))
{
if (toUpper(zerlegt[1]) == "TRUE")
if (toUpper(splitted[1]) == "TRUE")
{
SetupModeActive = true;
}