refactor: rename einausgange to digitalOtputs and digitalInputs

This commit is contained in:
ISA
2025-06-27 07:10:34 +02:00
parent b9651a53a9
commit c558b9b826
16 changed files with 36 additions and 69 deletions

View File

@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.483 NEXT_PUBLIC_APP_VERSION=1.6.485
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.483 NEXT_PUBLIC_APP_VERSION=1.6.485
NEXT_PUBLIC_CPL_MODE=production NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,13 @@
## [1.6.485] 2025-06-27
- esLint
---
## [1.6.484] 2025-06-27
- esLint
---
## [1.6.483] 2025-06-26 ## [1.6.483] 2025-06-26
- EsLint - EsLint

View File

@@ -1,5 +1,5 @@
"use client"; "use client";
// /components/main/einausgaenge/DigitalInputs.tsx // /components/main/digitalOutputs/DigitalInputs.tsx
import React from "react"; import React from "react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { RootState } from "../../../redux/store"; import { RootState } from "../../../redux/store";

View File

@@ -1,5 +1,5 @@
"use client"; "use client";
// /components/main/einausgaenge/modals/InputModal.tsx // /components/main/digitalInputs/InputModal.tsx
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { useSelector, useDispatch } from "react-redux"; import { useSelector, useDispatch } from "react-redux";
import { RootState } from "@/redux/store"; import { RootState } from "@/redux/store";

View File

