# HG changeset patch # User Edouard Tisserant # Date 1671194811 -3600 # Node ID 7fbcc7b741b7ad8d75f0e8bdfe08c6c8086d70eb # Parent 2299f25779cee427f45881257f47eb10ec956fef SVGHMI: update generated XSLT files diff -r 2299f25779ce -r 7fbcc7b741b7 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Fri Dec 16 13:46:07 2022 +0100 +++ b/svghmi/gen_index_xhtml.xslt Fri Dec 16 13:46:51 2022 +0100 @@ -1217,6 +1217,8 @@ </xsl:text> <xsl:text> </xsl:text> + <xsl:text>const xmlns = "http://www.w3.org/2000/svg"; +</xsl:text> <xsl:text>let id = document.getElementById.bind(document); </xsl:text> <xsl:text>var svg_root = id("</xsl:text> @@ -2158,7 +2160,7 @@ </xsl:text> <xsl:text> } </xsl:text> - <xsl:text> + <xsl:text> </xsl:text> <xsl:text> undeafen(index){ </xsl:text> @@ -2168,6 +2170,10 @@ </xsl:text> <xsl:text> this.incoming[index] = undefined; </xsl:text> + <xsl:text> // TODO: add timestamp argument to dispatch, so that defered data do not appear wrong on graphs +</xsl:text> + <xsl:text> this.lastdispatch[index] = Date.now(); +</xsl:text> <xsl:text> this.do_dispatch(new_val, old_val, index); </xsl:text> <xsl:text> } @@ -5586,7 +5592,7 @@ <xsl:if test="$have_value"> <xsl:text> animate: function(){ </xsl:text> - <xsl:text> this.value_elt.textContent = String(this.display); + <xsl:text> multiline_to_svg_text(this.value_elt, String(this.display)); </xsl:text> <xsl:text> }, </xsl:text> @@ -5624,7 +5630,7 @@ </xsl:text> </xsl:for-each> <xsl:if test="$have_value"> - <xsl:text> this.value_elt.textContent = ""; + <xsl:text> multiline_to_svg_text(this.value_elt, ""); </xsl:text> </xsl:if> <xsl:text> }, @@ -9145,21 +9151,23 @@ </xsl:text> <xsl:text> // Compute visible Y range by merging fixed curves Y ranges </xsl:text> - <xsl:text> for(let minmax of this.minmaxes){ -</xsl:text> - <xsl:text> if(minmax){ -</xsl:text> - <xsl:text> let [min,max] = minmax; -</xsl:text> - <xsl:text> if(min < y_min) -</xsl:text> - <xsl:text> y_min = min; -</xsl:text> - <xsl:text> if(max > y_max) -</xsl:text> - <xsl:text> y_max = max; -</xsl:text> - <xsl:text> } + <xsl:text> for(let varopts of this.variables_options){ +</xsl:text> + <xsl:text> let minmax = varopts.minmax +</xsl:text> + <xsl:text> if(minmax){ +</xsl:text> + <xsl:text> let [min,max] = minmax; +</xsl:text> + <xsl:text> if(min < y_min) +</xsl:text> + <xsl:text> y_min = min; +</xsl:text> + <xsl:text> if(max > y_max) +</xsl:text> + <xsl:text> y_max = max; +</xsl:text> + <xsl:text> } </xsl:text> <xsl:text> } </xsl:text> @@ -9167,11 +9175,11 @@ </xsl:text> <xsl:text> if(y_min !== Infinity && y_max !== -Infinity){ </xsl:text> - <xsl:text> this.fixed_y_range = true; + <xsl:text> this.fixed_y_range = true; </xsl:text> <xsl:text> } else { </xsl:text> - <xsl:text> this.fixed_y_range = false; + <xsl:text> this.fixed_y_range = false; </xsl:text> <xsl:text> } </xsl:text> @@ -9265,6 +9273,8 @@ </xsl:text> <xsl:text> </xsl:text> + <xsl:text> console.log("dispatch(",value,oldval, index, time); +</xsl:text> <xsl:text> // naive local buffer impl. </xsl:text> <xsl:text> // data is updated only when graph is visible @@ -12755,8 +12765,6 @@ </xsl:text> <xsl:text> </xsl:text> - <xsl:text>const xmlns = "http://www.w3.org/2000/svg"; -</xsl:text> <xsl:text>var edit_callback; </xsl:text> <xsl:text>const localtypes = {"PAGE_LOCAL":null, "HMI_LOCAL":null}