diff options
author | Suchita Lad | 2024-05-31 16:56:50 +0530 |
---|---|---|
committer | Suchita Lad | 2024-05-31 16:56:50 +0530 |
commit | 77949555a9c9fa4f69e8c04c019b06a2b6f2122f (patch) | |
tree | 5dbe947b0583b05808ef96166198bdbb357bd6d4 | |
parent | d77d45efa780d1828ee90f3691559a95cc250523 (diff) | |
download | Common-Interface-Project-77949555a9c9fa4f69e8c04c019b06a2b6f2122f.tar.gz Common-Interface-Project-77949555a9c9fa4f69e8c04c019b06a2b6f2122f.tar.bz2 Common-Interface-Project-77949555a9c9fa4f69e8c04c019b06a2b6f2122f.zip |
Updated ports & links code of xcos2xml
-rw-r--r-- | blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/foot.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/head.xsl | 15 | ||||
-rw-r--r-- | blocks/xcos2xml/links/CommandControlLink.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/links/ExplicitLink.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/links/ImplicitLink.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/ports/CommandPort.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/ports/ControlPort.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/ports/ExplicitInputPort.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/ports/ExplicitOutputPort.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/ports/ImplicitInputPort.xsl | 2 | ||||
-rw-r--r-- | blocks/xcos2xml/ports/ImplicitOutputPort.xsl | 2 |
12 files changed, 26 insertions, 11 deletions
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js index f27eee1b..21a9f407 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js @@ -305,7 +305,7 @@ export default function SchematicToolbar ({ mobileClose, gridRef }) { const handleLocalSchOpen = () => { const fileSelector = document.createElement('input') fileSelector.setAttribute('type', 'file') - fileSelector.setAttribute('accept', '.xml, application/xml') + fileSelector.setAttribute('accept', '.xcos, .xml, application/xml') fileSelector.click() fileSelector.addEventListener('change', function (event) { const file = event.target.files[0] diff --git a/blocks/xcos2xml/foot.xsl b/blocks/xcos2xml/foot.xsl index 53c781e1..a9b3a034 100644 --- a/blocks/xcos2xml/foot.xsl +++ b/blocks/xcos2xml/foot.xsl @@ -1,4 +1,4 @@ - <xsl:template match="Array" /> + <xsl:template match="Array[@as != 'points']"/> <xsl:template match="ScilabDouble" /> <xsl:template match="ScilabInteger" /> <xsl:template match="SuperBlockDiagram" /> diff --git a/blocks/xcos2xml/head.xsl b/blocks/xcos2xml/head.xsl index 1028a07b..21cbd5cb 100644 --- a/blocks/xcos2xml/head.xsl +++ b/blocks/xcos2xml/head.xsl @@ -90,6 +90,11 @@ <xsl:value-of select="@as" /> </xsl:attribute> </xsl:if> + <xsl:if test="@x"> + <xsl:attribute name="x"> + <xsl:value-of select="@x" /> + </xsl:attribute> + </xsl:if> <xsl:if test="@y"> <xsl:attribute name="y"> <xsl:value-of select="@y" /> @@ -98,3 +103,13 @@ <!-- <xsl:apply-templates /> --> </xsl:element> </xsl:template> + <xsl:template name="Array" match="Array[@as = 'points']"> + <xsl:element name="Array"> + <xsl:if test="@as"> + <xsl:attribute name="as"> + <xsl:value-of select="@as" /> + </xsl:attribute> + </xsl:if> + <xsl:apply-templates /> + </xsl:element> + </xsl:template> diff --git a/blocks/xcos2xml/links/CommandControlLink.xsl b/blocks/xcos2xml/links/CommandControlLink.xsl index b9365a55..3433c5d9 100644 --- a/blocks/xcos2xml/links/CommandControlLink.xsl +++ b/blocks/xcos2xml/links/CommandControlLink.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='CommandControlLink']"> + <xsl:template match="CommandControlLink"> <xsl:element name="mxCell"> <xsl:attribute name="id"> <xsl:value-of select="@id" /> diff --git a/blocks/xcos2xml/links/ExplicitLink.xsl b/blocks/xcos2xml/links/ExplicitLink.xsl index 9ca9c4fc..6f99ee2c 100644 --- a/blocks/xcos2xml/links/ExplicitLink.xsl +++ b/blocks/xcos2xml/links/ExplicitLink.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='ExplicitLink']"> + <xsl:template match="ExplicitLink"> <xsl:element name="mxCell"> <xsl:attribute name="id"> <xsl:value-of select="@id" /> diff --git a/blocks/xcos2xml/links/ImplicitLink.xsl b/blocks/xcos2xml/links/ImplicitLink.xsl index 1e6a84a8..13c5e046 100644 --- a/blocks/xcos2xml/links/ImplicitLink.xsl +++ b/blocks/xcos2xml/links/ImplicitLink.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='ImplicitLink']"> + <xsl:template match="ImplicitLink"> <xsl:element name="mxCell"> <xsl:attribute name="id"> <xsl:value-of select="@id" /> diff --git a/blocks/xcos2xml/ports/CommandPort.xsl b/blocks/xcos2xml/ports/CommandPort.xsl index eb59a0c3..73dbd17a 100644 --- a/blocks/xcos2xml/ports/CommandPort.xsl +++ b/blocks/xcos2xml/ports/CommandPort.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='CommandPort']"> + <xsl:template match="CommandPort"> <xsl:element name="mxCell"> <xsl:attribute name="style"> <xsl:value-of select="@style" /> diff --git a/blocks/xcos2xml/ports/ControlPort.xsl b/blocks/xcos2xml/ports/ControlPort.xsl index 540936d3..a7980ebf 100644 --- a/blocks/xcos2xml/ports/ControlPort.xsl +++ b/blocks/xcos2xml/ports/ControlPort.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='ControlPort']"> + <xsl:template match="ControlPort"> <xsl:element name="mxCell"> <xsl:attribute name="style"> <xsl:value-of select="@style" /> diff --git a/blocks/xcos2xml/ports/ExplicitInputPort.xsl b/blocks/xcos2xml/ports/ExplicitInputPort.xsl index 770431d6..06cb1e0d 100644 --- a/blocks/xcos2xml/ports/ExplicitInputPort.xsl +++ b/blocks/xcos2xml/ports/ExplicitInputPort.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='ExplicitInputPort']"> + <xsl:template match="ExplicitInputPort"> <xsl:element name="mxCell"> <xsl:attribute name="style"> <xsl:value-of select="@style" /> diff --git a/blocks/xcos2xml/ports/ExplicitOutputPort.xsl b/blocks/xcos2xml/ports/ExplicitOutputPort.xsl index 65da873a..29ae4746 100644 --- a/blocks/xcos2xml/ports/ExplicitOutputPort.xsl +++ b/blocks/xcos2xml/ports/ExplicitOutputPort.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='ExplicitOutputPort']"> + <xsl:template match="ExplicitOutputPort"> <xsl:element name="mxCell"> <xsl:attribute name="style"> <xsl:value-of select="@style" /> diff --git a/blocks/xcos2xml/ports/ImplicitInputPort.xsl b/blocks/xcos2xml/ports/ImplicitInputPort.xsl index b5d853cb..31e0b5bd 100644 --- a/blocks/xcos2xml/ports/ImplicitInputPort.xsl +++ b/blocks/xcos2xml/ports/ImplicitInputPort.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='ImplicitInputPort']"> + <xsl:template match="ImplicitInputPort"> <xsl:element name="mxCell"> <xsl:attribute name="style"> <xsl:value-of select="@style" /> diff --git a/blocks/xcos2xml/ports/ImplicitOutputPort.xsl b/blocks/xcos2xml/ports/ImplicitOutputPort.xsl index ea109e16..3837970b 100644 --- a/blocks/xcos2xml/ports/ImplicitOutputPort.xsl +++ b/blocks/xcos2xml/ports/ImplicitOutputPort.xsl @@ -1,4 +1,4 @@ - <xsl:template match="*[@style='ImplicitOutputPort']"> + <xsl:template match="ImplicitOutputPort"> <xsl:element name="mxCell"> <xsl:attribute name="style"> <xsl:value-of select="@style" /> |