diff options
author | Sunil Shetye | 2025-06-11 13:19:21 +0530 |
---|---|---|
committer | Sunil Shetye | 2025-06-11 13:22:44 +0530 |
commit | 265c796af7d8132b453dc2f406c4b081af749dfa (patch) | |
tree | 62d33a4428838bd20f64c34e7218e8d3d52e30e9 | |
parent | ddcf14c0553a5443fa47d55467aa70eaf6176817 (diff) | |
download | Common-Interface-Project-265c796af7d8132b453dc2f406c4b081af749dfa.tar.gz Common-Interface-Project-265c796af7d8132b453dc2f406c4b081af749dfa.tar.bz2 Common-Interface-Project-265c796af7d8132b453dc2f406c4b081af749dfa.zip |
add pins while parsing
-rw-r--r-- | blocks/eda-frontend/public/geometry.xsl | 14 | ||||
-rw-r--r-- | blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js | 13 |
2 files changed, 20 insertions, 7 deletions
diff --git a/blocks/eda-frontend/public/geometry.xsl b/blocks/eda-frontend/public/geometry.xsl index d36ebc34..7b535725 100644 --- a/blocks/eda-frontend/public/geometry.xsl +++ b/blocks/eda-frontend/public/geometry.xsl @@ -14,6 +14,7 @@ <xsl:key name="k-cell" match="mxCell" use="@id" /> + <!-- templates {{{2 --> <xsl:template name="get-port"> <xsl:param name="style" /> @@ -91,8 +92,9 @@ </xsl:when> </xsl:choose> </xsl:template> + <!-- }}}2 --> - <!-- sourcePoint {{{2 --> + <!-- sourcePoint {{{3 --> <xsl:template match="mxPoint[@as='sourcePoint']"> <xsl:copy> <xsl:apply-templates select="@*" /> @@ -202,9 +204,9 @@ <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> - <!-- }}}2 --> + <!-- }}}3 --> - <!-- targetpoint {{{3 --> + <!-- targetpoint {{{4 --> <xsl:template match="mxPoint[@as='targetPoint']"> <xsl:copy> <xsl:apply-templates select="@*" /> @@ -314,9 +316,9 @@ <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> - <!-- }}}3 --> + <!-- }}}4 --> - <!-- mxcell tarx & tary & tar2x & tar2y {{{4 --> + <!-- mxcell tarx & tary & tar2x & tar2y {{{5 --> <xsl:template match="mxCell[@edge='1']"> <xsl:copy> <xsl:apply-templates select="@*" /> @@ -515,6 +517,6 @@ <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> - <!-- }}}4 --> + <!-- }}}5 --> </xsl:stylesheet> diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js index 9ffa25ed..b4fc9aa2 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js @@ -446,6 +446,14 @@ function parseXmlToGraph (xmlDoc, graph) { v1.controlPorts = 0 v1.commandPorts = 0 v1.simulationFunction = cellAttrs.simulationFunction?.value + v1.pins = { + explicitInputPorts: [], + implicitInputPorts: [], + controlPorts: [], + explicitOutputPorts: [], + implicitOutputPorts: [], + commandPorts: [] + } const SuperBlockDiagram = cell.querySelector('SuperBlockDiagram') if (SuperBlockDiagram !== null) { v1.SuperBlockDiagram = SuperBlockDiagram @@ -487,7 +495,7 @@ function parseXmlToGraph (xmlDoc, graph) { console.log('rotation:', styleObject, rotation, xPos, yPos, portSize, rotationParameters) } - getPins(stylename, v1) + const pins = getPins(stylename, v1) const pointXY = getPointXY(rotationParameters) const pointX = pointXY.pointX @@ -521,6 +529,9 @@ function parseXmlToGraph (xmlDoc, graph) { vp.ordering = ordering vp.ParentComponent = v1.id + if (pins != null) { + pins.push(vp) + } } else if (cellAttrs.edge) { // is edge const edgeId = cellAttrs.id.value |