fix: digital inputs status LED

This commit is contained in:
ISA
2025-06-20 11:49:13 +02:00
parent b233694fed
commit 846abedae4
8 changed files with 14 additions and 10 deletions

View File

@@ -6,5 +6,5 @@ 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.428 NEXT_PUBLIC_APP_VERSION=1.6.429
NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (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.428 NEXT_PUBLIC_APP_VERSION=1.6.429
NEXT_PUBLIC_CPL_MODE=production NEXT_PUBLIC_CPL_MODE=production

View File

@@ -19,6 +19,7 @@ export default function DigitalInputs({ openInputModal, inputRange }: Props) {
); );
const inputs = digitalInputs.slice(inputRange.start, inputRange.end); const inputs = digitalInputs.slice(inputRange.start, inputRange.end);
//console.log("DigitalInputs", inputs);
return ( return (
<div className="bg-white shadow-md border border-gray-200 p-3 rounded-lg w-full laptop:p-1 xl:p-1"> <div className="bg-white shadow-md border border-gray-200 p-3 rounded-lg w-full laptop:p-1 xl:p-1">

View File

@@ -40,7 +40,7 @@ export default function InputModal({
useEffect(() => { useEffect(() => {
if (reduxInput && isInitialLoad) { if (reduxInput && isInitialLoad) {
//reduxInput //reduxInput
console.log("📦 reduxInput geladen:", reduxInput); //console.log("📦 reduxInput geladen:", reduxInput);
setLabel(reduxInput.label || ""); setLabel(reduxInput.label || "");
setInvertiert(reduxInput.invert); setInvertiert(reduxInput.invert);
setTimeFilter(reduxInput.timeFilter); setTimeFilter(reduxInput.timeFilter);
@@ -55,7 +55,7 @@ export default function InputModal({
const sendCgiUpdate = async (param: string) => { const sendCgiUpdate = async (param: string) => {
const url = `/CPL?/eingaenge.html&${param}`; const url = `/CPL?/eingaenge.html&${param}`;
console.log("📡 CGI senden:", url); //console.log("📡 CGI senden:", url);
const response = await fetch(url); const response = await fetch(url);
if (!response.ok) { if (!response.ok) {

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.428", "version": "1.6.429",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.428", "version": "1.6.429",
"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.428", "version": "1.6.429",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",

View File

@@ -4,7 +4,6 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit";
interface DigitalInput { interface DigitalInput {
id: number; id: number;
label: string; label: string;
status: number;
counter: number; counter: number;
flutter: number; flutter: number;
invert: boolean; invert: boolean;
@@ -12,6 +11,7 @@ interface DigitalInput {
weighting: number; weighting: number;
zaehlerAktiv: boolean; zaehlerAktiv: boolean;
eingangOffline: boolean; eingangOffline: boolean;
status: boolean;
} }
interface DigitalInputsState { interface DigitalInputsState {

View File

@@ -29,6 +29,7 @@ export const fetchDigitalInputsService = async () => {
weighting: win.win_de_weighting[i], weighting: win.win_de_weighting[i],
counterActive: !!win.win_de_counter_active[i], counterActive: !!win.win_de_counter_active[i],
eingangOffline: !!win.win_de_offline[i], eingangOffline: !!win.win_de_offline[i],
status: !!win.win_de_state[i],
})); }));
} }
@@ -39,7 +40,7 @@ export const fetchDigitalInputsService = async () => {
throw new Error("❌ Fehler beim Laden der digitalen Eingänge (json)"); throw new Error("❌ Fehler beim Laden der digitalen Eingänge (json)");
const data = await res.json(); const data = await res.json();
console.log("📡 JSON-Daten geladen in service:", data);
return data.win_de_state.map((_: any, i: number) => ({ return data.win_de_state.map((_: any, i: number) => ({
id: i + 1, id: i + 1,
value: data.win_de_state[i], value: data.win_de_state[i],
@@ -50,6 +51,7 @@ export const fetchDigitalInputsService = async () => {
weighting: data.win_de_weighting[i], weighting: data.win_de_weighting[i],
counterActive: !!data.win_de_counter_active[i], counterActive: !!data.win_de_counter_active[i],
eingangOffline: !!data.win_de_offline[i], eingangOffline: !!data.win_de_offline[i],
status: !!data.win_de_state[i],
})); }));
} }
@@ -60,7 +62,7 @@ export const fetchDigitalInputsService = async () => {
throw new Error("❌ Fehler beim Laden der digitalen Eingänge (json)"); throw new Error("❌ Fehler beim Laden der digitalen Eingänge (json)");
const data = await res.json(); const data = await res.json();
//console.log("📡 JSMOCK-Daten geladen in service:", data); console.log("📡 JSMOCK-Daten geladen in service:", data);
return data.win_de_state.map((_: any, i: number) => ({ return data.win_de_state.map((_: any, i: number) => ({
id: i + 1, id: i + 1,
@@ -72,6 +74,7 @@ export const fetchDigitalInputsService = async () => {
weighting: data.win_de_weighting[i], weighting: data.win_de_weighting[i],
counterActive: !!data.win_de_counter_active[i], counterActive: !!data.win_de_counter_active[i],
eingangOffline: !!data.win_de_offline[i], eingangOffline: !!data.win_de_offline[i],
status: !!data.win_de_state[i],
})); }));
} }