DTCs now hav severity and improved DTCMaintenance

This commit is contained in:
2022-08-22 14:13:55 +02:00
parent 808709f5c2
commit bd4c1d9d53
14 changed files with 109 additions and 29 deletions

View File

@@ -16,7 +16,7 @@ void initWebUI()
if (!LittleFS.begin())
{
Serial.println("An Error has occurred while mounting LittleFS");
MaintainDTC(DTC_FLASHFS_ERROR, true);
MaintainDTC(DTC_FLASHFS_ERROR, DTC_CRITICAL, true);
return;
}
@@ -117,7 +117,7 @@ String processor(const String &var)
return "hidden";
#endif
if (var == "SHOW_DTC_TABLE")
return globals.systemStatus == sysStat_Error ? "" : "hidden";
return globals.hasDTC ? "" : "hidden";
if (var == "DTC_TABLE")
{
@@ -137,6 +137,20 @@ String processor(const String &var)
temp = temp + "<tr><td>" + String(buff_timestamp);
temp = temp + "</td><td>" + String(DTCStorage[i].Number) + "</td><td>";
temp = temp + "<img src=static/img/";
switch (DTCStorage[i].severity)
{
case DTC_CRITICAL:
temp = temp + "critical";
break;
case DTC_WARN:
temp = temp + "warn";
break;
case DTC_INFO:
temp = temp + "info";
break;
}
temp = temp + "_black.png></td><td>";
if (DTCStorage[i].active == DTC_ACTIVE)
temp = temp + "active";