diff --git a/apiMockData/SERVICE/kabelueberwachungMockData.js b/apiMockData/SERVICE/kabelueberwachungMockData.js index b4f09e3..882a90f 100644 --- a/apiMockData/SERVICE/kabelueberwachungMockData.js +++ b/apiMockData/SERVICE/kabelueberwachungMockData.js @@ -133,19 +133,61 @@ var win_kueID = [ "Kabel 32", ]; +// Kabelnamen in der Anzeige +var win_kueName = [ + "Kabel 1", + "Kabel 2", + "Kabel 3", + "Kabel 4", + "Kabel 5", + "Kabel 6", + "Kabel 7", + "Kabel 8", + "Kabel 9", + "Kabel 10", + "Kabel 11", + "Kabel 12", + "Kabel 13", + "Kabel 14", + "Kabel 15", + "Kabel 16", + "Kabel 17", + "Kabel 18", + "Kabel 19", + "Kabel 20", + "Kabel 21", + "Kabel 22", + "Kabel 23", + "Kabel 24", + "Kabel 25", + "Kabel 26", + "Kabel 27", + "Kabel 28", + "Kabel 29", + "Kabel 30", + "Kabel 31", + "Kabel 32", +]; + //-------------TDR--------------------------------------------------- var win_tdrActive = [ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, ]; //---------------------------------------------------- var win_tdrAtten = [ - 11, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 + 11, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, + 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, + 2.0, ]; var win_tdrSpeed = [ - 112, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 + 112, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, ]; var win_tdrTrigger = [ - 102, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80 + 102, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, ]; //---------------------------------------------------- var win_tdrPulse = [ diff --git a/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx b/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx index 26be6ca..ffa79d1 100644 --- a/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx +++ b/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx @@ -38,6 +38,7 @@ export default function KueEinstellung({ const dispatch = useDispatch(); const { kueID, + kueName, kueLimit1, kueDelay1, kueLimit2Low, @@ -57,7 +58,8 @@ export default function KueEinstellung({ const [formData, setFormData] = useState(() => { if (cached) return cached; return { - name: kueID[slot] || "", + kueID: kueID[slot] || "", + kueName: kueName[slot] || "", limit1: kueLimit1[slot]?.toString() ?? "", delay1: kueDelay1[slot]?.toString() ?? "", limit2Low: kueLimit2Low[slot]?.toString() ?? "", @@ -74,9 +76,12 @@ export default function KueEinstellung({ } }; - const handleSaveWrapper = () => { + const handleSaveWrapper = async () => { const updatedKueID = [...kueID]; - updatedKueID[slot] = formData.name; + updatedKueID[slot] = formData.kueID; + + const updatedKueName = [...kueName]; + updatedKueName[slot] = formData.kueName; const updatedLimit1 = [...kueLimit1]; updatedLimit1[slot] = Number(formData.limit1); @@ -93,31 +98,9 @@ export default function KueEinstellung({ const updatedMemoryInterval = [...memoryInterval]; updatedMemoryInterval[slot] = Number(formData.memoryInterval); - handleSave({ - ids: updatedKueID, - isolationsgrenzwerte: updatedLimit1, - verzoegerung: updatedDelay1, - untereSchleifenGrenzwerte: updatedLimit2Low, - obereSchleifenGrenzwerte: updatedLimit2Low, - schleifenintervall: updatedLoopInterval, - speicherintervall: updatedMemoryInterval, - originalValues: { - kueID, - isolationsgrenzwerte: kueLimit1, - verzoegerung: kueDelay1, - untereSchleifenGrenzwerte: kueLimit2Low, - obereSchleifenGrenzwerte: kueLimit2Low, - schleifenintervall: kueLoopInterval, - speicherintervall: memoryInterval, - }, - slot, - dispatch, - onModulNameChange: onModulNameChange ?? (() => {}), - onClose, - }); - const newData = { - name: updatedKueID[slot], + kueID: updatedKueID[slot], + kueName: updatedKueName[slot], limit1: updatedLimit1[slot].toString(), delay1: updatedDelay1[slot].toString(), limit2Low: updatedLimit2Low[slot].toString(), @@ -126,10 +109,35 @@ export default function KueEinstellung({ }; setFormData(newData); - if (typeof window !== "undefined") { - window.__kueCache![formCacheKey] = newData; + window.__kueCache![`slot_${slot}`] = newData; } + + // 🔧 handleSave aufrufen mit allen Daten + await handleSave({ + slot, + ids: updatedKueID, + kueName: updatedKueName, + isolationsgrenzwerte: updatedLimit1, + verzoegerung: updatedDelay1, + untereSchleifenGrenzwerte: updatedLimit2Low, + obereSchleifenGrenzwerte: updatedLimit2Low, // ggf. anpassen, falls du später High-Werte brauchst + schleifenintervall: updatedLoopInterval, + speicherintervall: updatedMemoryInterval, + originalValues: { + kueID, + kueName, + isolationsgrenzwerte: kueLimit1, + verzoegerung: kueDelay1, + untereSchleifenGrenzwerte: kueLimit2Low, + obereSchleifenGrenzwerte: kueLimit2Low, + schleifenintervall: kueLoopInterval, + speicherintervall: memoryInterval, + }, + dispatch, + onModulNameChange, + onClose, + }); }; return ( @@ -137,11 +145,22 @@ export default function KueEinstellung({ {/* Kabelbezeichnung */}
+ +
+ {/* Kabelname */} +
+ handleChange("name", e.target.value)} + value={formData.kueName} + onChange={(e) => handleChange("kueName", e.target.value)} />
{/* Speicherintervall */} @@ -223,7 +242,7 @@ export default function KueEinstellung({ -
+
{isAdminLoggedIn && (