@@ -1,7 +1,7 @@
"use client"; // /components/main/einausgaenge/modals/DigitalOutputsModal.tsx "use client"; // /components/main/digitalOutputs/DigitalOutputsModal.tsx
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { RootState } from "../../../../redux/store"; import { RootState } from "@/redux/store";
import type { DigitalOutput } from "@/types/digitalOutput"; import type { DigitalOutput } from "@/types/digitalOutput";
export default function DigitalOutputsModal({ export default function DigitalOutputsModal({

View File

@@ -1,5 +1,5 @@
"use client"; "use client";
// /components/main/einausgaenge/DigitalOutputsWidget.tsx // /components/main/digitalOutputs/DigitalOutputsWidget.tsx
import React from "react"; import React from "react";
import { useSelector, useDispatch } from "react-redux"; import { useSelector, useDispatch } from "react-redux";
import { RootState, AppDispatch } from "../../../redux/store"; import { RootState, AppDispatch } from "../../../redux/store";

View File

@@ -1,43 +0,0 @@
### 🧩 Datenfluss CPLv4.0 Digitale Eingänge
```mermaid
classDiagram
class EmbeddedServer {
+ Generiert de.js per CGI
+ Ersetzt Platzhalter wie <%=DES81%>
+ Kein Node.js vorhanden
}
class DeJS {
+ JavaScript mit konkreten Werten
+ Beispiel: win_de_state, win_de_label
}
class FrontendLoader {
+ Lädt de.js dynamisch mit script-Tag
+ Pfad: /CPL?/CPL/SERVICE/de.js
}
class DatenMapper {
+ Wandelt window-Variablen in Objekte
+ Wandelt in strukturierte Eingangs-Daten
}
class ReduxStore {
+ digitalInputsSlice
+ Speichert die Eingänge im State
}
class ReactComponent {
+ DigitalInputs.tsx
+ useSelector: Zugriff auf Redux
+ Darstellung mit Tailwind
}
EmbeddedServer --> DeJS : erstellt per CGI
DeJS --> FrontendLoader : wird per Script geladen
FrontendLoader --> DatenMapper : verarbeitet window-Variablen
DatenMapper --> ReduxStore : dispatch(setInputs)
ReduxStore --> ReactComponent : useSelector() → Anzeige
```

View File

@@ -78,7 +78,7 @@ flowchart TD
/mocks/device-cgi-simulator/SERVICE/→ jsSimulatedProd: digitalOutputsMockData.js /mocks/device-cgi-simulator/SERVICE/→ jsSimulatedProd: digitalOutputsMockData.js
/public/CPL/SERVICE/ → production: digitalOutputs.js /public/CPL/SERVICE/ → production: digitalOutputs.js
/pages/api/cpl/ → GET/POST-Handler für json + jsSimulatedProd /pages/api/cpl/ → GET/POST-Handler für json + jsSimulatedProd
/components/main/einausgaenge/ → UI-Komponente: DigitalOutputsWidget.tsx /components/main/digitalOutputs/ → UI-Komponente: DigitalOutputsWidget.tsx
``` ```
--- ---

View File

@@ -11,5 +11,5 @@
--- ---
📄 **Quelle:** Abschnitt 4.1.2 im Lastenheft 📄 **Quelle:** Abschnitt 4.1.2 im Lastenheft
📁 **Komponente:** `/components/einausgaenge.tsx` 📁 **Komponente:** `/components/digitalInputs.tsx`
🛠️ **API-Route:** `/pages/api/cpl/digitaleEingaenge.ts` 🛠️ **API-Route:** `/pages/api/cpl/digitalInputs.ts`

View File

@@ -102,7 +102,7 @@
0 0
], ],
"win_de_time_filter": [ "win_de_time_filter": [
2, 1,
0, 0,
1, 1,
0, 0,
@@ -136,7 +136,7 @@
0 0
], ],
"win_de_weighting": [ "win_de_weighting": [
4, 3,
0, 0,
1, 1,
0, 0,
@@ -238,7 +238,7 @@
0 0
], ],
"win_de_label": [ "win_de_label": [
"DE11", "DE1",
"DE2", "DE2",
"DE3", "DE3",
"DE4", "DE4",

View File

@@ -1,12 +1,12 @@
{ {
"win_da_state": [ "win_da_state": [
0, 1,
0, 0,
0, 0,
1 1
], ],
"win_da_bezeichnung": [ "win_da_bezeichnung": [
"Ausgang11", "Ausgang1",
"Ausgang2", "Ausgang2",
"Ausgang3", "Ausgang3",
"Ausgang4" "Ausgang4"

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.483", "version": "1.6.485",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.483", "version": "1.6.485",
"dependencies": { "dependencies": {
"@fontsource/roboto": "^5.1.0", "@fontsource/roboto": "^5.1.0",
"@iconify-icons/ri": "^1.2.10", "@iconify-icons/ri": "^1.2.10",

View File

@@ -1,6 +1,6 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.483", "version": "1.6.485",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",

View File

@@ -4,13 +4,13 @@ import React, { useEffect, useState } from "react";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { AppDispatch } from "@/redux/store"; import { AppDispatch } from "@/redux/store";
import InputModal from "@/components/main/einausgaenge/modals/InputModal"; import InputModal from "@/components/main/digitalInputs/digitalInputsModal";
import { getDigitalInputsThunk } from "@/redux/thunks/getDigitalInputsThunk"; import { getDigitalInputsThunk } from "@/redux/thunks/getDigitalInputsThunk";
import DigitalInputs from "@/components/main/einausgaenge/DigitalInputs"; import DigitalInputs from "@/components/main/digitalInputs/DigitalInputsWidget";
const EinAusgaenge: React.FC = () => { const digitalInputs: React.FC = () => {
const dispatch = useDispatch<AppDispatch>(); const dispatch = useDispatch<AppDispatch>();
interface DigitalInput { interface DigitalInput {
id: number; id: number;
@@ -70,4 +70,4 @@ const EinAusgaenge: React.FC = () => {
); );
}; };
export default EinAusgaenge; export default digitalInputs;

View File

@@ -4,15 +4,15 @@ import React, { useEffect, useState } from "react";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { AppDispatch } from "@/redux/store"; import { AppDispatch } from "@/redux/store";
import DigitalOutputsModal from "../components/main/einausgaenge/modals/DigitalOutputsModal"; import DigitalOutputsModal from "../components/main/digitalOutputs/DigitalOutputsModal";
import DigitalOutputs from "../components/main/einausgaenge/DigitalOutputsWidget"; import DigitalOutputs from "../components/main/digitalOutputs/DigitalOutputsWidget";
import { getDigitalInputsThunk } from "@/redux/thunks/getDigitalInputsThunk"; import { getDigitalInputsThunk } from "@/redux/thunks/getDigitalInputsThunk";
import { getDigitalOutputsThunk } from "@/redux/thunks/getDigitalOutputsThunk"; import { getDigitalOutputsThunk } from "@/redux/thunks/getDigitalOutputsThunk";
import type { DigitalOutput } from "@/types/digitalOutput"; import type { DigitalOutput } from "@/types/digitalOutput";
const EinAusgaenge: React.FC = () => { const digitalOutputs: React.FC = () => {
const dispatch = useDispatch<AppDispatch>(); const dispatch = useDispatch<AppDispatch>();
const [selectedOutput, setSelectedOutput] = useState<DigitalOutput | null>( const [selectedOutput, setSelectedOutput] = useState<DigitalOutput | null>(
null null
@@ -59,4 +59,4 @@ const EinAusgaenge: React.FC = () => {
); );
}; };
export default EinAusgaenge; export default digitalOutputs;