Feature: Show CONTACTOR_CONTROL status in the WebUI

When CONTACTOR_CONTROL is used, the battery-emulator controls
its own contactors. There is nowhere on the WebUI to show if
the contactors are engaged or not, only an error event is shown
if the contactors are disengaged.

Add an entry in the WebUI to show the CONTACTOR_CONTROL status.

Signed-off-by: Christopher Obbard <obbardc@gmail.com>
This commit is contained in:
Christopher Obbard 2024-09-05 18:25:34 +01:00
parent d7b8509d10
commit 12650d4e7c
3 changed files with 28 additions and 1 deletions

View file

@ -645,6 +645,16 @@ String processor(const String& var) {
else
content += "<h4 style='color: red;'>Pause status: " + String(get_emulator_pause_status().c_str()) + " </h4>";
#ifdef CONTACTOR_CONTROL
content += "<h4>Contactors controlled by Battery-Emulator: ";
if (datalayer.system.status.contactor_control_closed) {
content += "<span style='color: green;'>ON</span>";
} else {
content += "<span style='color: red;'>OFF</span>";
}
content += "</h4>";
#endif
// Close the block
content += "</div>";
@ -720,6 +730,17 @@ String processor(const String& var) {
} else {
content += "<span style='color: red;'>&#10005;</span></h4>";
}
#ifdef CONTACTOR_CONTROL
content += "<h4>Contactors controlled by Battery-Emulator: ";
if (datalayer.system.status.contactor_control_closed) {
content += "<span style='color: green;'>ON</span>";
} else {
content += "<span style='color: red;'>OFF</span>";
}
content += "</h4>";
#endif
if (emulator_pause_status == NORMAL)
content += "<h4>Pause status: " + String(get_emulator_pause_status().c_str()) + " </h4>";
else