# HG changeset patch # User Edouard Tisserant # Date 1642588897 -3600 # Node ID a1d9a03530536736f8c385f601c4fd73018dd3d6 # Parent 9b9775d230f5f5cb44ef0999ffaf01ccd396b393 SVGHMI: update generated XSLT diff -r 9b9775d230f5 -r a1d9a0353053 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Wed Jan 19 11:41:04 2022 +0100 +++ b/svghmi/gen_index_xhtml.xslt Wed Jan 19 11:41:37 2022 +0100 @@ -1459,8 +1459,6 @@ </xsl:text> <xsl:text> this.element = id(elt_id); </xsl:text> - <xsl:text> if(freq !== undefined) this.frequency = freq; -</xsl:text> <xsl:text> this.args = args; </xsl:text> <xsl:text> this.indexes = indexes; @@ -1477,6 +1475,8 @@ </xsl:text> <xsl:text> this.bound_unhinibit = this.unhinibit.bind(this); </xsl:text> + <xsl:text> this.forced_frequency = freq; +</xsl:text> <xsl:text> } </xsl:text> <xsl:text> @@ -2402,7 +2402,7 @@ </xsl:text> <xsl:text>console.log("Entering state </xsl:text> <xsl:value-of select="@name"/> - <xsl:text>"); + <xsl:text>", this.frequency); </xsl:text> <xsl:apply-templates mode="actions" select="*"/> <xsl:text> } @@ -8237,6 +8237,10 @@ </xsl:text> <xsl:text> } </xsl:text> + <xsl:text> if(widget.forced_frequency !== undefined) +</xsl:text> + <xsl:text> widget.frequency = widget.forced_frequency; +</xsl:text> <xsl:text> }); </xsl:text> <xsl:text>}; @@ -8801,8 +8805,6 @@ </xsl:text> <xsl:text>function send_hmi_value(index, value) { </xsl:text> - <xsl:text> console.log("send_hmi_value("+index+", "+value+")") -</xsl:text> <xsl:text> if(index > last_remote_index){ </xsl:text> <xsl:text> updates.set(index, value); @@ -8851,7 +8853,9 @@ </xsl:text> <xsl:text>function apply_hmi_value(index, new_val) { </xsl:text> - <xsl:text> console.log("apply_hmi_value("+index+", "+new_val+")") + <xsl:text> // Similarly to previous comment, taking decision to update based +</xsl:text> + <xsl:text> // on cache content is bad and can lead to inconsistency </xsl:text> <xsl:text> /*let old_val = cache[index];*/ </xsl:text>