From d6ed002ff386c816ed70de5f2bae01db234a161d Mon Sep 17 00:00:00 2001 From: ISA Date: Fri, 24 Jan 2025 08:59:23 +0100 Subject: [PATCH] Xio-PM mit Mock Daten --- .../modules/AnalogeEingaengeComponent.tsx | 6 +- components/modules/XioPM.tsx | 79 +++++++++ pages/analogeEingaenge.js | 167 ++++++++++-------- 3 files changed, 173 insertions(+), 79 deletions(-) create mode 100644 components/modules/XioPM.tsx diff --git a/components/modules/AnalogeEingaengeComponent.tsx b/components/modules/AnalogeEingaengeComponent.tsx index 3d00574..a0d323e 100644 --- a/components/modules/AnalogeEingaengeComponent.tsx +++ b/components/modules/AnalogeEingaengeComponent.tsx @@ -44,10 +44,8 @@ const AnalogeEingaengeComponent = () => { ]; return ( -
-

- Analoge Eingänge -

+
+

Analoge Eingänge

diff --git a/components/modules/XioPM.tsx b/components/modules/XioPM.tsx new file mode 100644 index 0000000..1e77f40 --- /dev/null +++ b/components/modules/XioPM.tsx @@ -0,0 +1,79 @@ +"use client"; + +import React from "react"; +import { Icon } from "@iconify/react"; + +interface InputData { + id: number; + value: number; + name: string; + uW: boolean; + uG: boolean; + oW: boolean; + oG: boolean; +} + +interface XioPmProps { + title: string; + data: InputData[]; + onConfigClick: (id: number) => void; +} + +const XioPM: React.FC = ({ title, data, onConfigClick }) => ( +
+

{title}

+
+ + + + + + + + + + + + + + {data.map((input) => ( + + + + + + + + + + + ))} + +
EingangWertBezeichnunguWuGoWoGAktion
{input.id}{input.value.toFixed(2)}{input.name} + + ● + + + + ● + + + + ● + + + + ● + + + +
+
+); + +export default XioPM; diff --git a/pages/analogeEingaenge.js b/pages/analogeEingaenge.js index 18f0721..5cb83bc 100644 --- a/pages/analogeEingaenge.js +++ b/pages/analogeEingaenge.js @@ -1,12 +1,13 @@ "use client"; // pages/analogeEingaenge.js import React, { useState } from "react"; import AnalogeEingaengeComponent from "../components/modules/AnalogeEingaengeComponent"; +import XioPM from "../components/modules/XioPM"; function AnalogeEingaenge() { const [activeConfig, setActiveConfig] = useState(null); // Mock-Daten für XIO-PM 1 - const xioPmInputs = [ + const xioPm1Inputs = [ { id: 1, value: 1.34, @@ -54,16 +55,16 @@ function AnalogeEingaenge() { }, { id: 6, - value: 8.77, + value: 7.94, name: "----", uW: true, uG: true, - oW: false, + oW: true, oG: true, }, { id: 7, - value: 10.59, + value: 7.94, name: "----", uW: true, uG: true, @@ -72,20 +73,94 @@ function AnalogeEingaenge() { }, { id: 8, - value: 15.11, + value: 7.94, + name: "----", + uW: true, + uG: true, + oW: true, + oG: true, + }, + ]; + + // Mock-Daten für XIO-PM 2 + const xioPm2Inputs = [ + { + id: 1, + value: 2.78, + name: "Test2", + uW: true, + uG: false, + oW: true, + oG: false, + }, + { + id: 2, + value: 4.33, + name: "----", + uW: false, + uG: true, + oW: false, + oG: true, + }, + { + id: 3, + value: 8.94, name: "----", uW: true, uG: true, oW: false, oG: true, }, + { + id: 4, + value: 9.44, + name: "----", + uW: true, + uG: false, + oW: true, + oG: false, + }, + { + id: 5, + value: 6.13, + name: "----", + uW: true, + uG: true, + oW: true, + oG: true, + }, + { + id: 6, + value: 7.94, + name: "----", + uW: true, + uG: true, + oW: true, + oG: true, + }, + { + id: 7, + value: 7.94, + name: "----", + uW: true, + uG: true, + oW: true, + oG: true, + }, + { + id: 8, + value: 7.94, + name: "----", + uW: true, + uG: true, + oW: true, + oG: true, + }, ]; return (
- {/* Main Content */}
- {/*Erste Box -> Analoge Eingänge */} {/* Zweite Box */} @@ -94,75 +169,17 @@ function AnalogeEingaenge() {

Diagramm wird hier eingefügt

- {/* Dritte Box */} -
-

XIO-PM 1

- - - - - - - - - - - - - - - {xioPmInputs.map((input) => ( - - - - - - - - - - - ))} - -
EingangWertBezeichnunguWuGoWoGAktion
{input.id}{input.value}{input.name} - - ● - - - - ● - - - - ● - - - - ● - - - -
-
+ setActiveConfig(id)} + /> - {/* Vierte Box */} -
-

XIO-PM 2

-

Inhalt für XIO-PM 2 wird hier eingefügt

-
+ setActiveConfig(id)} + />
);