# HG changeset patch # User Edouard Tisserant # Date 1654068127 -7200 # Node ID e87a2daace80705b24d702fabd486935ec2d11c9 # Parent ca312be569294eda8870ce6b8ad71a7d4c865a92# Parent a88ac1760faf2f2d7eadc135de5324c2dbe57225 merged diff -r a88ac1760faf -r e87a2daace80 svghmi/analyse_widget.xslt --- a/svghmi/analyse_widget.xslt Thu May 26 23:41:10 2022 +0200 +++ b/svghmi/analyse_widget.xslt Wed Jun 01 09:22:07 2022 +0200 @@ -2,7 +2,7 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:str="http://exslt.org/strings" xmlns:func="http://exslt.org/functions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" extension-element-prefixes="ns func exsl regexp str dyn" exclude-result-prefixes="ns func exsl regexp str dyn svg inkscape"> <xsl:output method="xml"/> <xsl:variable name="indexed_hmitree" select="/.."/> - <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([\d,]*)$'"/> + <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"/> <xsl:template mode="parselabel" match="*"> <xsl:variable name="label" select="@inkscape:label"/> <xsl:variable name="id" select="@id"/> @@ -885,6 +885,56 @@ <xsl:text>Boolean variable</xsl:text> </path> </xsl:template> + <xsl:template match="widget[@type='XYGraph']" mode="widget_desc"> + <type> + <xsl:value-of select="@type"/> + </type> + <longdesc> + <xsl:text>XYGraph draws a cartesian trend graph re-using styles given for axis, +</xsl:text> + <xsl:text>grid/marks, legends and curves. +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>Elements labeled "x_axis" and "y_axis" are svg:groups containg: +</xsl:text> + <xsl:text> - "axis_label" svg:text gives style an alignment for axis labels. +</xsl:text> + <xsl:text> - "interval_major_mark" and "interval_minor_mark" are svg elements to be +</xsl:text> + <xsl:text> duplicated along axis line to form intervals marks. +</xsl:text> + <xsl:text> - "axis_line" svg:path is the axis line. Paths must be intersect and their +</xsl:text> + <xsl:text> bounding box is the chart wall. +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>Elements labeled "curve_0", "curve_1", ... are paths whose styles are used +</xsl:text> + <xsl:text>to draw curves corresponding to data from variables passed as HMI tree paths. +</xsl:text> + <xsl:text>"curve_0" is mandatory. HMI variables outnumbering given curves are ignored. +</xsl:text> + <xsl:text> +</xsl:text> + </longdesc> + <shortdesc> + <xsl:text>Cartesian trend graph showing values of given variables over time</xsl:text> + </shortdesc> + <path name="value" count="1+" accepts="HMI_INT,HMI_REAL"> + <xsl:text>value</xsl:text> + </path> + <arg name="xrange" accepts="int,time"> + <xsl:text>X axis range expressed either in samples or duration.</xsl:text> + </arg> + <arg name="xformat" count="optional" accepts="string"> + <xsl:text>format string for X label</xsl:text> + </arg> + <arg name="yformat" count="optional" accepts="string"> + <xsl:text>format string for Y label</xsl:text> + </arg> + </xsl:template> <xsl:template mode="document" match="@* | node()"> <xsl:copy> <xsl:apply-templates mode="document" select="@* | node()"/> diff -r a88ac1760faf -r e87a2daace80 svghmi/gen_dnd_widget_svg.xslt --- a/svghmi/gen_dnd_widget_svg.xslt Thu May 26 23:41:10 2022 +0200 +++ b/svghmi/gen_dnd_widget_svg.xslt Wed Jun 01 09:22:07 2022 +0200 @@ -4,7 +4,7 @@ <xsl:variable name="hmi_elements" select="//svg:*[starts-with(@inkscape:label, 'HMI:')]"/> <xsl:variable name="widgetparams" select="ns:GetWidgetParams()"/> <xsl:variable name="indexed_hmitree" select="/.."/> - <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([\d,]*)$'"/> + <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"/> <xsl:template mode="parselabel" match="*"> <xsl:variable name="label" select="@inkscape:label"/> <xsl:variable name="id" select="@id"/> diff -r a88ac1760faf -r e87a2daace80 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Thu May 26 23:41:10 2022 +0200 +++ b/svghmi/gen_index_xhtml.xslt Wed Jun 01 09:22:07 2022 +0200 @@ -159,7 +159,7 @@ </xsl:with-param> </xsl:apply-templates> </xsl:template> - <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([\d,]*)$'"/> + <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"/> <xsl:template mode="parselabel" match="*"> <xsl:variable name="label" select="@inkscape:label"/> <xsl:variable name="id" select="@id"/> @@ -1108,6 +1108,11 @@ <xsl:attribute name="label"> <xsl:value-of select="substring(@inkscape:label,2)"/> </xsl:attribute> + <xsl:if test="string-length(text()) > 0"> + <line> + <xsl:value-of select="text()"/> + </line> + </xsl:if> <xsl:apply-templates mode="extract_i18n" select="svg:*"/> </msg> </xsl:template> @@ -1485,7 +1490,19 @@ </xsl:text> <xsl:text> this.pending = indexes.map(() => undefined); </xsl:text> - <xsl:text> this.bound_unhinibit = this.unhinibit.bind(this); + <xsl:text> this.bound_uninhibit = this.uninhibit.bind(this); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.lastdispatch = indexes.map(() => undefined); +</xsl:text> + <xsl:text> this.deafen = indexes.map(() => undefined); +</xsl:text> + <xsl:text> this.incoming = indexes.map(() => undefined); +</xsl:text> + <xsl:text> this.bound_undeafen = this.undeafen.bind(this); +</xsl:text> + <xsl:text> </xsl:text> <xsl:text> this.forced_frequency = freq; </xsl:text> @@ -1573,10 +1590,22 @@ </xsl:text> <xsl:text> this.lastapply[i] = undefined; </xsl:text> - <xsl:text> this.unhinibit(i); + <xsl:text> this.uninhibit(i); </xsl:text> <xsl:text> } </xsl:text> + <xsl:text> let deafened = this.deafen[i]; +</xsl:text> + <xsl:text> if(deafened != undefined){ +</xsl:text> + <xsl:text> clearTimeout(deafened); +</xsl:text> + <xsl:text> this.lastdispatch[i] = undefined; +</xsl:text> + <xsl:text> this.undeafen(i); +</xsl:text> + <xsl:text> } +</xsl:text> <xsl:text> let index = this.indexes[i]; </xsl:text> <xsl:text> if(this.relativeness[i]) @@ -1749,7 +1778,7 @@ </xsl:text> <xsl:text> </xsl:text> - <xsl:text> unhinibit(index){ + <xsl:text> uninhibit(index){ </xsl:text> <xsl:text> this.inhibit[index] = undefined; </xsl:text> @@ -1787,7 +1816,7 @@ </xsl:text> <xsl:text> this.pending[index] = new_val; </xsl:text> - <xsl:text> this.inhibit[index] = setTimeout(this.bound_unhinibit, min_interval - elapsed, index); + <xsl:text> this.inhibit[index] = setTimeout(this.bound_uninhibit, min_interval - elapsed, index); </xsl:text> <xsl:text> } </xsl:text> @@ -1831,19 +1860,65 @@ </xsl:text> <xsl:text> </xsl:text> + <xsl:text> undeafen(index){ +</xsl:text> + <xsl:text> this.deafen[index] = undefined; +</xsl:text> + <xsl:text> let [new_val, old_val] = this.incoming[index]; +</xsl:text> + <xsl:text> this.incoming[index] = undefined; +</xsl:text> + <xsl:text> this.dispatch(new_val, old_val, index); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> <xsl:text> _dispatch(value, oldval, varnum) { </xsl:text> <xsl:text> let dispatch = this.dispatch; </xsl:text> <xsl:text> if(dispatch != undefined){ </xsl:text> - <xsl:text> try { -</xsl:text> - <xsl:text> dispatch.call(this, value, oldval, varnum); -</xsl:text> - <xsl:text> } catch(err) { -</xsl:text> - <xsl:text> console.log(err); + <xsl:text> if(this.deafen[varnum] == undefined){ +</xsl:text> + <xsl:text> let now = Date.now(); +</xsl:text> + <xsl:text> let min_interval = 1000/this.frequency; +</xsl:text> + <xsl:text> let lastdispatch = this.lastdispatch[varnum]; +</xsl:text> + <xsl:text> if(lastdispatch == undefined || now > lastdispatch + min_interval){ +</xsl:text> + <xsl:text> this.lastdispatch[varnum] = now; +</xsl:text> + <xsl:text> try { +</xsl:text> + <xsl:text> dispatch.call(this, value, oldval, varnum); +</xsl:text> + <xsl:text> } catch(err) { +</xsl:text> + <xsl:text> console.log(err); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> else { +</xsl:text> + <xsl:text> let elapsed = now - lastdispatch; +</xsl:text> + <xsl:text> this.incoming[varnum] = [value, oldval]; +</xsl:text> + <xsl:text> this.deafen[varnum] = setTimeout(this.bound_undeafen, min_interval - elapsed, varnum); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> else { +</xsl:text> + <xsl:text> this.incoming[varnum] = [value, oldval]; </xsl:text> <xsl:text> } </xsl:text> @@ -4211,7 +4286,7 @@ <xsl:value-of select="$text_elt/@id"/> <xsl:text>"); </xsl:text> - <xsl:text> this.content = langs; + <xsl:text> this.content = langs.map(([lname,lcode]) => lname); </xsl:text> </xsl:when> <xsl:when test="count(arg) = 0"> @@ -7750,6 +7825,1313 @@ <xsl:with-param name="mandatory" select="'no'"/> </xsl:call-template> </xsl:template> + <xsl:template match="widget[@type='XYGraph']" mode="widget_desc"> + <type> + <xsl:value-of select="@type"/> + </type> + <longdesc> + <xsl:text>XYGraph draws a cartesian trend graph re-using styles given for axis, +</xsl:text> + <xsl:text>grid/marks, legends and curves. +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>Elements labeled "x_axis" and "y_axis" are svg:groups containg: +</xsl:text> + <xsl:text> - "axis_label" svg:text gives style an alignment for axis labels. +</xsl:text> + <xsl:text> - "interval_major_mark" and "interval_minor_mark" are svg elements to be +</xsl:text> + <xsl:text> duplicated along axis line to form intervals marks. +</xsl:text> + <xsl:text> - "axis_line" svg:path is the axis line. Paths must be intersect and their +</xsl:text> + <xsl:text> bounding box is the chart wall. +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>Elements labeled "curve_0", "curve_1", ... are paths whose styles are used +</xsl:text> + <xsl:text>to draw curves corresponding to data from variables passed as HMI tree paths. +</xsl:text> + <xsl:text>"curve_0" is mandatory. HMI variables outnumbering given curves are ignored. +</xsl:text> + <xsl:text> +</xsl:text> + </longdesc> + <shortdesc> + <xsl:text>Cartesian trend graph showing values of given variables over time</xsl:text> + </shortdesc> + <path name="value" count="1+" accepts="HMI_INT,HMI_REAL"> + <xsl:text>value</xsl:text> + </path> + <arg name="xrange" accepts="int,time"> + <xsl:text>X axis range expressed either in samples or duration.</xsl:text> + </arg> + <arg name="xformat" count="optional" accepts="string"> + <xsl:text>format string for X label</xsl:text> + </arg> + <arg name="yformat" count="optional" accepts="string"> + <xsl:text>format string for Y label</xsl:text> + </arg> + </xsl:template> + <xsl:template match="widget[@type='XYGraph']" mode="widget_class"> + <xsl:text>class </xsl:text> + <xsl:text>XYGraphWidget</xsl:text> + <xsl:text> extends Widget{ +</xsl:text> + <xsl:text> frequency = 1; +</xsl:text> + <xsl:text> init() { +</xsl:text> + <xsl:text> let x_duration_s; +</xsl:text> + <xsl:text> [x_duration_s, +</xsl:text> + <xsl:text> this.x_format, this.y_format] = this.args; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let timeunit = x_duration_s.slice(-1); +</xsl:text> + <xsl:text> let factor = { +</xsl:text> + <xsl:text> "s":1, +</xsl:text> + <xsl:text> "m":60, +</xsl:text> + <xsl:text> "h":3600, +</xsl:text> + <xsl:text> "d":86400}[timeunit]; +</xsl:text> + <xsl:text> if(factor == undefined){ +</xsl:text> + <xsl:text> this.max_data_length = Number(x_duration_s); +</xsl:text> + <xsl:text> this.x_duration = undefined; +</xsl:text> + <xsl:text> }else{ +</xsl:text> + <xsl:text> let duration = factor*Number(x_duration_s.slice(0,-1)); +</xsl:text> + <xsl:text> this.max_data_length = undefined; +</xsl:text> + <xsl:text> this.x_duration = duration*1000; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Min and Max given with paths are meant to describe visible range, +</xsl:text> + <xsl:text> // not to clip data. +</xsl:text> + <xsl:text> this.clip = false; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let y_min = Infinity, y_max = -Infinity; +</xsl:text> + <xsl:text> +</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> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> if(y_min !== Infinity && y_max !== -Infinity){ +</xsl:text> + <xsl:text> this.fixed_y_range = true; +</xsl:text> + <xsl:text> } else { +</xsl:text> + <xsl:text> this.fixed_y_range = false; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.ymin = y_min; +</xsl:text> + <xsl:text> this.ymax = y_max; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.curves = []; +</xsl:text> + <xsl:text> this.init_specific(); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.reference = new ReferenceFrame( +</xsl:text> + <xsl:text> [[this.x_interval_minor_mark_elt, this.x_interval_major_mark_elt], +</xsl:text> + <xsl:text> [this.y_interval_minor_mark_elt, this.y_interval_major_mark_elt]], +</xsl:text> + <xsl:text> [this.x_axis_label_elt, this.y_axis_label_elt], +</xsl:text> + <xsl:text> [this.x_axis_line_elt, this.y_axis_line_elt], +</xsl:text> + <xsl:text> [this.x_format, this.y_format]); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let max_stroke_width = 0; +</xsl:text> + <xsl:text> for(let curve of this.curves){ +</xsl:text> + <xsl:text> if(curve.style.strokeWidth > max_stroke_width){ +</xsl:text> + <xsl:text> max_stroke_width = curve.style.strokeWidth; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.Margins=this.reference.getLengths().map(length => max_stroke_width/length); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // create <clipPath> path and attach it to widget +</xsl:text> + <xsl:text> let clipPath = document.createElementNS(xmlns,"clipPath"); +</xsl:text> + <xsl:text> let clipPathPath = document.createElementNS(xmlns,"path"); +</xsl:text> + <xsl:text> let clipPathPathDattr = document.createAttribute("d"); +</xsl:text> + <xsl:text> clipPathPathDattr.value = this.reference.getClipPathPathDattr(); +</xsl:text> + <xsl:text> clipPathPath.setAttributeNode(clipPathPathDattr); +</xsl:text> + <xsl:text> clipPath.appendChild(clipPathPath); +</xsl:text> + <xsl:text> clipPath.id = randomId(); +</xsl:text> + <xsl:text> this.element.appendChild(clipPath); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // assign created clipPath to clip-path property of curves +</xsl:text> + <xsl:text> for(let curve of this.curves){ +</xsl:text> + <xsl:text> curve.setAttribute("clip-path", "url(#" + clipPath.id + ")"); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.curves_data = this.curves.map(_unused => []); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> dispatch(value,oldval, index) { +</xsl:text> + <xsl:text> // TODO: get PLC time instead of browser time +</xsl:text> + <xsl:text> let time = Date.now(); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // naive local buffer impl. +</xsl:text> + <xsl:text> // data is updated only when graph is visible +</xsl:text> + <xsl:text> // TODO: replace with separate recording +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.curves_data[index].push([time, value]); +</xsl:text> + <xsl:text> let data_length = this.curves_data[index].length; +</xsl:text> + <xsl:text> let ymin_damaged = false; +</xsl:text> + <xsl:text> let ymax_damaged = false; +</xsl:text> + <xsl:text> let overflow; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> if(this.max_data_length == undefined){ +</xsl:text> + <xsl:text> let peremption = time - this.x_duration; +</xsl:text> + <xsl:text> let oldest = this.curves_data[index][0][0] +</xsl:text> + <xsl:text> this.xmin = peremption; +</xsl:text> + <xsl:text> if(oldest < peremption){ +</xsl:text> + <xsl:text> // remove first item +</xsl:text> + <xsl:text> overflow = this.curves_data[index].shift()[1]; +</xsl:text> + <xsl:text> data_length = data_length - 1; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } else { +</xsl:text> + <xsl:text> if(data_length > this.max_data_length){ +</xsl:text> + <xsl:text> // remove first item +</xsl:text> + <xsl:text> [this.xmin, overflow] = this.curves_data[index].shift(); +</xsl:text> + <xsl:text> data_length = data_length - 1; +</xsl:text> + <xsl:text> } else { +</xsl:text> + <xsl:text> if(this.xmin == undefined){ +</xsl:text> + <xsl:text> this.xmin = time; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.xmax = time; +</xsl:text> + <xsl:text> let Xrange = this.xmax - this.xmin; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> if(!this.fixed_y_range){ +</xsl:text> + <xsl:text> ymin_damaged = overflow <= this.ymin; +</xsl:text> + <xsl:text> ymax_damaged = overflow >= this.ymax; +</xsl:text> + <xsl:text> if(value > this.ymax){ +</xsl:text> + <xsl:text> ymax_damaged = false; +</xsl:text> + <xsl:text> this.ymax = value; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> if(value < this.ymin){ +</xsl:text> + <xsl:text> ymin_damaged = false; +</xsl:text> + <xsl:text> this.ymin = value; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> let Yrange = this.ymax - this.ymin; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // apply margin by moving min and max to enlarge range +</xsl:text> + <xsl:text> let [xMargin,yMargin] = zip(this.Margins, [Xrange, Yrange]).map(([m,l]) => m*l); +</xsl:text> + <xsl:text> [[this.dxmin, this.dxmax],[this.dymin,this.dymax]] = +</xsl:text> + <xsl:text> [[this.xmin-xMargin, this.xmax+xMargin], +</xsl:text> + <xsl:text> [this.ymin-yMargin, this.ymax+yMargin]]; +</xsl:text> + <xsl:text> Xrange += 2*xMargin; +</xsl:text> + <xsl:text> Yrange += 2*yMargin; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // recompute curves "d" attribute +</xsl:text> + <xsl:text> // FIXME: use SVG getPathData and setPathData when available. +</xsl:text> + <xsl:text> // https://svgwg.org/specs/paths/#InterfaceSVGPathData +</xsl:text> + <xsl:text> // https://github.com/jarek-foksa/path-data-polyfill +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let [base_point, xvect, yvect] = this.reference.getBaseRef(); +</xsl:text> + <xsl:text> this.curves_d_attr = +</xsl:text> + <xsl:text> zip(this.curves_data, this.curves).map(([data,curve]) => { +</xsl:text> + <xsl:text> let new_d = data.map(([x,y], i) => { +</xsl:text> + <xsl:text> // compute curve point from data, ranges, and base_ref +</xsl:text> + <xsl:text> let xv = vectorscale(xvect, (x - this.dxmin) / Xrange); +</xsl:text> + <xsl:text> let yv = vectorscale(yvect, (y - this.dymin) / Yrange); +</xsl:text> + <xsl:text> let px = base_point.x + xv.x + yv.x; +</xsl:text> + <xsl:text> let py = base_point.y + xv.y + yv.y; +</xsl:text> + <xsl:text> if(!this.fixed_y_range){ +</xsl:text> + <xsl:text> // update min and max from curve data if needed +</xsl:text> + <xsl:text> if(ymin_damaged && y < this.ymin) this.ymin = y; +</xsl:text> + <xsl:text> if(ymax_damaged && y > this.ymax) this.ymax = y; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return " " + px + "," + py; +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> new_d.unshift("M "); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return new_d.join(''); +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // computed curves "d" attr is applied to svg curve during animate(); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.request_animate(); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> animate(){ +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // move elements only if enough data +</xsl:text> + <xsl:text> if(this.curves_data.some(data => data.length > 1)){ +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // move marks and update labels +</xsl:text> + <xsl:text> this.reference.applyRanges([[this.dxmin, this.dxmax], +</xsl:text> + <xsl:text> [this.dymin, this.dymax]]); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // apply computed curves "d" attributes +</xsl:text> + <xsl:text> for(let [curve, d_attr] of zip(this.curves, this.curves_d_attr)){ +</xsl:text> + <xsl:text> curve.setAttribute("d", d_attr); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>} +</xsl:text> + </xsl:template> + <xsl:template match="widget[@type='XYGraph']" mode="widget_defs"> + <xsl:param name="hmi_element"/> + <xsl:call-template name="defs_by_labels"> + <xsl:with-param name="hmi_element" select="$hmi_element"/> + <xsl:with-param name="labels"> + <xsl:text>/x_interval_minor_mark /x_axis_line /x_interval_major_mark /x_axis_label</xsl:text> + </xsl:with-param> + </xsl:call-template> + <xsl:call-template name="defs_by_labels"> + <xsl:with-param name="hmi_element" select="$hmi_element"/> + <xsl:with-param name="labels"> + <xsl:text>/y_interval_minor_mark /y_axis_line /y_interval_major_mark /y_axis_label</xsl:text> + </xsl:with-param> + </xsl:call-template> + <xsl:text> init_specific() { +</xsl:text> + <xsl:for-each select="$hmi_element/*[regexp:test(@inkscape:label,'^curve_[0-9]+$')]"> + <xsl:variable name="label" select="@inkscape:label"/> + <xsl:variable name="id" select="@id"/> + <xsl:if test="$hmi_element/*[not($id = @id) and @inkscape:label=$label]"> + <xsl:message terminate="yes"> + <xsl:text>XYGraph id="</xsl:text> + <xsl:value-of select="$id"/> + <xsl:text>", label="</xsl:text> + <xsl:value-of select="$label"/> + <xsl:text>" : elements with data_n label must be unique.</xsl:text> + </xsl:message> + </xsl:if> + <xsl:text> this.curves[</xsl:text> + <xsl:value-of select="substring(@inkscape:label, 7)"/> + <xsl:text>] = id("</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>"); /* </xsl:text> + <xsl:value-of select="@inkscape:label"/> + <xsl:text> */ +</xsl:text> + </xsl:for-each> + <xsl:text> } +</xsl:text> + </xsl:template> + <declarations:XYGraph/> + <xsl:template match="declarations:XYGraph"> + <xsl:text> +</xsl:text> + <xsl:text>/* </xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:text> */ +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function lineFromPath(path_elt) { +</xsl:text> + <xsl:text> let start = path_elt.getPointAtLength(0); +</xsl:text> + <xsl:text> let end = path_elt.getPointAtLength(path_elt.getTotalLength()); +</xsl:text> + <xsl:text> return [start, new DOMPoint(end.x - start.x , end.y - start.y)]; +</xsl:text> + <xsl:text>}; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function vector(p1, p2) { +</xsl:text> + <xsl:text> return new DOMPoint(p2.x - p1.x , p2.y - p1.y); +</xsl:text> + <xsl:text>}; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function vectorscale(p1, p2) { +</xsl:text> + <xsl:text> return new DOMPoint(p2 * p1.x , p2 * p1.y); +</xsl:text> + <xsl:text>}; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function vectorLength(p1) { +</xsl:text> + <xsl:text> return Math.sqrt(p1.x*p1.x + p1.y*p1.y); +</xsl:text> + <xsl:text>}; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function randomId(){ +</xsl:text> + <xsl:text> return Date.now().toString(36) + Math.random().toString(36).substr(2); +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function move_elements_to_group(elements) { +</xsl:text> + <xsl:text> let newgroup = document.createElementNS(xmlns,"g"); +</xsl:text> + <xsl:text> newgroup.id = randomId(); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> for(let element of elements){ +</xsl:text> + <xsl:text> let parent = element.parentElement; +</xsl:text> + <xsl:text> if(parent !== null) +</xsl:text> + <xsl:text> parent.removeChild(element); +</xsl:text> + <xsl:text> newgroup.appendChild(element); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> return newgroup; +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text>function getLinesIntesection(l1, l2) { +</xsl:text> + <xsl:text> let [l1start, l1vect] = l1; +</xsl:text> + <xsl:text> let [l2start, l2vect] = l2; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> /* +</xsl:text> + <xsl:text> Compute intersection of two lines +</xsl:text> + <xsl:text> ================================= +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> ^ l2vect +</xsl:text> + <xsl:text> / +</xsl:text> + <xsl:text> / +</xsl:text> + <xsl:text> / +</xsl:text> + <xsl:text> l1start ----------X--------------> l1vect +</xsl:text> + <xsl:text> / intersection +</xsl:text> + <xsl:text> / +</xsl:text> + <xsl:text> / +</xsl:text> + <xsl:text> l2start +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> */ +</xsl:text> + <xsl:text> let [x1, y1, x3, y3] = [l1start.x, l1start.y, l2start.x, l2start.y]; +</xsl:text> + <xsl:text> let [x2, y2, x4, y4] = [x1+l1vect.x, y1+l1vect.y, x3+l2vect.x, y3+l2vect.y]; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // line intercept math by Paul Bourke http://paulbourke.net/geometry/pointlineplane/ +</xsl:text> + <xsl:text> // Determine the intersection point of two line segments +</xsl:text> + <xsl:text> // Return FALSE if the lines don't intersect +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Check if none of the lines are of length 0 +</xsl:text> + <xsl:text> if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) { +</xsl:text> + <xsl:text> return false +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> denominator = ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1)) +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Lines are parallel +</xsl:text> + <xsl:text> if (denominator === 0) { +</xsl:text> + <xsl:text> return false +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator +</xsl:text> + <xsl:text> let ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Return a object with the x and y coordinates of the intersection +</xsl:text> + <xsl:text> let x = x1 + ua * (x2 - x1) +</xsl:text> + <xsl:text> let y = y1 + ua * (y2 - y1) +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return new DOMPoint(x,y); +</xsl:text> + <xsl:text>}; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>class ReferenceFrame { +</xsl:text> + <xsl:text> constructor( +</xsl:text> + <xsl:text> // [[Xminor,Xmajor], [Yminor,Ymajor]] +</xsl:text> + <xsl:text> marks, +</xsl:text> + <xsl:text> // [Xlabel, Ylabel] +</xsl:text> + <xsl:text> labels, +</xsl:text> + <xsl:text> // [Xline, Yline] +</xsl:text> + <xsl:text> lines, +</xsl:text> + <xsl:text> // [Xformat, Yformat] printf-like formating strings +</xsl:text> + <xsl:text> formats +</xsl:text> + <xsl:text> ){ +</xsl:text> + <xsl:text> this.axes = zip(labels,marks,lines,formats).map(args => new Axis(...args)); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let [lx,ly] = this.axes.map(axis => axis.line); +</xsl:text> + <xsl:text> let [[xstart, xvect], [ystart, yvect]] = [lx,ly]; +</xsl:text> + <xsl:text> let base_point = this.getBasePoint(); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // setup clipping for curves +</xsl:text> + <xsl:text> this.clipPathPathDattr = +</xsl:text> + <xsl:text> "m " + base_point.x + "," + base_point.y + " " +</xsl:text> + <xsl:text> + xvect.x + "," + xvect.y + " " +</xsl:text> + <xsl:text> + yvect.x + "," + yvect.y + " " +</xsl:text> + <xsl:text> + -xvect.x + "," + -xvect.y + " " +</xsl:text> + <xsl:text> + -yvect.x + "," + -yvect.y + " z"; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.base_ref = [base_point, xvect, yvect]; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.lengths = [xvect,yvect].map(v => vectorLength(v)); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> for(let axis of this.axes){ +</xsl:text> + <xsl:text> axis.setBasePoint(base_point); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> getLengths(){ +</xsl:text> + <xsl:text> return this.lengths; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> getBaseRef(){ +</xsl:text> + <xsl:text> return this.base_ref; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> getClipPathPathDattr(){ +</xsl:text> + <xsl:text> return this.clipPathPathDattr; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> applyRanges(ranges){ +</xsl:text> + <xsl:text> let origin_moves = zip(ranges,this.axes).map(([range,axis]) => axis.applyRange(...range)); +</xsl:text> + <xsl:text> zip(origin_moves.reverse(),this.axes).forEach(([vect,axis]) => axis.moveOrigin(vect)); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> getBasePoint() { +</xsl:text> + <xsl:text> let [[xstart, xvect], [ystart, yvect]] = this.axes.map(axis => axis.line); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> /* +</xsl:text> + <xsl:text> Compute graph clipping region base point +</xsl:text> + <xsl:text> ======================================== +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> Clipping region is a parallelogram containing axes lines, +</xsl:text> + <xsl:text> and whose sides are parallel to axes line respectively. +</xsl:text> + <xsl:text> Given axes lines are not starting at the same point, hereafter is +</xsl:text> + <xsl:text> calculus of parallelogram base point. +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> ^ given Y axis (yvect) +</xsl:text> + <xsl:text> / / +</xsl:text> + <xsl:text> / / +</xsl:text> + <xsl:text> / / +</xsl:text> + <xsl:text> xstart *---------*--------------> given X axis (xvect) +</xsl:text> + <xsl:text> / /origin +</xsl:text> + <xsl:text> / / +</xsl:text> + <xsl:text> *---------*-------------- +</xsl:text> + <xsl:text> base_point ystart +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> */ +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let base_point = getLinesIntesection([xstart,yvect],[ystart,xvect]); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return base_point; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>class Axis { +</xsl:text> + <xsl:text> constructor(label, marks, line, format){ +</xsl:text> + <xsl:text> this.lineElement = line; +</xsl:text> + <xsl:text> this.line = lineFromPath(line); +</xsl:text> + <xsl:text> this.format = format; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.label = label; +</xsl:text> + <xsl:text> this.marks = marks; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // add transforms for elements sliding along the axis line +</xsl:text> + <xsl:text> for(let [elementname,element] of zip(["minor", "major", "label"],[...marks,label])){ +</xsl:text> + <xsl:text> for(let name of ["base","slide"]){ +</xsl:text> + <xsl:text> let transform = svg_root.createSVGTransform(); +</xsl:text> + <xsl:text> element.transform.baseVal.insertItemBefore(transform,0); +</xsl:text> + <xsl:text> this[elementname+"_"+name+"_transform"]=transform; +</xsl:text> + <xsl:text> }; +</xsl:text> + <xsl:text> }; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // group marks an labels together +</xsl:text> + <xsl:text> let parent = line.parentElement; +</xsl:text> + <xsl:text> this.marks_group = move_elements_to_group(marks); +</xsl:text> + <xsl:text> this.marks_and_label_group = move_elements_to_group([this.marks_group, label]); +</xsl:text> + <xsl:text> this.group = move_elements_to_group([this.marks_and_label_group,line]); +</xsl:text> + <xsl:text> parent.appendChild(this.group); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Add transforms to group +</xsl:text> + <xsl:text> for(let name of ["base","origin"]){ +</xsl:text> + <xsl:text> let transform = svg_root.createSVGTransform(); +</xsl:text> + <xsl:text> this.group.transform.baseVal.appendItem(transform); +</xsl:text> + <xsl:text> this[name+"_transform"]=transform; +</xsl:text> + <xsl:text> }; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.marks_and_label_group_transform = svg_root.createSVGTransform(); +</xsl:text> + <xsl:text> this.marks_and_label_group.transform.baseVal.appendItem(this.marks_and_label_group_transform); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.duplicates = []; +</xsl:text> + <xsl:text> this.last_duplicate_index = 0; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> setBasePoint(base_point){ +</xsl:text> + <xsl:text> // move Axis to base point +</xsl:text> + <xsl:text> let [start, _vect] = this.line; +</xsl:text> + <xsl:text> let v = vector(start, base_point); +</xsl:text> + <xsl:text> this.base_transform.setTranslate(v.x, v.y); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Move marks and label to base point. +</xsl:text> + <xsl:text> // _|_______ _|________ +</xsl:text> + <xsl:text> // | ' | ==> ' +</xsl:text> + <xsl:text> // | 0 0 +</xsl:text> + <xsl:text> // | | +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> for(let [markname,mark] of zip(["minor", "major"],this.marks)){ +</xsl:text> + <xsl:text> let pos = vector( +</xsl:text> + <xsl:text> // Marks are expected to be paths +</xsl:text> + <xsl:text> // paths are expected to be lines +</xsl:text> + <xsl:text> // intersection with axis line is taken +</xsl:text> + <xsl:text> // as reference for mark position +</xsl:text> + <xsl:text> getLinesIntesection( +</xsl:text> + <xsl:text> this.line, lineFromPath(mark)),base_point); +</xsl:text> + <xsl:text> this[markname+"_base_transform"].setTranslate(pos.x - v.x, pos.y - v.y); +</xsl:text> + <xsl:text> if(markname == "major"){ // label follow major mark +</xsl:text> + <xsl:text> this.label_base_transform.setTranslate(pos.x - v.x, pos.y - v.y); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> moveOrigin(vect){ +</xsl:text> + <xsl:text> this.origin_transform.setTranslate(vect.x, vect.y); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> applyRange(min, max){ +</xsl:text> + <xsl:text> let range = max - min; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // compute how many units for a mark +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> // - Units are expected to be an order of magnitude smaller than range, +</xsl:text> + <xsl:text> // so that marks are not too dense and also not too sparse. +</xsl:text> + <xsl:text> // Order of magnitude of range is log10(range) +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> // - Units are necessarily power of ten, otherwise it is complicated to +</xsl:text> + <xsl:text> // fill the text in labels... +</xsl:text> + <xsl:text> // Unit is pow(10, integer_number ) +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> // - To transform order of magnitude to an integer, floor() is used. +</xsl:text> + <xsl:text> // This results in a count of mark fluctuating in between 10 and 100. +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> // - To spare resources result is better in between 3 and 30, +</xsl:text> + <xsl:text> // and log10(3) is substracted to order of magnitude to obtain this +</xsl:text> + <xsl:text> let unit = Math.pow(10, Math.floor(Math.log10(range)-Math.log10(3))); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // TODO: for time values (ms), units may be : +</xsl:text> + <xsl:text> // 1 -> ms +</xsl:text> + <xsl:text> // 10 -> s/100 +</xsl:text> + <xsl:text> // 100 -> s/10 +</xsl:text> + <xsl:text> // 1000 -> s +</xsl:text> + <xsl:text> // 60000 -> min +</xsl:text> + <xsl:text> // 3600000 -> hour +</xsl:text> + <xsl:text> // ... +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Compute position of origin along axis [0...range] +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // min < 0, max > 0, offset = -min +</xsl:text> + <xsl:text> // _____________|________________ +</xsl:text> + <xsl:text> // ... -3 -2 -1 |0 1 2 3 4 ... +</xsl:text> + <xsl:text> // <--offset---> ^ +</xsl:text> + <xsl:text> // |_original +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // min > 0, max > 0, offset = 0 +</xsl:text> + <xsl:text> // |________________ +</xsl:text> + <xsl:text> // |6 7 8 9 10... +</xsl:text> + <xsl:text> // ^ +</xsl:text> + <xsl:text> // |_original +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // min < 0, max < 0, offset = max-min (range) +</xsl:text> + <xsl:text> // _____________|_ +</xsl:text> + <xsl:text> // ... -5 -4 -3 |-2 +</xsl:text> + <xsl:text> // <--offset---> ^ +</xsl:text> + <xsl:text> // |_original +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let offset = (max>=0 && min>=0) ? 0 : ( +</xsl:text> + <xsl:text> (max<0 && min<0) ? range : -min); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // compute unit vector +</xsl:text> + <xsl:text> let [_start, vect] = this.line; +</xsl:text> + <xsl:text> let unit_vect = vectorscale(vect, 1/range); +</xsl:text> + <xsl:text> let [mark_min, mark_max, mark_offset] = [min,max,offset].map(val => Math.round(val/unit)); +</xsl:text> + <xsl:text> let mark_count = mark_max-mark_min; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // apply unit vector to marks and label +</xsl:text> + <xsl:text> // offset is a representing position of an +</xsl:text> + <xsl:text> // axis along the opposit axis line, expressed in major marks units +</xsl:text> + <xsl:text> // unit_vect is unit vector +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // ^ +</xsl:text> + <xsl:text> // | unit_vect +</xsl:text> + <xsl:text> // |<---> +</xsl:text> + <xsl:text> // _________|__________> +</xsl:text> + <xsl:text> // ^ | ' | ' | ' +</xsl:text> + <xsl:text> // |yoffset | 1 +</xsl:text> + <xsl:text> // | | +</xsl:text> + <xsl:text> // v xoffset| +</xsl:text> + <xsl:text> // X<------>| +</xsl:text> + <xsl:text> // base_point +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // move major marks and label to first positive mark position +</xsl:text> + <xsl:text> // let v = vectorscale(unit_vect, unit); +</xsl:text> + <xsl:text> // this.label_slide_transform.setTranslate(v.x, v.y); +</xsl:text> + <xsl:text> // this.major_slide_transform.setTranslate(v.x, v.y); +</xsl:text> + <xsl:text> // move minor mark to first half positive mark position +</xsl:text> + <xsl:text> let v = vectorscale(unit_vect, unit/2); +</xsl:text> + <xsl:text> this.minor_slide_transform.setTranslate(v.x, v.y); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // duplicate marks and labels as needed +</xsl:text> + <xsl:text> let current_mark_count = this.duplicates.length; +</xsl:text> + <xsl:text> for(let i = current_mark_count; i <= mark_count; i++){ +</xsl:text> + <xsl:text> // cloneNode() label and add a svg:use of marks in a new group +</xsl:text> + <xsl:text> let newgroup = document.createElementNS(xmlns,"g"); +</xsl:text> + <xsl:text> let transform = svg_root.createSVGTransform(); +</xsl:text> + <xsl:text> let newlabel = this.label.cloneNode(true); +</xsl:text> + <xsl:text> let newuse = document.createElementNS(xmlns,"use"); +</xsl:text> + <xsl:text> let newuseAttr = document.createAttribute("href"); +</xsl:text> + <xsl:text> newuseAttr.value = "#"+this.marks_group.id; +</xsl:text> + <xsl:text> newuse.setAttributeNode(newuseAttr); +</xsl:text> + <xsl:text> newgroup.transform.baseVal.appendItem(transform); +</xsl:text> + <xsl:text> newgroup.appendChild(newlabel); +</xsl:text> + <xsl:text> newgroup.appendChild(newuse); +</xsl:text> + <xsl:text> this.duplicates.push([transform,newgroup]); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // move marks and labels, set labels +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> // min > 0, max > 0, offset = 0 +</xsl:text> + <xsl:text> // ^ +</xsl:text> + <xsl:text> // |________> +</xsl:text> + <xsl:text> // '| | ' | +</xsl:text> + <xsl:text> // | 6 7 +</xsl:text> + <xsl:text> // X +</xsl:text> + <xsl:text> // base_point +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> // min < 0, max > 0, offset = -min +</xsl:text> + <xsl:text> // ^ +</xsl:text> + <xsl:text> // _________|__________> +</xsl:text> + <xsl:text> // ' | ' | ' | ' +</xsl:text> + <xsl:text> // -1 | 1 +</xsl:text> + <xsl:text> // offset | +</xsl:text> + <xsl:text> // X<------>| +</xsl:text> + <xsl:text> // base_point +</xsl:text> + <xsl:text> // +</xsl:text> + <xsl:text> // min < 0, max < 0, offset = range +</xsl:text> + <xsl:text> // ^ +</xsl:text> + <xsl:text> // ____________| +</xsl:text> + <xsl:text> // ' | ' | |' +</xsl:text> + <xsl:text> // -5 -4 | +</xsl:text> + <xsl:text> // offset | +</xsl:text> + <xsl:text> // X<--------->| +</xsl:text> + <xsl:text> // base_point +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let duplicate_index = 0; +</xsl:text> + <xsl:text> for(let mark_index = 0; mark_index <= mark_count; mark_index++){ +</xsl:text> + <xsl:text> let val = (mark_min + mark_index) * unit; +</xsl:text> + <xsl:text> let vec = vectorscale(unit_vect, val - min); +</xsl:text> + <xsl:text> let text = this.format ? sprintf(this.format, val) : val.toString(); +</xsl:text> + <xsl:text> if(mark_index == mark_offset){ +</xsl:text> + <xsl:text> // apply offset to original marks and label groups +</xsl:text> + <xsl:text> this.marks_and_label_group_transform.setTranslate(vec.x, vec.y); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // update original label text +</xsl:text> + <xsl:text> this.label.getElementsByTagName("tspan")[0].textContent = text; +</xsl:text> + <xsl:text> } else { +</xsl:text> + <xsl:text> let [transform,element] = this.duplicates[duplicate_index++]; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // apply unit vector*N to marks and label groups +</xsl:text> + <xsl:text> transform.setTranslate(vec.x, vec.y); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // update label text +</xsl:text> + <xsl:text> element.getElementsByTagName("tspan")[0].textContent = text; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> // Attach to group if not already +</xsl:text> + <xsl:text> if(element.parentElement == null){ +</xsl:text> + <xsl:text> this.group.appendChild(element); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> let save_duplicate_index = duplicate_index; +</xsl:text> + <xsl:text> // dettach marks and label from group if not anymore visible +</xsl:text> + <xsl:text> for(;duplicate_index < this.last_duplicate_index; duplicate_index++){ +</xsl:text> + <xsl:text> let [transform,element] = this.duplicates[duplicate_index]; +</xsl:text> + <xsl:text> this.group.removeChild(element); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> this.last_duplicate_index = save_duplicate_index; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return vectorscale(unit_vect, offset); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + </xsl:template> <xsl:template match="/"> <xsl:comment> <xsl:text>Made with SVGHMI. https://beremiz.org</xsl:text> @@ -8027,9 +9409,21 @@ </xsl:text> <xsl:text> let lang = get_current_lang_code(); </xsl:text> - <xsl:text> arg = Date(arg).toLocaleString('en-US', options); -</xsl:text> - <xsl:text> + <xsl:text> let f; +</xsl:text> + <xsl:text> try{ +</xsl:text> + <xsl:text> f = new Intl.DateTimeFormat(lang, options); +</xsl:text> + <xsl:text> } catch(e) { +</xsl:text> + <xsl:text> f = new Intl.DateTimeFormat('en-US', options); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> arg = f.format(arg); +</xsl:text> + <xsl:text> </xsl:text> <xsl:text> /* </xsl:text> @@ -8349,6 +9743,430 @@ </xsl:text> <xsl:text>}(); // eslint-disable-line </xsl:text> + <xsl:text>/* +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>From https://github.com/keyvan-m-sadeghi/pythonic +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>Slightly modified in order to be usable in browser (i.e. not as a node.js module) +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>The MIT License (MIT) +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>Copyright (c) 2016 Assister.Ai +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>Permission is hereby granted, free of charge, to any person obtaining a copy of +</xsl:text> + <xsl:text>this software and associated documentation files (the "Software"), to deal in +</xsl:text> + <xsl:text>the Software without restriction, including without limitation the rights to +</xsl:text> + <xsl:text>use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +</xsl:text> + <xsl:text>the Software, and to permit persons to whom the Software is furnished to do so, +</xsl:text> + <xsl:text>subject to the following conditions: +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>The above copyright notice and this permission notice shall be included in all +</xsl:text> + <xsl:text>copies or substantial portions of the Software. +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +</xsl:text> + <xsl:text>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +</xsl:text> + <xsl:text>FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +</xsl:text> + <xsl:text>COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +</xsl:text> + <xsl:text>IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +</xsl:text> + <xsl:text>CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +</xsl:text> + <xsl:text>*/ +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>class Iterator { +</xsl:text> + <xsl:text> constructor(generator) { +</xsl:text> + <xsl:text> this[Symbol.iterator] = generator; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> async * [Symbol.asyncIterator]() { +</xsl:text> + <xsl:text> for (const element of this) { +</xsl:text> + <xsl:text> yield await element; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> forEach(callback) { +</xsl:text> + <xsl:text> for (const element of this) { +</xsl:text> + <xsl:text> callback(element); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> map(callback) { +</xsl:text> + <xsl:text> const result = []; +</xsl:text> + <xsl:text> for (const element of this) { +</xsl:text> + <xsl:text> result.push(callback(element)); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return result; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> filter(callback) { +</xsl:text> + <xsl:text> const result = []; +</xsl:text> + <xsl:text> for (const element of this) { +</xsl:text> + <xsl:text> if (callback(element)) { +</xsl:text> + <xsl:text> result.push(element); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return result; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> reduce(callback, initialValue) { +</xsl:text> + <xsl:text> let empty = typeof initialValue === 'undefined'; +</xsl:text> + <xsl:text> let accumulator = initialValue; +</xsl:text> + <xsl:text> let index = 0; +</xsl:text> + <xsl:text> for (const currentValue of this) { +</xsl:text> + <xsl:text> if (empty) { +</xsl:text> + <xsl:text> accumulator = currentValue; +</xsl:text> + <xsl:text> empty = false; +</xsl:text> + <xsl:text> continue; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> accumulator = callback(accumulator, currentValue, index, this); +</xsl:text> + <xsl:text> index++; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> if (empty) { +</xsl:text> + <xsl:text> throw new TypeError('Reduce of empty Iterator with no initial value'); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return accumulator; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> some(callback) { +</xsl:text> + <xsl:text> for (const element of this) { +</xsl:text> + <xsl:text> if (callback(element)) { +</xsl:text> + <xsl:text> return true; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return false; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> every(callback) { +</xsl:text> + <xsl:text> for (const element of this) { +</xsl:text> + <xsl:text> if (!callback(element)) { +</xsl:text> + <xsl:text> return false; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return true; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> static fromIterable(iterable) { +</xsl:text> + <xsl:text> return new Iterator(function * () { +</xsl:text> + <xsl:text> for (const element of iterable) { +</xsl:text> + <xsl:text> yield element; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> toArray() { +</xsl:text> + <xsl:text> return Array.from(this); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> next() { +</xsl:text> + <xsl:text> if (!this.currentInvokedGenerator) { +</xsl:text> + <xsl:text> this.currentInvokedGenerator = this[Symbol.iterator](); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return this.currentInvokedGenerator.next(); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> reset() { +</xsl:text> + <xsl:text> delete this.currentInvokedGenerator; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function rangeSimple(stop) { +</xsl:text> + <xsl:text> return new Iterator(function * () { +</xsl:text> + <xsl:text> for (let i = 0; i < stop; i++) { +</xsl:text> + <xsl:text> yield i; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function rangeOverload(start, stop, step = 1) { +</xsl:text> + <xsl:text> return new Iterator(function * () { +</xsl:text> + <xsl:text> for (let i = start; i < stop; i += step) { +</xsl:text> + <xsl:text> yield i; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function range(...args) { +</xsl:text> + <xsl:text> if (args.length < 2) { +</xsl:text> + <xsl:text> return rangeSimple(...args); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return rangeOverload(...args); +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function enumerate(iterable) { +</xsl:text> + <xsl:text> return new Iterator(function * () { +</xsl:text> + <xsl:text> let index = 0; +</xsl:text> + <xsl:text> for (const element of iterable) { +</xsl:text> + <xsl:text> yield [index, element]; +</xsl:text> + <xsl:text> index++; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>const _zip = longest => (...iterables) => { +</xsl:text> + <xsl:text> if (iterables.length < 2) { +</xsl:text> + <xsl:text> throw new TypeError("zip takes 2 iterables at least, "+iterables.length+" given"); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return new Iterator(function * () { +</xsl:text> + <xsl:text> const iterators = iterables.map(iterable => Iterator.fromIterable(iterable)); +</xsl:text> + <xsl:text> while (true) { +</xsl:text> + <xsl:text> const row = iterators.map(iterator => iterator.next()); +</xsl:text> + <xsl:text> const check = longest ? row.every.bind(row) : row.some.bind(row); +</xsl:text> + <xsl:text> if (check(next => next.done)) { +</xsl:text> + <xsl:text> return; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> yield row.map(next => next.value); +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text>}; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>const zip = _zip(false), zipLongest= _zip(true); +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>function items(obj) { +</xsl:text> + <xsl:text> let {keys, get} = obj; +</xsl:text> + <xsl:text> if (obj instanceof Map) { +</xsl:text> + <xsl:text> keys = keys.bind(obj); +</xsl:text> + <xsl:text> get = get.bind(obj); +</xsl:text> + <xsl:text> } else { +</xsl:text> + <xsl:text> keys = function () { +</xsl:text> + <xsl:text> return Object.keys(obj); +</xsl:text> + <xsl:text> }; +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> get = function (key) { +</xsl:text> + <xsl:text> return obj[key]; +</xsl:text> + <xsl:text> }; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text> return new Iterator(function * () { +</xsl:text> + <xsl:text> for (const key of keys()) { +</xsl:text> + <xsl:text> yield [key, get(key)]; +</xsl:text> + <xsl:text> } +</xsl:text> + <xsl:text> }); +</xsl:text> + <xsl:text>} +</xsl:text> + <xsl:text> +</xsl:text> + <xsl:text>/* +</xsl:text> + <xsl:text>module.exports = {Iterator, range, enumerate, zip: _zip(false), zipLongest: _zip(true), items}; +</xsl:text> + <xsl:text>*/ +</xsl:text> <xsl:text>// svghmi.js </xsl:text> <xsl:text> diff -r a88ac1760faf -r e87a2daace80 svghmi/parse_labels.ysl2 --- a/svghmi/parse_labels.ysl2 Thu May 26 23:41:10 2022 +0200 +++ b/svghmi/parse_labels.ysl2 Wed Jun 01 09:22:07 2022 +0200 @@ -13,7 +13,7 @@ // path value="path4" index="path4" type="HMI_LOCAL"; // } // -const "pathregex",!"'^([^\[,]+)(\[[^\]]+\])?([\d,]*)$'"!; +const "pathregex",!"'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"!; template "*", mode="parselabel" { diff -r a88ac1760faf -r e87a2daace80 svghmi/widget_xygraph.ysl2 --- a/svghmi/widget_xygraph.ysl2 Thu May 26 23:41:10 2022 +0200 +++ b/svghmi/widget_xygraph.ysl2 Wed Jun 01 09:22:07 2022 +0200 @@ -22,20 +22,35 @@ path name="value" count="1+" accepts="HMI_INT,HMI_REAL" > value - arg name="size" accepts="int" > buffer size + arg name="xrange" accepts="int,time" > X axis range expressed either in samples or duration. arg name="xformat" count="optional" accepts="string" > format string for X label arg name="yformat" count="optional" accepts="string" > format string for Y label - arg name="ymin" count="optional" accepts="int,real" > minimum value foe Y axis - arg name="ymax" count="optional" accepts="int,real" > maximum value for Y axis } widget_class("XYGraph") { || frequency = 1; init() { - [this.x_size, + let x_duration_s; + [x_duration_s, this.x_format, this.y_format] = this.args; + let timeunit = x_duration_s.slice(-1); + let factor = { + "s":1, + "m":60, + "h":3600, + "d":86400}[timeunit]; + if(factor == undefined){ + this.max_data_length = Number(x_duration_s); + this.x_duration = undefined; + }else{ + let duration = factor*Number(x_duration_s.slice(0,-1)); + this.max_data_length = undefined; + this.x_duration = duration*1000; + } + + // Min and Max given with paths are meant to describe visible range, // not to clip data. this.clip = false; @@ -97,7 +112,6 @@ } this.curves_data = this.curves.map(_unused => []); - this.max_data_length = this.args[0]; } dispatch(value,oldval, index) { @@ -114,13 +128,24 @@ let ymax_damaged = false; let overflow; - if(data_length > this.max_data_length){ - // remove first item - [this.xmin, overflow] = this.curves_data[index].shift(); - data_length = data_length - 1; + if(this.max_data_length == undefined){ + let peremption = time - this.x_duration; + let oldest = this.curves_data[index][0][0] + this.xmin = peremption; + if(oldest < peremption){ + // remove first item + overflow = this.curves_data[index].shift()[1]; + data_length = data_length - 1; + } } else { - if(this.xmin == undefined){ - this.xmin = time; + if(data_length > this.max_data_length){ + // remove first item + [this.xmin, overflow] = this.curves_data[index].shift(); + data_length = data_length - 1; + } else { + if(this.xmin == undefined){ + this.xmin = time; + } } } @@ -141,6 +166,7 @@ } let Yrange = this.ymax - this.ymin; + // apply margin by moving min and max to enlarge range let [xMargin,yMargin] = zip(this.Margins, [Xrange, Yrange]).map(([m,l]) => m*l); [[this.dxmin, this.dxmax],[this.dymin,this.dymax]] = [[this.xmin-xMargin, this.xmax+xMargin], @@ -163,6 +189,7 @@ let px = base_point.x + xv.x + yv.x; let py = base_point.y + xv.y + yv.y; if(!this.fixed_y_range){ + // update min and max from curve data if needed if(ymin_damaged && y < this.ymin) this.ymin = y; if(ymax_damaged && y > this.ymax) this.ymax = y; } diff -r a88ac1760faf -r e87a2daace80 svghmi/widgets_common.ysl2 --- a/svghmi/widgets_common.ysl2 Thu May 26 23:41:10 2022 +0200 +++ b/svghmi/widgets_common.ysl2 Wed Jun 01 09:22:07 2022 +0200 @@ -181,7 +181,13 @@ this.lastapply = indexes.map(() => undefined); this.inhibit = indexes.map(() => undefined); this.pending = indexes.map(() => undefined); - this.bound_unhinibit = this.unhinibit.bind(this); + this.bound_uninhibit = this.uninhibit.bind(this); + + this.lastdispatch = indexes.map(() => undefined); + this.deafen = indexes.map(() => undefined); + this.incoming = indexes.map(() => undefined); + this.bound_undeafen = this.undeafen.bind(this); + this.forced_frequency = freq; this.clip = true; } @@ -225,7 +231,13 @@ if(inhibition != undefined){ clearTimeout(inhibition); this.lastapply[i] = undefined; - this.unhinibit(i); + this.uninhibit(i); + } + let deafened = this.deafen[i]; + if(deafened != undefined){ + clearTimeout(deafened); + this.lastdispatch[i] = undefined; + this.undeafen(i); } let index = this.indexes[i]; if(this.relativeness[i]) @@ -313,7 +325,7 @@ return apply_hmi_value(realindex, new_val); } - unhinibit(index){ + uninhibit(index){ this.inhibit[index] = undefined; let new_val = this.pending[index]; this.pending[index] = undefined; @@ -332,7 +344,7 @@ else { let elapsed = now - lastapply; this.pending[index] = new_val; - this.inhibit[index] = setTimeout(this.bound_unhinibit, min_interval - elapsed, index); + this.inhibit[index] = setTimeout(this.bound_uninhibit, min_interval - elapsed, index); } } else { @@ -354,13 +366,36 @@ } } + undeafen(index){ + this.deafen[index] = undefined; + let [new_val, old_val] = this.incoming[index]; + this.incoming[index] = undefined; + this.dispatch(new_val, old_val, index); + } + _dispatch(value, oldval, varnum) { let dispatch = this.dispatch; if(dispatch != undefined){ - try { - dispatch.call(this, value, oldval, varnum); - } catch(err) { - console.log(err); + if(this.deafen[varnum] == undefined){ + let now = Date.now(); + let min_interval = 1000/this.frequency; + let lastdispatch = this.lastdispatch[varnum]; + if(lastdispatch == undefined || now > lastdispatch + min_interval){ + this.lastdispatch[varnum] = now; + try { + dispatch.call(this, value, oldval, varnum); + } catch(err) { + console.log(err); + } + } + else { + let elapsed = now - lastdispatch; + this.incoming[varnum] = [value, oldval]; + this.deafen[varnum] = setTimeout(this.bound_undeafen, min_interval - elapsed, varnum); + } + } + else { + this.incoming[varnum] = [value, oldval]; } } } diff -r a88ac1760faf -r e87a2daace80 tests/projects/svghmi_xy/svghmi_0@svghmi/svghmi.svg --- a/tests/projects/svghmi_xy/svghmi_0@svghmi/svghmi.svg Thu May 26 23:41:10 2022 +0200 +++ b/tests/projects/svghmi_xy/svghmi_0@svghmi/svghmi.svg Wed Jun 01 09:22:07 2022 +0200 @@ -306,13 +306,13 @@ inkscape:window-height="836" id="namedview4" showgrid="false" - inkscape:zoom="2.6222222" - inkscape:cx="138.92196" - inkscape:cy="243.43713" + inkscape:zoom="0.32777778" + inkscape:cx="-105.99939" + inkscape:cy="106.14218" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="g2776" /> + inkscape:current-layer="hmi0" /> <rect inkscape:label="HMI:Page:Home" y="0" @@ -322,100 +322,7 @@ id="rect1016" style="color:#000000;opacity:1;fill:#d6d6d6;fill-opacity:1" /> <g - transform="matrix(3.7795276,0,0,3.7795276,-24.745762,-208.06827)" - id="g2776" - inkscape:label="HMI:XYGraph|10:100:%.2D:%.4f@/TRENDVAL0@/TRENDVAL1"> - <rect - inkscape:label="background" - ry="1.8520833" - rx="1.8520833" - y="87.995224" - x="22.985178" - height="114.9259" - width="167.31071" - id="rect2746" - style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.66866732;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> - <path - style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 155.83129,160.76911 c -6.48118,-0.65276 -10.17779,-21.29836 -15.40662,-31.02314 -3.53004,-8.41808 -7.5877,-1.29208 -10.4198,6.97869 -4.61524,10.2233 -10.32507,20.13252 -15.96731,14.06607 -7.74352,-19.32213 -18.607099,-4.75161 -26.390159,-23.86108 -4.63396,-13.32693 -11.88412,-10.90822 -16.09527,3.29105 -2.36066,8.20528 -4.35835,18.89169 -7.94811,21.41954 -2.80281,2.74222 -5.9827,1.11526 -8.29837,-5.00354" - id="path2748" - inkscape:connector-curvature="0" - sodipodi:nodetypes="cccccccc" - inkscape:label="curve_1" /> - <path - inkscape:label="curve_0" - sodipodi:nodetypes="cccccccc" - inkscape:connector-curvature="0" - id="path2750" - d="m 55.011564,133.09949 c 6.481177,0.19426 10.177788,6.33834 15.406617,9.23241 3.530037,2.5052 7.587703,0.38452 10.419795,-2.07684 4.615243,-3.04243 10.325074,-5.99139 15.967312,-4.18603 7.743522,5.75022 18.607102,1.41407 26.390162,7.101 4.63396,3.96606 11.88412,3.24626 16.09527,-0.97941 2.36066,-2.44187 4.35835,-5.62212 7.94811,-6.3744 2.80281,-0.81608 5.9827,-0.3319 8.29837,1.48904" - style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#00b4cf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - inkscape:label="y_interval_minor_mark" - inkscape:connector-curvature="0" - id="path2752" - d="m 43.637172,172.91226 h -1.35783" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - sodipodi:nodetypes="cc" /> - <path - inkscape:label="y_axis_line" - inkscape:connector-curvature="0" - id="path2754" - d="M 44.123362,185.11382 V 98.607125" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6249)" - sodipodi:nodetypes="cc" /> - <path - inkscape:label="y_interval_major_mark" - inkscape:connector-curvature="0" - id="path2756" - d="m 43.637172,167.88501 h -3.4745" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <text - inkscape:label="y_axis_label" - id="text2760" - y="169.42703" - x="38.401363" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-size:4.23333311px;text-align:end;text-anchor:end;stroke-width:0.26458332px" - y="169.42703" - x="38.401363" - id="tspan2758" - sodipodi:role="line">10</tspan></text> - <path - sodipodi:nodetypes="cc" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 63.393748,179.65255 v 1.35783" - id="path2764" - inkscape:connector-curvature="0" - inkscape:label="x_interval_minor_mark" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6185)" - d="M 39.02135,179.37991 H 169.44888" - id="path2766" - inkscape:connector-curvature="0" - inkscape:label="x_axis_line" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 68.420998,179.65255 v 3.4745" - id="path2768" - inkscape:connector-curvature="0" - inkscape:label="x_interval_major_mark" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" - x="-184.6293" - y="70.044762" - id="text2772" - inkscape:label="x_axis_label" - transform="rotate(-90)"><tspan - sodipodi:role="line" - id="tspan2770" - x="-186.94957" - y="70.044762" - style="font-size:4.23333311px;stroke-width:0.26458332px;text-anchor:end;text-align:end;">10</tspan></text> - </g> - <g - transform="matrix(2.1611542,0,0,2.1611542,616.6367,256.27681)" + transform="matrix(2.1611542,0,0,2.1611542,936.6367,256.27681)" id="g7998" inkscape:label="HMI:Meter@/TRENDVAL0"> <desc @@ -432,7 +339,7 @@ sodipodi:cx="128.02208" sodipodi:type="arc" id="path7978" - style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#00b4cf;stroke-width:1.74884677;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:url(#marker19820-3);marker-end:url(#marker25117-7);color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;font-variant-east_asian:normal;vector-effect:none;stroke-linecap:butt;stroke-linejoin:miter" /> + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#00b4cf;stroke-width:1.74884677;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:url(#marker19820-3);marker-end:url(#marker25117-7);color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> <path inkscape:label="needle" sodipodi:nodetypes="cc" @@ -466,7 +373,7 @@ sodipodi:role="line">1</tspan></text> </g> <g - transform="matrix(2.1611542,0,0,2.1611542,630.36551,530.09036)" + transform="matrix(2.1611542,0,0,2.1611542,950.36551,530.09036)" id="g7998-9" inkscape:label="HMI:Meter@/TRENDVAL1"> <desc @@ -483,7 +390,7 @@ sodipodi:cx="128.02208" sodipodi:type="arc" id="path7978-2" - style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1.7488468;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:url(#marker19820-3);marker-end:url(#marker25117-7);color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;font-variant-east_asian:normal;vector-effect:none;stroke-linecap:butt;stroke-linejoin:miter" /> + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1.74884677;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:url(#marker19820-3);marker-end:url(#marker25117-7);color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> <path inkscape:label="needle" sodipodi:nodetypes="cc" @@ -519,18 +426,18 @@ <text xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="1003.7288" - y="83.8983" + x="603.72882" + y="663.89832" id="text73" inkscape:label="_blup"><tspan sodipodi:role="line" id="tspan71" - x="1003.7288" - y="83.8983">blup</tspan></text> + x="603.72882" + y="663.89832">blup</tspan></text> <g id="g14237" inkscape:label="HMI:DropDown:#langs@lang" - transform="matrix(0.81491208,0,0,0.81491208,42.49804,-160.06995)" + transform="matrix(0.81491208,0,0,0.81491208,-657.50196,-160.06995)" style="stroke-width:0.35083869"> <rect style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#53676c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75419343;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" @@ -582,4 +489,380 @@ inkscape:transform-center-y="10.92088" inkscape:label="button" /> </g> + <g + style="stroke-width:1.81524098" + inkscape:label="HMI:XYGraph|5:10s:%.2D:%.2f@/TRENDVAL0,-1,1@/TRENDVAL1" + id="g105" + transform="matrix(2.0836471,0,0,2.08057,14.234354,161.43189)"> + <rect + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.21379232;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + id="rect79" + width="167.31071" + height="114.9259" + x="22.985178" + y="87.995224" + rx="3.3594942" + ry="3.3644626" + inkscape:label="background" /> + <path + inkscape:label="curve_1" + sodipodi:nodetypes="cccccccc" + inkscape:connector-curvature="0" + id="path81" + d="m 155.83129,160.76911 c -6.48118,-0.65276 -10.17779,-21.29836 -15.40662,-31.02314 -3.53004,-8.41808 -7.5877,-1.29208 -10.4198,6.97869 -4.61524,10.2233 -10.32507,20.13252 -15.96731,14.06607 -7.74352,-19.32213 -18.607099,-4.75161 -26.390159,-23.86108 -4.63396,-13.32693 -11.88412,-10.90822 -16.09527,3.29105 -2.36066,8.20528 -4.35835,18.89169 -7.94811,21.41954 -2.80281,2.74222 -5.9827,1.11526 -8.29837,-5.00354" + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#00b4cf;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 55.011564,133.09949 c 6.481177,0.19426 10.177788,6.33834 15.406617,9.23241 3.530037,2.5052 7.587703,0.38452 10.419795,-2.07684 4.615243,-3.04243 10.325074,-5.99139 15.967312,-4.18603 7.743522,5.75022 18.607102,1.41407 26.390162,7.101 4.63396,3.96606 11.88412,3.24626 16.09527,-0.97941 2.36066,-2.44187 4.35835,-5.62212 7.94811,-6.3744 2.80281,-0.81608 5.9827,-0.3319 8.29837,1.48904" + id="path83" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" + inkscape:label="curve_0" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 44.208773,172.91226 h -1.35783" + id="path85" + inkscape:connector-curvature="0" + inkscape:label="y_interval_minor_mark" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6249)" + d="M 44.123362,185.11382 V 98.607125" + id="path87" + inkscape:connector-curvature="0" + inkscape:label="y_axis_line" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 44.208773,167.88501 h -3.4745" + id="path89" + inkscape:connector-curvature="0" + inkscape:label="y_interval_major_mark" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="40.321072" + y="169.03821" + id="text93" + inkscape:label="y_axis_label"><tspan + sodipodi:role="line" + id="tspan91" + x="40.321072" + y="169.03821" + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px">10</tspan></text> + <path + inkscape:label="x_interval_minor_mark" + inkscape:connector-curvature="0" + id="path95" + d="m 63.393748,179.65255 v 1.35783" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <path + inkscape:label="x_axis_line" + inkscape:connector-curvature="0" + id="path97" + d="M 39.02135,179.37991 H 169.44888" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6185)" /> + <path + inkscape:label="x_interval_major_mark" + inkscape:connector-curvature="0" + id="path99" + d="m 68.420998,179.65255 v 3.4745" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <text + transform="rotate(-90)" + inkscape:label="x_axis_label" + id="text103" + y="69.591827" + x="-183.59244" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px" + y="69.591827" + x="-183.59244" + id="tspan101" + sodipodi:role="line">10</tspan></text> + </g> + <g + transform="matrix(2.0836471,0,0,2.08057,14.234354,-118.56811)" + id="g127" + inkscape:label="HMI:XYGraph|10:100:%.2D:%.2f@/TRENDVAL0@/TRENDVAL1" + style="stroke-width:1.81524098"> + <rect + inkscape:label="background" + ry="3.3644626" + rx="3.3594942" + y="87.995224" + x="22.985178" + height="114.9259" + width="167.31071" + id="rect101" + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.21379232;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + <path + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 155.83129,160.76911 c -6.48118,-0.65276 -10.17779,-21.29836 -15.40662,-31.02314 -3.53004,-8.41808 -7.5877,-1.29208 -10.4198,6.97869 -4.61524,10.2233 -10.32507,20.13252 -15.96731,14.06607 -7.74352,-19.32213 -18.607099,-4.75161 -26.390159,-23.86108 -4.63396,-13.32693 -11.88412,-10.90822 -16.09527,3.29105 -2.36066,8.20528 -4.35835,18.89169 -7.94811,21.41954 -2.80281,2.74222 -5.9827,1.11526 -8.29837,-5.00354" + id="path103" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" + inkscape:label="curve_1" /> + <path + inkscape:label="curve_0" + sodipodi:nodetypes="cccccccc" + inkscape:connector-curvature="0" + id="path105" + d="m 55.011564,133.09949 c 6.481177,0.19426 10.177788,6.33834 15.406617,9.23241 3.530037,2.5052 7.587703,0.38452 10.419795,-2.07684 4.615243,-3.04243 10.325074,-5.99139 15.967312,-4.18603 7.743522,5.75022 18.607102,1.41407 26.390162,7.101 4.63396,3.96606 11.88412,3.24626 16.09527,-0.97941 2.36066,-2.44187 4.35835,-5.62212 7.94811,-6.3744 2.80281,-0.81608 5.9827,-0.3319 8.29837,1.48904" + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#00b4cf;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + inkscape:label="y_interval_minor_mark" + inkscape:connector-curvature="0" + id="path107" + d="m 44.208773,172.91226 h -1.35783" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <path + inkscape:label="y_axis_line" + inkscape:connector-curvature="0" + id="path109" + d="M 44.123362,185.11382 V 98.607125" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6249)" + sodipodi:nodetypes="cc" /> + <path + inkscape:label="y_interval_major_mark" + inkscape:connector-curvature="0" + id="path111" + d="m 44.208773,167.88501 h -3.4745" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <text + inkscape:label="y_axis_label" + id="text115" + y="169.03821" + x="40.321072" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px" + y="169.03821" + x="40.321072" + id="tspan113" + sodipodi:role="line">10</tspan></text> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 63.393748,179.65255 v 1.35783" + id="path117" + inkscape:connector-curvature="0" + inkscape:label="x_interval_minor_mark" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6185)" + d="M 39.02135,179.37991 H 169.44888" + id="path119" + inkscape:connector-curvature="0" + inkscape:label="x_axis_line" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 68.420998,179.65255 v 3.4745" + id="path121" + inkscape:connector-curvature="0" + inkscape:label="x_interval_major_mark" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-183.59244" + y="69.591827" + id="text125" + inkscape:label="x_axis_label" + transform="rotate(-90)"><tspan + sodipodi:role="line" + id="tspan123" + x="-183.59244" + y="69.591827" + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px">10</tspan></text> + </g> + <g + transform="matrix(2.0836471,0,0,2.08057,414.23435,161.43189)" + id="g120" + inkscape:label="HMI:XYGraph|10:1s:%.2D:%.2f@/TRENDVAL0,-2,2@/TRENDVAL1" + style="stroke-width:1.81524098"> + <rect + inkscape:label="background" + ry="3.3644626" + rx="3.3594942" + y="87.995224" + x="22.985178" + height="114.9259" + width="167.31071" + id="rect93" + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.21379232;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + <path + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 155.83129,160.76911 c -6.48118,-0.65276 -10.17779,-21.29836 -15.40662,-31.02314 -3.53004,-8.41808 -7.5877,-1.29208 -10.4198,6.97869 -4.61524,10.2233 -10.32507,20.13252 -15.96731,14.06607 -7.74352,-19.32213 -18.607099,-4.75161 -26.390159,-23.86108 -4.63396,-13.32693 -11.88412,-10.90822 -16.09527,3.29105 -2.36066,8.20528 -4.35835,18.89169 -7.94811,21.41954 -2.80281,2.74222 -5.9827,1.11526 -8.29837,-5.00354" + id="path96" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" + inkscape:label="curve_1" /> + <path + inkscape:label="curve_0" + sodipodi:nodetypes="cccccccc" + inkscape:connector-curvature="0" + id="path98" + d="m 55.011564,133.09949 c 6.481177,0.19426 10.177788,6.33834 15.406617,9.23241 3.530037,2.5052 7.587703,0.38452 10.419795,-2.07684 4.615243,-3.04243 10.325074,-5.99139 15.967312,-4.18603 7.743522,5.75022 18.607102,1.41407 26.390162,7.101 4.63396,3.96606 11.88412,3.24626 16.09527,-0.97941 2.36066,-2.44187 4.35835,-5.62212 7.94811,-6.3744 2.80281,-0.81608 5.9827,-0.3319 8.29837,1.48904" + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#00b4cf;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + inkscape:label="y_interval_minor_mark" + inkscape:connector-curvature="0" + id="path100" + d="m 44.208773,172.91226 h -1.35783" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <path + inkscape:label="y_axis_line" + inkscape:connector-curvature="0" + id="path102" + d="M 44.123362,185.11382 V 98.607125" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6249)" + sodipodi:nodetypes="cc" /> + <path + inkscape:label="y_interval_major_mark" + inkscape:connector-curvature="0" + id="path104" + d="m 44.208773,167.88501 h -3.4745" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <text + inkscape:label="y_axis_label" + id="text108" + y="169.03821" + x="40.321072" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px" + y="169.03821" + x="40.321072" + id="tspan106" + sodipodi:role="line">10</tspan></text> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 63.393748,179.65255 v 1.35783" + id="path110" + inkscape:connector-curvature="0" + inkscape:label="x_interval_minor_mark" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6185)" + d="M 39.02135,179.37991 H 169.44888" + id="path112" + inkscape:connector-curvature="0" + inkscape:label="x_axis_line" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 68.420998,179.65255 v 3.4745" + id="path114" + inkscape:connector-curvature="0" + inkscape:label="x_interval_major_mark" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-183.59244" + y="69.591827" + id="text118" + inkscape:label="x_axis_label" + transform="rotate(-90)"><tspan + sodipodi:role="line" + id="tspan116" + x="-183.59244" + y="69.591827" + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px">10</tspan></text> + </g> + <g + style="stroke-width:1.81524098" + inkscape:label="HMI:XYGraph|5:1m:%.2D:%.2f@/TRENDVAL0,-0.5,0.5@/TRENDVAL1" + id="g148" + transform="matrix(2.0836471,0,0,2.08057,414.23435,-118.56811)"> + <rect + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.21379232;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + id="rect122" + width="167.31071" + height="114.9259" + x="22.985178" + y="87.995224" + rx="3.3594942" + ry="3.3644626" + inkscape:label="background" /> + <path + inkscape:label="curve_1" + sodipodi:nodetypes="cccccccc" + inkscape:connector-curvature="0" + id="path124" + d="m 155.83129,160.76911 c -6.48118,-0.65276 -10.17779,-21.29836 -15.40662,-31.02314 -3.53004,-8.41808 -7.5877,-1.29208 -10.4198,6.97869 -4.61524,10.2233 -10.32507,20.13252 -15.96731,14.06607 -7.74352,-19.32213 -18.607099,-4.75161 -26.390159,-23.86108 -4.63396,-13.32693 -11.88412,-10.90822 -16.09527,3.29105 -2.36066,8.20528 -4.35835,18.89169 -7.94811,21.41954 -2.80281,2.74222 -5.9827,1.11526 -8.29837,-5.00354" + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#00b4cf;stroke-width:1.81524098;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 55.011564,133.09949 c 6.481177,0.19426 10.177788,6.33834 15.406617,9.23241 3.530037,2.5052 7.587703,0.38452 10.419795,-2.07684 4.615243,-3.04243 10.325074,-5.99139 15.967312,-4.18603 7.743522,5.75022 18.607102,1.41407 26.390162,7.101 4.63396,3.96606 11.88412,3.24626 16.09527,-0.97941 2.36066,-2.44187 4.35835,-5.62212 7.94811,-6.3744 2.80281,-0.81608 5.9827,-0.3319 8.29837,1.48904" + id="path126" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" + inkscape:label="curve_0" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 44.208773,172.91226 h -1.35783" + id="path128" + inkscape:connector-curvature="0" + inkscape:label="y_interval_minor_mark" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6249)" + d="M 44.123362,185.11382 V 98.607125" + id="path130" + inkscape:connector-curvature="0" + inkscape:label="y_axis_line" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 44.208773,167.88501 h -3.4745" + id="path132" + inkscape:connector-curvature="0" + inkscape:label="y_interval_major_mark" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="40.321072" + y="169.03821" + id="text136" + inkscape:label="y_axis_label"><tspan + sodipodi:role="line" + id="tspan134" + x="40.321072" + y="169.03821" + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px">10</tspan></text> + <path + inkscape:label="x_interval_minor_mark" + inkscape:connector-curvature="0" + id="path138" + d="m 63.393748,179.65255 v 1.35783" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.12007062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <path + inkscape:label="x_axis_line" + inkscape:connector-curvature="0" + id="path140" + d="M 39.02135,179.37991 H 169.44888" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.48103884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6185)" /> + <path + inkscape:label="x_interval_major_mark" + inkscape:connector-curvature="0" + id="path142" + d="m 68.420998,179.65255 v 3.4745" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.24014124;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <text + transform="rotate(-90)" + inkscape:label="x_axis_label" + id="text146" + y="69.591827" + x="-183.59244" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.20188332px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.48028249px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + style="font-size:3.20188332px;text-align:end;text-anchor:end;stroke-width:0.48028249px" + y="69.591827" + x="-183.59244" + id="tspan144" + sodipodi:role="line">10</tspan></text> + </g> </svg>