beremiz

SVGHMI: update generated xslt files
py2compat
17 months ago, Edouard Tisserant
2a5647b82666
Parents cd5fbf238096
Children 9ade1b678069
SVGHMI: update generated xslt files
--- a/svghmi/analyse_widget.xslt Thu Jan 09 17:10:40 2025 +0100
+++ b/svghmi/analyse_widget.xslt Thu Jan 09 17:11:18 2025 +0100
@@ -501,7 +501,7 @@
<longdesc>
<xsl:text>ForEach widget is used to span a small set of widget over a larger set of
</xsl:text>
- <xsl:text>repeated HMI_NODEs.
+ <xsl:text>repeated HMI_NODEs.
</xsl:text>
<xsl:text>
</xsl:text>
@@ -545,6 +545,15 @@
<path name="root" accepts="HMI_NODE">
<xsl:text> where to find HMI_NODEs whose HMI_CLASS is class_name</xsl:text>
</path>
+ <path name="position" accepts="HMI_INT">
+ <xsl:text>position of HMI_NODE mapped to first item, among similar siblings</xsl:text>
+ </path>
+ <path name="range" accepts="HMI_INT" count="optional">
+ <xsl:text> count of HMI_NODE siblings</xsl:text>
+ </path>
+ <path name="size" accepts="HMI_INT" count="optional">
+ <xsl:text> count of visible items</xsl:text>
+ </path>
</xsl:template>
<xsl:template match="widget[@type='Image']" mode="widget_desc">
<type>
--- a/svghmi/gen_index_xhtml.xslt Thu Jan 09 17:10:40 2025 +0100
+++ b/svghmi/gen_index_xhtml.xslt Thu Jan 09 17:11:18 2025 +0100
@@ -4410,7 +4410,7 @@
<longdesc>
<xsl:text>ForEach widget is used to span a small set of widget over a larger set of
</xsl:text>
- <xsl:text>repeated HMI_NODEs.
+ <xsl:text>repeated HMI_NODEs.
</xsl:text>
<xsl:text>
</xsl:text>
@@ -4454,6 +4454,15 @@
<path name="root" accepts="HMI_NODE">
<xsl:text> where to find HMI_NODEs whose HMI_CLASS is class_name</xsl:text>
</path>
+ <path name="position" accepts="HMI_INT">
+ <xsl:text>position of HMI_NODE mapped to first item, among similar siblings</xsl:text>
+ </path>
+ <path name="range" accepts="HMI_INT" count="optional">
+ <xsl:text> count of HMI_NODE siblings</xsl:text>
+ </path>
+ <path name="size" accepts="HMI_INT" count="optional">
+ <xsl:text> count of visible items</xsl:text>
+ </path>
</xsl:template>
<xsl:template match="widget[@type='ForEach']" mode="widget_defs">
<xsl:param name="hmi_element"/>
@@ -4877,14 +4886,11 @@
</xsl:text>
<xsl:text> },
</xsl:text>
- <xsl:text>
-</xsl:text>
- <xsl:text> init: function() {
-</xsl:text>
- <xsl:text> this.animate();
-</xsl:text>
- <xsl:text> },
-</xsl:text>
+ </xsl:template>
+ <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="svg:image[starts-with(@inkscape:label, 'HMI:Image')]">
+ <xsl:copy>
+ <xsl:apply-templates mode="inline_svg" select="@*[not(contains(name(), 'href'))] | node()"/>
+ </xsl:copy>
</xsl:template>
<xsl:template match="widget[@type='Input']" mode="widget_desc">
<type>
@@ -10274,6 +10280,8 @@
</xsl:text>
<xsl:text> let widget = hmi_widgets[id];
</xsl:text>
+ <xsl:text> if(widget.curr_value != undefined) return;
+</xsl:text>
<xsl:text> widget.do_init();
</xsl:text>
<xsl:text> });