diff options
author | Sunil Shetye | 2021-09-16 12:25:17 +0530 |
---|---|---|
committer | Sunil Shetye | 2021-10-01 11:37:02 +0530 |
commit | 34aa455803bcf737f4b1696bd01a5638ae74d5f6 (patch) | |
tree | b2d0e0910337c602dfcf04d9f9ba7dac3f2a2799 | |
parent | ae82b21f41a8b4bc704c1fc1e493d243f3e29255 (diff) | |
download | Common-Interface-Project-34aa455803bcf737f4b1696bd01a5638ae74d5f6.tar.gz Common-Interface-Project-34aa455803bcf737f4b1696bd01a5638ae74d5f6.tar.bz2 Common-Interface-Project-34aa455803bcf737f4b1696bd01a5638ae74d5f6.zip |
filter data with encodeURIComponent()
14 files changed, 21 insertions, 51 deletions
diff --git a/blocks/eda-frontend/README.md b/blocks/eda-frontend/README.md index 65e364fc..838922d5 100644 --- a/blocks/eda-frontend/README.md +++ b/blocks/eda-frontend/README.md @@ -15,7 +15,7 @@ Refer to https://nodejs.org/en/ to install nodejs Clone the project into local -#### Install all the npm packages. +#### Install all the npm packages. Go into the project folder and type the following command to install all npm packages and dependencies ```bash diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ComponentProperties.js b/blocks/eda-frontend/src/components/SchematicEditor/ComponentProperties.js index 24701765..bf765c0d 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/ComponentProperties.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/ComponentProperties.js @@ -34,7 +34,6 @@ export default function ComponentProperties () { const link2 = 'Set ' + process.env.REACT_APP_BLOCK_NAME + ' Parameters'; const link3 = 'No ' + process.env.REACT_APP_BLOCK_NAME + ' Parameters'; return ( - <div style={isOpen ? {} : { display: 'none' }}> <ListItem> diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js b/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js index 5b873136..808e801a 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/ComponentSidebar.js @@ -11,7 +11,6 @@ import { Tooltip, TextField, InputAdornment - } from '@material-ui/core' import Loader from 'react-loader-spinner' import SearchIcon from '@material-ui/icons/Search' @@ -157,9 +156,7 @@ export default function ComponentSidebar ({ compRef }) { <InputAdornment position="start"> <SearchIcon /> </InputAdornment> - ) - }} /> @@ -174,7 +171,6 @@ export default function ComponentSidebar ({ compRef }) { </ListItemIcon>) } ) - } <ListItem> @@ -191,7 +187,6 @@ export default function ComponentSidebar ({ compRef }) { {!loading && searchText.length !== 0 && isSearchedResultsEmpty && <span style={{ margin: '20px' }}>{link3}</span> - } {/* Collapsing List Mapped by Libraries fetched by the API */} diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js index b8d6c762..43f03a81 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js @@ -71,7 +71,6 @@ export default function LoadGrid (container, sidebar, outline) { // Creates the graph inside the given container graph = new mxGraph(container) - mxConnectionHandler.prototype.movePreviewAway = false mxConnectionHandler.prototype.waypointsEnabled = true @@ -327,7 +326,7 @@ export default function LoadGrid (container, sidebar, outline) { // Computes edge-to-edge connection point if (pt != null) { pt = new mxPoint(s * (tr.x + pt.x + orig.x), - s * (tr.y + pt.y + orig.y)) + s * (tr.y + pt.y + orig.y)) // Finds nearest segment on edge and computes intersection if (terminal != null && terminal.absolutePoints != null) { @@ -370,7 +369,7 @@ export default function LoadGrid (container, sidebar, outline) { if (this.sourceConstraint != null && this.previous != null) { edge.style = mxConstants.STYLE_EXIT_X + '=' + this.sourceConstraint.point.x + ';' + - mxConstants.STYLE_EXIT_Y + '=' + this.sourceConstraint.point.y + ';' + mxConstants.STYLE_EXIT_Y + '=' + this.sourceConstraint.point.y + ';' } else if (this.graph.model.isEdge(me.getCell())) { var scale = this.graph.view.scale var tr = this.graph.view.translate @@ -391,17 +390,16 @@ export default function LoadGrid (container, sidebar, outline) { try { var mxConnectionHandlerUpdateCurrentState = mxConnectionHandler.prototype.updateCurrentState mxConnectionHandler.prototype.updateCurrentState = function (me) { - try { + try { mxConnectionHandlerUpdateCurrentState.apply(this, arguments) } catch(err) { - } if (this.edgeState != null) { this.edgeState.cell.geometry.setTerminalPoint(null, false) if (this.shape != null && this.currentState != null && - this.currentState.view.graph.model.isEdge(this.currentState.cell)) { + this.currentState.view.graph.model.isEdge(this.currentState.cell)) { var scale = this.graph.view.scale var tr = this.graph.view.translate var pt = new mxPoint(this.graph.snap(me.getGraphX() / scale) - tr.x, @@ -610,19 +608,19 @@ export default function LoadGrid (container, sidebar, outline) { if (hints != null && hints.length > 0) { // FIXME: First segment not movable /* hint = state.view.transformControlPoint(state, hints[0]); - mxLog.show(); - mxLog.debug(hints.length,'hints0.y='+hint.y, pt.y) - - if (horizontal && Math.floor(hint.y) != Math.floor(pt.y)) - { - mxLog.show(); - mxLog.debug('add waypoint'); - - pt = new mxPoint(pt.x, hint.y); - result.push(pt); - pt = pt.clone(); - //horizontal = !horizontal; - } */ + mxLog.show(); + mxLog.debug(hints.length,'hints0.y='+hint.y, pt.y) + + if (horizontal && Math.floor(hint.y) != Math.floor(pt.y)) + { + mxLog.show(); + mxLog.debug('add waypoint'); + + pt = new mxPoint(pt.x, hint.y); + result.push(pt); + pt = pt.clone(); + //horizontal = !horizontal; + } */ for (var i = 0; i < hints.length; i++) { horizontal = !horizontal diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js index 3fe08061..02a1ec35 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js @@ -238,7 +238,6 @@ function ErcCheckNets () { // GENERATE NETLIST export function GenerateNetList () { - var c = 1 var spiceModels = '' var netlist = { @@ -302,7 +301,6 @@ export function GenerateNetList () { console.log(pin.edges[wire].targetVertex) } k = k + ' ' + pin.edges[0].node - } } } @@ -311,7 +309,6 @@ export function GenerateNetList () { compobj.node2 = component.children[1].edges[0].node compobj.magnitude = 10 netlist.nodelist.push(compobj.node2, compobj.node1) - } console.log('component parameter_values', component.parameter_values) @@ -453,8 +450,8 @@ export function renderGalleryXML (xml) { var xmlDoc = mxUtils.parseXml(xml) parseXmlToGraph(xmlDoc, graph) } -function XMLWireConnections () { +function XMLWireConnections () { var erc = true if (erc === false) { alert('ERC check failed') @@ -490,16 +487,12 @@ function XMLWireConnections () { console.log(pin.edges[wire].sourceVertex) console.log(pin.edges[wire].targetVertex) } - } } catch (e) { console.log('error', e) } } } - } - } } } - } diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js index 04f7af12..1ef676a8 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js @@ -159,9 +159,10 @@ export default function SchematicToolbar ({ mobileClose, gridRef }) { canvas.style.height = canvas.height + 'px' var images = svg.getElementsByTagName('image') for (var image of images) { - const data = await fetch(image.getAttribute('xlink:href')).then((v) => { + let data = await fetch(image.getAttribute('xlink:href')).then((v) => { return v.text() }) + data = encodeURIComponent(data); image.removeAttribute('xlink:href') image.setAttribute( 'href', @@ -169,7 +170,6 @@ export default function SchematicToolbar ({ mobileClose, gridRef }) { ) } var ctx = canvas.getContext('2d') - ctx.mozImageSmoothingEnabled = true ctx.webkitImageSmoothingEnabled = true ctx.msImageSmoothingEnabled = true ctx.imageSmoothingEnabled = true diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js index 5db2803f..61bd2eff 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js @@ -18,7 +18,6 @@ import { TableContainer, TableHead, TableRow - } from '@material-ui/core' import { makeStyles } from '@material-ui/core/styles' import CloseIcon from '@material-ui/icons/Close' diff --git a/blocks/eda-frontend/src/components/Shared/Graph.js b/blocks/eda-frontend/src/components/Shared/Graph.js index e48f35c8..c0e62423 100644 --- a/blocks/eda-frontend/src/components/Shared/Graph.js +++ b/blocks/eda-frontend/src/components/Shared/Graph.js @@ -79,7 +79,6 @@ class Graph extends Component { lineGraph = new Chart(myChartRef, { type: 'line', data: { - // labels: x, labels: x.map(e => (e / scales[xscale].value).toFixed(precision)), datasets: dataset() @@ -87,11 +86,8 @@ class Graph extends Component { options: { plugins: { - colorschemes: { - scheme: 'brewer.SetOne9' - } }, responsive: true, diff --git a/blocks/eda-frontend/src/components/Simulator/Editor.js b/blocks/eda-frontend/src/components/Simulator/Editor.js index de35efac..2656345b 100644 --- a/blocks/eda-frontend/src/components/Simulator/Editor.js +++ b/blocks/eda-frontend/src/components/Simulator/Editor.js @@ -7,7 +7,6 @@ import 'brace/theme/github' export default function Editor (props) { // code editor for online spice simulator return ( - <AceEditor style={{ width: '100%', marginTop: '35px' }} onChange={props.onCodeChange} @@ -22,10 +21,8 @@ export default function Editor (props) { enableLiveAutocompletion: true, enableSnippets: true, fontSize: 18 - }} /> - ) } diff --git a/blocks/eda-frontend/src/components/Simulator/SimulationScreen.js b/blocks/eda-frontend/src/components/Simulator/SimulationScreen.js index b42abc03..fcfc28b8 100644 --- a/blocks/eda-frontend/src/components/Simulator/SimulationScreen.js +++ b/blocks/eda-frontend/src/components/Simulator/SimulationScreen.js @@ -18,7 +18,6 @@ import { TableContainer, TableHead, TableRow - } from '@material-ui/core' import { makeStyles } from '@material-ui/core/styles' import CloseIcon from '@material-ui/icons/Close' @@ -108,7 +107,6 @@ export default function SimulationScreen ({ open, close, isResult }) { > {isResult === true ? <> { - (result.graph !== {} && result.isGraph === 'true') ? <Grid item xs={12} sm={12}> <Paper className={classes.paper}> diff --git a/blocks/eda-frontend/src/pages/SchematicEditor.js b/blocks/eda-frontend/src/pages/SchematicEditor.js index 0864844a..d4f06d1f 100644 --- a/blocks/eda-frontend/src/pages/SchematicEditor.js +++ b/blocks/eda-frontend/src/pages/SchematicEditor.js @@ -59,7 +59,6 @@ export default function SchematicEditor (props) { }, [compRef, gridRef, outlineRef, props.location, dispatch]) return ( - <div className={classes.root}> <CssBaseline /> diff --git a/blocks/eda-frontend/src/pages/Simulator.js b/blocks/eda-frontend/src/pages/Simulator.js index 52c62be7..7570eca7 100644 --- a/blocks/eda-frontend/src/pages/Simulator.js +++ b/blocks/eda-frontend/src/pages/Simulator.js @@ -19,7 +19,6 @@ const useStyles = makeStyles((theme) => ({ textAlign: 'center', backgroundColor: '#404040', color: '#fff' - } })) @@ -29,7 +28,6 @@ export default function Simulator () { const [netlistCode, setNetlistCode] = useState('') const [state, setState] = React.useState({ checkedA: false - }) useEffect(() => { diff --git a/blocks/frontend/templates/frontend/name.html b/blocks/frontend/templates/frontend/name.html index 4aa67abf..3de8f878 100644 --- a/blocks/frontend/templates/frontend/name.html +++ b/blocks/frontend/templates/frontend/name.html @@ -3,4 +3,3 @@ {{ form.as_p }} <input type="submit" value="Submit"> </form> - diff --git a/blocks/simulationAPI/urls.py b/blocks/simulationAPI/urls.py index 69fe23ee..eab40590 100644 --- a/blocks/simulationAPI/urls.py +++ b/blocks/simulationAPI/urls.py @@ -8,5 +8,4 @@ urlpatterns = [ path('status/<uuid:task_id>', simulationAPI_views.CeleryResultView.as_view(), name='celery_status'), - ] |