polylines mit Messwert und Schleifenwert
This commit is contained in:
@@ -33,10 +33,12 @@ const useLineData = (webserviceGisLinesStatusUrl, setLineStatusData) => {
|
|||||||
schleifenwert: undefined,
|
schleifenwert: undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (statis.DpName.includes("_Messwert") && statis.Value !== "True" && valueMap[key].messwert === undefined) {
|
// Füge Messwert hinzu, falls es noch nicht vorhanden ist
|
||||||
|
if (statis.DpName.endsWith("_Messwert") && statis.Value !== "True" && !valueMap[key].messwert) {
|
||||||
valueMap[key].messwert = statis.Value;
|
valueMap[key].messwert = statis.Value;
|
||||||
}
|
}
|
||||||
if (statis.DpName.includes("_Schleifenwert") && valueMap[key].schleifenwert === undefined) {
|
// Füge Schleifenwert hinzu, falls es noch nicht vorhanden ist
|
||||||
|
if (statis.DpName.endsWith("_Schleifenwert") && !valueMap[key].schleifenwert) {
|
||||||
valueMap[key].schleifenwert = statis.Value;
|
valueMap[key].schleifenwert = statis.Value;
|
||||||
}
|
}
|
||||||
if (statis.Message && statis.Message !== "?") {
|
if (statis.Message && statis.Message !== "?") {
|
||||||
@@ -94,7 +96,7 @@ const useLineData = (webserviceGisLinesStatusUrl, setLineStatusData) => {
|
|||||||
// Funktion zum Loggen der gruppierten und aggregierten Daten
|
// Funktion zum Loggen der gruppierten und aggregierten Daten
|
||||||
function logGroupedData(statisList) {
|
function logGroupedData(statisList) {
|
||||||
const grouped = statisList.reduce((acc, item) => {
|
const grouped = statisList.reduce((acc, item) => {
|
||||||
const { IdLD, Modul, Level, PrioColor, PrioName, ModulName, ModulTyp, Message } = item;
|
const { IdLD, Modul, Level, PrioColor, PrioName, ModulName, ModulTyp, Message, DpName, Value } = item;
|
||||||
|
|
||||||
if (!acc[IdLD]) {
|
if (!acc[IdLD]) {
|
||||||
acc[IdLD] = {};
|
acc[IdLD] = {};
|
||||||
@@ -104,10 +106,12 @@ function logGroupedData(statisList) {
|
|||||||
acc[IdLD][Modul] = {
|
acc[IdLD][Modul] = {
|
||||||
ModulName: ModulName || "Unknown",
|
ModulName: ModulName || "Unknown",
|
||||||
ModulTyp: ModulTyp || "N/A",
|
ModulTyp: ModulTyp || "N/A",
|
||||||
TotalLevel: Level, // Use the original Level directly
|
TotalLevel: Level, // Verwende den ursprünglichen Level-Wert
|
||||||
PrioColors: new Set(),
|
PrioColors: new Set(),
|
||||||
PrioNames: new Set(),
|
PrioNames: new Set(),
|
||||||
Messages: [],
|
Messages: [],
|
||||||
|
Messwert: undefined, // Neuer Wert für Messwert
|
||||||
|
Schleifenwert: undefined, // Neuer Wert für Schleifenwert
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,6 +122,16 @@ function logGroupedData(statisList) {
|
|||||||
acc[IdLD][Modul].Messages.push(Message);
|
acc[IdLD][Modul].Messages.push(Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Füge Messwert hinzu, wenn DpName "_Messwert" enthält und es noch nicht gesetzt ist
|
||||||
|
if (DpName.endsWith("_Messwert") && !acc[IdLD][Modul].Messwert) {
|
||||||
|
acc[IdLD][Modul].Messwert = Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Füge Schleifenwert hinzu, wenn DpName "_Schleifenwert" enthält und es noch nicht gesetzt ist
|
||||||
|
if (DpName.endsWith("_Schleifenwert") && !acc[IdLD][Modul].Schleifenwert) {
|
||||||
|
acc[IdLD][Modul].Schleifenwert = Value;
|
||||||
|
}
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
@@ -125,15 +139,17 @@ function logGroupedData(statisList) {
|
|||||||
const formattedData = {};
|
const formattedData = {};
|
||||||
Object.entries(grouped).forEach(([stationId, modules]) => {
|
Object.entries(grouped).forEach(([stationId, modules]) => {
|
||||||
const filteredModules = Object.entries(modules)
|
const filteredModules = Object.entries(modules)
|
||||||
.filter(([modulId, data]) => data.ModulName !== "?") // Filter out modules without names
|
.filter(([modulId, data]) => data.ModulName !== "?") // Filtere Module ohne Namen heraus
|
||||||
.map(([modulId, data]) => ({
|
.map(([modulId, data]) => ({
|
||||||
Modul: modulId,
|
Modul: modulId,
|
||||||
ModulName: data.ModulName,
|
ModulName: data.ModulName,
|
||||||
ModulTyp: data.ModulTyp,
|
ModulTyp: data.ModulTyp,
|
||||||
Level: data.TotalLevel, // Use the original Level
|
TotalLevel: data.TotalLevel, // Verwende den ursprünglichen Level
|
||||||
PrioColors: Array.from(data.PrioColors).join(", "),
|
PrioColors: Array.from(data.PrioColors).join(", "),
|
||||||
PrioNames: Array.from(data.PrioNames).join(", "),
|
PrioNames: Array.from(data.PrioNames).join(", "),
|
||||||
Messages: data.Messages.join(" | "),
|
Messages: data.Messages.join(" | "),
|
||||||
|
Messwert: data.Messwert, // Füge Messwert hinzu
|
||||||
|
Schleifenwert: data.Schleifenwert, // Füge Schleifenwert hinzu
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (filteredModules.length > 0) {
|
if (filteredModules.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user