reworked DTC-Data handling

This commit is contained in:
2023-09-27 19:13:54 +02:00
parent d593e40f38
commit 2138f640ee
27 changed files with 397 additions and 149 deletions

View File

@@ -19,6 +19,7 @@ AsyncWebSocket webSocket("/ws");
void WebsocketEvent_Callback(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len);
void Websocket_HandleMessage(void *arg, uint8_t *data, size_t len);
void Websocket_RefreshClientData_DTCs();
#endif
@@ -27,7 +28,7 @@ void initWebUI()
if (!LittleFS.begin())
{
Debug_pushMessage("An Error has occurred while mounting LittleFS\n");
MaintainDTC(DTC_FLASHFS_ERROR, DTC_CRITICAL, true);
MaintainDTC(DTC_FLASHFS_ERROR, true);
return;
}
@@ -37,7 +38,7 @@ void initWebUI()
snprintf(buffer, sizeof(buffer), "%d.%02d", constants.Required_Flash_Version_major, constants.Required_Flash_Version_minor);
if (strcmp(globals.FlashVersion, buffer))
{
MaintainDTC(DTC_FLASHFS_VERSION_ERROR, DTC_WARN, true);
MaintainDTC(DTC_FLASHFS_VERSION_ERROR, true);
}
MDNS.begin(globals.DeviceName);
@@ -183,7 +184,7 @@ String processor(const String &var)
temp = temp + " data-debugval=" + String(DTCStorage[i].debugVal) + "><td>" + String(buff_timestamp);
temp = temp + "</td><td>" + String(DTCStorage[i].Number) + "</td><td>";
temp = temp + "<img src=static/img/";
switch (DTCStorage[i].severity)
switch (getSeverityForDTC(DTCStorage[i].Number))
{
case DTC_CRITICAL:
temp = temp + "critical";
@@ -194,6 +195,9 @@ String processor(const String &var)
case DTC_INFO:
temp = temp + "info";
break;
case DTC_NONE:
temp = temp + "none";
break;
}
temp = temp + ".png></td><td>";