Add: SERVICE JSON Files
This commit is contained in:
BIN
redux/slices.zip
Normal file
BIN
redux/slices.zip
Normal file
Binary file not shown.
35
redux/slices/selectedAnalogInputSlice.ts
Normal file
35
redux/slices/selectedAnalogInputSlice.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// /redux/slices/selectedAnalogInputSlice.ts
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
export interface SelectedAnalogInput {
|
||||
id: number;
|
||||
label: string;
|
||||
unit?: string;
|
||||
value?: number;
|
||||
offset?: number;
|
||||
factor?: number;
|
||||
loggerInterval?: number;
|
||||
weighting?: number;
|
||||
}
|
||||
|
||||
const initialState: SelectedAnalogInput | null = null;
|
||||
|
||||
const selectedAnalogInputSlice = createSlice({
|
||||
name: "selectedAnalogInput",
|
||||
initialState,
|
||||
reducers: {
|
||||
setSelectedAnalogInput: (
|
||||
state,
|
||||
action: PayloadAction<SelectedAnalogInput>
|
||||
) => {
|
||||
return action.payload;
|
||||
},
|
||||
clearSelectedAnalogInput: () => {
|
||||
return null;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setSelectedAnalogInput, clearSelectedAnalogInput } =
|
||||
selectedAnalogInputSlice.actions;
|
||||
export default selectedAnalogInputSlice.reducer;
|
||||
@@ -24,6 +24,7 @@ import tdrReferenceChartDataBySlotReducer from "./slices/tdrReferenceChartDataBy
|
||||
import loopChartTypeSlice from "./slices/loopChartTypeSlice";
|
||||
import systemVoltTempReducer from "./slices/systemVoltTempSlice";
|
||||
import analogInputsHistoryReducer from "./slices/analogInputsHistorySlice";
|
||||
import selectedAnalogInputReducer from "./slices/selectedAnalogInputSlice";
|
||||
|
||||
const store = configureStore({
|
||||
reducer: {
|
||||
@@ -50,6 +51,7 @@ const store = configureStore({
|
||||
loopChartType: loopChartTypeSlice,
|
||||
systemVoltTemp: systemVoltTempReducer,
|
||||
analogInputsHistory: analogInputsHistoryReducer,
|
||||
selectedAnalogInput: selectedAnalogInputReducer,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
BIN
redux/thunks.zip
Normal file
BIN
redux/thunks.zip
Normal file
Binary file not shown.
BIN
redux/types.zip
Normal file
BIN
redux/types.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user