refactor: OPC-UA Variablen aus variablesSlice entfernt und in opcuaSettingsSlice integriert

- OPC-UA Variablen (`opcUaZustand`, `opcUaActiveClientCount`, `opcUaNodesetName`) aus `variablesSlice` entfernt
- `_app.tsx` angepasst, um OPC-UA Daten direkt in `opcuaSettingsSlice` zu speichern
- `loadWindowVariables.ts` aktualisiert:
  - OPC-UA Status, Verschlüsselung, aktive Clients und Nodeset werden nun in `opcuaSettingsSlice` gespeichert
  - `variablesSlice` speichert keine OPC-UA Daten mehr
- Redux-Store aufgeräumt: DevTools zeigt keine OPC-UA Variablen mehr in `variablesSlice`

Jetzt ist die Trennung zwischen `variablesSlice` und `opcuaSettingsSlice` vollständig! 🚀🔥
This commit is contained in:
Ismail Ali
2025-02-23 11:59:40 +01:00
parent 772ef50af5
commit 19b661fc70
3 changed files with 21 additions and 28 deletions

View File

@@ -14,7 +14,6 @@ export interface VariablesState {
obereSchleifenGrenzwerte: number[];
schleifenintervall: number[];
//---------------
de: string | null;
counter: number | null;
flutter: string | null;
@@ -25,8 +24,8 @@ export interface VariablesState {
kueAlarm1: number[];
kueAlarm2: number[];
kueResidence: string[];
kueCableBreak: number[];
kueGroundFault: number[];
kueCableBreak: string[];
kueGroundFault: string[];
kueLimit1: number | null;
kueLimit2Low: number | null;
kueDelay1: number | null;
@@ -50,15 +49,11 @@ export interface VariablesState {
win_analogeEingaenge6: string | null;
win_analogeEingaenge7: string | null;
win_analogeEingaenge8: string | null;
opcUaZustand: string | null;
opcUaActiveClientCount: number | null;
opcUaNodesetName: string | null;
}
// Initialer Zustand
const initialState: VariablesState = {
selectedFileName: null,
//------------
selectedChartData: null,
kueBezeichnungen: [],
isolationsgrenzwerte: [],
@@ -66,8 +61,6 @@ const initialState: VariablesState = {
untereSchleifenGrenzwerte: [],
obereSchleifenGrenzwerte: [],
schleifenintervall: [],
//---------------
de: null,
counter: null,
flutter: null,
@@ -103,9 +96,6 @@ const initialState: VariablesState = {
win_analogeEingaenge6: null,
win_analogeEingaenge7: null,
win_analogeEingaenge8: null,
opcUaZustand: null,
opcUaActiveClientCount: null,
opcUaNodesetName: null,
};
// Slice erstellen
@@ -124,7 +114,6 @@ const variablesSlice = createSlice({
(state[key] as VariablesState[keyof VariablesState]) = value;
},
setVariables(state, action: PayloadAction<Partial<VariablesState>>) {
//console.log("setVariables aufgerufen mit:", action.payload);
Object.entries(action.payload).forEach(([key, value]) => {
(state[
key as keyof VariablesState
@@ -137,15 +126,6 @@ const variablesSlice = createSlice({
setSelectedFileName(state, action: PayloadAction<string | null>) {
state.selectedFileName = action.payload;
},
setOpcUaZustand(state, action: PayloadAction<string | null>) {
state.opcUaZustand = action.payload;
},
setOpcUaActiveClientCount(state, action: PayloadAction<number | null>) {
state.opcUaActiveClientCount = action.payload;
},
setOpcUaNodesetName(state, action: PayloadAction<string | null>) {
state.opcUaNodesetName = action.payload;
},
},
});
@@ -154,8 +134,6 @@ export const {
setVariables,
setSelectedChartData,
setSelectedFileName,
setOpcUaZustand,
setOpcUaActiveClientCount,
setOpcUaNodesetName,
} = variablesSlice.actions;
export default variablesSlice.reducer;