made active faction recovery configurable
This commit is contained in:
parent
eb771d07d3
commit
7e58db489d
@ -204,8 +204,8 @@
|
||||
<!-- Div Group Battery Type -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Akku-Variante</h4>
|
||||
<form action="post.htm" method="POST" class="form-horizontal">
|
||||
<h4>Akku-Variante</h4>
|
||||
<div class="form-group row">
|
||||
<label for="battery_select" class="control-label col-4">Akku</label>
|
||||
<div class="col-8">
|
||||
@ -214,6 +214,18 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Timer-Einstellungen</h4>
|
||||
<div class="form-group row">
|
||||
<label for="factionreboot_cont" class="control-label col-4">active Faction Recovery</label>
|
||||
<div class="col-8">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="factionreboot_cont" id="factionreboot_cont" %FACTIONREBOOT_CHECKED%>
|
||||
<label class="form-check-label" for="factionreboot_cont">
|
||||
aktive Faktion beim booten wiederherstellen ?
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button name="settingssave" type="submit" class="btn btn-outline-primary">Übernehmen</button>
|
||||
@ -267,6 +279,10 @@
|
||||
<td>Battery_type</td>
|
||||
<td>%BATTERY_TYPE%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Faction_recovery</td>
|
||||
<td>%FACTION_RECOVERY%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>EEPROM Version</td>
|
||||
<td>%EEPROM_VERSION%</td>
|
||||
|
@ -49,6 +49,7 @@ typedef struct
|
||||
{
|
||||
uint8_t EEPROM_Version = 1;
|
||||
batteryType_t batteryType = BATTERY_UNDEFINED;
|
||||
bool active_faction_on_reboot = false;
|
||||
uint32_t checksum = 0;
|
||||
} configData_t;
|
||||
|
||||
|
@ -207,6 +207,9 @@ void setup()
|
||||
tmrFactionTicker.start();
|
||||
tmrInputGetter.start();
|
||||
|
||||
if (ConfigData.active_faction_on_reboot == false)
|
||||
PersistenceData.activeFaction = NONE;
|
||||
|
||||
Serial.print("\nSetup Done\n");
|
||||
}
|
||||
|
||||
@ -246,7 +249,7 @@ void loop()
|
||||
/* code */
|
||||
break;
|
||||
case sysStat_Shutdown:
|
||||
OverrideDisplay(SHUTDOWN_DELAY_MS , " re", "boot", " ");
|
||||
OverrideDisplay(SHUTDOWN_DELAY_MS, " re", "boot", " ");
|
||||
SystemShutdown();
|
||||
break;
|
||||
case sysStat_Startup:
|
||||
@ -371,6 +374,7 @@ void tmrCallback_InputGetter()
|
||||
if (PersistenceData.activeFaction != FACTION_1)
|
||||
{
|
||||
Serial.println("Faction 1 captured !");
|
||||
globals.requestEEAction = EE_PDS_SAVE;
|
||||
}
|
||||
PersistenceData.activeFaction = FACTION_1;
|
||||
}
|
||||
@ -380,6 +384,7 @@ void tmrCallback_InputGetter()
|
||||
if (PersistenceData.activeFaction != FACTION_2)
|
||||
{
|
||||
Serial.println("Faction 2 captured !");
|
||||
globals.requestEEAction = EE_PDS_SAVE;
|
||||
}
|
||||
PersistenceData.activeFaction = FACTION_2;
|
||||
}
|
||||
@ -389,6 +394,7 @@ void tmrCallback_InputGetter()
|
||||
if (PersistenceData.activeFaction != FACTION_3)
|
||||
{
|
||||
Serial.println("Faction 3 captured !");
|
||||
globals.requestEEAction = EE_PDS_SAVE;
|
||||
}
|
||||
PersistenceData.activeFaction = FACTION_3;
|
||||
}
|
||||
@ -583,7 +589,7 @@ void ProcessKeyCombos(bool *btnState)
|
||||
if (keyCount_Fac2 == 2 && keyCount_Fac3 == 0)
|
||||
{
|
||||
Serial.println("KeyCombo: WiFi AP ON");
|
||||
OverrideDisplay(5000, "NET ", " "," ");
|
||||
OverrideDisplay(5000, "NET ", " ", " ");
|
||||
toggleWiFiAP(false);
|
||||
}
|
||||
else if (keyCount_Fac2 == 4 && keyCount_Fac3 == 0)
|
||||
|
@ -200,6 +200,12 @@ String processor(const String &var)
|
||||
return temp;
|
||||
}
|
||||
|
||||
if (var == "FACTIONREBOOT_CHECKED")
|
||||
return String(ConfigData.active_faction_on_reboot == true ? "checked" : "");
|
||||
|
||||
if (var == "FACTION_RECOVERY")
|
||||
return String(ConfigData.active_faction_on_reboot);
|
||||
|
||||
return String();
|
||||
}
|
||||
|
||||
@ -256,6 +262,15 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
|
||||
ConfigData.batteryType = temp;
|
||||
}
|
||||
|
||||
if (request->hasParam("factionreboot_cont", true))
|
||||
{
|
||||
AsyncWebParameter *param = request->getParam("factionreboot_cont", true);
|
||||
if (param->value() == "on")
|
||||
ConfigData.active_faction_on_reboot = true;
|
||||
else
|
||||
ConfigData.active_faction_on_reboot = false;
|
||||
}
|
||||
|
||||
if (p->name() == "settingssave")
|
||||
globals.requestEEAction = EE_CFG_SAVE;
|
||||
// end: POST Form Settings
|
||||
|
Loading…
x
Reference in New Issue
Block a user