feat: Fallsensors

This commit is contained in:
ISA
2025-07-23 15:11:13 +02:00
parent bdbdd27963
commit ada2f5e2a7
12 changed files with 75 additions and 8 deletions

View File

@@ -0,0 +1,27 @@
import React from "react";
// components/main/fall-detection-sensors/FallSensors.tsx
const FallSensors = () => {
const sensors = [
{ id: "KVZ1", status: "inactive" },
{ id: "KVZ2", status: "active" },
{ id: "KVZ3", status: "active" },
{ id: "KVZ4", status: "active" },
];
return (
<div className="flex gap-1 p-1 border rounded bg-gray-200">
{sensors.map((sensor) => (
<div key={sensor.id} className="flex flex-col items-center gap-1">
<span className="text-[0.5rem]">{sensor.id}</span>
<div
className={`w-4 h-4 flex items-center justify-center rounded-full border ${
sensor.status === "active" ? "bg-green-400" : "bg-red-400"
}`}
></div>
</div>
))}
</div>
);
};
export default FallSensors;

View File

@@ -58,6 +58,7 @@ function KabelueberwachungView() {
kueOnlineStatus: kueOnline[index],
alarmStatus: alarmStatus[index],
tdrLocation: [], // Placeholder, replace with actual tdrLocation if available
win_fallSensorsActive: kueOnline[index] ? 1 : 0, // Beispielwert, anpassen je nach Logik
}));
//console.log("Alle Module:", allModules);
@@ -146,6 +147,7 @@ function KabelueberwachungView() {
kueOnlineStatus: number;
alarmStatus?: boolean;
tdrLocation: number[];
win_fallSensorsActive: number;
},
index: number
) => {
@@ -160,6 +162,7 @@ function KabelueberwachungView() {
alarmStatus={slot.alarmStatus}
slotIndex={slotIndex}
tdrLocation={slot.tdrLocation}
win_fallSensorsActive={slot.win_fallSensorsActive}
/>
</div>
);

View File

@@ -25,6 +25,7 @@ import handleCloseModal from "./handlers/handleCloseModal";
import handleOpenChartModal from "./handlers/handleOpenChartModal";
import handleCloseChartModal from "./handlers/handleCloseChartModal";
import handleRefreshClick from "./handlers/handleRefreshClick";
import FallSensors from "@/components/main/fall-detection-sensors/FallSensors";
const Kue705FO: React.FC<Kue705FOProps> = ({
isolationswert,
@@ -33,6 +34,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
kueOnline,
slotIndex,
tdrLocation,
win_fallSensorsActive,
}) => {
/* console.log(
`Rendering Kue705FO - SlotIndex: ${slotIndex}, ModulName: ${modulName}`
@@ -167,9 +169,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
return (
<div
className="relative bg-gray-300 w-[7.25rem] h-[24.375rem] border border-gray-400 transform laptop:-translate-y-12 2xl:-translate-y-0
scale-100 sm:scale-95 md:scale-100 lg:scale-105 xl:scale-90 2xl:scale-125 top-3 qhd:scale-150 qhd:-translate-y-0
"
scale-100 sm:scale-95 md:scale-100 lg:scale-105 xl:scale-90 2xl:scale-125 top-3 qhd:scale-150 qhd:-translate-y-0"
>
{kueOnline === 1 ? (
<>
@@ -363,8 +363,19 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
>
Messkurve
</button>
{/* Sensoren anzeigen */}
{
/* if Kabelüberwachungsmodul online (kue_online ) */
kueOnline === 1 && win_fallSensorsActive === 1 && (
<div className="mt-4 w-full flex justify-center">
<FallSensors />
</div>
)
}
</div>
{/* Modal für Einstellungen */}
{/* Modal für Messkurve */}
{showChartModal && (
<ChartSwitcher