mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Batteries implement HTML renderers for status and commands
This commit is contained in:
parent
d1fb28337e
commit
662ae57d2b
48 changed files with 2345 additions and 2020 deletions
28
Software/src/battery/ECMP-HTML.h
Normal file
28
Software/src/battery/ECMP-HTML.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#ifndef _ECMP_HTML_H
|
||||
#define _ECMP_HTML_H
|
||||
|
||||
#include "../datalayer/datalayer.h"
|
||||
#include "../datalayer/datalayer_extended.h"
|
||||
#include "src/devboard/webserver/BatteryHtmlRenderer.h"
|
||||
|
||||
class EcmpHtmlRenderer : public BatteryHtmlRenderer {
|
||||
public:
|
||||
String get_status_html() {
|
||||
String content;
|
||||
|
||||
content += "<h4>Main Connector State: ";
|
||||
if (datalayer_extended.stellantisECMP.MainConnectorState == 0) {
|
||||
content += "Contactors open</h4>";
|
||||
} else if (datalayer_extended.stellantisECMP.MainConnectorState == 0x01) {
|
||||
content += "Precharged</h4>";
|
||||
} else {
|
||||
content += "Invalid</h4>";
|
||||
}
|
||||
content +=
|
||||
"<h4>Insulation Resistance: " + String(datalayer_extended.stellantisECMP.InsulationResistance) + "kOhm</h4>";
|
||||
|
||||
return content;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue