From 0cff3e0ccf289d3b5da7e1b530f3186d50d2acb4 Mon Sep 17 00:00:00 2001 From: ISA Date: Wed, 23 Oct 2024 19:53:17 +0200 Subject: [PATCH] =?UTF-8?q?LED=20Alarm=20in=20Kabel=C3=BCberwachung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/kabelueberwachung/page.jsx | 40 ++++++++++++++++++++------------- components/modules/Kue705FO.jsx | 13 ++++++----- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/app/kabelueberwachung/page.jsx b/app/kabelueberwachung/page.jsx index c85443f..179e2de 100644 --- a/app/kabelueberwachung/page.jsx +++ b/app/kabelueberwachung/page.jsx @@ -119,21 +119,31 @@ function Kabelueberwachung() {
- {racks[`rack${activeRack}`].map((slot, index) => ( -
- - {console.log( - `Module Data (Rack ${activeRack}, Slot ${index + 1}):`, - slot - )} -
- ))} + {racks[`rack${activeRack}`].map((slot, index) => { + const slotIndex = index + (activeRack - 1) * 8; + const alarmStatus = + (window.kueAlarm1 && window.kueAlarm1[slotIndex]) || + (window.kueAlarm2 && window.kueAlarm2[slotIndex]) || + (window.kueCableBreak && window.kueCableBreak[slotIndex]) || + (window.kueGroundFault && window.kueGroundFault[slotIndex]); + + return ( +
+ + {console.log( + `Module Data (Rack ${activeRack}, Slot ${index + 1}):`, + slot + )} +
+ ); + })}
); diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx index 35efffc..8b5136f 100644 --- a/components/modules/Kue705FO.jsx +++ b/components/modules/Kue705FO.jsx @@ -13,6 +13,7 @@ function Kue705FO({ kueOnline, slotIndex, tdrLocation, + alarmStatus, }) { const [currentModulName, setCurrentModulName] = useState(modulName); const [activeButton, setActiveButton] = useState("Schleife"); @@ -177,6 +178,11 @@ function Kue705FO({ } */ //------------------------------------------------- let slot = slotIndex; + const alarmStatus = + (window.kueAlarm1 && window.kueAlarm1[slotIndex]) || + (window.kueAlarm2 && window.kueAlarm2[slotIndex]) || + (window.kueCableBreak && window.kueCableBreak[slotIndex]) || + (window.kueGroundFault && window.kueGroundFault[slotIndex]); if (slot >= 32) { return; @@ -307,12 +313,7 @@ function Kue705FO({
Alarm