diff options
author | Sunil Shetye | 2021-07-28 00:00:58 +0530 |
---|---|---|
committer | Sunil Shetye | 2021-10-01 11:37:00 +0530 |
commit | 630a52b95b1a4bb40c16f2b12a1ba83969180e48 (patch) | |
tree | 3e418ce600d3b8860dfafc093ffd2ffeae5d7f45 | |
parent | 07a893f68aea7424e9ce60397ed5b6caa8b212b8 (diff) | |
download | Common-Interface-Project-630a52b95b1a4bb40c16f2b12a1ba83969180e48.tar.gz Common-Interface-Project-630a52b95b1a4bb40c16f2b12a1ba83969180e48.tar.bz2 Common-Interface-Project-630a52b95b1a4bb40c16f2b12a1ba83969180e48.zip |
code cleanup
-rw-r--r-- | Xcos Categories - Xcos Datatypes.csv | 22 | ||||
-rw-r--r-- | blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js | 20 | ||||
-rw-r--r-- | blocks/eda-frontend/src/utils/Api.js | 4 | ||||
-rw-r--r-- | data/blockprefixes.csv (renamed from Xcos Categories - Xcos Blocks.csv) | 0 | ||||
-rw-r--r-- | data/categories-blocks.csv (renamed from Xcos Categories - Categories and Blocks.csv) | 0 | ||||
-rw-r--r-- | data/categories.csv (renamed from Xcos Categories - Xcos Categories.csv) | 0 | ||||
-rw-r--r-- | data/datatypes.csv | 25 |
7 files changed, 37 insertions, 34 deletions
diff --git a/Xcos Categories - Xcos Datatypes.csv b/Xcos Categories - Xcos Datatypes.csv deleted file mode 100644 index fb91b3a6..00000000 --- a/Xcos Categories - Xcos Datatypes.csv +++ /dev/null @@ -1,22 +0,0 @@ -Id,Datatype,Explanation
-1,boolean,0 or 1 only
-2,integer,"only integer values e.g. 2,4,6"
-3,double,double or integer values
-4,complex,complex or double or integer values
-5,string,any string values
-6,yesno,a yes (y) or no (n) value
-7,filename,a file for reading or writing
-8,vector of booleans,a 1-D array of specified datatype
-9,vector of integers,
-10,vector of doubles,
-11,vector of complexes,
-12,vector of strings,
-13,vector of yesnoes,
-14,vector of filenames,
-15,matrix of booleans,a 2-D array of specified datatype
-16,matrix of integers,
-17,matrix of doubles,
-18,matrix of complexes,
-19,matrix of strings,
-20,matrix of yesnoes,
-21,matrix of filenames,
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js index 2561ddda..6841cd47 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js @@ -264,7 +264,7 @@ export function GenerateNetList () { for (var child in component.children) { var pin = component.children[child] if (pin.vertex === true) { - if (pin.edges !== null || pin.edges.length !== 0) { + if (pin.edges !== null && pin.edges.length !== 0) { for (var wire in pin.edges) { if (pin.edges[wire].source !== null && pin.edges[wire].target !== null) { if (pin.edges[wire].source.edge === true) { @@ -414,18 +414,18 @@ function parseXmlToGraph (xmlDoc, graph) { console.log(edgeId) var plist = cells[i].children[1].children try { - var e = graph.insertEdge(parent, edgeId, null, + var edge = graph.insertEdge(parent, edgeId, null, graph.getModel().getCell(source), graph.getModel().getCell(target) ) - e.geometry.points = [] + edge.geometry.points = [] for (var a in cells[i].children[1].children) { try { console.log(plist[a].attributes.x.value) console.log(plist[a].attributes.y.value) - e.geometry.points.push(new mxPoint(Number(plist[a].attributes.x.value), Number(plist[a].attributes.y.value))) - console.log(e.geometry.points) - } catch (e) { console.log('error') } + edge.geometry.points.push(new mxPoint(Number(plist[a].attributes.x.value), Number(plist[a].attributes.y.value))) + console.log(edge.geometry.points) + } catch (e) { console.log('error', e) } graph.getModel().beginUpdate() try { graph.view.refresh() @@ -439,7 +439,7 @@ function parseXmlToGraph (xmlDoc, graph) { } } if (graph.getModel().getCell(target).edge === true) { - e.geometry.setTerminalPoint(new mxPoint(Number(cellAttrs.tarx.value), Number(cellAttrs.tary.value)), false) + edge.geometry.setTerminalPoint(new mxPoint(Number(cellAttrs.tarx.value), Number(cellAttrs.tary.value)), false) graph.getModel().beginUpdate() try { graph.view.refresh() @@ -455,7 +455,7 @@ function parseXmlToGraph (xmlDoc, graph) { } catch (e) { console.log(graph.getModel().getCell(source)) console.log(graph.getModel().getCell(target)) - console.log('error') + console.log('error', e) } } } @@ -483,7 +483,7 @@ function XMLWireConnections () { var pin = component.children[child] if (pin.vertex === true) { try { - if (pin.edges !== null || pin.edges.length !== 0) { + if (pin.edges !== null && pin.edges.length !== 0) { for (var wire in pin.edges) { if (pin.edges[wire].source !== null && pin.edges[wire].target !== null) { if (pin.edges[wire].source.edge === true) { @@ -509,7 +509,7 @@ function XMLWireConnections () { } } - } catch (e) { console.log('error') } + } catch (e) { console.log('error', e) } } } diff --git a/blocks/eda-frontend/src/utils/Api.js b/blocks/eda-frontend/src/utils/Api.js index c1410b3a..bd30f173 100644 --- a/blocks/eda-frontend/src/utils/Api.js +++ b/blocks/eda-frontend/src/utils/Api.js @@ -4,6 +4,6 @@ import axios from 'axios' export default axios.create({ baseURL: '/api/', responseType: 'json', - // xsrfCookieName: 'csrftoken', - // withCredentials: true, + xsrfCookieName: 'csrftoken', + withCredentials: true, }) diff --git a/Xcos Categories - Xcos Blocks.csv b/data/blockprefixes.csv index 383017fb..383017fb 100644 --- a/Xcos Categories - Xcos Blocks.csv +++ b/data/blockprefixes.csv diff --git a/Xcos Categories - Categories and Blocks.csv b/data/categories-blocks.csv index 4aeeae78..4aeeae78 100644 --- a/Xcos Categories - Categories and Blocks.csv +++ b/data/categories-blocks.csv diff --git a/Xcos Categories - Xcos Categories.csv b/data/categories.csv index dbb2b9d8..dbb2b9d8 100644 --- a/Xcos Categories - Xcos Categories.csv +++ b/data/categories.csv diff --git a/data/datatypes.csv b/data/datatypes.csv new file mode 100644 index 00000000..e5d2be9d --- /dev/null +++ b/data/datatypes.csv @@ -0,0 +1,25 @@ +Id,Datatype,Explanation +1,boolean,0 or 1 only +2,integer,"only integer values e.g. 2,4,6" +3,double,double or integer values +4,double with scale,"double or integer values with an optional scale like pico, micro (u), milli, kilo, mega, giga" +5,complex,complex or double or integer values +6,string,any string values +7,yesno,a yes (y) or no (n) value +8,filename,a file for reading or writing +9,vector of booleans,a 1-D array of specified datatype +10,vector of integers, +11,vector of doubles, +12,vector of doubles with scale, +13,vector of complexes, +14,vector of strings, +15,vector of yesnoes, +16,vector of filenames, +17,array of booleans,a 2-D array of specified datatype +18,array of integers, +19,array of doubles, +20,array of doubles with scale, +21,array of complexes, +22,array of strings, +23,array of yesnoes, +24,array of filenames, |