summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuchita Lad2025-07-01 15:51:23 +0530
committerSuchita Lad2025-07-01 15:51:23 +0530
commit0a7bf48f799e736cd08c4e5957320b279963ef8e (patch)
tree6b64d0d349824ebc7a13838b260f28660c62d26f
parent3aba2c30b3ae5eb89cf3ee75ae9317fc7d50d103 (diff)
downloadCommon-Interface-Project-0a7bf48f799e736cd08c4e5957320b279963ef8e.tar.gz
Common-Interface-Project-0a7bf48f799e736cd08c4e5957320b279963ef8e.tar.bz2
Common-Interface-Project-0a7bf48f799e736cd08c4e5957320b279963ef8e.zip
Added generate_block template in head.xsl
-rw-r--r--blocks/xcos2xml/head.xsl54
1 files changed, 54 insertions, 0 deletions
diff --git a/blocks/xcos2xml/head.xsl b/blocks/xcos2xml/head.xsl
index 0e3f61f2..5c28f899 100644
--- a/blocks/xcos2xml/head.xsl
+++ b/blocks/xcos2xml/head.xsl
@@ -277,3 +277,57 @@
<xsl:apply-templates />
</xsl:element>
</xsl:template>
+
+ <xsl:template name="generate-block">
+ <xsl:param name="explicitInputPorts"/>
+ <xsl:param name="implicitInputPorts"/>
+ <xsl:param name="explicitOutputPorts"/>
+ <xsl:param name="implicitOutputPorts"/>
+ <xsl:param name="controlPorts"/>
+ <xsl:param name="commandPorts"/>
+ <xsl:param name="blockId"/>
+ <xsl:param name="style"/>
+ <xsl:param name="simulationFunction"/>
+
+ <xsl:element name="mxCell">
+ <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
+ <xsl:attribute name="id"><xsl:value-of select="$blockId"/></xsl:attribute>
+ <xsl:attribute name="vertex">1</xsl:attribute>
+ <xsl:attribute name="connectable">0</xsl:attribute>
+ <xsl:attribute name="CellType">Component</xsl:attribute>
+ <xsl:attribute name="blockprefix">XCOS</xsl:attribute>
+ <xsl:attribute name="explicitInputPorts"><xsl:value-of select="$explicitInputPorts"/></xsl:attribute>
+ <xsl:attribute name="implicitInputPorts"><xsl:value-of select="$implicitInputPorts"/></xsl:attribute>
+ <xsl:attribute name="explicitOutputPorts"><xsl:value-of select="$explicitOutputPorts"/></xsl:attribute>
+ <xsl:attribute name="implicitOutputPorts"><xsl:value-of select="$implicitOutputPorts"/></xsl:attribute>
+ <xsl:attribute name="controlPorts"><xsl:value-of select="$controlPorts"/></xsl:attribute>
+ <xsl:attribute name="commandPorts"><xsl:value-of select="$commandPorts"/></xsl:attribute>
+ <xsl:attribute name="simulationFunction"><xsl:value-of select="$simulationFunction"/></xsl:attribute>
+ <xsl:attribute name="sourceVertex">0</xsl:attribute>
+ <xsl:attribute name="targetVertex">0</xsl:attribute>
+ <xsl:attribute name="tarx">0</xsl:attribute>
+ <xsl:attribute name="tary">0</xsl:attribute>
+
+ <xsl:apply-templates select="mxGeometry"/>
+ <Object as="displayProperties">
+ <xsl:attribute name="display_parameter">
+ <xsl:value-of select="*[@as='exprs']/data/@value"/>
+ </xsl:attribute>
+ </Object>
+ <Object as="parameter_values">
+ <xsl:attribute name="p000_value">
+ <xsl:value-of select="*[@as='exprs']/data/@value"/>
+ </xsl:attribute>
+ </Object>
+ </xsl:element>
+
+ <xsl:call-template name="port">
+ <xsl:with-param name="id" select="$blockId"/>
+ <xsl:with-param name="explicitInputPorts" select="$explicitInputPorts"/>
+ <xsl:with-param name="explicitOutputPorts" select="$explicitOutputPorts"/>
+ <xsl:with-param name="implicitInputPorts" select="$implicitInputPorts"/>
+ <xsl:with-param name="implicitOutputPorts" select="$implicitOutputPorts"/>
+ <xsl:with-param name="controlPorts" select="$controlPorts"/>
+ <xsl:with-param name="commandPorts" select="$commandPorts"/>
+ </xsl:call-template>
+ </xsl:template>