summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Shetye2025-04-03 21:21:28 +0530
committerSunil Shetye2025-04-07 15:38:17 +0530
commit4b50b816c8cd6bbd39927b57b99a8499897b57fb (patch)
tree9771a4cdeda9729a1f4cc00dcf702b58cd2df9ea
parent2ffd1bc5bc6a38348fd495490facbd5bc0a6f09e (diff)
downloadCommon-Interface-Project-4b50b816c8cd6bbd39927b57b99a8499897b57fb.tar.gz
Common-Interface-Project-4b50b816c8cd6bbd39927b57b99a8499897b57fb.tar.bz2
Common-Interface-Project-4b50b816c8cd6bbd39927b57b99a8499897b57fb.zip
remove netlist action/reducer
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/Header.js2
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js2
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js2
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js4
-rw-r--r--blocks/eda-frontend/src/redux/actions/actions.js4
-rw-r--r--blocks/eda-frontend/src/redux/actions/index.js2
-rw-r--r--blocks/eda-frontend/src/redux/actions/netlistActions.js31
-rw-r--r--blocks/eda-frontend/src/redux/reducers/index.js5
-rw-r--r--blocks/eda-frontend/src/redux/reducers/netlistReducer.js35
9 files changed, 4 insertions, 83 deletions
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Header.js b/blocks/eda-frontend/src/components/SchematicEditor/Header.js
index 04c17d8a..857cbc6e 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/Header.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/Header.js
@@ -30,7 +30,6 @@ import { makeStyles } from '@material-ui/core/styles'
import { deepPurple } from '@material-ui/core/colors'
import logo from '../../static/favicon.ico'
-import { setTitle } from '../../redux/actions/index'
import { setSchTitle, setSchShared } from '../../redux/saveSchematicSlice'
import { logout } from '../../redux/authSlice'
import { getDateTime as getDate, getUppercaseInitial } from '../../utils/GalleryUtils'
@@ -122,7 +121,6 @@ function Header () {
}
const titleHandler = (e) => {
- dispatch(setTitle(`* ${e.target.value}`))
dispatch(setSchTitle(`${e.target.value}`))
}
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js b/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js
index a80e495c..cd3a1704 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js
@@ -42,7 +42,7 @@ const useStyles = makeStyles((theme) => ({
}))
export default function SimulationProperties () {
- const title = useSelector(state => state.netlistReducer.title)
+ const title = useSelector(state => state.saveSchematic.title)
const isSimRes = useSelector(state => state.simulation.isSimRes)
const dispatch = useDispatch()
const classes = useStyles()
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js
index a9ffe287..b7739341 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js
@@ -114,7 +114,7 @@ export default function SimulationScreen ({ open, close }) {
const dispatch = useDispatch()
const isGraph = useSelector(state => state.simulation.isGraph)
const rtitle = useSelector(state => state.simulation.title)
- const stitle = useSelector(state => state.netlistReducer.title)
+ const stitle = useSelector(state => state.saveSchematic.title)
const taskId = useSelector(state => state.simulation.taskId)
const [isResult, setIsResult] = useState(false)
const graphsRef = useRef([])
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js
index 3e79ae4a..371f19d3 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js
@@ -50,7 +50,7 @@ const Transition = forwardRef(function Transition (props, ref) {
// Dialog box to display generated netlist
export function NetlistModal ({ open, close, netlist }) {
- const title = useSelector(state => state.netlistReducer.title)
+ const title = useSelector(state => state.saveSchematic.title)
const createNetlistFile = () => {
const titleA = title.split(' ')[1]
const name = process.env.REACT_APP_NAME
@@ -340,7 +340,7 @@ HelpScreen.propTypes = {
export function ScriptScreen ({ isOpen, onClose }) {
const scriptDump = useSelector(state => state.saveSchematic.scriptDump)
- const title = useSelector(state => state.netlistReducer.title)
+ const title = useSelector(state => state.saveSchematic.title)
const dispatch = useDispatch()
const scriptHandler = (e) => {
dispatch(setSchScriptDump(e.target.value))
diff --git a/blocks/eda-frontend/src/redux/actions/actions.js b/blocks/eda-frontend/src/redux/actions/actions.js
deleted file mode 100644
index 44ca1340..00000000
--- a/blocks/eda-frontend/src/redux/actions/actions.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// Actions for handling and generating netlist
-export const SET_NETLIST = 'SET_NETLIST'
-export const SET_TITLE = 'SET_TITLE'
-export const SET_MODEL = 'SET_MODEL'
diff --git a/blocks/eda-frontend/src/redux/actions/index.js b/blocks/eda-frontend/src/redux/actions/index.js
deleted file mode 100644
index 10284a93..00000000
--- a/blocks/eda-frontend/src/redux/actions/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-// Actions dispatch to change state variables inside store
-export * from './netlistActions'
diff --git a/blocks/eda-frontend/src/redux/actions/netlistActions.js b/blocks/eda-frontend/src/redux/actions/netlistActions.js
deleted file mode 100644
index bc703f7b..00000000
--- a/blocks/eda-frontend/src/redux/actions/netlistActions.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import * as actions from './actions'
-
-// Action to update netlist with component nodes and parameters
-export const setNetlist = (netlist) => (dispatch) => {
- dispatch({
- type: actions.SET_NETLIST,
- payload: {
- netlist
- }
- })
-}
-
-// Action to update netlist title
-export const setTitle = (title) => (dispatch) => {
- dispatch({
- type: actions.SET_TITLE,
- payload: {
- title
- }
- })
-}
-
-// Action to update netlist model section
-export const setModel = (model) => (dispatch) => {
- dispatch({
- type: actions.SET_MODEL,
- payload: {
- model
- }
- })
-}
diff --git a/blocks/eda-frontend/src/redux/reducers/index.js b/blocks/eda-frontend/src/redux/reducers/index.js
deleted file mode 100644
index 4217a528..00000000
--- a/blocks/eda-frontend/src/redux/reducers/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { combineReducers } from 'redux'
-import netlistReducer from './netlistReducer'
-export default combineReducers({
- netlistReducer
-})
diff --git a/blocks/eda-frontend/src/redux/reducers/netlistReducer.js b/blocks/eda-frontend/src/redux/reducers/netlistReducer.js
deleted file mode 100644
index 81ab7344..00000000
--- a/blocks/eda-frontend/src/redux/reducers/netlistReducer.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import * as actions from '../actions/actions'
-
-const initialState = {
- title: '* Untitled',
- model: '',
- netlist: '',
- controlLine: '',
- controlBlock: ''
-}
-
-export default function netlistReducer (state = initialState, action) {
- switch (action.type) {
- case actions.SET_NETLIST: {
- return {
- ...state,
- netlist: action.payload.netlist
- }
- }
- case actions.SET_TITLE: {
- return {
- ...state,
- title: action.payload.title
- }
- }
-
- case actions.SET_MODEL: {
- return {
- ...state,
- model: action.payload.model
- }
- }
- default:
- return state
- }
-}