summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Shetye2025-06-05 11:41:48 +0530
committerSunil Shetye2025-06-05 11:41:48 +0530
commitde7a74c5fb9d0dd15799f81889e5432e5ecb697d (patch)
tree810395daa80ede3206252738a3caa06ceb5a2eb9
parent2370825caa883b2f8147cf8fe6d08177d285a1f2 (diff)
downloadCommon-Interface-Project-de7a74c5fb9d0dd15799f81889e5432e5ecb697d.tar.gz
Common-Interface-Project-de7a74c5fb9d0dd15799f81889e5432e5ecb697d.tar.bz2
Common-Interface-Project-de7a74c5fb9d0dd15799f81889e5432e5ecb697d.zip
reorder
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js52
1 files changed, 26 insertions, 26 deletions
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js
index ecc4a1cf..17cfbc18 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js
@@ -364,26 +364,6 @@ export function ScriptScreen ({ isOpen, onClose }) {
dispatch(setShowDot(true))
}
- useEffect(() => {
- if (fetchComplete) {
- const timer = setTimeout(() => {
- executeScript()
- }, 1000)
-
- return () => clearTimeout(timer)
- }
- }, [executeScript, fetchComplete])
-
- const prepareScriptNetlist = useCallback((scriptDump) => {
- const titleA = sanitizeTitle(title)
- const myblob = new Blob([scriptDump], {
- type: 'text/plain'
- })
- const file = new File([myblob], `${titleA}.sce`, { type: 'text/sce', lastModified: Date.now() })
- const type = 'SCRIPT'
- sendScriptNetlist(file, type)
- }, [sendScriptNetlist, title])
-
const sendScriptNetlist = useCallback((file, type) => {
netlistConfig(file, type)
.then((response) => {
@@ -400,6 +380,32 @@ export function ScriptScreen ({ isOpen, onClose }) {
})
}, [dispatch])
+ const prepareScriptNetlist = useCallback((scriptDump) => {
+ const titleA = sanitizeTitle(title)
+ const myblob = new Blob([scriptDump], {
+ type: 'text/plain'
+ })
+ const file = new File([myblob], `${titleA}.sce`, { type: 'text/sce', lastModified: Date.now() })
+ const type = 'SCRIPT'
+ sendScriptNetlist(file, type)
+ }, [sendScriptNetlist, title])
+
+ const executeScript = useCallback(() => {
+ dispatch(setScriptTaskId(''))
+ prepareScriptNetlist(scriptDump)
+ dispatch(setShowDot(false))
+ }, [dispatch, prepareScriptNetlist, scriptDump])
+
+ useEffect(() => {
+ if (fetchComplete) {
+ const timer = setTimeout(() => {
+ executeScript()
+ }, 1000)
+
+ return () => clearTimeout(timer)
+ }
+ }, [executeScript, fetchComplete])
+
async function netlistConfig (file, type) {
const formData = new FormData()
@@ -415,12 +421,6 @@ export function ScriptScreen ({ isOpen, onClose }) {
return await api.post('simulation/upload', formData, config)
}
- const executeScript = useCallback(() => {
- dispatch(setScriptTaskId(''))
- prepareScriptNetlist(scriptDump)
- dispatch(setShowDot(false))
- }, [dispatch, prepareScriptNetlist, scriptDump])
-
const resetCode = () => {
dispatch(setSchScriptDump(''))
dispatch(setShowDot(false))