--- a/BeremizIDE.py Wed Jun 17 14:32:55 2020 +0200
+++ b/BeremizIDE.py Thu Jun 18 11:00:26 2020 +0200
@@ -103,7 +103,7 @@
}
else:
faces = {
- 'mono': 'Courier',
+ 'mono': 'FreeMono',
'size': 10,
}
--- a/ConfigTreeNode.py Wed Jun 17 14:32:55 2020 +0200
+++ b/ConfigTreeNode.py Thu Jun 18 11:00:26 2020 +0200
@@ -46,6 +46,7 @@
from xmlclass import GenerateParserFromXSDstring
from PLCControler import LOCATION_CONFNODE
from editors.ConfTreeNodeEditor import ConfTreeNodeEditor
+from POULibrary import UserAddressedException
_BaseParamsParser = GenerateParserFromXSDstring("""<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
--- a/ProjectController.py Wed Jun 17 14:32:55 2020 +0200
+++ b/ProjectController.py Thu Jun 18 11:00:26 2020 +0200
@@ -254,7 +254,7 @@
# Setup debug information
self.IECdebug_datas = {}
- self.DebugTimer = None
+ self.DebugUpdatePending = False
self.ResetIECProgramsAndVariables()
# In both new or load scenario, no need to save
@@ -276,8 +276,6 @@
self.debug_status = PlcStatus.Stopped
def __del__(self):
- if self.DebugTimer:
- self.DebugTimer.cancel()
self.KillDebugThread()
def LoadLibraries(self):
@@ -1538,7 +1536,6 @@
return debug_status, ticks, buffers
def RegisterDebugVarToConnector(self):
- self.DebugTimer = None
Idxs = []
self.TracedIECPath = []
self.TracedIECTypes = []
@@ -1577,25 +1574,15 @@
self._connector.SetTraceVariablesList([])
self.DebugToken = None
self.debug_status, _debug_ticks, _buffers = self.SnapshotAndResetDebugValuesBuffers()
+ self.DebugUpdatePending = False
def IsPLCStarted(self):
return self.previous_plcstate == PlcStatus.Started
- def ReArmDebugRegisterTimer(self):
- if self.DebugTimer is not None:
- self.DebugTimer.cancel()
-
- # Prevent to call RegisterDebugVarToConnector when PLC is not started
- # If an output location var is forced it's leads to segmentation fault in runtime
- # Links between PLC located variables and real variables are not ready
- if self.IsPLCStarted():
- # Timer to prevent rapid-fire when registering many variables
- # use wx.CallAfter use keep using same thread. TODO : use wx.Timer
- # instead
- self.DebugTimer = Timer(
- 0.5, wx.CallAfter, args=[self.RegisterDebugVarToConnector])
- # Rearm anti-rapid-fire timer
- self.DebugTimer.start()
+ def AppendDebugUpdate(self):
+ if not self.DebugUpdatePending :
+ wx.CallAfter(self.RegisterDebugVarToConnector)
+ self.DebugUpdatePending = True
def GetDebugIECVariableType(self, IECPath):
_Idx, IEC_Type = self._IECPathToIdx.get(IECPath, (None, None))
@@ -1625,7 +1612,7 @@
IECdebug_data[0][callableobj] = buffer_list
- self.ReArmDebugRegisterTimer()
+ self.AppendDebugUpdate()
return IECdebug_data[1]
@@ -1641,12 +1628,12 @@
IECdebug_data[0].itervalues(),
False)
- self.ReArmDebugRegisterTimer()
+ self.AppendDebugUpdate()
def UnsubscribeAllDebugIECVariable(self):
self.IECdebug_datas = {}
- self.ReArmDebugRegisterTimer()
+ self.AppendDebugUpdate()
def ForceDebugIECVariable(self, IECPath, fvalue):
if IECPath not in self.IECdebug_datas:
@@ -1657,7 +1644,7 @@
IECdebug_data[2] = "Forced"
IECdebug_data[3] = fvalue
- self.ReArmDebugRegisterTimer()
+ self.AppendDebugUpdate()
def ReleaseDebugIECVariable(self, IECPath):
if IECPath not in self.IECdebug_datas:
@@ -1668,7 +1655,7 @@
IECdebug_data[2] = "Registered"
IECdebug_data[3] = None
- self.ReArmDebugRegisterTimer()
+ self.AppendDebugUpdate()
def CallWeakcallables(self, IECPath, function_name, *cargs):
data_tuple = self.IECdebug_datas.get(IECPath, None)
--- a/XSLTransform.py Wed Jun 17 14:32:55 2020 +0200
+++ b/XSLTransform.py Thu Jun 18 11:00:26 2020 +0200
@@ -22,4 +22,7 @@
# print(self.xslt.error_log)
return res
+ def get_error_log(self):
+ return self.xslt.error_log
+
--- a/controls/CustomStyledTextCtrl.py Wed Jun 17 14:32:55 2020 +0200
+++ b/controls/CustomStyledTextCtrl.py Thu Jun 18 11:00:26 2020 +0200
@@ -40,7 +40,7 @@
else:
faces = {
'times': 'Times',
- 'mono': 'Courier',
+ 'mono': 'FreeMono',
'helv': 'Helvetica',
'other': 'new century schoolbook',
'size': 12,
--- a/controls/LogViewer.py Wed Jun 17 14:32:55 2020 +0200
+++ b/controls/LogViewer.py Thu Jun 18 11:00:26 2020 +0200
@@ -339,7 +339,7 @@
if wx.Platform == '__WXMSW__':
self.Font = wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName='Courier New')
else:
- self.Font = wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName='Courier')
+ self.Font = wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName='FreeMono')
self.MessagePanel.Bind(wx.EVT_LEFT_UP, self.OnMessagePanelLeftUp)
self.MessagePanel.Bind(wx.EVT_RIGHT_UP, self.OnMessagePanelRightUp)
self.MessagePanel.Bind(wx.EVT_LEFT_DCLICK, self.OnMessagePanelLeftDCLick)
--- a/editors/ConfTreeNodeEditor.py Wed Jun 17 14:32:55 2020 +0200
+++ b/editors/ConfTreeNodeEditor.py Thu Jun 18 11:00:26 2020 +0200
@@ -48,7 +48,7 @@
else:
faces = {
'times': 'Times',
- 'mono': 'Courier',
+ 'mono': 'FreeMono',
'helv': 'Helvetica',
'other': 'new century schoolbook',
'size': 18,
--- a/editors/Viewer.py Wed Jun 17 14:32:55 2020 +0200
+++ b/editors/Viewer.py Thu Jun 18 11:00:26 2020 +0200
@@ -82,7 +82,7 @@
else:
faces = {
'times': 'Times',
- 'mono': 'Courier',
+ 'mono': 'FreeMono',
'helv': 'Helvetica',
'other': 'new century schoolbook',
'size': 10,
--- a/features.py Wed Jun 17 14:32:55 2020 +0200
+++ b/features.py Thu Jun 18 11:00:26 2020 +0200
@@ -12,7 +12,8 @@
('Native', 'NativeLib.NativeLibrary', True),
('Python', 'py_ext.PythonLibrary', True),
('Etherlab', 'etherlab.EthercatMaster.EtherlabLibrary', False),
- ('SVGUI', 'svgui.SVGUILibrary', False)]
+ ('SVGUI', 'svgui.SVGUILibrary', False),
+ ('SVGHMI', 'svghmi.SVGHMILibrary', False)]
catalog = [
('canfestival', _('CANopen support'), _('Map located variables over CANopen'), 'canfestival.canfestival.RootClass'),
@@ -22,6 +23,7 @@
('c_ext', _('C extension'), _('Add C code accessing located variables synchronously'), 'c_ext.CFile'),
('py_ext', _('Python file'), _('Add Python code executed asynchronously'), 'py_ext.PythonFile'),
('wxglade_hmi', _('WxGlade GUI'), _('Add a simple WxGlade based GUI.'), 'wxglade_hmi.WxGladeHMI'),
- ('svgui', _('SVGUI'), _('Experimental web based HMI'), 'svgui.SVGUI')]
+ ('svgui', _('SVGUI'), _('Experimental web based HMI'), 'svgui.SVGUI'),
+ ('svghmi', _('SVGHMI'), _('SVG based HMI'), 'svghmi.SVGHMI')]
file_editors = []
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/Makefile Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,26 @@
+#! gmake
+
+# Makefile to generate XSLT stylesheets from ysl2 files in the same directory
+
+# This uses YML2.
+# hg clone https://pep.foundation/dev/repos/yml2/
+
+# It should be just fine if yml2 is cloned just asside beremiz
+# otherwise, point yml2path to yml2 source directory
+# make yml2path=path/to/yml/dir
+
+yml2path ?= $(abspath ../../yml2)
+
+ysl2files := gen_index_xhtml.ysl2
+ysl2includes := $(filter-out $(ysl2files), $(wildcard *.ysl2))
+xsltfiles := $(patsubst %.ysl2, %.xslt, $(ysl2files))
+
+all:$(xsltfiles)
+
+%.xslt: %.ysl2 $(ysl2includes) svghmi.js ../yslt_noindent.yml2
+ $(yml2path)/yml2c -I $(yml2path):../ $< -o $@.tmp
+ xmlstarlet fo $@.tmp > $@
+ rm $@.tmp
+
+clean:
+ rm -f $(xsltfiles)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/README Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,1 @@
+SVG HMI
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/__init__.py Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# This file is part of Beremiz
+# Copyright (C) 2019: Edouard TISSERANT
+#
+# See COPYING file for copyrights details.
+
+from __future__ import absolute_import
+from svghmi.svghmi import *
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/default.svg Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="1280"
+ height="720"
+ viewBox="0 0 1280 720"
+ version="1.1"
+ id="hmi0"
+ sodipodi:docname="default.svg"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)">
+ <metadata
+ id="metadata4542">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs2" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:document-units="px"
+ inkscape:current-layer="hmi0"
+ showgrid="false"
+ units="px"
+ inkscape:zoom="0.7"
+ inkscape:cx="576.80864"
+ inkscape:cy="330.28432"
+ inkscape:window-width="1600"
+ inkscape:window-height="886"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1" />
+ <rect
+ style="color:#000000"
+ id="page0"
+ width="1280"
+ height="720"
+ x="0"
+ y="0">
+ <desc
+ id="desc_page0">This is description for page 0
+
+all lines in the form "name: value"
+are used as js object definition initializer
+
+role: "page"
+name: "Home"
+
+after triple opening braces is global JavaScript code
+
+{{{
+/* JS style Comment */
+alert("Hello World");
+}}}
+
+after triple closing braces is back to description
+</desc>
+ </rect>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="436.32812"
+ y="418.24219"
+ id="text5151"
+ inkscape:label="count"><desc
+ id="desc5153">path: "count"
+format: "%4.4d"</desc><tspan
+ sodipodi:role="line"
+ id="tspan5149"
+ x="436.32812"
+ y="418.24219"
+ style="stroke-width:1px">8888</tspan></text>
+</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/detachable_pages.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,191 @@
+// detachable_pages.ysl2
+//
+// compute what elements are required by pages
+// and decide where to cut when removing/attaching
+// pages elements on page switch
+
+const "hmi_pages_descs", "$parsed_widgets/widget[@type = 'Page']";
+const "hmi_pages", "$hmi_elements[@id = $hmi_pages_descs/@id]";
+
+const "default_page" choose {
+ when "count($hmi_pages) > 1" {
+ choose {
+ when "$hmi_pages_descs/arg[1]/@value = 'Home'" > Home
+ otherwise {
+ error "No Home page defined!";
+ }
+ }
+ }
+ when "count($hmi_pages) = 0" {
+ error "No page defined!";
+ }
+ otherwise > «func:widget($hmi_pages/@id)/arg[1]/@value»
+}
+
+emit "preamble:default-page" {
+ |
+ | var default_page = "«$default_page»";
+}
+
+const "keypads_descs", "$parsed_widgets/widget[@type = 'Keypad']";
+const "keypads", "$hmi_elements[@id = $keypads_descs/@id]";
+
+// returns all directly or indirectly refered elements
+def "func:refered_elements" {
+ param "elems";
+ const "descend", "$elems/descendant-or-self::svg:*";
+ const "clones", "$descend[self::svg:use]";
+ const "originals", "//svg:*[concat('#',@id) = $clones/@xlink:href]";
+ choose {
+ when "$originals"
+ result "$descend | func:refered_elements($originals)";
+ otherwise
+ result "$descend";
+ }
+}
+
+def "func:all_related_elements" {
+ param "page";
+ const "page_overlapping_geometry", "func:overlapping_geometry($page)";
+ const "page_overlapping_elements", "//svg:*[@id = $page_overlapping_geometry/@Id]";
+ const "page_sub_elements", "func:refered_elements($page | $page_overlapping_elements)";
+ result "$page_sub_elements";
+}
+
+def "func:required_elements" {
+ param "pages";
+ choose{
+ when "$pages"{
+ result """func:all_related_elements($pages[1])
+ | func:required_elements($pages[position()!=1])""";
+ }otherwise{
+ result "/..";
+ }
+ }
+}
+
+const "required_elements",
+ """//svg:defs/descendant-or-self::svg:*
+ | func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*""";
+
+const "discardable_elements", "//svg:*[not(@id = $required_elements/@id)]";
+
+def "func:sumarized_elements" {
+ param "elements";
+ const "short_list", "$elements[not(ancestor::*/@id = $elements/@id)]";
+ const "filled_groups", """$short_list/parent::svg:*[
+ not(descendant::*[
+ not(self::svg:g) and
+ not(@id = $discardable_elements/@id) and
+ not(@id = $short_list/descendant-or-self::*[not(self::svg:g)]/@id)
+ ])]""";
+ const "groups_to_add", "$filled_groups[not(ancestor::*/@id = $filled_groups/@id)]";
+ result "$groups_to_add | $short_list[not(ancestor::svg:g/@id = $filled_groups/@id)]";
+}
+
+def "func:detachable_elements" {
+ param "pages";
+ choose{
+ when "$pages"{
+ result """func:sumarized_elements(func:all_related_elements($pages[1]))
+ | func:detachable_elements($pages[position()!=1])""";
+ }otherwise{
+ result "/..";
+ }
+ }
+}
+
+// Avoid nested detachables
+const "_detachable_elements", "func:detachable_elements($hmi_pages | $keypads)";
+const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
+
+emit "declarations:detachable-elements" {
+ |
+ | var detachable_elements = {
+ foreach "$detachable_elements"{
+ | "«@id»":[id("«@id»"), id("«../@id»")]`if "position()!=last()" > ,`
+ }
+ | }
+}
+
+const "forEach_widgets_ids", "$parsed_widgets/widget[@type = 'ForEach']/@id";
+const "forEach_widgets", "$hmi_elements[@id = $forEach_widgets_ids]";
+const "in_forEach_widget_ids", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id";
+
+template "svg:*", mode="page_desc" {
+ const "desc", "func:widget(@id)";
+ const "page", ".";
+ const "p", "$geometry[@Id = $page/@id]";
+
+ const "page_all_elements", "func:all_related_elements($page)";
+
+ const "all_page_widgets","$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id]";
+ const "page_managed_widgets","$all_page_widgets[not(@id=$in_forEach_widget_ids)]";
+ const "page_relative_widgets",
+ "$page_managed_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]";
+
+ // Take closest ancestor in detachable_elements
+ // since nested detachable elements are filtered out
+ const "required_detachables",
+ """func:sumarized_elements($page_all_elements)/
+ ancestor-or-self::*[@id = $detachable_elements/@id]""";
+
+ | "«$desc/arg[1]/@value»": {
+ //| widget: hmi_widgets["«@id»"],
+ | bbox: [«$p/@x», «$p/@y», «$p/@w», «$p/@h»],
+ if "$desc/path/@value" {
+ if "count($desc/path/@index)=0"
+ warning > Page id="«$page/@id»" : No match for path "«$desc/path/@value»" in HMI tree
+ | page_index: «$desc/path/@index»,
+ }
+ | relative_widgets: [
+ foreach "$page_relative_widgets" {
+ | hmi_widgets["«@id»"]`if "position()!=last()" > ,`
+ }
+ | ],
+ | absolute_widgets: [
+ foreach "$page_managed_widgets[not(@id = $page_relative_widgets/@id)]" {
+ | hmi_widgets["«@id»"]`if "position()!=last()" > ,`
+ }
+ | ],
+ | jumps: [
+ foreach "$parsed_widgets/widget[@id = $all_page_widgets/@id and @type='Jump']" {
+ const "_id","@id";
+ const "opts" call "jump_widget_activity" with "hmi_element", "$hmi_elements[@id=$_id]";
+ if "string-length($opts)>0"
+ | hmi_widgets["«@id»"]`if "position()!=last()" > ,`
+ }
+ | ],
+ | required_detachables: {
+ foreach "$required_detachables" {
+ | "«@id»": detachable_elements["«@id»"]`if "position()!=last()" > ,`
+ }
+ | }
+ /* TODO generate some code for init() instead */
+ apply "$parsed_widgets/widget[@id = $all_page_widgets/@id]", mode="per_page_widget_template"{
+ with "page_desc", "$desc";
+ }
+ | }`if "position()!=last()" > ,`
+}
+
+emit "declarations:page-desc" {
+ |
+ | var page_desc = {
+ apply "$hmi_pages", mode="page_desc";
+ | }
+}
+
+template "*", mode="per_page_widget_template";
+
+
+emit "debug:detachable-pages" {
+ |
+ | DETACHABLES:
+ foreach "$detachable_elements"{
+ | «@id»
+ }
+ | In Foreach:
+ foreach "$in_forEach_widget_ids"{
+ | «.»
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/gen_index_xhtml.xslt Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,3737 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:ns="beremiz" xmlns:definitions="definitions" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:func="http://exslt.org/functions" xmlns:epilogue="epilogue" xmlns:preamble="preamble" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:svg="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:str="http://exslt.org/strings" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:exsl="http://exslt.org/common" xmlns:declarations="declarations" xmlns:debug="debug" exclude-result-prefixes="ns func exsl regexp str dyn debug preamble epilogue declarations definitions" extension-element-prefixes="ns func exsl regexp str dyn" version="1.0">
+ <xsl:output method="xml" cdata-section-elements="xhtml:script"/>
+ <xsl:variable name="svg" select="/svg:svg"/>
+ <xsl:variable name="hmi_elements" select="//svg:*[starts-with(@inkscape:label, 'HMI:')]"/>
+ <xsl:variable name="hmitree" select="ns:GetHMITree()"/>
+ <xsl:variable name="_categories">
+ <noindex>
+ <xsl:text>HMI_PLC_STATUS</xsl:text>
+ </noindex>
+ <noindex>
+ <xsl:text>HMI_CURRENT_PAGE</xsl:text>
+ </noindex>
+ </xsl:variable>
+ <xsl:variable name="categories" select="exsl:node-set($_categories)"/>
+ <xsl:variable name="_indexed_hmitree">
+ <xsl:apply-templates mode="index" select="$hmitree"/>
+ </xsl:variable>
+ <xsl:variable name="indexed_hmitree" select="exsl:node-set($_indexed_hmitree)"/>
+ <preamble:hmi-tree/>
+ <xsl:template match="preamble:hmi-tree">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var hmi_hash = [</xsl:text>
+ <xsl:value-of select="$hmitree/@hash"/>
+ <xsl:text>];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var heartbeat_index = </xsl:text>
+ <xsl:value-of select="$indexed_hmitree/*[@hmipath = '/HEARTBEAT']/@index"/>
+ <xsl:text>;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var hmitree_types = [
+</xsl:text>
+ <xsl:for-each select="$indexed_hmitree/*">
+ <xsl:text> /* </xsl:text>
+ <xsl:value-of select="@index"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@hmipath"/>
+ <xsl:text> */ "</xsl:text>
+ <xsl:value-of select="substring(local-name(), 5)"/>
+ <xsl:text>"</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>]
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="index" match="*">
+ <xsl:param name="index" select="0"/>
+ <xsl:param name="parentpath" select="''"/>
+ <xsl:variable name="content">
+ <xsl:variable name="path">
+ <xsl:choose>
+ <xsl:when test="count(ancestor::*)=0">
+ <xsl:text>/</xsl:text>
+ </xsl:when>
+ <xsl:when test="count(ancestor::*)=1">
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$parentpath"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="not(local-name() = $categories/noindex)">
+ <xsl:copy>
+ <xsl:attribute name="index">
+ <xsl:value-of select="$index"/>
+ </xsl:attribute>
+ <xsl:attribute name="hmipath">
+ <xsl:value-of select="$path"/>
+ </xsl:attribute>
+ <xsl:for-each select="@*">
+ <xsl:copy/>
+ </xsl:for-each>
+ </xsl:copy>
+ <xsl:apply-templates mode="index" select="*[1]">
+ <xsl:with-param name="index" select="$index + 1"/>
+ <xsl:with-param name="parentpath">
+ <xsl:value-of select="$path"/>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates mode="index" select="*[1]">
+ <xsl:with-param name="index" select="$index"/>
+ <xsl:with-param name="parentpath">
+ <xsl:value-of select="$path"/>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:copy-of select="$content"/>
+ <xsl:apply-templates mode="index" select="following-sibling::*[1]">
+ <xsl:with-param name="index" select="$index + count(exsl:node-set($content)/*)"/>
+ <xsl:with-param name="parentpath">
+ <xsl:value-of select="$parentpath"/>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:template>
+ <xsl:template mode="parselabel" match="*">
+ <xsl:variable name="label" select="@inkscape:label"/>
+ <xsl:variable name="description" select="substring-after($label,'HMI:')"/>
+ <xsl:variable name="_args" select="substring-before($description,'@')"/>
+ <xsl:variable name="args">
+ <xsl:choose>
+ <xsl:when test="$_args">
+ <xsl:value-of select="$_args"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$description"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="_type" select="substring-before($args,':')"/>
+ <xsl:variable name="type">
+ <xsl:choose>
+ <xsl:when test="$_type">
+ <xsl:value-of select="$_type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$args"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$type">
+ <widget>
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:attribute name="type">
+ <xsl:value-of select="$type"/>
+ </xsl:attribute>
+ <xsl:for-each select="str:split(substring-after($args, ':'), ':')">
+ <arg>
+ <xsl:attribute name="value">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </arg>
+ </xsl:for-each>
+ <xsl:variable name="paths" select="substring-after($description,'@')"/>
+ <xsl:for-each select="str:split($paths, '@')">
+ <xsl:if test="string-length(.) > 0">
+ <path>
+ <xsl:attribute name="value">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ <xsl:variable name="path" select="."/>
+ <xsl:variable name="item" select="$indexed_hmitree/*[@hmipath = $path]"/>
+ <xsl:if test="count($item) = 1">
+ <xsl:attribute name="index">
+ <xsl:value-of select="$item/@index"/>
+ </xsl:attribute>
+ <xsl:attribute name="type">
+ <xsl:value-of select="local-name($item)"/>
+ </xsl:attribute>
+ </xsl:if>
+ </path>
+ </xsl:if>
+ </xsl:for-each>
+ </widget>
+ </xsl:if>
+ </xsl:template>
+ <xsl:variable name="_parsed_widgets">
+ <xsl:apply-templates mode="parselabel" select="$hmi_elements"/>
+ </xsl:variable>
+ <xsl:variable name="parsed_widgets" select="exsl:node-set($_parsed_widgets)"/>
+ <func:function name="func:widget">
+ <xsl:param name="id"/>
+ <func:result select="$parsed_widgets/widget[@id = $id]"/>
+ </func:function>
+ <func:function name="func:is_descendant_path">
+ <xsl:param name="descend"/>
+ <xsl:param name="ancest"/>
+ <func:result select="string-length($ancest) > 0 and starts-with($descend,$ancest)"/>
+ </func:function>
+ <func:function name="func:same_class_paths">
+ <xsl:param name="a"/>
+ <xsl:param name="b"/>
+ <xsl:variable name="class_a" select="$indexed_hmitree/*[@hmipath = $a]/@class"/>
+ <xsl:variable name="class_b" select="$indexed_hmitree/*[@hmipath = $b]/@class"/>
+ <func:result select="$class_a and $class_b and $class_a = $class_b"/>
+ </func:function>
+ <xsl:template mode="testtree" match="*">
+ <xsl:param name="indent" select="''"/>
+ <xsl:value-of select="$indent"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> </xsl:text>
+ <xsl:for-each select="@*">
+ <xsl:value-of select="local-name()"/>
+ <xsl:text>="</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>" </xsl:text>
+ </xsl:for-each>
+ <xsl:text>
+</xsl:text>
+ <xsl:apply-templates mode="testtree" select="*">
+ <xsl:with-param name="indent">
+ <xsl:value-of select="concat($indent,'>')"/>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:template>
+ <debug:hmi-tree/>
+ <xsl:template match="debug:hmi-tree">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>Raw HMI tree
+</xsl:text>
+ <xsl:apply-templates mode="testtree" select="$hmitree"/>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>Indexed HMI tree
+</xsl:text>
+ <xsl:apply-templates mode="testtree" select="$indexed_hmitree"/>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>Parsed Widgets
+</xsl:text>
+ <xsl:copy-of select="_parsed_widgets"/>
+ <xsl:apply-templates mode="testtree" select="$parsed_widgets"/>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:variable name="geometry" select="ns:GetSVGGeometry()"/>
+ <debug:geometry/>
+ <xsl:template match="debug:geometry">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>ID, x, y, w, h
+</xsl:text>
+ <xsl:for-each select="$geometry">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@Id"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@x"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@y"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@w"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@h"/>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <func:function name="func:intersect_1d">
+ <xsl:param name="a0"/>
+ <xsl:param name="a1"/>
+ <xsl:param name="b0"/>
+ <xsl:param name="b1"/>
+ <xsl:variable name="d0" select="$a0 >= $b0"/>
+ <xsl:variable name="d1" select="$a1 >= $b1"/>
+ <xsl:choose>
+ <xsl:when test="not($d0) and $d1">
+ <func:result select="3"/>
+ </xsl:when>
+ <xsl:when test="$d0 and not($d1)">
+ <func:result select="2"/>
+ </xsl:when>
+ <xsl:when test="$d0 and $d1 and $a0 < $b1">
+ <func:result select="1"/>
+ </xsl:when>
+ <xsl:when test="not($d0) and not($d1) and $b0 < $a1">
+ <func:result select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+ <func:function name="func:intersect">
+ <xsl:param name="a"/>
+ <xsl:param name="b"/>
+ <xsl:variable name="x_intersect" select="func:intersect_1d($a/@x, $a/@x+$a/@w, $b/@x, $b/@x+$b/@w)"/>
+ <xsl:choose>
+ <xsl:when test="$x_intersect != 0">
+ <xsl:variable name="y_intersect" select="func:intersect_1d($a/@y, $a/@y+$a/@h, $b/@y, $b/@y+$b/@h)"/>
+ <func:result select="$x_intersect * $y_intersect"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+ <func:function name="func:overlapping_geometry">
+ <xsl:param name="elt"/>
+ <xsl:variable name="groups" select="/svg:svg | //svg:g"/>
+ <xsl:variable name="g" select="$geometry[@Id = $elt/@id]"/>
+ <xsl:variable name="candidates" select="$geometry[@Id != $elt/@id]"/>
+ <func:result select="$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or (not(@Id = $groups/@id) and (func:intersect($g, .) > 0 ))]"/>
+ </func:function>
+ <xsl:variable name="hmi_pages_descs" select="$parsed_widgets/widget[@type = 'Page']"/>
+ <xsl:variable name="hmi_pages" select="$hmi_elements[@id = $hmi_pages_descs/@id]"/>
+ <xsl:variable name="default_page">
+ <xsl:choose>
+ <xsl:when test="count($hmi_pages) > 1">
+ <xsl:choose>
+ <xsl:when test="$hmi_pages_descs/arg[1]/@value = 'Home'">
+ <xsl:text>Home</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">No Home page defined!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="count($hmi_pages) = 0">
+ <xsl:message terminate="yes">No page defined!</xsl:message>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="func:widget($hmi_pages/@id)/arg[1]/@value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <preamble:default-page/>
+ <xsl:template match="preamble:default-page">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var default_page = "</xsl:text>
+ <xsl:value-of select="$default_page"/>
+ <xsl:text>";
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:variable name="keypads_descs" select="$parsed_widgets/widget[@type = 'Keypad']"/>
+ <xsl:variable name="keypads" select="$hmi_elements[@id = $keypads_descs/@id]"/>
+ <func:function name="func:refered_elements">
+ <xsl:param name="elems"/>
+ <xsl:variable name="descend" select="$elems/descendant-or-self::svg:*"/>
+ <xsl:variable name="clones" select="$descend[self::svg:use]"/>
+ <xsl:variable name="originals" select="//svg:*[concat('#',@id) = $clones/@xlink:href]"/>
+ <xsl:choose>
+ <xsl:when test="$originals">
+ <func:result select="$descend | func:refered_elements($originals)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="$descend"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+ <func:function name="func:all_related_elements">
+ <xsl:param name="page"/>
+ <xsl:variable name="page_overlapping_geometry" select="func:overlapping_geometry($page)"/>
+ <xsl:variable name="page_overlapping_elements" select="//svg:*[@id = $page_overlapping_geometry/@Id]"/>
+ <xsl:variable name="page_sub_elements" select="func:refered_elements($page | $page_overlapping_elements)"/>
+ <func:result select="$page_sub_elements"/>
+ </func:function>
+ <func:function name="func:required_elements">
+ <xsl:param name="pages"/>
+ <xsl:choose>
+ <xsl:when test="$pages">
+ <func:result select="func:all_related_elements($pages[1]) | func:required_elements($pages[position()!=1])"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="/.."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+ <xsl:variable name="required_elements" select="//svg:defs/descendant-or-self::svg:* | func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*"/>
+ <xsl:variable name="discardable_elements" select="//svg:*[not(@id = $required_elements/@id)]"/>
+ <func:function name="func:sumarized_elements">
+ <xsl:param name="elements"/>
+ <xsl:variable name="short_list" select="$elements[not(ancestor::*/@id = $elements/@id)]"/>
+ <xsl:variable name="filled_groups" select="$short_list/parent::svg:*[ not(descendant::*[ not(self::svg:g) and not(@id = $discardable_elements/@id) and not(@id = $short_list/descendant-or-self::*[not(self::svg:g)]/@id) ])]"/>
+ <xsl:variable name="groups_to_add" select="$filled_groups[not(ancestor::*/@id = $filled_groups/@id)]"/>
+ <func:result select="$groups_to_add | $short_list[not(ancestor::svg:g/@id = $filled_groups/@id)]"/>
+ </func:function>
+ <func:function name="func:detachable_elements">
+ <xsl:param name="pages"/>
+ <xsl:choose>
+ <xsl:when test="$pages">
+ <func:result select="func:sumarized_elements(func:all_related_elements($pages[1])) | func:detachable_elements($pages[position()!=1])"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="/.."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+ <xsl:variable name="_detachable_elements" select="func:detachable_elements($hmi_pages | $keypads)"/>
+ <xsl:variable name="detachable_elements" select="$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]"/>
+ <declarations:detachable-elements/>
+ <xsl:template match="declarations:detachable-elements">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var detachable_elements = {
+</xsl:text>
+ <xsl:for-each select="$detachable_elements">
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>":[id("</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"), id("</xsl:text>
+ <xsl:value-of select="../@id"/>
+ <xsl:text>")]</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:variable name="forEach_widgets_ids" select="$parsed_widgets/widget[@type = 'ForEach']/@id"/>
+ <xsl:variable name="forEach_widgets" select="$hmi_elements[@id = $forEach_widgets_ids]"/>
+ <xsl:variable name="in_forEach_widget_ids" select="func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id"/>
+ <xsl:template mode="page_desc" match="svg:*">
+ <xsl:variable name="desc" select="func:widget(@id)"/>
+ <xsl:variable name="page" select="."/>
+ <xsl:variable name="p" select="$geometry[@Id = $page/@id]"/>
+ <xsl:variable name="page_all_elements" select="func:all_related_elements($page)"/>
+ <xsl:variable name="all_page_widgets" select="$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id]"/>
+ <xsl:variable name="page_managed_widgets" select="$all_page_widgets[not(@id=$in_forEach_widget_ids)]"/>
+ <xsl:variable name="page_relative_widgets" select="$page_managed_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]"/>
+ <xsl:variable name="required_detachables" select="func:sumarized_elements($page_all_elements)/ ancestor-or-self::*[@id = $detachable_elements/@id]"/>
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="$desc/arg[1]/@value"/>
+ <xsl:text>": {
+</xsl:text>
+ <xsl:text> bbox: [</xsl:text>
+ <xsl:value-of select="$p/@x"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="$p/@y"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="$p/@w"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="$p/@h"/>
+ <xsl:text>],
+</xsl:text>
+ <xsl:if test="$desc/path/@value">
+ <xsl:if test="count($desc/path/@index)=0">
+ <xsl:message terminate="no">
+ <xsl:text>Page id="</xsl:text>
+ <xsl:value-of select="$page/@id"/>
+ <xsl:text>" : No match for path "</xsl:text>
+ <xsl:value-of select="$desc/path/@value"/>
+ <xsl:text>" in HMI tree</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ <xsl:text> page_index: </xsl:text>
+ <xsl:value-of select="$desc/path/@index"/>
+ <xsl:text>,
+</xsl:text>
+ </xsl:if>
+ <xsl:text> relative_widgets: [
+</xsl:text>
+ <xsl:for-each select="$page_relative_widgets">
+ <xsl:text> hmi_widgets["</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"]</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ],
+</xsl:text>
+ <xsl:text> absolute_widgets: [
+</xsl:text>
+ <xsl:for-each select="$page_managed_widgets[not(@id = $page_relative_widgets/@id)]">
+ <xsl:text> hmi_widgets["</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"]</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ],
+</xsl:text>
+ <xsl:text> jumps: [
+</xsl:text>
+ <xsl:for-each select="$parsed_widgets/widget[@id = $all_page_widgets/@id and @type='Jump']">
+ <xsl:variable name="_id" select="@id"/>
+ <xsl:variable name="opts">
+ <xsl:call-template name="jump_widget_activity">
+ <xsl:with-param name="hmi_element" select="$hmi_elements[@id=$_id]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length($opts)>0">
+ <xsl:text> hmi_widgets["</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"]</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text> ],
+</xsl:text>
+ <xsl:text> required_detachables: {
+</xsl:text>
+ <xsl:for-each select="$required_detachables">
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>": detachable_elements["</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"]</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> }
+</xsl:text>
+ <xsl:apply-templates mode="per_page_widget_template" select="$parsed_widgets/widget[@id = $all_page_widgets/@id]">
+ <xsl:with-param name="page_desc" select="$desc"/>
+ </xsl:apply-templates>
+ <xsl:text> }</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <declarations:page-desc/>
+ <xsl:template match="declarations:page-desc">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var page_desc = {
+</xsl:text>
+ <xsl:apply-templates mode="page_desc" select="$hmi_pages"/>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="per_page_widget_template" match="*"/>
+ <debug:detachable-pages/>
+ <xsl:template match="debug:detachable-pages">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>DETACHABLES:
+</xsl:text>
+ <xsl:for-each select="$detachable_elements">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>In Foreach:
+</xsl:text>
+ <xsl:for-each select="$in_forEach_widget_ids">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="inline_svg" match="@* | node()">
+ <xsl:if test="not(@id = $discardable_elements/@id)">
+ <xsl:copy>
+ <xsl:apply-templates mode="inline_svg" select="@* | node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template mode="inline_svg" match="svg:svg/@width"/>
+ <xsl:template mode="inline_svg" match="svg:svg/@height"/>
+ <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="svg:svg">
+ <svg>
+ <xsl:attribute name="preserveAspectRatio">
+ <xsl:text>none</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="height">
+ <xsl:text>100vh</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="width">
+ <xsl:text>100vw</xsl:text>
+ </xsl:attribute>
+ <xsl:apply-templates mode="inline_svg" select="@* | node()"/>
+ </svg>
+ </xsl:template>
+ <xsl:template mode="inline_svg" match="svg:svg[@viewBox!=concat('0 0 ', @width, ' ', @height)]">
+ <xsl:message terminate="yes">
+ <xsl:text>ViewBox settings other than X=0, Y=0 and Scale=1 are not supported</xsl:text>
+ </xsl:message>
+ </xsl:template>
+ <xsl:template mode="inline_svg" match="sodipodi:namedview[@units!='px' or @inkscape:document-units!='px']">
+ <xsl:message terminate="yes">
+ <xsl:text>All units must be set to "px" in Inkscape's document properties</xsl:text>
+ </xsl:message>
+ </xsl:template>
+ <xsl:variable name="to_unlink" select="$hmi_elements[not(@id = $hmi_pages)]/descendant-or-self::svg:use"/>
+ <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="svg:use">
+ <xsl:choose>
+ <xsl:when test="@id = $to_unlink/@id">
+ <xsl:call-template name="unlink_clone"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates mode="inline_svg" select="@* | node()"/>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:variable name="_excluded_use_attrs">
+ <name>
+ <xsl:text>href</xsl:text>
+ </name>
+ <name>
+ <xsl:text>width</xsl:text>
+ </name>
+ <name>
+ <xsl:text>height</xsl:text>
+ </name>
+ <name>
+ <xsl:text>x</xsl:text>
+ </name>
+ <name>
+ <xsl:text>y</xsl:text>
+ </name>
+ </xsl:variable>
+ <xsl:variable name="excluded_use_attrs" select="exsl:node-set($_excluded_use_attrs)"/>
+ <xsl:variable name="_merge_use_attrs">
+ <name>
+ <xsl:text>transform</xsl:text>
+ </name>
+ <name>
+ <xsl:text>style</xsl:text>
+ </name>
+ </xsl:variable>
+ <xsl:variable name="merge_use_attrs" select="exsl:node-set($_merge_use_attrs)"/>
+ <xsl:template xmlns="http://www.w3.org/2000/svg" name="unlink_clone">
+ <xsl:variable name="targetid" select="substring-after(@xlink:href,'#')"/>
+ <xsl:variable name="target" select="//svg:*[@id = $targetid]"/>
+ <g>
+ <xsl:choose>
+ <xsl:when test="$target[self::svg:g]">
+ <xsl:for-each select="@*[not(local-name() = $excluded_use_attrs/name | $merge_use_attrs)]">
+ <xsl:attribute name="{name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:if test="@style | $target/@style">
+ <xsl:attribute name="style">
+ <xsl:value-of select="@style"/>
+ <xsl:if test="@style and $target/@style">
+ <xsl:text>;</xsl:text>
+ </xsl:if>
+ <xsl:value-of select="$target/@style"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@transform | $target/@transform">
+ <xsl:attribute name="transform">
+ <xsl:value-of select="@transform"/>
+ <xsl:if test="@transform and $target/@transform">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="$target/@transform"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates mode="unlink_clone" select="$target/*">
+ <xsl:with-param name="seed" select="@id"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="@*[not(local-name() = $excluded_use_attrs/name)]">
+ <xsl:attribute name="{name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:apply-templates mode="unlink_clone" select="$target">
+ <xsl:with-param name="seed" select="@id"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </g>
+ </xsl:template>
+ <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="@id">
+ <xsl:param name="seed"/>
+ <xsl:attribute name="id">
+ <xsl:value-of select="$seed"/>
+ <xsl:text>_</xsl:text>
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+ <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="@*">
+ <xsl:copy/>
+ </xsl:template>
+ <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="svg:*">
+ <xsl:param name="seed"/>
+ <xsl:choose>
+ <xsl:when test="@id = $hmi_elements/@id">
+ <use>
+ <xsl:attribute name="xlink:href">
+ <xsl:value-of select="concat('#',@id)"/>
+ </xsl:attribute>
+ </use>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates mode="unlink_clone" select="@* | node()">
+ <xsl:with-param name="seed" select="$seed"/>
+ </xsl:apply-templates>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:variable name="result_svg">
+ <xsl:apply-templates mode="inline_svg" select="/"/>
+ </xsl:variable>
+ <xsl:variable name="result_svg_ns" select="exsl:node-set($result_svg)"/>
+ <preamble:inline-svg/>
+ <xsl:template match="preamble:inline-svg">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>let id = document.getElementById.bind(document);
+</xsl:text>
+ <xsl:text>var svg_root = id("</xsl:text>
+ <xsl:value-of select="$svg/@id"/>
+ <xsl:text>");
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <debug:clone-unlinking/>
+ <xsl:template match="debug:clone-unlinking">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>Unlinked :
+</xsl:text>
+ <xsl:for-each select="$to_unlink">
+ <xsl:value-of select="@id"/>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="hmi_widgets" match="svg:*">
+ <xsl:variable name="widget" select="func:widget(@id)"/>
+ <xsl:variable name="eltid" select="@id"/>
+ <xsl:variable name="args">
+ <xsl:for-each select="$widget/arg">
+ <xsl:text>"</xsl:text>
+ <xsl:value-of select="@value"/>
+ <xsl:text>"</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="indexes">
+ <xsl:for-each select="$widget/path">
+ <xsl:choose>
+ <xsl:when test="not(@index)">
+ <xsl:message terminate="no">
+ <xsl:text>Widget </xsl:text>
+ <xsl:value-of select="$widget/@type"/>
+ <xsl:text> id="</xsl:text>
+ <xsl:value-of select="$eltid"/>
+ <xsl:text>" : No match for path "</xsl:text>
+ <xsl:value-of select="@value"/>
+ <xsl:text>" in HMI tree</xsl:text>
+ </xsl:message>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@index"/>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>": new </xsl:text>
+ <xsl:value-of select="$widget/@type"/>
+ <xsl:text>Widget ("</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>",[</xsl:text>
+ <xsl:value-of select="$args"/>
+ <xsl:text>],[</xsl:text>
+ <xsl:value-of select="$indexes"/>
+ <xsl:text>],{
+</xsl:text>
+ <xsl:apply-templates mode="widget_defs" select="$widget">
+ <xsl:with-param name="hmi_element" select="."/>
+ </xsl:apply-templates>
+ <xsl:text> })</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <func:function name="func:unique_types">
+ <xsl:param name="elts_with_type"/>
+ <xsl:choose>
+ <xsl:when test="count($elts_with_type) > 1">
+ <xsl:variable name="prior_results" select="func:unique_types($elts_with_type[position()!=last()])"/>
+ <xsl:choose>
+ <xsl:when test="$elts_with_type[last()][@type = $prior_results/@type]">
+ <func:result select="$prior_results"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="$prior_results | $elts_with_type[last()]"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="$elts_with_type"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+ <preamble:widget-base-class/>
+ <xsl:template match="preamble:widget-base-class">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>class Widget {
+</xsl:text>
+ <xsl:text> offset = 0;
+</xsl:text>
+ <xsl:text> frequency = 10; /* FIXME arbitrary default max freq. Obtain from config ? */
+</xsl:text>
+ <xsl:text> unsubscribable = false;
+</xsl:text>
+ <xsl:text> constructor(elt_id,args,indexes,members){
+</xsl:text>
+ <xsl:text> this.element_id = elt_id;
+</xsl:text>
+ <xsl:text> this.element = id(elt_id);
+</xsl:text>
+ <xsl:text> this.args = args;
+</xsl:text>
+ <xsl:text> this.indexes = indexes;
+</xsl:text>
+ <xsl:text> Object.keys(members).forEach(prop => this[prop]=members[prop]);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> unsub(){
+</xsl:text>
+ <xsl:text> /* remove subsribers */
+</xsl:text>
+ <xsl:text> if(!this.unsubscribable) for(let index of this.indexes){
+</xsl:text>
+ <xsl:text> let idx = index + this.offset;
+</xsl:text>
+ <xsl:text> subscribers[idx].delete(this);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> this.offset = 0;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> sub(new_offset=0){
+</xsl:text>
+ <xsl:text> /* set the offset because relative */
+</xsl:text>
+ <xsl:text> this.offset = new_offset;
+</xsl:text>
+ <xsl:text> /* add this's subsribers */
+</xsl:text>
+ <xsl:text> if(!this.unsubscribable) for(let index of this.indexes){
+</xsl:text>
+ <xsl:text> subscribers[index + new_offset].add(this);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> need_cache_apply.push(this);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> apply_cache() {
+</xsl:text>
+ <xsl:text> if(!this.unsubscribable) for(let index of this.indexes){
+</xsl:text>
+ <xsl:text> /* dispatch current cache in newly opened page widgets */
+</xsl:text>
+ <xsl:text> let realindex = index+this.offset;
+</xsl:text>
+ <xsl:text> let cached_val = cache[realindex];
+</xsl:text>
+ <xsl:text> if(cached_val != undefined)
+</xsl:text>
+ <xsl:text> dispatch_value_to_widget(this, realindex, cached_val, cached_val);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <preamble:hmi-classes/>
+ <xsl:template match="preamble:hmi-classes">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:variable name="used_widget_types" select="func:unique_types($parsed_widgets/widget)"/>
+ <xsl:apply-templates mode="widget_class" select="$used_widget_types"/>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_class" match="widget">
+ <xsl:text>class </xsl:text>
+ <xsl:value-of select="@type"/>
+ <xsl:text>Widget extends Widget{
+</xsl:text>
+ <xsl:text> /* empty class, as </xsl:text>
+ <xsl:value-of select="@type"/>
+ <xsl:text> widget didn't provide any */
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ </xsl:template>
+ <xsl:variable name="excluded_types" select="str:split('Page Lang List')"/>
+ <xsl:variable name="excluded_ids" select="$parsed_widgets/widget[not(@type = $excluded_types)]/@id"/>
+ <preamble:hmi-elements/>
+ <xsl:template match="preamble:hmi-elements">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var hmi_widgets = {
+</xsl:text>
+ <xsl:apply-templates mode="hmi_widgets" select="$hmi_elements[@id = $excluded_ids]"/>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:template name="defs_by_labels">
+ <xsl:param name="labels" select="''"/>
+ <xsl:param name="mandatory" select="'yes'"/>
+ <xsl:param name="subelements" select="/.."/>
+ <xsl:param name="hmi_element"/>
+ <xsl:variable name="widget_type" select="@type"/>
+ <xsl:for-each select="str:split($labels)">
+ <xsl:variable name="name" select="."/>
+ <xsl:variable name="elt" select="$result_svg_ns//*[@id = $hmi_element/@id]//*[@inkscape:label=$name][1]"/>
+ <xsl:choose>
+ <xsl:when test="not($elt/@id)">
+ <xsl:if test="$mandatory='yes'">
+ <xsl:message terminate="yes">
+ <xsl:value-of select="$widget_type"/>
+ <xsl:text> widget must have a </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text> element</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>_elt: id("</xsl:text>
+ <xsl:value-of select="$elt/@id"/>
+ <xsl:text>"),
+</xsl:text>
+ <xsl:if test="$subelements">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>_sub: {
+</xsl:text>
+ <xsl:for-each select="str:split($subelements)">
+ <xsl:variable name="subname" select="."/>
+ <xsl:variable name="subelt" select="$elt/*[@inkscape:label=$subname][1]"/>
+ <xsl:choose>
+ <xsl:when test="not($subelt/@id)">
+ <xsl:if test="$mandatory='yes'">
+ <xsl:message terminate="yes">
+ <xsl:value-of select="$widget_type"/>
+ <xsl:text> widget must have a </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="$subname"/>
+ <xsl:text> element</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ <xsl:text> /* missing </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="$subname"/>
+ <xsl:text> element */
+</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="$subname"/>
+ <xsl:text>": id("</xsl:text>
+ <xsl:value-of select="$subelt/@id"/>
+ <xsl:text>")</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:text> },
+</xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <func:function name="func:escape_quotes">
+ <xsl:param name="txt"/>
+ <xsl:variable name="frst" select="substring-before($txt,'"')"/>
+ <xsl:variable name="frstln" select="string-length($frst)"/>
+ <xsl:choose>
+ <xsl:when test="$frstln > 0 and string-length($txt) > $frstln">
+ <func:result select="concat($frst,'\"',func:escape_quotes(substring-after($txt,'"')))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="$txt"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+ <xsl:template mode="widget_class" match="widget[@type='Back']">
+ <xsl:text>class BackWidget extends Widget{
+</xsl:text>
+ <xsl:text> on_click(evt) {
+</xsl:text>
+ <xsl:text> if(jump_history.length > 1){
+</xsl:text>
+ <xsl:text> jump_history.pop();
+</xsl:text>
+ <xsl:text> let [page_name, index] = jump_history.pop();
+</xsl:text>
+ <xsl:text> switch_page(page_name, index);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> init() {
+</xsl:text>
+ <xsl:text> this.element.setAttribute("onclick", "hmi_widgets['"+this.element_id+"'].on_click(evt)");
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='Button']">
+ <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>active inactive</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ </xsl:call-template>
+ <xsl:text>frequency: 5,
+</xsl:text>
+ <xsl:text>on_mouse_down: function(evt) {
+</xsl:text>
+ <xsl:text> if (this.active_style && this.inactive_style) {
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", this.active_style);
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> change_hmi_value(this.indexes[0], "=1");
+</xsl:text>
+ <xsl:text>},
+</xsl:text>
+ <xsl:text>on_mouse_up: function(evt) {
+</xsl:text>
+ <xsl:text> if (this.active_style && this.inactive_style) {
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", this.inactive_style);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> change_hmi_value(this.indexes[0], "=0");
+</xsl:text>
+ <xsl:text>},
+</xsl:text>
+ <xsl:text>active_style: undefined,
+</xsl:text>
+ <xsl:text>inactive_style: undefined,
+</xsl:text>
+ <xsl:text>init: function() {
+</xsl:text>
+ <xsl:text> this.active_style = this.active_elt ? this.active_elt.style.cssText : undefined;
+</xsl:text>
+ <xsl:text> this.inactive_style = this.inactive_elt ? this.inactive_elt.style.cssText : undefined;
+</xsl:text>
+ <xsl:text> if (this.active_style && this.inactive_style) {
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", this.inactive_style);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> this.element.setAttribute("onmousedown", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_mouse_down(evt)");
+</xsl:text>
+ <xsl:text> this.element.setAttribute("onmouseup", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_mouse_up(evt)");
+</xsl:text>
+ <xsl:text>},
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='CircularBar']">
+ <xsl:param name="hmi_element"/>
+ <xsl:text>frequency: 10,
+</xsl:text>
+ <xsl:call-template name="defs_by_labels">
+ <xsl:with-param name="hmi_element" select="$hmi_element"/>
+ <xsl:with-param name="labels">
+ <xsl:text>path</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>value min max</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ </xsl:call-template>
+ <xsl:text>dispatch: function(value) {
+</xsl:text>
+ <xsl:text> if(this.value_elt)
+</xsl:text>
+ <xsl:text> this.value_elt.textContent = String(value);
+</xsl:text>
+ <xsl:text> let [min,max,start,end] = this.range;
+</xsl:text>
+ <xsl:text> let [cx,cy] = this.center;
+</xsl:text>
+ <xsl:text> let [rx,ry] = this.proportions;
+</xsl:text>
+ <xsl:text> let tip = start + (end-start)*Number(value)/(max-min);
+</xsl:text>
+ <xsl:text> let size = 0;
+</xsl:text>
+ <xsl:text> if (tip-start > Math.PI) {
+</xsl:text>
+ <xsl:text> size = 1;
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> size = 0;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> this.path_elt.setAttribute('d', "M "+(cx+rx*Math.cos(start))+","+(cy+ry*Math.sin(start))+" A "+rx+","+ry+" 0 "+size+" 1 "+(cx+rx*Math.cos(tip))+","+(cy+ry*Math.sin(tip)));
+</xsl:text>
+ <xsl:text>},
+</xsl:text>
+ <xsl:text>range: undefined,
+</xsl:text>
+ <xsl:text>init: function() {
+</xsl:text>
+ <xsl:text> let start = Number(this.path_elt.getAttribute('sodipodi:start'));
+</xsl:text>
+ <xsl:text> let end = Number(this.path_elt.getAttribute('sodipodi:end'));
+</xsl:text>
+ <xsl:text> let cx = Number(this.path_elt.getAttribute('sodipodi:cx'));
+</xsl:text>
+ <xsl:text> let cy = Number(this.path_elt.getAttribute('sodipodi:cy'));
+</xsl:text>
+ <xsl:text> let rx = Number(this.path_elt.getAttribute('sodipodi:rx'));
+</xsl:text>
+ <xsl:text> let ry = Number(this.path_elt.getAttribute('sodipodi:ry'));
+</xsl:text>
+ <xsl:text> if (ry == 0) {
+</xsl:text>
+ <xsl:text> ry = rx;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> if (start > end) {
+</xsl:text>
+ <xsl:text> end = end + 2*Math.PI;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> let min = this.min_elt ?
+</xsl:text>
+ <xsl:text> Number(this.min_elt.textContent) :
+</xsl:text>
+ <xsl:text> this.args.length >= 1 ? this.args[0] : 0;
+</xsl:text>
+ <xsl:text> let max = this.max_elt ?
+</xsl:text>
+ <xsl:text> Number(this.max_elt.textContent) :
+</xsl:text>
+ <xsl:text> this.args.length >= 2 ? this.args[1] : 100;
+</xsl:text>
+ <xsl:text> this.range = [min, max, start, end];
+</xsl:text>
+ <xsl:text> this.center = [cx, cy];
+</xsl:text>
+ <xsl:text> this.proportions = [rx, ry];
+</xsl:text>
+ <xsl:text>},
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='Display']">
+ <xsl:param name="hmi_element"/>
+ <xsl:text> frequency: 5,
+</xsl:text>
+ <xsl:text> dispatch: function(value) {
+</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$hmi_element[self::svg:text]">
+ <xsl:text> this.element.textContent = String(value);
+</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="no">
+ <xsl:text>Display widget as a group not implemented</xsl:text>
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='DropDown']">
+ <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>text box button</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text> dispatch: function(value) {
+</xsl:text>
+ <xsl:text> if(!this.opened) this.set_selection(value);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> init: function() {
+</xsl:text>
+ <xsl:text> this.button_elt.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_button_click()");
+</xsl:text>
+ <xsl:text> // Save original size of rectangle
+</xsl:text>
+ <xsl:text> this.box_bbox = this.box_elt.getBBox()
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // Compute margins
+</xsl:text>
+ <xsl:text> text_bbox = this.text_elt.getBBox()
+</xsl:text>
+ <xsl:text> lmargin = text_bbox.x - this.box_bbox.x;
+</xsl:text>
+ <xsl:text> tmargin = text_bbox.y - this.box_bbox.y;
+</xsl:text>
+ <xsl:text> this.margins = [lmargin, tmargin].map(x => Math.max(x,0));
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // It is assumed that list content conforms to Array interface.
+</xsl:text>
+ <xsl:text> this.content = [
+</xsl:text>
+ <xsl:for-each select="arg">
+ <xsl:text>"</xsl:text>
+ <xsl:value-of select="@value"/>
+ <xsl:text>",
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // Index of first visible element in the menu, when opened
+</xsl:text>
+ <xsl:text> this.menu_offset = 0;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // How mutch to lift the menu vertically so that it does not cross bottom border
+</xsl:text>
+ <xsl:text> this.lift = 0;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // Event handlers cannot be object method ('this' is unknown)
+</xsl:text>
+ <xsl:text> // as a workaround, handler given to addEventListener is bound in advance.
+</xsl:text>
+ <xsl:text> this.bound_close_on_click_elsewhere = this.close_on_click_elsewhere.bind(this);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.opened = false;
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> // Called when a menu entry is clicked
+</xsl:text>
+ <xsl:text> on_selection_click: function(selection) {
+</xsl:text>
+ <xsl:text> this.close();
+</xsl:text>
+ <xsl:text> let orig = this.indexes[0];
+</xsl:text>
+ <xsl:text> let idx = this.offset ? orig - this.offset : orig;
+</xsl:text>
+ <xsl:text> apply_hmi_value(idx, selection);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_button_click: function() {
+</xsl:text>
+ <xsl:text> this.open();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_backward_click: function(){
+</xsl:text>
+ <xsl:text> this.scroll(false);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_forward_click:function(){
+</xsl:text>
+ <xsl:text> this.scroll(true);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> set_selection: function(value) {
+</xsl:text>
+ <xsl:text> let display_str;
+</xsl:text>
+ <xsl:text> if(value >= 0 && value < this.content.length){
+</xsl:text>
+ <xsl:text> // if valid selection resolve content
+</xsl:text>
+ <xsl:text> display_str = this.content[value];
+</xsl:text>
+ <xsl:text> this.last_selection = value;
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> // otherwise show problem
+</xsl:text>
+ <xsl:text> display_str = "?"+String(value)+"?";
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> // It is assumed that first span always stays,
+</xsl:text>
+ <xsl:text> // and contains selection when menu is closed
+</xsl:text>
+ <xsl:text> this.text_elt.firstElementChild.textContent = display_str;
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> grow_text: function(up_to) {
+</xsl:text>
+ <xsl:text> let count = 1;
+</xsl:text>
+ <xsl:text> let txt = this.text_elt;
+</xsl:text>
+ <xsl:text> let first = txt.firstElementChild;
+</xsl:text>
+ <xsl:text> // Real world (pixels) boundaries of current page
+</xsl:text>
+ <xsl:text> let bounds = svg_root.getBoundingClientRect();
+</xsl:text>
+ <xsl:text> this.lift = 0;
+</xsl:text>
+ <xsl:text> while(count < up_to) {
+</xsl:text>
+ <xsl:text> let next = first.cloneNode();
+</xsl:text>
+ <xsl:text> // relative line by line text flow instead of absolute y coordinate
+</xsl:text>
+ <xsl:text> next.removeAttribute("y");
+</xsl:text>
+ <xsl:text> next.setAttribute("dy", "1.1em");
+</xsl:text>
+ <xsl:text> // default content to allow computing text element bbox
+</xsl:text>
+ <xsl:text> next.textContent = "...";
+</xsl:text>
+ <xsl:text> // append new span to text element
+</xsl:text>
+ <xsl:text> txt.appendChild(next);
+</xsl:text>
+ <xsl:text> // now check if text extended by one row fits to page
+</xsl:text>
+ <xsl:text> // FIXME : exclude margins to be more accurate on box size
+</xsl:text>
+ <xsl:text> let rect = txt.getBoundingClientRect();
+</xsl:text>
+ <xsl:text> if(rect.bottom > bounds.bottom){
+</xsl:text>
+ <xsl:text> // in case of overflow at the bottom, lift up one row
+</xsl:text>
+ <xsl:text> let backup = first.getAttribute("dy");
+</xsl:text>
+ <xsl:text> // apply lift asr a dy added too first span (y attrib stays)
+</xsl:text>
+ <xsl:text> first.setAttribute("dy", "-"+String((this.lift+1)*1.1)+"em");
+</xsl:text>
+ <xsl:text> rect = txt.getBoundingClientRect();
+</xsl:text>
+ <xsl:text> if(rect.top > bounds.top){
+</xsl:text>
+ <xsl:text> this.lift += 1;
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> // if it goes over the top, then backtrack
+</xsl:text>
+ <xsl:text> // restore dy attribute on first span
+</xsl:text>
+ <xsl:text> if(backup)
+</xsl:text>
+ <xsl:text> first.setAttribute("dy", backup);
+</xsl:text>
+ <xsl:text> else
+</xsl:text>
+ <xsl:text> first.removeAttribute("dy");
+</xsl:text>
+ <xsl:text> // remove unwanted child
+</xsl:text>
+ <xsl:text> txt.removeChild(next);
+</xsl:text>
+ <xsl:text> return count;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> count++;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> return count;
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> close_on_click_elsewhere: function(e) {
+</xsl:text>
+ <xsl:text> // inhibit events not targetting spans (menu items)
+</xsl:text>
+ <xsl:text> if(e.target.parentNode !== this.text_elt){
+</xsl:text>
+ <xsl:text> e.stopPropagation();
+</xsl:text>
+ <xsl:text> // close menu in case click is outside box
+</xsl:text>
+ <xsl:text> if(e.target !== this.box_elt)
+</xsl:text>
+ <xsl:text> this.close();
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> close: function(){
+</xsl:text>
+ <xsl:text> // Stop hogging all click events
+</xsl:text>
+ <xsl:text> svg_root.removeEventListener("click", this.bound_close_on_click_elsewhere, true);
+</xsl:text>
+ <xsl:text> // Restore position and sixe of widget elements
+</xsl:text>
+ <xsl:text> this.reset_text();
+</xsl:text>
+ <xsl:text> this.reset_box();
+</xsl:text>
+ <xsl:text> // Put the button back in place
+</xsl:text>
+ <xsl:text> this.element.appendChild(this.button_elt);
+</xsl:text>
+ <xsl:text> // Mark as closed (to allow dispatch)
+</xsl:text>
+ <xsl:text> this.opened = false;
+</xsl:text>
+ <xsl:text> // Dispatch last cached value
+</xsl:text>
+ <xsl:text> this.apply_cache();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> // Set text content when content is smaller than menu (no scrolling)
+</xsl:text>
+ <xsl:text> set_complete_text: function(){
+</xsl:text>
+ <xsl:text> let spans = this.text_elt.children;
+</xsl:text>
+ <xsl:text> let c = 0;
+</xsl:text>
+ <xsl:text> for(let item of this.content){
+</xsl:text>
+ <xsl:text> let span=spans[c];
+</xsl:text>
+ <xsl:text> span.textContent = item;
+</xsl:text>
+ <xsl:text> span.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_selection_click("+c+")");
+</xsl:text>
+ <xsl:text> c++;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> // Move partial view :
+</xsl:text>
+ <xsl:text> // false : upward, lower value
+</xsl:text>
+ <xsl:text> // true : downward, higher value
+</xsl:text>
+ <xsl:text> scroll: function(forward){
+</xsl:text>
+ <xsl:text> let contentlength = this.content.length;
+</xsl:text>
+ <xsl:text> let spans = this.text_elt.children;
+</xsl:text>
+ <xsl:text> let spanslength = spans.length;
+</xsl:text>
+ <xsl:text> // reduce accounted menu size according to jumps
+</xsl:text>
+ <xsl:text> if(this.menu_offset != 0) spanslength--;
+</xsl:text>
+ <xsl:text> if(this.menu_offset < contentlength - 1) spanslength--;
+</xsl:text>
+ <xsl:text> if(forward){
+</xsl:text>
+ <xsl:text> this.menu_offset = Math.min(
+</xsl:text>
+ <xsl:text> contentlength - spans.length + 1,
+</xsl:text>
+ <xsl:text> this.menu_offset + spanslength);
+</xsl:text>
+ <xsl:text> }else{
+</xsl:text>
+ <xsl:text> this.menu_offset = Math.max(
+</xsl:text>
+ <xsl:text> 0,
+</xsl:text>
+ <xsl:text> this.menu_offset - spanslength);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> console.log(this.menu_offset);
+</xsl:text>
+ <xsl:text> this.set_partial_text();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> // Setup partial view text content
+</xsl:text>
+ <xsl:text> // with jumps at first and last entry when appropriate
+</xsl:text>
+ <xsl:text> set_partial_text: function(){
+</xsl:text>
+ <xsl:text> let spans = this.text_elt.children;
+</xsl:text>
+ <xsl:text> let contentlength = this.content.length;
+</xsl:text>
+ <xsl:text> let spanslength = spans.length;
+</xsl:text>
+ <xsl:text> let i = this.menu_offset, c = 0;
+</xsl:text>
+ <xsl:text> while(c < spanslength){
+</xsl:text>
+ <xsl:text> let span=spans[c];
+</xsl:text>
+ <xsl:text> // backward jump only present if not exactly at start
+</xsl:text>
+ <xsl:text> if(c == 0 && i != 0){
+</xsl:text>
+ <xsl:text> span.textContent = "↑ ↑ ↑";
+</xsl:text>
+ <xsl:text> span.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_backward_click()");
+</xsl:text>
+ <xsl:text> // presence of forward jump when not right at the end
+</xsl:text>
+ <xsl:text> }else if(c == spanslength-1 && i < contentlength - 1){
+</xsl:text>
+ <xsl:text> span.textContent = "↓ ↓ ↓";
+</xsl:text>
+ <xsl:text> span.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_forward_click()");
+</xsl:text>
+ <xsl:text> // otherwise normal content
+</xsl:text>
+ <xsl:text> }else{
+</xsl:text>
+ <xsl:text> span.textContent = this.content[i];
+</xsl:text>
+ <xsl:text> span.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_selection_click("+i+")");
+</xsl:text>
+ <xsl:text> i++;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> c++;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> open: function(){
+</xsl:text>
+ <xsl:text> let length = this.content.length;
+</xsl:text>
+ <xsl:text> // systematically reset text, to strip eventual whitespace spans
+</xsl:text>
+ <xsl:text> this.reset_text();
+</xsl:text>
+ <xsl:text> // grow as much as needed or possible
+</xsl:text>
+ <xsl:text> let slots = this.grow_text(length);
+</xsl:text>
+ <xsl:text> // Depending on final size
+</xsl:text>
+ <xsl:text> if(slots == length) {
+</xsl:text>
+ <xsl:text> // show all at once
+</xsl:text>
+ <xsl:text> this.set_complete_text();
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> // eventualy align menu to current selection, compensating for lift
+</xsl:text>
+ <xsl:text> let offset = this.last_selection - this.lift;
+</xsl:text>
+ <xsl:text> if(offset > 0)
+</xsl:text>
+ <xsl:text> this.menu_offset = Math.min(offset + 1, length - slots + 1);
+</xsl:text>
+ <xsl:text> else
+</xsl:text>
+ <xsl:text> this.menu_offset = 0;
+</xsl:text>
+ <xsl:text> // show surrounding values
+</xsl:text>
+ <xsl:text> this.set_partial_text();
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> // Now that text size is known, we can set the box around it
+</xsl:text>
+ <xsl:text> this.adjust_box_to_text();
+</xsl:text>
+ <xsl:text> // Take button out until menu closed
+</xsl:text>
+ <xsl:text> this.element.removeChild(this.button_elt);
+</xsl:text>
+ <xsl:text> // Rise widget to top by moving it to last position among siblings
+</xsl:text>
+ <xsl:text> this.element.parentNode.appendChild(this.element.parentNode.removeChild(this.element));
+</xsl:text>
+ <xsl:text> // disable interaction with background
+</xsl:text>
+ <xsl:text> svg_root.addEventListener("click", this.bound_close_on_click_elsewhere, true);
+</xsl:text>
+ <xsl:text> // mark as open
+</xsl:text>
+ <xsl:text> this.opened = true;
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> // Put text element in normalized state
+</xsl:text>
+ <xsl:text> reset_text: function(){
+</xsl:text>
+ <xsl:text> let txt = this.text_elt;
+</xsl:text>
+ <xsl:text> let first = txt.firstElementChild;
+</xsl:text>
+ <xsl:text> // remove attribute eventually added to first text line while opening
+</xsl:text>
+ <xsl:text> first.removeAttribute("onclick");
+</xsl:text>
+ <xsl:text> first.removeAttribute("dy");
+</xsl:text>
+ <xsl:text> // keep only the first line of text
+</xsl:text>
+ <xsl:text> for(let span of Array.from(txt.children).slice(1)){
+</xsl:text>
+ <xsl:text> txt.removeChild(span)
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> // Put rectangle element in saved original state
+</xsl:text>
+ <xsl:text> reset_box: function(){
+</xsl:text>
+ <xsl:text> let m = this.box_bbox;
+</xsl:text>
+ <xsl:text> let b = this.box_elt;
+</xsl:text>
+ <xsl:text> b.x.baseVal.value = m.x;
+</xsl:text>
+ <xsl:text> b.y.baseVal.value = m.y;
+</xsl:text>
+ <xsl:text> b.width.baseVal.value = m.width;
+</xsl:text>
+ <xsl:text> b.height.baseVal.value = m.height;
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> // Use margin and text size to compute box size
+</xsl:text>
+ <xsl:text> adjust_box_to_text: function(){
+</xsl:text>
+ <xsl:text> let [lmargin, tmargin] = this.margins;
+</xsl:text>
+ <xsl:text> let m = this.text_elt.getBBox();
+</xsl:text>
+ <xsl:text> let b = this.box_elt;
+</xsl:text>
+ <xsl:text> b.x.baseVal.value = m.x - lmargin;
+</xsl:text>
+ <xsl:text> b.y.baseVal.value = m.y - tmargin;
+</xsl:text>
+ <xsl:text> b.width.baseVal.value = 2 * lmargin + m.width;
+</xsl:text>
+ <xsl:text> b.height.baseVal.value = 2 * tmargin + m.height;
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='ForEach']">
+ <xsl:param name="hmi_element"/>
+ <xsl:variable name="class" select="arg[1]/@value"/>
+ <xsl:variable name="base_path" select="path/@value"/>
+ <xsl:variable name="hmi_index_base" select="$indexed_hmitree/*[@hmipath = $base_path]"/>
+ <xsl:variable name="hmi_tree_base" select="$hmitree/descendant-or-self::*[@path = $hmi_index_base/@path]"/>
+ <xsl:variable name="hmi_tree_items" select="$hmi_tree_base/*[@class = $class]"/>
+ <xsl:variable name="hmi_index_items" select="$indexed_hmitree/*[@path = $hmi_tree_items/@path]"/>
+ <xsl:variable name="items_paths" select="$hmi_index_items/@hmipath"/>
+ <xsl:text> index_pool: [
+</xsl:text>
+ <xsl:for-each select="$hmi_index_items">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@index"/>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ],
+</xsl:text>
+ <xsl:text> init: function() {
+</xsl:text>
+ <xsl:variable name="prefix" select="concat($class,':')"/>
+ <xsl:variable name="buttons_regex" select="concat('^',$prefix,'[+\-][0-9]+')"/>
+ <xsl:variable name="buttons" select="$hmi_element/*[regexp:test(@inkscape:label, $buttons_regex)]"/>
+ <xsl:for-each select="$buttons">
+ <xsl:variable name="op" select="substring-after(@inkscape:label, $prefix)"/>
+ <xsl:text> id("</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>").setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_click('</xsl:text>
+ <xsl:value-of select="$op"/>
+ <xsl:text>', evt)");
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.items = [
+</xsl:text>
+ <xsl:variable name="items_regex" select="concat('^',$prefix,'[0-9]+')"/>
+ <xsl:variable name="unordered_items" select="$hmi_element//*[regexp:test(@inkscape:label, $items_regex)]"/>
+ <xsl:for-each select="$unordered_items">
+ <xsl:variable name="elt_label" select="concat($prefix, string(position()))"/>
+ <xsl:variable name="elt" select="$unordered_items[@inkscape:label = $elt_label]"/>
+ <xsl:variable name="pos" select="position()"/>
+ <xsl:variable name="item_path" select="$items_paths[$pos]"/>
+ <xsl:text> [ /* item="</xsl:text>
+ <xsl:value-of select="$elt_label"/>
+ <xsl:text>" path="</xsl:text>
+ <xsl:value-of select="$item_path"/>
+ <xsl:text>" */
+</xsl:text>
+ <xsl:if test="count($elt)=0">
+ <xsl:message terminate="yes">
+ <xsl:text>Missing item labeled </xsl:text>
+ <xsl:value-of select="$elt_label"/>
+ <xsl:text> in ForEach widget </xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ </xsl:message>
+ </xsl:if>
+ <xsl:for-each select="func:refered_elements($elt)[@id = $hmi_elements/@id][not(@id = $elt/@id)]">
+ <xsl:if test="not(func:is_descendant_path(func:widget(@id)/path/@value, $item_path))">
+ <xsl:message terminate="yes">
+ <xsl:text>Widget id="</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>" label="</xsl:text>
+ <xsl:value-of select="@inkscape:label"/>
+ <xsl:text>" is having wrong path. Accroding to ForEach widget ancestor id="</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>", path should be descendant of "</xsl:text>
+ <xsl:value-of select="$item_path"/>
+ <xsl:text>".</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ <xsl:text> hmi_widgets["</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"]</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ]</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ]
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> item_offset: 0,
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_class" match="widget[@type='ForEach']">
+ <xsl:text>class ForEachWidget extends Widget{
+</xsl:text>
+ <xsl:text> unsub(){
+</xsl:text>
+ <xsl:text> for(let item of this.items){
+</xsl:text>
+ <xsl:text> for(let widget of item) {
+</xsl:text>
+ <xsl:text> widget.unsub();
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> this.offset = 0;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> foreach_widgets_do(new_offset, todo){
+</xsl:text>
+ <xsl:text> this.offset = new_offset;
+</xsl:text>
+ <xsl:text> for(let i = 0; i < this.items.length; i++) {
+</xsl:text>
+ <xsl:text> let item = this.items[i];
+</xsl:text>
+ <xsl:text> let orig_item_index = this.index_pool[i];
+</xsl:text>
+ <xsl:text> let item_index = this.index_pool[i+this.item_offset];
+</xsl:text>
+ <xsl:text> let item_index_offset = item_index - orig_item_index;
+</xsl:text>
+ <xsl:text> for(let widget of item) {
+</xsl:text>
+ <xsl:text> todo(widget).call(widget, new_offset + item_index_offset);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> sub(new_offset=0){
+</xsl:text>
+ <xsl:text> this.foreach_widgets_do(new_offset, w=>w.sub);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> apply_cache() {
+</xsl:text>
+ <xsl:text> this.foreach_widgets_do(this.offset, w=>w.apply_cache);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> on_click(opstr, evt) {
+</xsl:text>
+ <xsl:text> let new_item_offset = eval(String(this.item_offset)+opstr);
+</xsl:text>
+ <xsl:text> if(new_item_offset + this.items.length > this.index_pool.length) {
+</xsl:text>
+ <xsl:text> if(this.item_offset + this.items.length == this.index_pool.length)
+</xsl:text>
+ <xsl:text> new_item_offset = 0;
+</xsl:text>
+ <xsl:text> else
+</xsl:text>
+ <xsl:text> new_item_offset = this.index_pool.length - this.items.length;
+</xsl:text>
+ <xsl:text> } else if(new_item_offset < 0) {
+</xsl:text>
+ <xsl:text> if(this.item_offset == 0)
+</xsl:text>
+ <xsl:text> new_item_offset = this.index_pool.length - this.items.length;
+</xsl:text>
+ <xsl:text> else
+</xsl:text>
+ <xsl:text> new_item_offset = 0;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> this.item_offset = new_item_offset;
+</xsl:text>
+ <xsl:text> this.unsub();
+</xsl:text>
+ <xsl:text> this.sub(this.offset);
+</xsl:text>
+ <xsl:text> update_subscriptions();
+</xsl:text>
+ <xsl:text> need_cache_apply.push(this);
+</xsl:text>
+ <xsl:text> jumps_need_update = true;
+</xsl:text>
+ <xsl:text> requestHMIAnimation();
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='Input']">
+ <xsl:param name="hmi_element"/>
+ <xsl:variable name="value_elt">
+ <xsl:call-template name="defs_by_labels">
+ <xsl:with-param name="hmi_element" select="$hmi_element"/>
+ <xsl:with-param name="labels">
+ <xsl:text>value</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="have_value" select="string-length($value_elt)>0"/>
+ <xsl:value-of select="$value_elt"/>
+ <xsl:if test="$have_value">
+ <xsl:text> frequency: 5,
+</xsl:text>
+ </xsl:if>
+ <xsl:text> last_val: undefined,
+</xsl:text>
+ <xsl:text> dispatch: function(value) {
+</xsl:text>
+ <xsl:text> this.last_val = value;
+</xsl:text>
+ <xsl:if test="$have_value">
+ <xsl:text> this.value_elt.textContent = String(value);
+</xsl:text>
+ </xsl:if>
+ <xsl:text> },
+</xsl:text>
+ <xsl:variable name="edit_elt_id" select="$hmi_element/*[@inkscape:label='edit'][1]/@id"/>
+ <xsl:text> init: function() {
+</xsl:text>
+ <xsl:if test="$edit_elt_id">
+ <xsl:text> id("</xsl:text>
+ <xsl:value-of select="$edit_elt_id"/>
+ <xsl:text>").setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_edit_click()");
+</xsl:text>
+ </xsl:if>
+ <xsl:for-each select="$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]">
+ <xsl:text> id("</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>").setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_op_click('</xsl:text>
+ <xsl:value-of select="func:escape_quotes(@inkscape:label)"/>
+ <xsl:text>')");
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_op_click: function(opstr) {
+</xsl:text>
+ <xsl:text> let orig = this.indexes[0];
+</xsl:text>
+ <xsl:text> let idx = this.offset ? orig - this.offset : orig;
+</xsl:text>
+ <xsl:text> let new_val = change_hmi_value(idx, opstr);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_edit_click: function(opstr) {
+</xsl:text>
+ <xsl:text> edit_value("</xsl:text>
+ <xsl:value-of select="path/@value"/>
+ <xsl:text>", "</xsl:text>
+ <xsl:value-of select="path/@type"/>
+ <xsl:text>", this, this.last_val);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> edit_callback: function(new_val) {
+</xsl:text>
+ <xsl:text> let orig = this.indexes[0];
+</xsl:text>
+ <xsl:text> let idx = this.offset ? orig - this.offset : orig;
+</xsl:text>
+ <xsl:text> apply_hmi_value(idx, new_val);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
+ <xsl:template name="jump_widget_activity">
+ <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>active inactive</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template name="jump_widget_disability">
+ <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>disabled</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='Jump']">
+ <xsl:param name="hmi_element"/>
+ <xsl:variable name="activity">
+ <xsl:call-template name="jump_widget_activity">
+ <xsl:with-param name="hmi_element" select="$hmi_element"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="have_activity" select="string-length($activity)>0"/>
+ <xsl:value-of select="$activity"/>
+ <xsl:variable name="disability">
+ <xsl:call-template name="jump_widget_disability">
+ <xsl:with-param name="hmi_element" select="$hmi_element"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="have_disability" select="$have_activity and string-length($disability)>0"/>
+ <xsl:value-of select="$disability"/>
+ <xsl:if test="$have_activity">
+ <xsl:text> active: false,
+</xsl:text>
+ <xsl:if test="$have_disability">
+ <xsl:text> disabled: false,
+</xsl:text>
+ <xsl:text> frequency: 2,
+</xsl:text>
+ <xsl:text> dispatch: function(value) {
+</xsl:text>
+ <xsl:text> this.disabled = !Number(value);
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ </xsl:if>
+ <xsl:text> update: function(){
+</xsl:text>
+ <xsl:if test="$have_disability">
+ <xsl:text> if(this.disabled) {
+</xsl:text>
+ <xsl:text> /* show disabled */
+</xsl:text>
+ <xsl:text> this.disabled_elt.setAttribute("style", this.active_elt_style);
+</xsl:text>
+ <xsl:text> /* hide inactive */
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> /* hide active */
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> /* hide disabled */
+</xsl:text>
+ <xsl:text> this.disabled_elt.setAttribute("style", "display:none");
+</xsl:text>
+ </xsl:if>
+ <xsl:text> if(this.active) {
+</xsl:text>
+ <xsl:text> /* show active */
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", this.active_elt_style);
+</xsl:text>
+ <xsl:text> /* hide inactive */
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> /* show inactive */
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", this.inactive_elt_style);
+</xsl:text>
+ <xsl:text> /* hide active */
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:if test="$have_disability">
+ <xsl:text> }
+</xsl:text>
+ </xsl:if>
+ <xsl:text> },
+</xsl:text>
+ </xsl:if>
+ <xsl:text> on_click: function(evt) {
+</xsl:text>
+ <xsl:text> const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined;
+</xsl:text>
+ <xsl:text> const name = this.args[0];
+</xsl:text>
+ <xsl:text> switch_page(name, index);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:if test="$have_activity">
+ <xsl:text> notify_page_change: function(page_name, index){
+</xsl:text>
+ <xsl:text> const ref_index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined;
+</xsl:text>
+ <xsl:text> const ref_name = this.args[0];
+</xsl:text>
+ <xsl:text> this.active =((ref_name == undefined || ref_name == page_name) && index == ref_index);
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ </xsl:if>
+ <xsl:text> init: function() {
+</xsl:text>
+ <xsl:text> this.element.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_click(evt)");
+</xsl:text>
+ <xsl:if test="$have_activity">
+ <xsl:text> this.active_elt_style = this.active_elt.getAttribute("style");
+</xsl:text>
+ <xsl:text> this.inactive_elt_style = this.inactive_elt.getAttribute("style");
+</xsl:text>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$have_disability">
+ <xsl:text> this.disabled_elt_style = this.disabled_elt.getAttribute("style");
+</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> this.unsubscribable = true;
+</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="per_page_widget_template" match="widget[@type='Jump']">
+ <xsl:param name="page_desc"/>
+ <xsl:if test="path">
+ <xsl:variable name="target_page_name">
+ <xsl:choose>
+ <xsl:when test="arg">
+ <xsl:value-of select="arg[1]/@value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$page_desc/arg[1]/@value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="target_page_path">
+ <xsl:choose>
+ <xsl:when test="arg">
+ <xsl:value-of select="$hmi_pages_descs[arg[1]/@value = $target_page_name]/path[1]/@value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$page_desc/path[1]/@value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="not(func:same_class_paths($target_page_path, path[1]/@value))">
+ <xsl:message terminate="yes">
+ <xsl:text>Jump id="</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>" to page "</xsl:text>
+ <xsl:value-of select="$target_page_name"/>
+ <xsl:text>" with incompatible path "</xsl:text>
+ <xsl:value-of select="path[1]/@value"/>
+ <xsl:text> (must be same class as "</xsl:text>
+ <xsl:value-of select="$target_page_path"/>
+ <xsl:text>")</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+ <declarations:jump/>
+ <xsl:template match="declarations:jump">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var jumps_need_update = false;
+</xsl:text>
+ <xsl:text>var jump_history = [[default_page, undefined]];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function update_jumps() {
+</xsl:text>
+ <xsl:text> page_desc[current_visible_page].jumps.map(w=>w.notify_page_change(current_visible_page,current_page_index));
+</xsl:text>
+ <xsl:text> jumps_need_update = false;
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <declarations:keypad/>
+ <xsl:template match="declarations:keypad">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var keypads = {
+</xsl:text>
+ <xsl:for-each select="$keypads_descs">
+ <xsl:variable name="keypad_id" select="@id"/>
+ <xsl:for-each select="arg">
+ <xsl:variable name="g" select="$geometry[@Id = $keypad_id]"/>
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="@value"/>
+ <xsl:text>":["</xsl:text>
+ <xsl:value-of select="$keypad_id"/>
+ <xsl:text>", </xsl:text>
+ <xsl:value-of select="$g/@x"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="$g/@y"/>
+ <xsl:text>],
+</xsl:text>
+ </xsl:for-each>
+ </xsl:for-each>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='Keypad']">
+ <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>Esc Enter BackSpace Keys Info Value</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>Sign Space NumDot</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ </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>CapsLock Shift</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ <xsl:with-param name="subelements" select="'active inactive'"/>
+ </xsl:call-template>
+ <xsl:text> init: function() {
+</xsl:text>
+ <xsl:for-each select="$hmi_element/*[@inkscape:label = 'Keys']/*">
+ <xsl:text> id("</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>").setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_key_click('</xsl:text>
+ <xsl:value-of select="func:escape_quotes(@inkscape:label)"/>
+ <xsl:text>')");
+</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select="str:split('Esc Enter BackSpace Sign Space NumDot CapsLock Shift')">
+ <xsl:text> if(this.</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>_elt)
+</xsl:text>
+ <xsl:text> this.</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>_elt.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>_click()");
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_key_click: function(symbols) {
+</xsl:text>
+ <xsl:text> var syms = symbols.split(" ");
+</xsl:text>
+ <xsl:text> this.shift |= this.caps;
+</xsl:text>
+ <xsl:text> this.editstr += syms[this.shift?syms.length-1:0];
+</xsl:text>
+ <xsl:text> this.shift = false;
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_Esc_click: function() {
+</xsl:text>
+ <xsl:text> end_modal.call(this);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_Enter_click: function() {
+</xsl:text>
+ <xsl:text> end_modal.call(this);
+</xsl:text>
+ <xsl:text> callback_obj = this.result_callback_obj;
+</xsl:text>
+ <xsl:text> callback_obj.edit_callback(this.editstr);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_BackSpace_click: function() {
+</xsl:text>
+ <xsl:text> this.editstr = this.editstr.slice(0,this.editstr.length-1);
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_Sign_click: function() {
+</xsl:text>
+ <xsl:text> if(this.editstr[0] == "-")
+</xsl:text>
+ <xsl:text> this.editstr = this.editstr.slice(1,this.editstr.length);
+</xsl:text>
+ <xsl:text> else
+</xsl:text>
+ <xsl:text> this.editstr = "-" + this.editstr;
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_NumDot_click: function() {
+</xsl:text>
+ <xsl:text> if(this.editstr.indexOf(".") == "-1"){
+</xsl:text>
+ <xsl:text> this.editstr += ".";
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_Space_click: function() {
+</xsl:text>
+ <xsl:text> this.editstr += " ";
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> caps: false,
+</xsl:text>
+ <xsl:text> _caps: undefined,
+</xsl:text>
+ <xsl:text> on_CapsLock_click: function() {
+</xsl:text>
+ <xsl:text> this.caps = !this.caps;
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> shift: false,
+</xsl:text>
+ <xsl:text> _shift: undefined,
+</xsl:text>
+ <xsl:text> on_Shift_click: function() {
+</xsl:text>
+ <xsl:text> this.shift = !this.shift;
+</xsl:text>
+ <xsl:text> this.caps = false;
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:variable name="g" select="$geometry[@Id = $hmi_element/@id]"/>
+ <xsl:text> coordinates: [</xsl:text>
+ <xsl:value-of select="$g/@x"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="$g/@y"/>
+ <xsl:text>],
+</xsl:text>
+ <xsl:text> editstr: "",
+</xsl:text>
+ <xsl:text> _editstr: undefined,
+</xsl:text>
+ <xsl:text> result_callback_obj: undefined,
+</xsl:text>
+ <xsl:text> start_edit: function(info, valuetype, callback_obj, initial) {
+</xsl:text>
+ <xsl:text> show_modal.call(this);
+</xsl:text>
+ <xsl:text> this.editstr = initial;
+</xsl:text>
+ <xsl:text> this.result_callback_obj = callback_obj;
+</xsl:text>
+ <xsl:text> this.Info_elt.textContent = info;
+</xsl:text>
+ <xsl:text> this.shift = false;
+</xsl:text>
+ <xsl:text> this.caps = false;
+</xsl:text>
+ <xsl:text> this.update();
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> update: function() {
+</xsl:text>
+ <xsl:text> if(this.editstr != this._editstr){
+</xsl:text>
+ <xsl:text> this._editstr = this.editstr;
+</xsl:text>
+ <xsl:text> this.Value_elt.textContent = this.editstr;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> if(this.shift != this._shift){
+</xsl:text>
+ <xsl:text> this._shift = this.shift;
+</xsl:text>
+ <xsl:text> (this.shift?widget_active_activable:widget_inactive_activable)(this.Shift_sub);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> if(this.caps != this._caps){
+</xsl:text>
+ <xsl:text> this._caps = this.caps;
+</xsl:text>
+ <xsl:text> (this.caps?widget_active_activable:widget_inactive_activable)(this.CapsLock_sub);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='Meter']">
+ <xsl:param name="hmi_element"/>
+ <xsl:text> frequency: 10,
+</xsl:text>
+ <xsl:call-template name="defs_by_labels">
+ <xsl:with-param name="hmi_element" select="$hmi_element"/>
+ <xsl:with-param name="labels">
+ <xsl:text>needle range</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>value min max</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="mandatory" select="'no'"/>
+ </xsl:call-template>
+ <xsl:text> dispatch: function(value) {
+</xsl:text>
+ <xsl:text> if(this.value_elt)
+</xsl:text>
+ <xsl:text> this.value_elt.textContent = String(value);
+</xsl:text>
+ <xsl:text> let [min,max,totallength] = this.range;
+</xsl:text>
+ <xsl:text> let length = Math.max(0,Math.min(totallength,(Number(value)-min)*totallength/(max-min)));
+</xsl:text>
+ <xsl:text> let tip = this.range_elt.getPointAtLength(length);
+</xsl:text>
+ <xsl:text> this.needle_elt.setAttribute('d', "M "+this.origin.x+","+this.origin.y+" "+tip.x+","+tip.y);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> origin: undefined,
+</xsl:text>
+ <xsl:text> range: undefined,
+</xsl:text>
+ <xsl:text> init: function() {
+</xsl:text>
+ <xsl:text> let min = this.min_elt ?
+</xsl:text>
+ <xsl:text> Number(this.min_elt.textContent) :
+</xsl:text>
+ <xsl:text> this.args.length >= 1 ? this.args[0] : 0;
+</xsl:text>
+ <xsl:text> let max = this.max_elt ?
+</xsl:text>
+ <xsl:text> Number(this.max_elt.textContent) :
+</xsl:text>
+ <xsl:text> this.args.length >= 2 ? this.args[1] : 100;
+</xsl:text>
+ <xsl:text> this.range = [min, max, this.range_elt.getTotalLength()]
+</xsl:text>
+ <xsl:text> this.origin = this.needle_elt.getPointAtLength(0);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_class" match="widget[@type='Switch']">
+ <xsl:text>class SwitchWidget extends Widget{
+</xsl:text>
+ <xsl:text> frequency = 5;
+</xsl:text>
+ <xsl:text> dispatch(value) {
+</xsl:text>
+ <xsl:text> for(let choice of this.choices){
+</xsl:text>
+ <xsl:text> if(value != choice.value){
+</xsl:text>
+ <xsl:text> choice.elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> choice.elt.setAttribute("style", choice.style);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='Switch']">
+ <xsl:param name="hmi_element"/>
+ <xsl:text> choices: [
+</xsl:text>
+ <xsl:variable name="regex" select="'^("[^"].*"|\-?[0-9]+|false|true)(#.*)?$'"/>
+ <xsl:for-each select="$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]">
+ <xsl:variable name="literal" select="regexp:match(@inkscape:label,$regex)[2]"/>
+ <xsl:text> {
+</xsl:text>
+ <xsl:text> elt:id("</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"),
+</xsl:text>
+ <xsl:text> style:"</xsl:text>
+ <xsl:value-of select="@style"/>
+ <xsl:text>",
+</xsl:text>
+ <xsl:text> value:</xsl:text>
+ <xsl:value-of select="$literal"/>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> }</xsl:text>
+ <xsl:if test="position()!=last()">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ],
+</xsl:text>
+ </xsl:template>
+ <xsl:template mode="widget_defs" match="widget[@type='ToggleButton']">
+ <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>active inactive</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text> frequency: 5,
+</xsl:text>
+ <xsl:text> state: 0,
+</xsl:text>
+ <xsl:text> dispatch: function(value) {
+</xsl:text>
+ <xsl:text> this.state = value;
+</xsl:text>
+ <xsl:text> if (this.state) {
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", this.active_style);
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> this.state = 0;
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> this.inactive_elt.setAttribute("style", this.inactive_style);
+</xsl:text>
+ <xsl:text> this.active_elt.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> this.state = 1;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> on_click: function(evt) {
+</xsl:text>
+ <xsl:text> change_hmi_value(this.indexes[0], "="+this.state);
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ <xsl:text> active_style: undefined,
+</xsl:text>
+ <xsl:text> inactive_style: undefined,
+</xsl:text>
+ <xsl:text> init: function() {
+</xsl:text>
+ <xsl:text> this.active_style = this.active_elt.style.cssText;
+</xsl:text>
+ <xsl:text> this.inactive_style = this.inactive_elt.style.cssText;
+</xsl:text>
+ <xsl:text> this.element.setAttribute("onclick", "hmi_widgets['</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>'].on_click(evt)");
+</xsl:text>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
+ <xsl:template match="/">
+ <xsl:comment>
+ <xsl:text>Made with SVGHMI. https://beremiz.org</xsl:text>
+ </xsl:comment>
+ <xsl:comment>
+ <xsl:apply-templates select="document('')/*/debug:*"/>
+ </xsl:comment>
+ <html xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/1999/xhtml">
+ <head/>
+ <body style="margin:0;overflow:hidden;">
+ <xsl:copy-of select="$result_svg"/>
+ <script>
+ <xsl:text>
+//
+//
+// Early independent declarations
+//
+//
+</xsl:text>
+ <xsl:apply-templates select="document('')/*/preamble:*"/>
+ <xsl:text>
+//
+//
+// Declarations depending on preamble
+//
+//
+</xsl:text>
+ <xsl:apply-templates select="document('')/*/declarations:*"/>
+ <xsl:text>
+//
+//
+// Order independent declaration and code
+//
+//
+</xsl:text>
+ <xsl:apply-templates select="document('')/*/definitions:*"/>
+ <xsl:text>
+//
+//
+// Statements that needs to be at the end
+//
+//
+</xsl:text>
+ <xsl:apply-templates select="document('')/*/epilogue:*"/>
+ <xsl:text>// svghmi.js
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var cache = hmitree_types.map(_ignored => undefined);
+</xsl:text>
+ <xsl:text>var updates = {};
+</xsl:text>
+ <xsl:text>var need_cache_apply = [];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function dispatch_value_to_widget(widget, index, value, oldval) {
+</xsl:text>
+ <xsl:text> try {
+</xsl:text>
+ <xsl:text> let idx = widget.offset ? index - widget.offset : index;
+</xsl:text>
+ <xsl:text> let idxidx = widget.indexes.indexOf(idx);
+</xsl:text>
+ <xsl:text> let d = widget.dispatch;
+</xsl:text>
+ <xsl:text> if(typeof(d) == "function" && idxidx == 0){
+</xsl:text>
+ <xsl:text> d.call(widget, value, oldval);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> else if(typeof(d) == "object" && d.length >= idxidx){
+</xsl:text>
+ <xsl:text> d[idxidx].call(widget, value, oldval);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> /* else dispatch_0, ..., dispatch_n ? */
+</xsl:text>
+ <xsl:text> /*else {
+</xsl:text>
+ <xsl:text> throw new Error("Dunno how to dispatch to widget at index = " + index);
+</xsl:text>
+ <xsl:text> }*/
+</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>
+</xsl:text>
+ <xsl:text>function dispatch_value(index, value) {
+</xsl:text>
+ <xsl:text> let widgets = subscribers[index];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let oldval = cache[index];
+</xsl:text>
+ <xsl:text> cache[index] = value;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(widgets.size > 0) {
+</xsl:text>
+ <xsl:text> for(let widget of widgets){
+</xsl:text>
+ <xsl:text> dispatch_value_to_widget(widget, index, value, oldval);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function init_widgets() {
+</xsl:text>
+ <xsl:text> Object.keys(hmi_widgets).forEach(function(id) {
+</xsl:text>
+ <xsl:text> let widget = hmi_widgets[id];
+</xsl:text>
+ <xsl:text> let init = widget.init;
+</xsl:text>
+ <xsl:text> if(typeof(init) == "function"){
+</xsl:text>
+ <xsl:text> try {
+</xsl:text>
+ <xsl:text> init.call(widget);
+</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> });
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// Open WebSocket to relative "/ws" address
+</xsl:text>
+ <xsl:text>var ws = new WebSocket(window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws'));
+</xsl:text>
+ <xsl:text>ws.binaryType = 'arraybuffer';
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>const dvgetters = {
+</xsl:text>
+ <xsl:text> INT: (dv,offset) => [dv.getInt16(offset, true), 2],
+</xsl:text>
+ <xsl:text> BOOL: (dv,offset) => [dv.getInt8(offset, true), 1],
+</xsl:text>
+ <xsl:text> NODE: (dv,offset) => [dv.getInt8(offset, true), 1],
+</xsl:text>
+ <xsl:text> STRING: (dv, offset) => {
+</xsl:text>
+ <xsl:text> size = dv.getInt8(offset);
+</xsl:text>
+ <xsl:text> return [
+</xsl:text>
+ <xsl:text> String.fromCharCode.apply(null, new Uint8Array(
+</xsl:text>
+ <xsl:text> dv.buffer, /* original buffer */
+</xsl:text>
+ <xsl:text> offset + 1, /* string starts after size*/
+</xsl:text>
+ <xsl:text> size /* size of string */
+</xsl:text>
+ <xsl:text> )), size + 1]; /* total increment */
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// Apply updates recieved through ws.onmessage to subscribed widgets
+</xsl:text>
+ <xsl:text>function apply_updates() {
+</xsl:text>
+ <xsl:text> for(let index in updates){
+</xsl:text>
+ <xsl:text> // serving as a key, index becomes a string
+</xsl:text>
+ <xsl:text> // -> pass Number(index) instead
+</xsl:text>
+ <xsl:text> dispatch_value(Number(index), updates[index]);
+</xsl:text>
+ <xsl:text> delete updates[index];
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// Called on requestAnimationFrame, modifies DOM
+</xsl:text>
+ <xsl:text>var requestAnimationFrameID = null;
+</xsl:text>
+ <xsl:text>function animate() {
+</xsl:text>
+ <xsl:text> // Do the page swith if any one pending
+</xsl:text>
+ <xsl:text> if(current_subscribed_page != current_visible_page){
+</xsl:text>
+ <xsl:text> switch_visible_page(current_subscribed_page);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> while(widget = need_cache_apply.pop()){
+</xsl:text>
+ <xsl:text> widget.apply_cache();
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(jumps_need_update) update_jumps();
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> apply_updates();
+</xsl:text>
+ <xsl:text> requestAnimationFrameID = null;
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function requestHMIAnimation() {
+</xsl:text>
+ <xsl:text> if(requestAnimationFrameID == null){
+</xsl:text>
+ <xsl:text> requestAnimationFrameID = window.requestAnimationFrame(animate);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// Message reception handler
+</xsl:text>
+ <xsl:text>// Hash is verified and HMI values updates resulting from binary parsing
+</xsl:text>
+ <xsl:text>// are stored until browser can compute next frame, DOM is left untouched
+</xsl:text>
+ <xsl:text>ws.onmessage = function (evt) {
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let data = evt.data;
+</xsl:text>
+ <xsl:text> let dv = new DataView(data);
+</xsl:text>
+ <xsl:text> let i = 0;
+</xsl:text>
+ <xsl:text> try {
+</xsl:text>
+ <xsl:text> for(let hash_int of hmi_hash) {
+</xsl:text>
+ <xsl:text> if(hash_int != dv.getUint8(i)){
+</xsl:text>
+ <xsl:text> throw new Error("Hash doesn't match");
+</xsl:text>
+ <xsl:text> };
+</xsl:text>
+ <xsl:text> i++;
+</xsl:text>
+ <xsl:text> };
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> while(i < data.byteLength){
+</xsl:text>
+ <xsl:text> let index = dv.getUint32(i, true);
+</xsl:text>
+ <xsl:text> i += 4;
+</xsl:text>
+ <xsl:text> let iectype = hmitree_types[index];
+</xsl:text>
+ <xsl:text> if(iectype != undefined){
+</xsl:text>
+ <xsl:text> let dvgetter = dvgetters[iectype];
+</xsl:text>
+ <xsl:text> let [value, bytesize] = dvgetter(dv,i);
+</xsl:text>
+ <xsl:text> updates[index] = value;
+</xsl:text>
+ <xsl:text> i += bytesize;
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> throw new Error("Unknown index "+index);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> };
+</xsl:text>
+ <xsl:text> // register for rendering on next frame, since there are updates
+</xsl:text>
+ <xsl:text> requestHMIAnimation();
+</xsl:text>
+ <xsl:text> } catch(err) {
+</xsl:text>
+ <xsl:text> // 1003 is for "Unsupported Data"
+</xsl:text>
+ <xsl:text> // ws.close(1003, err.message);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // TODO : remove debug alert ?
+</xsl:text>
+ <xsl:text> alert("Error : "+err.message+"\nHMI will be reloaded.");
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // force reload ignoring cache
+</xsl:text>
+ <xsl:text> location.reload(true);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function send_blob(data) {
+</xsl:text>
+ <xsl:text> if(data.length > 0) {
+</xsl:text>
+ <xsl:text> ws.send(new Blob([new Uint8Array(hmi_hash)].concat(data)));
+</xsl:text>
+ <xsl:text> };
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>const typedarray_types = {
+</xsl:text>
+ <xsl:text> INT: (number) => new Int16Array([number]),
+</xsl:text>
+ <xsl:text> BOOL: (truth) => new Int16Array([truth]),
+</xsl:text>
+ <xsl:text> NODE: (truth) => new Int16Array([truth]),
+</xsl:text>
+ <xsl:text> STRING: (str) => {
+</xsl:text>
+ <xsl:text> // beremiz default string max size is 128
+</xsl:text>
+ <xsl:text> str = str.slice(0,128);
+</xsl:text>
+ <xsl:text> binary = new Uint8Array(str.length + 1);
+</xsl:text>
+ <xsl:text> binary[0] = str.length;
+</xsl:text>
+ <xsl:text> for(var i = 0; i < str.length; i++){
+</xsl:text>
+ <xsl:text> binary[i+1] = str.charCodeAt(i);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> return binary;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> /* TODO */
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function send_reset() {
+</xsl:text>
+ <xsl:text> send_blob(new Uint8Array([1])); /* reset = 1 */
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// subscription state, as it should be in hmi server
+</xsl:text>
+ <xsl:text>// hmitree indexed array of integers
+</xsl:text>
+ <xsl:text>var subscriptions = hmitree_types.map(_ignored => 0);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// subscription state as needed by widget now
+</xsl:text>
+ <xsl:text>// hmitree indexed array of Sets of widgets objects
+</xsl:text>
+ <xsl:text>var subscribers = hmitree_types.map(_ignored => new Set());
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// artificially subscribe the watchdog widget to "/heartbeat" hmi variable
+</xsl:text>
+ <xsl:text>// Since dispatch directly calls change_hmi_value,
+</xsl:text>
+ <xsl:text>// PLC will periodically send variable at given frequency
+</xsl:text>
+ <xsl:text>subscribers[heartbeat_index].add({
+</xsl:text>
+ <xsl:text> /* type: "Watchdog", */
+</xsl:text>
+ <xsl:text> frequency: 1,
+</xsl:text>
+ <xsl:text> indexes: [heartbeat_index],
+</xsl:text>
+ <xsl:text> dispatch: function(value) {
+</xsl:text>
+ <xsl:text> change_hmi_value(heartbeat_index, "+1");
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>});
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function update_subscriptions() {
+</xsl:text>
+ <xsl:text> let delta = [];
+</xsl:text>
+ <xsl:text> for(let index = 0; index < subscribers.length; index++){
+</xsl:text>
+ <xsl:text> let widgets = subscribers[index];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // periods are in ms
+</xsl:text>
+ <xsl:text> let previous_period = subscriptions[index];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // subscribing with a zero period is unsubscribing
+</xsl:text>
+ <xsl:text> let new_period = 0;
+</xsl:text>
+ <xsl:text> if(widgets.size > 0) {
+</xsl:text>
+ <xsl:text> let maxfreq = 0;
+</xsl:text>
+ <xsl:text> for(let widget of widgets){
+</xsl:text>
+ <xsl:text> let wf = widget.frequency;
+</xsl:text>
+ <xsl:text> if(wf != undefined && maxfreq < wf)
+</xsl:text>
+ <xsl:text> maxfreq = wf;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(maxfreq != 0)
+</xsl:text>
+ <xsl:text> new_period = 1000/maxfreq;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(previous_period != new_period) {
+</xsl:text>
+ <xsl:text> subscriptions[index] = new_period;
+</xsl:text>
+ <xsl:text> delta.push(
+</xsl:text>
+ <xsl:text> new Uint8Array([2]), /* subscribe = 2 */
+</xsl:text>
+ <xsl:text> new Uint32Array([index]),
+</xsl:text>
+ <xsl:text> new Uint16Array([new_period]));
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> send_blob(delta);
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function send_hmi_value(index, value) {
+</xsl:text>
+ <xsl:text> let iectype = hmitree_types[index];
+</xsl:text>
+ <xsl:text> let tobinary = typedarray_types[iectype];
+</xsl:text>
+ <xsl:text> send_blob([
+</xsl:text>
+ <xsl:text> new Uint8Array([0]), /* setval = 0 */
+</xsl:text>
+ <xsl:text> new Uint32Array([index]),
+</xsl:text>
+ <xsl:text> tobinary(value)]);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // DON'T DO THAT unless read_iterator in svghmi.c modifies wbuf as well, not only rbuf
+</xsl:text>
+ <xsl:text> // cache[index] = value;
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function apply_hmi_value(index, new_val) {
+</xsl:text>
+ <xsl:text> let old_val = cache[index]
+</xsl:text>
+ <xsl:text> if(new_val != undefined && old_val != new_val)
+</xsl:text>
+ <xsl:text> send_hmi_value(index, new_val);
+</xsl:text>
+ <xsl:text> return new_val;
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>quotes = {"'":null, '"':null};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function change_hmi_value(index, opstr) {
+</xsl:text>
+ <xsl:text> let op = opstr[0];
+</xsl:text>
+ <xsl:text> let given_val;
+</xsl:text>
+ <xsl:text> if(opstr.length < 2)
+</xsl:text>
+ <xsl:text> return undefined; // TODO raise
+</xsl:text>
+ <xsl:text> if(opstr[1] in quotes){
+</xsl:text>
+ <xsl:text> if(opstr.length < 3)
+</xsl:text>
+ <xsl:text> return undefined; // TODO raise
+</xsl:text>
+ <xsl:text> if(opstr[opstr.length-1] == opstr[1]){
+</xsl:text>
+ <xsl:text> given_val = opstr.slice(2,opstr.length-1);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> } else {
+</xsl:text>
+ <xsl:text> given_val = Number(opstr.slice(1));
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> let old_val = cache[index];
+</xsl:text>
+ <xsl:text> let new_val;
+</xsl:text>
+ <xsl:text> switch(op){
+</xsl:text>
+ <xsl:text> case "=":
+</xsl:text>
+ <xsl:text> new_val = given_val;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> case "+":
+</xsl:text>
+ <xsl:text> new_val = old_val + given_val;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> case "-":
+</xsl:text>
+ <xsl:text> new_val = old_val - given_val;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> case "*":
+</xsl:text>
+ <xsl:text> new_val = old_val * given_val;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> case "/":
+</xsl:text>
+ <xsl:text> new_val = old_val / given_val;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> if(new_val != undefined && old_val != new_val)
+</xsl:text>
+ <xsl:text> send_hmi_value(index, new_val);
+</xsl:text>
+ <xsl:text> // TODO else raise
+</xsl:text>
+ <xsl:text> return new_val;
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var current_visible_page;
+</xsl:text>
+ <xsl:text>var current_subscribed_page;
+</xsl:text>
+ <xsl:text>var current_page_index;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function prepare_svg() {
+</xsl:text>
+ <xsl:text> for(let eltid in detachable_elements){
+</xsl:text>
+ <xsl:text> let [element,parent] = detachable_elements[eltid];
+</xsl:text>
+ <xsl:text> parent.removeChild(element);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function switch_page(page_name, page_index) {
+</xsl:text>
+ <xsl:text> if(current_subscribed_page != current_visible_page){
+</xsl:text>
+ <xsl:text> /* page switch already going */
+</xsl:text>
+ <xsl:text> /* TODO LOG ERROR */
+</xsl:text>
+ <xsl:text> return false;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(page_name == undefined)
+</xsl:text>
+ <xsl:text> page_name = current_subscribed_page;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let old_desc = page_desc[current_subscribed_page];
+</xsl:text>
+ <xsl:text> let new_desc = page_desc[page_name];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(new_desc == undefined){
+</xsl:text>
+ <xsl:text> /* TODO LOG ERROR */
+</xsl:text>
+ <xsl:text> return false;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(page_index == undefined){
+</xsl:text>
+ <xsl:text> page_index = new_desc.page_index;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(old_desc){
+</xsl:text>
+ <xsl:text> old_desc.absolute_widgets.map(w=>w.unsub());
+</xsl:text>
+ <xsl:text> old_desc.relative_widgets.map(w=>w.unsub());
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> new_desc.absolute_widgets.map(w=>w.sub());
+</xsl:text>
+ <xsl:text> var new_offset = page_index == undefined ? 0 : page_index - new_desc.page_index;
+</xsl:text>
+ <xsl:text> new_desc.relative_widgets.map(w=>w.sub(new_offset));
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> update_subscriptions();
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> current_subscribed_page = page_name;
+</xsl:text>
+ <xsl:text> current_page_index = page_index;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> jumps_need_update = true;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> requestHMIAnimation();
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> jump_history.push([page_name, page_index]);
+</xsl:text>
+ <xsl:text> if(jump_history.length > 42)
+</xsl:text>
+ <xsl:text> jump_history.shift();
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> return true;
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function switch_visible_page(page_name) {
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let old_desc = page_desc[current_visible_page];
+</xsl:text>
+ <xsl:text> let new_desc = page_desc[page_name];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> if(old_desc){
+</xsl:text>
+ <xsl:text> for(let eltid in old_desc.required_detachables){
+</xsl:text>
+ <xsl:text> if(!(eltid in new_desc.required_detachables)){
+</xsl:text>
+ <xsl:text> let [element, parent] = old_desc.required_detachables[eltid];
+</xsl:text>
+ <xsl:text> parent.removeChild(element);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> for(let eltid in new_desc.required_detachables){
+</xsl:text>
+ <xsl:text> if(!(eltid in old_desc.required_detachables)){
+</xsl:text>
+ <xsl:text> let [element, parent] = new_desc.required_detachables[eltid];
+</xsl:text>
+ <xsl:text> parent.appendChild(element);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }else{
+</xsl:text>
+ <xsl:text> for(let eltid in new_desc.required_detachables){
+</xsl:text>
+ <xsl:text> let [element, parent] = new_desc.required_detachables[eltid];
+</xsl:text>
+ <xsl:text> parent.appendChild(element);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> svg_root.setAttribute('viewBox',new_desc.bbox.join(" "));
+</xsl:text>
+ <xsl:text> current_visible_page = page_name;
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>// Once connection established
+</xsl:text>
+ <xsl:text>ws.onopen = function (evt) {
+</xsl:text>
+ <xsl:text> init_widgets();
+</xsl:text>
+ <xsl:text> send_reset();
+</xsl:text>
+ <xsl:text> // show main page
+</xsl:text>
+ <xsl:text> prepare_svg();
+</xsl:text>
+ <xsl:text> switch_page(default_page);
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>ws.onclose = function (evt) {
+</xsl:text>
+ <xsl:text> // TODO : add visible notification while waiting for reload
+</xsl:text>
+ <xsl:text> console.log("Connection closed. code:"+evt.code+" reason:"+evt.reason+" wasClean:"+evt.wasClean+" Reload in 10s.");
+</xsl:text>
+ <xsl:text> // TODO : re-enable auto reload when not in debug
+</xsl:text>
+ <xsl:text> //window.setTimeout(() => location.reload(true), 10000);
+</xsl:text>
+ <xsl:text> alert("Connection closed. code:"+evt.code+" reason:"+evt.reason+" wasClean:"+evt.wasClean+".");
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var xmlns = "http://www.w3.org/2000/svg";
+</xsl:text>
+ <xsl:text>var edit_callback;
+</xsl:text>
+ <xsl:text>function edit_value(path, valuetype, callback, initial) {
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let [keypadid, xcoord, ycoord] = keypads[valuetype];
+</xsl:text>
+ <xsl:text> console.log('XXX TODO : Edit value', path, valuetype, callback, initial, keypadid);
+</xsl:text>
+ <xsl:text> edit_callback = callback;
+</xsl:text>
+ <xsl:text> let widget = hmi_widgets[keypadid];
+</xsl:text>
+ <xsl:text> widget.start_edit(path, valuetype, callback, initial);
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>var current_modal; /* TODO stack ?*/
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function show_modal() {
+</xsl:text>
+ <xsl:text> let [element, parent] = detachable_elements[this.element.id];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> tmpgrp = document.createElementNS(xmlns,"g");
+</xsl:text>
+ <xsl:text> tmpgrpattr = document.createAttribute("transform");
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let [xcoord,ycoord] = this.coordinates;
+</xsl:text>
+ <xsl:text> let [xdest,ydest] = page_desc[current_visible_page].bbox;
+</xsl:text>
+ <xsl:text> tmpgrpattr.value = "translate("+String(xdest-xcoord)+","+String(ydest-ycoord)+")";
+</xsl:text>
+ <xsl:text> tmpgrp.setAttributeNode(tmpgrpattr);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> tmpgrp.appendChild(element);
+</xsl:text>
+ <xsl:text> parent.appendChild(tmpgrp);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> current_modal = [this.element.id, tmpgrp];
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function end_modal() {
+</xsl:text>
+ <xsl:text> let [eltid, tmpgrp] = current_modal;
+</xsl:text>
+ <xsl:text> let [element, parent] = detachable_elements[this.element.id];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> parent.removeChild(tmpgrp);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> current_modal = undefined;
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function widget_active_activable(eltsub) {
+</xsl:text>
+ <xsl:text> if(eltsub.inactive_style === undefined)
+</xsl:text>
+ <xsl:text> eltsub.inactive_style = eltsub.inactive.getAttribute("style");
+</xsl:text>
+ <xsl:text> eltsub.inactive.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> if(eltsub.active_style !== undefined)
+</xsl:text>
+ <xsl:text> eltsub.active.setAttribute("style", eltsub.active_style);
+</xsl:text>
+ <xsl:text> console.log("active", eltsub);
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>function widget_inactive_activable(eltsub) {
+</xsl:text>
+ <xsl:text> if(eltsub.active_style === undefined)
+</xsl:text>
+ <xsl:text> eltsub.active_style = eltsub.active.getAttribute("style");
+</xsl:text>
+ <xsl:text> eltsub.active.setAttribute("style", "display:none");
+</xsl:text>
+ <xsl:text> if(eltsub.inactive_style !== undefined)
+</xsl:text>
+ <xsl:text> eltsub.inactive.setAttribute("style", eltsub.inactive_style);
+</xsl:text>
+ <xsl:text> console.log("inactive", eltsub);
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ </script>
+ </body>
+ </html>
+ </xsl:template>
+</xsl:stylesheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/gen_index_xhtml.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,91 @@
+include yslt_noindent.yml2
+
+// overrides yslt's output function to set CDATA
+decl output(method, cdata-section-elements="xhtml:script");
+
+// helper to emit some content to internal namespaces
+decl emit(*name) alias - {
+ *name;
+ template *name {
+ |
+ | /* «local-name()» */
+ |
+ content;
+ |
+ }
+};
+
+istylesheet
+ /* From Inkscape */
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+
+ /* Internal namespaces to allow emit code/content from anywhere */
+ xmlns:debug="debug"
+ xmlns:preamble="preamble"
+ xmlns:declarations="declarations"
+ xmlns:definitions="definitions"
+ xmlns:epilogue="epilogue"
+
+ /* Namespace to invoke python code */
+ xmlns:ns="beremiz"
+
+ extension-element-prefixes="ns func exsl regexp str dyn"
+ exclude-result-prefixes="ns func exsl regexp str dyn debug preamble epilogue declarations definitions" {
+
+ const "svg", "/svg:svg";
+ const "hmi_elements", "//svg:*[starts-with(@inkscape:label, 'HMI:')]";
+
+
+ include hmi_tree.ysl2
+
+ include geometry.ysl2
+
+ include detachable_pages.ysl2
+
+ include inline_svg.ysl2
+
+ include widgets_common.ysl2
+
+ include widget_*.ysl2
+
+
+ template "/" {
+ comment > Made with SVGHMI. https://beremiz.org
+
+ // all debug output from included definitions, as comments
+ comment apply "document('')/*/debug:*";
+
+ html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink" {
+ head;
+ body style="margin:0;overflow:hidden;" {
+ // Inline SVG
+ copy "$result_svg";
+ script{
+ | \n//\n//\n// Early independent declarations \n//\n//
+ apply "document('')/*/preamble:*";
+
+ | \n//\n//\n// Declarations depending on preamble \n//\n//
+ apply "document('')/*/declarations:*";
+
+ | \n//\n//\n// Order independent declaration and code \n//\n//
+ apply "document('')/*/definitions:*";
+
+ | \n//\n//\n// Statements that needs to be at the end \n//\n//
+ apply "document('')/*/epilogue:*";
+
+ include text svghmi.js
+
+ }
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/geometry.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,144 @@
+// geometry.ysl2
+//
+// Geometry (bounding box intersection) definitions
+
+// This retrieves geometry obtained through "inkscape -S"
+// already parsed by python and presented as a list of
+// <bbox x="0" y="0" w="42" h="42">
+const "geometry", "ns:GetSVGGeometry()";
+
+// Debug data
+emit "debug:geometry" {
+ | ID, x, y, w, h
+ foreach "$geometry"
+ | «@Id» «@x» «@y» «@w» «@h»
+}
+
+// Rates 1D intersection of 2 segments A and B
+// described respectively with a0,a1 and b0,b1
+def "func:intersect_1d" {
+ // it is assumed that a1 > a0 and b1 > b0
+ param "a0";
+ param "a1";
+ param "b0";
+ param "b1";
+
+ const "d0", "$a0 >= $b0";
+ const "d1", "$a1 >= $b1";
+ choose {
+ when "not($d0) and $d1"
+ // b contained in a
+ // a0<b0 b1<a1
+ // a +--------+
+ // b +--+
+ result "3";
+ when "$d0 and not($d1)"
+ // a contained in b
+ // b0<a0 a1<b1
+ // a +--+
+ // b +--------+
+ result "2";
+ when "$d0 and $d1 and $a0 < $b1"
+ // a and b are overlapped
+ // b0<a0<b1<a1
+ // a +-----+
+ // b +-----+
+ result "1";
+ when "not($d0) and not($d1) and $b0 < $a1"
+ // a and b are overlapped
+ // a0<b0<a1<b1
+ // a +-----+
+ // b +-----+
+ result "1";
+ // since orientation doesn't matter,
+ // rated same as previous symetrical overlapping
+ otherwise
+ result "0"; /* no intersection*/
+ }
+}
+
+
+// Rates intersection A and B areas described with x,y,w and h
+// attributes passed as $a and $b parameters.
+//
+// returns :
+// 0 - no intersection
+// .-----.
+// .-----. | b|
+// | | | |
+// | | '-----'
+// |a |
+// '-----'
+//
+// 1 - overlapping
+// .-----.
+// .---|--. b|
+// | | | |
+// | '-----'
+// |a |
+// '------'
+//
+// 2 - overlapping
+// .-----.
+// | a |
+// .---|-----|---.
+// | '-----' |
+// | b |
+// '-------------'
+//
+// 3 - overlapping
+// .-----.
+// | b |
+// .---|-----|---.
+// | '-----' |
+// | a |
+// '-------------'
+//
+// 4 - a contained in b
+// .-------------.
+// | .-----. |
+// | | a | |
+// |b '-----' |
+// '-------------'
+//
+// 6 - overlapping
+// .----.
+// | b|
+// .---|----|---.
+// |a | | |
+// '---|----|---'
+// '----'
+//
+// 9 - b contained in a
+// .-------------.
+// | .-----. |
+// | | b | |
+// |a '-----' |
+// '-------------'
+//
+def "func:intersect" {
+ param "a";
+ param "b";
+
+ const "x_intersect", "func:intersect_1d($a/@x, $a/@x+$a/@w, $b/@x, $b/@x+$b/@w)";
+
+ choose{
+ when "$x_intersect != 0"{
+ const "y_intersect", "func:intersect_1d($a/@y, $a/@y+$a/@h, $b/@y, $b/@y+$b/@h)";
+ result "$x_intersect * $y_intersect";
+ }
+ otherwise result "0";
+ }
+}
+
+// return overlapping geometry for a given element
+// all intersercting element are returned
+// except groups, that must be contained to be counted in
+def "func:overlapping_geometry" {
+ param "elt";
+ const "groups", "/svg:svg | //svg:g";
+ const "g", "$geometry[@Id = $elt/@id]";
+ const "candidates", "$geometry[@Id != $elt/@id]";
+ result """$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or
+ (not(@Id = $groups/@id) and (func:intersect($g, .) > 0 ))]""";
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/hmi_tree.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,163 @@
+// hmi_tree.ysl2
+
+
+// HMI Tree computed from VARIABLES.CSV in svghmi.py
+const "hmitree", "ns:GetHMITree()";
+
+const "_categories" {
+ noindex > HMI_PLC_STATUS
+ noindex > HMI_CURRENT_PAGE
+}
+const "categories", "exsl:node-set($_categories)";
+
+// HMI Tree Index
+const "_indexed_hmitree" apply "$hmitree", mode="index";
+const "indexed_hmitree", "exsl:node-set($_indexed_hmitree)";
+
+emit "preamble:hmi-tree" {
+ | var hmi_hash = [«$hmitree/@hash»];
+ |
+ | var heartbeat_index = «$indexed_hmitree/*[@hmipath = '/HEARTBEAT']/@index»;
+ |
+ | var hmitree_types = [
+
+ foreach "$indexed_hmitree/*"
+ | /* «@index» «@hmipath» */ "«substring(local-name(), 5)»"`if "position()!=last()" > ,`
+
+ | ]
+ |
+}
+
+template "*", mode="index" {
+ param "index", "0";
+ param "parentpath", "''";
+ const "content" {
+ const "path"
+ choose {
+ when "count(ancestor::*)=0" > /
+ when "count(ancestor::*)=1" > /«@name»
+ otherwise > «$parentpath»/«@name»
+ }
+ choose {
+ when "not(local-name() = $categories/noindex)" {
+ xsl:copy {
+ attrib "index" > «$index»
+ attrib "hmipath" > «$path»
+ foreach "@*" xsl:copy;
+ }
+ apply "*[1]", mode="index"{
+ with "index", "$index + 1";
+ with "parentpath" > «$path»
+ }
+ }
+ otherwise {
+ apply "*[1]", mode="index"{
+ with "index", "$index";
+ with "parentpath" > «$path»
+ }
+ }
+ }
+ }
+
+ copy "$content";
+ apply "following-sibling::*[1]", mode="index" {
+ with "index", "$index + count(exsl:node-set($content)/*)";
+ with "parentpath" > «$parentpath»
+ }
+}
+
+// Parses:
+// "HMI:WidgetType:param1:param2@path1@path2"
+//
+// Into:
+// widget type="WidgetType" id="blah456" {
+// arg value="param1";
+// arg value="param2";
+// path value="path1" index="345";
+// path value="path2";
+// }
+//
+template "*", mode="parselabel" {
+ const "label","@inkscape:label";
+ const "description", "substring-after($label,'HMI:')";
+
+ const "_args", "substring-before($description,'@')";
+ const "args" choose {
+ when "$_args" value "$_args";
+ otherwise value "$description";
+ }
+
+ const "_type", "substring-before($args,':')";
+ const "type" choose {
+ when "$_type" value "$_type";
+ otherwise value "$args";
+ }
+
+ if "$type" widget {
+ attrib "id" > «@id»
+ attrib "type" > «$type»
+ foreach "str:split(substring-after($args, ':'), ':')" {
+ arg {
+ attrib "value" > «.»
+ }
+ }
+ const "paths", "substring-after($description,'@')";
+ foreach "str:split($paths, '@')" {
+ if "string-length(.) > 0" path {
+ attrib "value" > «.»
+ const "path", ".";
+ const "item", "$indexed_hmitree/*[@hmipath = $path]";
+ if "count($item) = 1" {
+ attrib "index" > «$item/@index»
+ attrib "type" > «local-name($item)»
+ }
+ }
+ }
+ }
+}
+
+const "_parsed_widgets" apply "$hmi_elements", mode="parselabel";
+const "parsed_widgets","exsl:node-set($_parsed_widgets)";
+
+def "func:widget" {
+ param "id";
+ result "$parsed_widgets/widget[@id = $id]";
+}
+
+def "func:is_descendant_path" {
+ param "descend";
+ param "ancest";
+ // TODO : use HMI tree to answer more accurately
+ result "string-length($ancest) > 0 and starts-with($descend,$ancest)";
+}
+
+def "func:same_class_paths" {
+ param "a";
+ param "b";
+ const "class_a", "$indexed_hmitree/*[@hmipath = $a]/@class";
+ const "class_b", "$indexed_hmitree/*[@hmipath = $b]/@class";
+ result "$class_a and $class_b and $class_a = $class_b";
+}
+
+// Debug data
+template "*", mode="testtree"{
+ param "indent", "''";
+ > «$indent» «local-name()»
+ foreach "@*" > «local-name()»="«.»"
+ > \n
+ apply "*", mode="testtree" {
+ with "indent" value "concat($indent,'>')"
+ };
+}
+
+emit "debug:hmi-tree" {
+ | Raw HMI tree
+ apply "$hmitree", mode="testtree";
+ |
+ | Indexed HMI tree
+ apply "$indexed_hmitree", mode="testtree";
+ |
+ | Parsed Widgets
+ copy "_parsed_widgets";
+ apply "$parsed_widgets", mode="testtree";
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/inline_svg.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,161 @@
+// inline_svg.ysl2
+//
+// Produce Inline SVG element of resulting XHTML page.
+
+// Since stylesheet output namespace is xhtml, templates that output svg have to be explicitely declared as such
+in xsl decl svgtmpl(match, xmlns="http://www.w3.org/2000/svg") alias template;
+in xsl decl svgfunc(name, xmlns="http://www.w3.org/2000/svg") alias template;
+
+
+// Identity template :
+// - copy every attributes
+// - copy every sub-elements
+template "@* | node()", mode="inline_svg" {
+ // use real xsl:copy instead copy-of alias from yslt.yml2
+ if "not(@id = $discardable_elements/@id)"
+ xsl:copy apply "@* | node()", mode="inline_svg";
+}
+
+// replaces inkscape's height and width hints. forces fit
+template "svg:svg/@width", mode="inline_svg";
+template "svg:svg/@height", mode="inline_svg";
+svgtmpl "svg:svg", mode="inline_svg" svg {
+ attrib "preserveAspectRatio" > none
+ attrib "height" > 100vh
+ attrib "width" > 100vw
+ apply "@* | node()", mode="inline_svg";
+}
+// ensure that coordinate in CSV file generated by inkscape are in default reference frame
+template "svg:svg[@viewBox!=concat('0 0 ', @width, ' ', @height)]", mode="inline_svg" {
+ error > ViewBox settings other than X=0, Y=0 and Scale=1 are not supported
+}
+// ensure that coordinate in CSV file generated by inkscape match svg default unit
+template "sodipodi:namedview[@units!='px' or @inkscape:document-units!='px']", mode="inline_svg" {
+ error > All units must be set to "px" in Inkscape's document properties
+}
+
+////// Clone unlinking
+//
+// svg:use (inkscape's clones) inside a widgets are
+// replaced by real elements they refer in order to :
+// - allow finding "needle" element in "meter" widget,
+// even if "needle" is in a group refered by a svg use.
+// - if "needle" is visible through a svg:use for
+// each instance of the widget, then needle would show
+// the same position in all instances
+//
+// For now, clone unlinkink applies to descendants of all widget except HMI:Page
+// TODO: narrow application of clone unlinking to active elements,
+// while keeping static decoration cloned
+const "to_unlink", "$hmi_elements[not(@id = $hmi_pages)]/descendant-or-self::svg:use";
+svgtmpl "svg:use", mode="inline_svg"
+{
+ choose {
+ when "@id = $to_unlink/@id"
+ call "unlink_clone";
+ otherwise
+ xsl:copy apply "@* | node()", mode="inline_svg";
+ }
+}
+
+// to unlink a clone, an group containing a copy of target element is created
+// that way, style and transforms can be preserved
+const "_excluded_use_attrs" {
+ name > href
+ name > width
+ name > height
+ name > x
+ name > y
+}
+const "excluded_use_attrs","exsl:node-set($_excluded_use_attrs)";
+
+const "_merge_use_attrs" {
+ name > transform
+ name > style
+}
+const "merge_use_attrs","exsl:node-set($_merge_use_attrs)";
+
+svgfunc "unlink_clone"{
+ const "targetid","substring-after(@xlink:href,'#')";
+ const "target", "//svg:*[@id = $targetid]";
+ g{
+ choose {
+ when "$target[self::svg:g]" {
+ foreach "@*[not(local-name() = $excluded_use_attrs/name | $merge_use_attrs)]"
+ attrib "{name()}" > «.»
+
+ if "@style | $target/@style"
+ attrib "style" {
+ > «@style»
+ if "@style and $target/@style" > ;
+ > «$target/@style»
+ }
+
+ if "@transform | $target/@transform"
+ attrib "transform" {
+ > «@transform»
+ if "@transform and $target/@transform" >
+ > «$target/@transform»
+ }
+
+ apply "$target/*", mode="unlink_clone"{
+ with "seed","@id";
+ }
+ }
+ otherwise {
+ // include non excluded attributes
+ foreach "@*[not(local-name() = $excluded_use_attrs/name)]"
+ attrib "{name()}" > «.»
+
+ apply "$target", mode="unlink_clone"{
+ with "seed","@id";
+ }
+ }
+ }
+ }
+}
+
+// clone unlinking is really similar to deep-copy
+// all nodes are sytematically copied
+svgtmpl "@id", mode="unlink_clone" {
+ param "seed";
+ attrib "id" > «$seed»_«.»
+}
+
+svgtmpl "@*", mode="unlink_clone" xsl:copy;
+
+// copying widgets would have unwanted effect
+// instead widget is refered through a svg:use.
+svgtmpl "svg:*", mode="unlink_clone" {
+ param "seed";
+ choose {
+ // node recursive copy ends when finding a widget
+ when "@id = $hmi_elements/@id" {
+ // place a clone instead of copying
+ use{
+ attrib "xlink:href" > «concat('#',@id)»
+ }
+ }
+ otherwise {
+ xsl:copy apply "@* | node()", mode="unlink_clone" {
+ with "seed","$seed";
+ }
+ }
+ }
+}
+
+const "result_svg" apply "/", mode="inline_svg";
+const "result_svg_ns", "exsl:node-set($result_svg)";
+
+emit "preamble:inline-svg" {
+ | let id = document.getElementById.bind(document);
+ | var svg_root = id("«$svg/@id»");
+}
+
+emit "debug:clone-unlinking" {
+ |
+ | Unlinked :
+ foreach "$to_unlink"{
+ | «@id»
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/pous.xml Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,50 @@
+<?xml version='1.0' encoding='utf-8'?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201">
+ <fileHeader companyName="Beremiz" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:53:26"/>
+ <contentHeader name="Beremiz non-standard POUs library" modificationDateTime="2019-08-06T14:08:26">
+ <coordinateInfo>
+ <fbd>
+ <scaling x="0" y="0"/>
+ </fbd>
+ <ld>
+ <scaling x="0" y="0"/>
+ </ld>
+ <sfc>
+ <scaling x="0" y="0"/>
+ </sfc>
+ </coordinateInfo>
+ </contentHeader>
+ <types>
+ <dataTypes>
+ <dataType name="HMI_INT">
+ <baseType>
+ <INT/>
+ </baseType>
+ </dataType>
+ <dataType name="HMI_REAL">
+ <baseType>
+ <REAL/>
+ </baseType>
+ </dataType>
+ <dataType name="HMI_STRING">
+ <baseType>
+ <string/>
+ </baseType>
+ </dataType>
+ <dataType name="HMI_BOOL">
+ <baseType>
+ <BOOL/>
+ </baseType>
+ </dataType>
+ <dataType name="HMI_NODE">
+ <baseType>
+ <BOOL/>
+ </baseType>
+ </dataType>
+ </dataTypes>
+ <pous/>
+ </types>
+ <instances>
+ <configurations/>
+ </instances>
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/svghmi.c Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,370 @@
+#include <pthread.h>
+#include <errno.h>
+#include "iec_types_all.h"
+#include "POUS.h"
+#include "config.h"
+#include "beremiz.h"
+
+#define DEFAULT_REFRESH_PERIOD_MS 100
+#define HMI_BUFFER_SIZE %(buffer_size)d
+#define HMI_ITEM_COUNT %(item_count)d
+#define HMI_HASH_SIZE 8
+static uint8_t hmi_hash[HMI_HASH_SIZE] = {%(hmi_hash_ints)s};
+
+/* PLC reads from that buffer */
+static char rbuf[HMI_BUFFER_SIZE];
+
+/* PLC writes to that buffer */
+static char wbuf[HMI_BUFFER_SIZE];
+
+/* TODO change that in case of multiclient... */
+/* worst biggest send buffer. FIXME : use dynamic alloc ? */
+static char sbuf[HMI_HASH_SIZE + HMI_BUFFER_SIZE + (HMI_ITEM_COUNT * sizeof(uint32_t))];
+static unsigned int sbufidx;
+
+%(extern_variables_declarations)s
+
+#define ticktime_ns %(PLC_ticktime)d
+static uint16_t ticktime_ms = (ticktime_ns>1000000)?
+ ticktime_ns/1000000:
+ 1;
+
+typedef enum {
+ buf_free = 0,
+ buf_new,
+ buf_set,
+ buf_tosend
+} buf_state_t;
+
+static int global_write_dirty = 0;
+
+typedef struct {
+ void *ptr;
+ __IEC_types_enum type;
+ uint32_t buf_index;
+
+ /* publish/write/send */
+ long wlock;
+ buf_state_t wstate;
+
+ /* zero means not subscribed */
+ uint16_t refresh_period_ms;
+ uint16_t age_ms;
+
+ /* retrieve/read/recv */
+ long rlock;
+ buf_state_t rstate;
+
+} hmi_tree_item_t;
+
+static hmi_tree_item_t hmi_tree_item[] = {
+%(variable_decl_array)s
+};
+
+typedef int(*hmi_tree_iterator)(uint32_t, hmi_tree_item_t*);
+static int traverse_hmi_tree(hmi_tree_iterator fp)
+{
+ unsigned int i;
+ for(i = 0; i < sizeof(hmi_tree_item)/sizeof(hmi_tree_item_t); i++){
+ hmi_tree_item_t *dsc = &hmi_tree_item[i];
+ int res = (*fp)(i, dsc);
+ if(res != 0){
+ return res;
+ }
+ }
+ return 0;
+}
+
+#define __Unpack_desc_type hmi_tree_item_t
+
+%(var_access_code)s
+
+static int write_iterator(uint32_t index, hmi_tree_item_t *dsc)
+{
+ if(AtomicCompareExchange(&dsc->wlock, 0, 1) == 0)
+ {
+ if(dsc->wstate == buf_set){
+ /* if being subscribed */
+ if(dsc->refresh_period_ms){
+ if(dsc->age_ms + ticktime_ms < dsc->refresh_period_ms){
+ dsc->age_ms += ticktime_ms;
+ }else{
+ dsc->wstate = buf_tosend;
+ global_write_dirty = 1;
+ }
+ }
+ }
+
+ void *dest_p = &wbuf[dsc->buf_index];
+ void *real_value_p = NULL;
+ char flags = 0;
+ void *visible_value_p = UnpackVar(dsc, &real_value_p, &flags);
+
+ /* if new value differs from previous one */
+ USINT sz = __get_type_enum_size(dsc->type);
+ if(__Is_a_string(dsc)){
+ sz = ((STRING*)visible_value_p)->len + 1;
+ }
+ if(dsc->wstate == buf_new /* just subscribed
+ or already subscribed having value change */
+ || (dsc->refresh_period_ms > 0 && memcmp(dest_p, visible_value_p, sz) != 0)){
+ /* copy and flag as set */
+ memcpy(dest_p, visible_value_p, sz);
+ /* if not already marked/signaled, do it */
+ if(dsc->wstate != buf_set && dsc->wstate != buf_tosend) {
+ if(dsc->wstate == buf_new || ticktime_ms > dsc->refresh_period_ms){
+ dsc->wstate = buf_tosend;
+ global_write_dirty = 1;
+ } else {
+ dsc->wstate = buf_set;
+ }
+ dsc->age_ms = 0;
+ }
+ }
+
+ AtomicCompareExchange(&dsc->wlock, 1, 0);
+ }
+ // else ... : PLC can't wait, variable will be updated next turn
+ return 0;
+}
+
+static int send_iterator(uint32_t index, hmi_tree_item_t *dsc)
+{
+ while(AtomicCompareExchange(&dsc->wlock, 0, 1)) sched_yield();
+
+ if(dsc->wstate == buf_tosend)
+ {
+ uint32_t sz = __get_type_enum_size(dsc->type);
+ if(sbufidx + sizeof(uint32_t) + sz <= sizeof(sbuf))
+ {
+ void *src_p = &wbuf[dsc->buf_index];
+ void *dst_p = &sbuf[sbufidx];
+ if(__Is_a_string(dsc)){
+ sz = ((STRING*)src_p)->len + 1;
+ }
+ /* TODO : force into little endian */
+ memcpy(dst_p, &index, sizeof(uint32_t));
+ memcpy(dst_p + sizeof(uint32_t), src_p, sz);
+ dsc->wstate = buf_free;
+ sbufidx += sizeof(uint32_t) /* index */ + sz;
+ }
+ else
+ {
+ printf("BUG!!! %%d + %%ld + %%d > %%ld \n", sbufidx, sizeof(uint32_t), sz, sizeof(sbuf));
+ AtomicCompareExchange(&dsc->wlock, 1, 0);
+ return EOVERFLOW;
+ }
+ }
+
+ AtomicCompareExchange(&dsc->wlock, 1, 0);
+ return 0;
+}
+
+static int read_iterator(uint32_t index, hmi_tree_item_t *dsc)
+{
+ if(AtomicCompareExchange(&dsc->rlock, 0, 1) == 0)
+ {
+ if(dsc->rstate == buf_set)
+ {
+ void *src_p = &rbuf[dsc->buf_index];
+ void *real_value_p = NULL;
+ char flags = 0;
+ void *visible_value_p = UnpackVar(dsc, &real_value_p, &flags);
+ memcpy(real_value_p, src_p, __get_type_enum_size(dsc->type));
+ dsc->rstate = buf_free;
+ }
+ AtomicCompareExchange(&dsc->rlock, 1, 0);
+ }
+ // else ... : PLC can't wait, variable will be updated next turn
+ return 0;
+}
+
+void update_refresh_period(hmi_tree_item_t *dsc, uint16_t refresh_period_ms)
+{
+ while(AtomicCompareExchange(&dsc->wlock, 0, 1)) sched_yield();
+ if(refresh_period_ms) {
+ if(!dsc->refresh_period_ms)
+ {
+ dsc->wstate = buf_new;
+ }
+ } else {
+ dsc->wstate = buf_free;
+ }
+ dsc->refresh_period_ms = refresh_period_ms;
+ AtomicCompareExchange(&dsc->wlock, 1, 0);
+}
+
+static int reset_iterator(uint32_t index, hmi_tree_item_t *dsc)
+{
+ update_refresh_period(dsc, 0);
+ return 0;
+}
+
+void SVGHMI_SuspendFromPythonThread(void);
+void SVGHMI_WakeupFromRTThread(void);
+
+static int continue_collect;
+
+int __init_svghmi()
+{
+ bzero(rbuf,sizeof(rbuf));
+ bzero(wbuf,sizeof(wbuf));
+
+ continue_collect = 1;
+
+ return 0;
+}
+
+void __cleanup_svghmi()
+{
+ continue_collect = 0;
+ SVGHMI_WakeupFromRTThread();
+}
+
+void __retrieve_svghmi()
+{
+ traverse_hmi_tree(read_iterator);
+}
+
+void __publish_svghmi()
+{
+ global_write_dirty = 0;
+ traverse_hmi_tree(write_iterator);
+ if(global_write_dirty) {
+ SVGHMI_WakeupFromRTThread();
+ }
+}
+
+/* PYTHON CALLS */
+int svghmi_send_collect(uint32_t *size, char **ptr){
+
+ SVGHMI_SuspendFromPythonThread();
+
+ if(continue_collect) {
+ int res;
+ sbufidx = HMI_HASH_SIZE;
+ if((res = traverse_hmi_tree(send_iterator)) == 0)
+ {
+ if(sbufidx > HMI_HASH_SIZE){
+ memcpy(&sbuf[0], &hmi_hash[0], HMI_HASH_SIZE);
+ *ptr = &sbuf[0];
+ *size = sbufidx;
+ return 0;
+ }
+ return ENODATA;
+ }
+ // printf("collected BAD result %%d\n", res);
+ return res;
+ }
+ else
+ {
+ return EINTR;
+ }
+}
+
+typedef enum {
+ setval = 0,
+ reset = 1,
+ subscribe = 2
+} cmd_from_JS;
+
+// Returns :
+// 0 is OK, <0 is error, 1 is heartbeat
+int svghmi_recv_dispatch(uint32_t size, const uint8_t *ptr){
+ const uint8_t* cursor = ptr + HMI_HASH_SIZE;
+ const uint8_t* end = ptr + size;
+
+ int was_hearbeat = 0;
+
+ /* match hmitree fingerprint */
+ if(size <= HMI_HASH_SIZE || memcmp(ptr, hmi_hash, HMI_HASH_SIZE) != 0)
+ {
+ printf("svghmi_recv_dispatch MISMATCH !!\n");
+ return -EINVAL;
+ }
+
+ while(cursor < end)
+ {
+ uint32_t progress;
+ cmd_from_JS cmd = *(cursor++);
+ switch(cmd)
+ {
+ case setval:
+ {
+ uint32_t index = *(uint32_t*)(cursor);
+ uint8_t const *valptr = cursor + sizeof(uint32_t);
+
+ if(index == heartbeat_index)
+ was_hearbeat = 1;
+
+ if(index < HMI_ITEM_COUNT)
+ {
+ hmi_tree_item_t *dsc = &hmi_tree_item[index];
+ void *real_value_p = NULL;
+ char flags = 0;
+ void *visible_value_p = UnpackVar(dsc, &real_value_p, &flags);
+ void *dst_p = &rbuf[dsc->buf_index];
+ uint32_t sz = __get_type_enum_size(dsc->type);
+
+ if(__Is_a_string(dsc)){
+ sz = ((STRING*)valptr)->len + 1;
+ }
+
+ if((valptr + sz) <= end)
+ {
+ // rescheduling spinlock until free
+ while(AtomicCompareExchange(&dsc->rlock, 0, 1)) sched_yield();
+
+ memcpy(dst_p, valptr, sz);
+ dsc->rstate = buf_set;
+
+ AtomicCompareExchange(&dsc->rlock, 1, 0);
+ progress = sz + sizeof(uint32_t) /* index */;
+ }
+ else
+ {
+ return -EINVAL;
+ }
+ }
+ else
+ {
+ return -EINVAL;
+ }
+ }
+ break;
+
+ case reset:
+ {
+ progress = 0;
+ traverse_hmi_tree(reset_iterator);
+ }
+ break;
+
+ case subscribe:
+ {
+ uint32_t index = *(uint32_t*)(cursor);
+ uint16_t refresh_period_ms = *(uint32_t*)(cursor + sizeof(uint32_t));
+
+ if(index < HMI_ITEM_COUNT)
+ {
+ hmi_tree_item_t *dsc = &hmi_tree_item[index];
+ update_refresh_period(dsc, refresh_period_ms);
+ }
+ else
+ {
+ return -EINVAL;
+ }
+
+ progress = sizeof(uint32_t) /* index */ +
+ sizeof(uint16_t) /* refresh period */;
+ }
+ break;
+ default:
+ printf("svghmi_recv_dispatch unknown %%d\n",cmd);
+
+ }
+ cursor += progress;
+ }
+ return was_hearbeat;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/svghmi.js Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,450 @@
+// svghmi.js
+
+var cache = hmitree_types.map(_ignored => undefined);
+var updates = {};
+var need_cache_apply = [];
+
+function dispatch_value_to_widget(widget, index, value, oldval) {
+ try {
+ let idx = widget.offset ? index - widget.offset : index;
+ let idxidx = widget.indexes.indexOf(idx);
+ let d = widget.dispatch;
+ if(typeof(d) == "function" && idxidx == 0){
+ d.call(widget, value, oldval);
+ }
+ else if(typeof(d) == "object" && d.length >= idxidx){
+ d[idxidx].call(widget, value, oldval);
+ }
+ /* else dispatch_0, ..., dispatch_n ? */
+ /*else {
+ throw new Error("Dunno how to dispatch to widget at index = " + index);
+ }*/
+ } catch(err) {
+ console.log(err);
+ }
+}
+
+function dispatch_value(index, value) {
+ let widgets = subscribers[index];
+
+ let oldval = cache[index];
+ cache[index] = value;
+
+ if(widgets.size > 0) {
+ for(let widget of widgets){
+ dispatch_value_to_widget(widget, index, value, oldval);
+ }
+ }
+};
+
+function init_widgets() {
+ Object.keys(hmi_widgets).forEach(function(id) {
+ let widget = hmi_widgets[id];
+ let init = widget.init;
+ if(typeof(init) == "function"){
+ try {
+ init.call(widget);
+ } catch(err) {
+ console.log(err);
+ }
+ }
+ });
+};
+
+// Open WebSocket to relative "/ws" address
+var ws = new WebSocket(window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws'));
+ws.binaryType = 'arraybuffer';
+
+const dvgetters = {
+ INT: (dv,offset) => [dv.getInt16(offset, true), 2],
+ BOOL: (dv,offset) => [dv.getInt8(offset, true), 1],
+ NODE: (dv,offset) => [dv.getInt8(offset, true), 1],
+ STRING: (dv, offset) => {
+ size = dv.getInt8(offset);
+ return [
+ String.fromCharCode.apply(null, new Uint8Array(
+ dv.buffer, /* original buffer */
+ offset + 1, /* string starts after size*/
+ size /* size of string */
+ )), size + 1]; /* total increment */
+ }
+};
+
+// Apply updates recieved through ws.onmessage to subscribed widgets
+function apply_updates() {
+ for(let index in updates){
+ // serving as a key, index becomes a string
+ // -> pass Number(index) instead
+ dispatch_value(Number(index), updates[index]);
+ delete updates[index];
+ }
+}
+
+// Called on requestAnimationFrame, modifies DOM
+var requestAnimationFrameID = null;
+function animate() {
+ // Do the page swith if any one pending
+ if(current_subscribed_page != current_visible_page){
+ switch_visible_page(current_subscribed_page);
+ }
+
+ while(widget = need_cache_apply.pop()){
+ widget.apply_cache();
+ }
+
+ if(jumps_need_update) update_jumps();
+
+ apply_updates();
+ requestAnimationFrameID = null;
+}
+
+function requestHMIAnimation() {
+ if(requestAnimationFrameID == null){
+ requestAnimationFrameID = window.requestAnimationFrame(animate);
+ }
+}
+
+// Message reception handler
+// Hash is verified and HMI values updates resulting from binary parsing
+// are stored until browser can compute next frame, DOM is left untouched
+ws.onmessage = function (evt) {
+
+ let data = evt.data;
+ let dv = new DataView(data);
+ let i = 0;
+ try {
+ for(let hash_int of hmi_hash) {
+ if(hash_int != dv.getUint8(i)){
+ throw new Error("Hash doesn't match");
+ };
+ i++;
+ };
+
+ while(i < data.byteLength){
+ let index = dv.getUint32(i, true);
+ i += 4;
+ let iectype = hmitree_types[index];
+ if(iectype != undefined){
+ let dvgetter = dvgetters[iectype];
+ let [value, bytesize] = dvgetter(dv,i);
+ updates[index] = value;
+ i += bytesize;
+ } else {
+ throw new Error("Unknown index "+index);
+ }
+ };
+ // register for rendering on next frame, since there are updates
+ requestHMIAnimation();
+ } catch(err) {
+ // 1003 is for "Unsupported Data"
+ // ws.close(1003, err.message);
+
+ // TODO : remove debug alert ?
+ alert("Error : "+err.message+"\\\\nHMI will be reloaded.");
+
+ // force reload ignoring cache
+ location.reload(true);
+ }
+};
+
+
+function send_blob(data) {
+ if(data.length > 0) {
+ ws.send(new Blob([new Uint8Array(hmi_hash)].concat(data)));
+ };
+};
+
+const typedarray_types = {
+ INT: (number) => new Int16Array([number]),
+ BOOL: (truth) => new Int16Array([truth]),
+ NODE: (truth) => new Int16Array([truth]),
+ STRING: (str) => {
+ // beremiz default string max size is 128
+ str = str.slice(0,128);
+ binary = new Uint8Array(str.length + 1);
+ binary[0] = str.length;
+ for(var i = 0; i < str.length; i++){
+ binary[i+1] = str.charCodeAt(i);
+ }
+ return binary;
+ }
+ /* TODO */
+};
+
+function send_reset() {
+ send_blob(new Uint8Array([1])); /* reset = 1 */
+};
+
+// subscription state, as it should be in hmi server
+// hmitree indexed array of integers
+var subscriptions = hmitree_types.map(_ignored => 0);
+
+// subscription state as needed by widget now
+// hmitree indexed array of Sets of widgets objects
+var subscribers = hmitree_types.map(_ignored => new Set());
+
+// artificially subscribe the watchdog widget to "/heartbeat" hmi variable
+// Since dispatch directly calls change_hmi_value,
+// PLC will periodically send variable at given frequency
+subscribers[heartbeat_index].add({
+ /* type: "Watchdog", */
+ frequency: 1,
+ indexes: [heartbeat_index],
+ dispatch: function(value) {
+ change_hmi_value(heartbeat_index, "+1");
+ }
+});
+
+function update_subscriptions() {
+ let delta = [];
+ for(let index = 0; index < subscribers.length; index++){
+ let widgets = subscribers[index];
+
+ // periods are in ms
+ let previous_period = subscriptions[index];
+
+ // subscribing with a zero period is unsubscribing
+ let new_period = 0;
+ if(widgets.size > 0) {
+ let maxfreq = 0;
+ for(let widget of widgets){
+ let wf = widget.frequency;
+ if(wf != undefined && maxfreq < wf)
+ maxfreq = wf;
+ }
+
+ if(maxfreq != 0)
+ new_period = 1000/maxfreq;
+ }
+
+ if(previous_period != new_period) {
+ subscriptions[index] = new_period;
+ delta.push(
+ new Uint8Array([2]), /* subscribe = 2 */
+ new Uint32Array([index]),
+ new Uint16Array([new_period]));
+ }
+ }
+ send_blob(delta);
+};
+
+function send_hmi_value(index, value) {
+ let iectype = hmitree_types[index];
+ let tobinary = typedarray_types[iectype];
+ send_blob([
+ new Uint8Array([0]), /* setval = 0 */
+ new Uint32Array([index]),
+ tobinary(value)]);
+
+ // DON'T DO THAT unless read_iterator in svghmi.c modifies wbuf as well, not only rbuf
+ // cache[index] = value;
+};
+
+function apply_hmi_value(index, new_val) {
+ let old_val = cache[index]
+ if(new_val != undefined && old_val != new_val)
+ send_hmi_value(index, new_val);
+ return new_val;
+}
+
+quotes = {"'":null, '"':null};
+
+function change_hmi_value(index, opstr) {
+ let op = opstr[0];
+ let given_val;
+ if(opstr.length < 2)
+ return undefined; // TODO raise
+ if(opstr[1] in quotes){
+ if(opstr.length < 3)
+ return undefined; // TODO raise
+ if(opstr[opstr.length-1] == opstr[1]){
+ given_val = opstr.slice(2,opstr.length-1);
+ }
+ } else {
+ given_val = Number(opstr.slice(1));
+ }
+ let old_val = cache[index];
+ let new_val;
+ switch(op){
+ case "=":
+ new_val = given_val;
+ break;
+ case "+":
+ new_val = old_val + given_val;
+ break;
+ case "-":
+ new_val = old_val - given_val;
+ break;
+ case "*":
+ new_val = old_val * given_val;
+ break;
+ case "/":
+ new_val = old_val / given_val;
+ break;
+ }
+ if(new_val != undefined && old_val != new_val)
+ send_hmi_value(index, new_val);
+ // TODO else raise
+ return new_val;
+}
+
+var current_visible_page;
+var current_subscribed_page;
+var current_page_index;
+
+function prepare_svg() {
+ for(let eltid in detachable_elements){
+ let [element,parent] = detachable_elements[eltid];
+ parent.removeChild(element);
+ }
+};
+
+function switch_page(page_name, page_index) {
+ if(current_subscribed_page != current_visible_page){
+ /* page switch already going */
+ /* TODO LOG ERROR */
+ return false;
+ }
+
+ if(page_name == undefined)
+ page_name = current_subscribed_page;
+
+
+ let old_desc = page_desc[current_subscribed_page];
+ let new_desc = page_desc[page_name];
+
+ if(new_desc == undefined){
+ /* TODO LOG ERROR */
+ return false;
+ }
+
+ if(page_index == undefined){
+ page_index = new_desc.page_index;
+ }
+
+ if(old_desc){
+ old_desc.absolute_widgets.map(w=>w.unsub());
+ old_desc.relative_widgets.map(w=>w.unsub());
+ }
+ new_desc.absolute_widgets.map(w=>w.sub());
+ var new_offset = page_index == undefined ? 0 : page_index - new_desc.page_index;
+ new_desc.relative_widgets.map(w=>w.sub(new_offset));
+
+ update_subscriptions();
+
+ current_subscribed_page = page_name;
+ current_page_index = page_index;
+
+ jumps_need_update = true;
+
+ requestHMIAnimation();
+
+ jump_history.push([page_name, page_index]);
+ if(jump_history.length > 42)
+ jump_history.shift();
+
+ return true;
+};
+
+function switch_visible_page(page_name) {
+
+ let old_desc = page_desc[current_visible_page];
+ let new_desc = page_desc[page_name];
+
+ if(old_desc){
+ for(let eltid in old_desc.required_detachables){
+ if(!(eltid in new_desc.required_detachables)){
+ let [element, parent] = old_desc.required_detachables[eltid];
+ parent.removeChild(element);
+ }
+ }
+ for(let eltid in new_desc.required_detachables){
+ if(!(eltid in old_desc.required_detachables)){
+ let [element, parent] = new_desc.required_detachables[eltid];
+ parent.appendChild(element);
+ }
+ }
+ }else{
+ for(let eltid in new_desc.required_detachables){
+ let [element, parent] = new_desc.required_detachables[eltid];
+ parent.appendChild(element);
+ }
+ }
+
+ svg_root.setAttribute('viewBox',new_desc.bbox.join(" "));
+ current_visible_page = page_name;
+};
+
+// Once connection established
+ws.onopen = function (evt) {
+ init_widgets();
+ send_reset();
+ // show main page
+ prepare_svg();
+ switch_page(default_page);
+};
+
+ws.onclose = function (evt) {
+ // TODO : add visible notification while waiting for reload
+ console.log("Connection closed. code:"+evt.code+" reason:"+evt.reason+" wasClean:"+evt.wasClean+" Reload in 10s.");
+ // TODO : re-enable auto reload when not in debug
+ //window.setTimeout(() => location.reload(true), 10000);
+ alert("Connection closed. code:"+evt.code+" reason:"+evt.reason+" wasClean:"+evt.wasClean+".");
+
+};
+
+var xmlns = "http://www.w3.org/2000/svg";
+var edit_callback;
+function edit_value(path, valuetype, callback, initial) {
+
+ let [keypadid, xcoord, ycoord] = keypads[valuetype];
+ console.log('XXX TODO : Edit value', path, valuetype, callback, initial, keypadid);
+ edit_callback = callback;
+ let widget = hmi_widgets[keypadid];
+ widget.start_edit(path, valuetype, callback, initial);
+};
+
+var current_modal; /* TODO stack ?*/
+
+function show_modal() {
+ let [element, parent] = detachable_elements[this.element.id];
+
+ tmpgrp = document.createElementNS(xmlns,"g");
+ tmpgrpattr = document.createAttribute("transform");
+
+ let [xcoord,ycoord] = this.coordinates;
+ let [xdest,ydest] = page_desc[current_visible_page].bbox;
+ tmpgrpattr.value = "translate("+String(xdest-xcoord)+","+String(ydest-ycoord)+")";
+ tmpgrp.setAttributeNode(tmpgrpattr);
+
+ tmpgrp.appendChild(element);
+ parent.appendChild(tmpgrp);
+
+ current_modal = [this.element.id, tmpgrp];
+};
+
+function end_modal() {
+ let [eltid, tmpgrp] = current_modal;
+ let [element, parent] = detachable_elements[this.element.id];
+
+ parent.removeChild(tmpgrp);
+
+ current_modal = undefined;
+};
+
+function widget_active_activable(eltsub) {
+ if(eltsub.inactive_style === undefined)
+ eltsub.inactive_style = eltsub.inactive.getAttribute("style");
+ eltsub.inactive.setAttribute("style", "display:none");
+ if(eltsub.active_style !== undefined)
+ eltsub.active.setAttribute("style", eltsub.active_style);
+ console.log("active", eltsub);
+};
+function widget_inactive_activable(eltsub) {
+ if(eltsub.active_style === undefined)
+ eltsub.active_style = eltsub.active.getAttribute("style");
+ eltsub.active.setAttribute("style", "display:none");
+ if(eltsub.inactive_style !== undefined)
+ eltsub.inactive.setAttribute("style", eltsub.inactive_style);
+ console.log("inactive", eltsub);
+};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/svghmi.py Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,645 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# This file is part of Beremiz
+# Copyright (C) 2019: Edouard TISSERANT
+#
+# See COPYING file for copyrights details.
+
+from __future__ import absolute_import
+import os
+import shutil
+from itertools import izip, imap
+from pprint import pformat
+import hashlib
+import weakref
+import shlex
+
+import wx
+import wx.dataview as dv
+
+from lxml import etree
+from lxml.etree import XSLTApplyError
+
+import util.paths as paths
+from POULibrary import POULibrary
+from docutil import open_svg, get_inkscape_path
+
+from util.ProcessLogger import ProcessLogger
+from runtime.typemapping import DebugTypesSize
+import targets
+from editors.ConfTreeNodeEditor import ConfTreeNodeEditor
+from XSLTransform import XSLTransform
+
+HMI_TYPES_DESC = {
+ "HMI_NODE":{},
+ "HMI_STRING":{},
+ "HMI_INT":{},
+ "HMI_BOOL":{}
+}
+
+HMI_TYPES = HMI_TYPES_DESC.keys()
+
+
+ScriptDirectory = paths.AbsDir(__file__)
+
+class HMITreeNode(object):
+ def __init__(self, path, name, nodetype, iectype = None, vartype = None, cpath = None, hmiclass = None):
+ self.path = path
+ self.name = name
+ self.nodetype = nodetype
+ self.hmiclass = hmiclass
+
+ if iectype is not None:
+ self.iectype = iectype
+ self.vartype = vartype
+ self.cpath = cpath
+
+ if nodetype in ["HMI_NODE"]:
+ self.children = []
+
+ def pprint(self, indent = 0):
+ res = ">"*indent + pformat(self.__dict__, indent = indent, depth = 1) + "\n"
+ if hasattr(self, "children"):
+ res += "\n".join([child.pprint(indent = indent + 1)
+ for child in self.children])
+ res += "\n"
+
+ return res
+
+ def place_node(self, node):
+ best_child = None
+ known_best_match = 0
+ potential_siblings = {}
+ for child in self.children:
+ if child.path is not None:
+ in_common = 0
+ for child_path_item, node_path_item in izip(child.path, node.path):
+ if child_path_item == node_path_item:
+ in_common +=1
+ else:
+ break
+ # Match can only be HMI_NODE, and the whole path of node
+ # must match candidate node (except for name part)
+ # since candidate would become child of that node
+ if in_common > known_best_match and \
+ child.nodetype == "HMI_NODE" and \
+ in_common == len(child.path) - 1:
+ known_best_match = in_common
+ best_child = child
+ else:
+ potential_siblings[child.path[
+ -2 if child.nodetype == "HMI_NODE" else -1]] = child
+ if best_child is not None:
+ if node.nodetype == "HMI_NODE" and best_child.path[:-1] == node.path[:-1]:
+ return "Duplicate_HMI_NODE", best_child
+ return best_child.place_node(node)
+ else:
+ candidate_name = node.path[-2 if node.nodetype == "HMI_NODE" else -1]
+ if candidate_name in potential_siblings:
+ return "Non_Unique", potential_siblings[candidate_name]
+
+ if node.nodetype == "HMI_NODE" and len(self.children) > 0:
+ prev = self.children[-1]
+ if prev.path[:-1] == node.path[:-1]:
+ return "Late_HMI_NODE",prev
+
+ self.children.append(node)
+ return None
+
+ def etree(self, add_hash=False):
+
+ attribs = dict(name=self.name)
+ if self.path is not None:
+ attribs["path"] = ".".join(self.path)
+
+ if self.hmiclass is not None:
+ attribs["class"] = self.hmiclass
+
+ if add_hash:
+ attribs["hash"] = ",".join(map(str,self.hash()))
+
+ res = etree.Element(self.nodetype, **attribs)
+
+ if hasattr(self, "children"):
+ for child_etree in imap(lambda c:c.etree(), self.children):
+ res.append(child_etree)
+
+ return res
+
+ def traverse(self):
+ yield self
+ if hasattr(self, "children"):
+ for c in self.children:
+ for yoodl in c.traverse():
+ yield yoodl
+
+
+ def hash(self):
+ """ Produce a hash, any change in HMI tree structure change that hash """
+ s = hashlib.new('md5')
+ self._hash(s)
+ # limit size to HMI_HASH_SIZE as in svghmi.c
+ return map(ord,s.digest())[:8]
+
+ def _hash(self, s):
+ s.update(str((self.name,self.nodetype)))
+ if hasattr(self, "children"):
+ for c in self.children:
+ c._hash(s)
+
+# module scope for HMITree root
+# so that CTN can use HMITree deduced in Library
+# note: this only works because library's Generate_C is
+# systematicaly invoked before CTN's CTNGenerate_C
+
+hmi_tree_root = None
+
+on_hmitree_update = None
+
+SPECIAL_NODES = [("HMI_ROOT", "HMI_NODE"),
+ ("heartbeat", "HMI_INT")]
+ # ("current_page", "HMI_STRING")])
+
+class SVGHMILibrary(POULibrary):
+ def GetLibraryPath(self):
+ return paths.AbsNeighbourFile(__file__, "pous.xml")
+
+ def Generate_C(self, buildpath, varlist, IECCFLAGS):
+ global hmi_tree_root, on_hmitree_update
+
+ """
+ PLC Instance Tree:
+ prog0
+ +->v1 HMI_INT
+ +->v2 HMI_INT
+ +->fb0 (type mhoo)
+ | +->va HMI_NODE
+ | +->v3 HMI_INT
+ | +->v4 HMI_INT
+ |
+ +->fb1 (type mhoo)
+ | +->va HMI_NODE
+ | +->v3 HMI_INT
+ | +->v4 HMI_INT
+ |
+ +->fb2
+ +->v5 HMI_IN
+
+ HMI tree:
+ hmi0
+ +->v1
+ +->v2
+ +->fb0 class:va
+ | +-> v3
+ | +-> v4
+ |
+ +->fb1 class:va
+ | +-> v3
+ | +-> v4
+ |
+ +->v5
+
+ """
+
+ # Filter known HMI types
+ hmi_types_instances = [v for v in varlist if v["derived"] in HMI_TYPES]
+
+ hmi_tree_root = None
+
+ # take first HMI_NODE (placed as special node), make it root
+ for i,v in enumerate(hmi_types_instances):
+ path = v["IEC_path"].split(".")
+ derived = v["derived"]
+ if derived == "HMI_NODE":
+ hmi_tree_root = HMITreeNode(path, "", derived, v["type"], v["vartype"], v["C_path"])
+ hmi_types_instances.pop(i)
+ break
+
+ assert(hmi_tree_root is not None)
+
+ # deduce HMI tree from PLC HMI_* instances
+ for v in hmi_types_instances:
+ path = v["IEC_path"].split(".")
+ # ignores variables starting with _TMP_
+ if path[-1].startswith("_TMP_"):
+ continue
+ derived = v["derived"]
+ kwargs={}
+ if derived == "HMI_NODE":
+ # TODO : make problem if HMI_NODE used in CONFIG or RESOURCE
+ name = path[-2]
+ kwargs['hmiclass'] = path[-1]
+ else:
+ name = path[-1]
+ new_node = HMITreeNode(path, name, derived, v["type"], v["vartype"], v["C_path"], **kwargs)
+ placement_result = hmi_tree_root.place_node(new_node)
+ if placement_result is not None:
+ cause, problematic_node = placement_result
+ if cause == "Non_Unique":
+ message = _("HMI tree nodes paths are not unique.\nConflicting variable: {} {}").format(
+ ".".join(problematic_node.path),
+ ".".join(new_node.path))
+
+ last_FB = None
+ for v in varlist:
+ if v["vartype"] == "FB":
+ last_FB = v
+ if v["C_path"] == problematic_node:
+ break
+ if last_FB is not None:
+ failing_parent = last_FB["type"]
+ message += "\n"
+ message += _("Solution: Add HMI_NODE at beginning of {}").format(failing_parent)
+
+ elif cause in ["Late_HMI_NODE", "Duplicate_HMI_NODE"]:
+ cause, problematic_node = placement_result
+ message = _("There must be only one occurrence of HMI_NODE before any HMI_* variable in POU.\nConflicting variable: {} {}").format(
+ ".".join(problematic_node.path),
+ ".".join(new_node.path))
+
+ self.FatalError("SVGHMI : " + message)
+
+ if on_hmitree_update is not None:
+ on_hmitree_update()
+
+ variable_decl_array = []
+ extern_variables_declarations = []
+ buf_index = 0
+ item_count = 0
+ found_heartbeat = False
+
+ hearbeat_IEC_path = ['CONFIG', 'HEARTBEAT']
+
+ for node in hmi_tree_root.traverse():
+ if not found_heartbeat and node.path == hearbeat_IEC_path:
+ hmi_tree_hearbeat_index = item_count
+ found_heartbeat = True
+ extern_variables_declarations += [
+ "#define heartbeat_index "+str(hmi_tree_hearbeat_index)
+ ]
+ if hasattr(node, "iectype"):
+ sz = DebugTypesSize.get(node.iectype, 0)
+ variable_decl_array += [
+ "{&(" + node.cpath + "), " + node.iectype + {
+ "EXT": "_P_ENUM",
+ "IN": "_P_ENUM",
+ "MEM": "_O_ENUM",
+ "OUT": "_O_ENUM",
+ "VAR": "_ENUM"
+ }[node.vartype] + ", " +
+ str(buf_index) + ", 0, }"]
+ buf_index += sz
+ item_count += 1
+ if len(node.path) == 1:
+ extern_variables_declarations += [
+ "extern __IEC_" + node.iectype + "_" +
+ "t" if node.vartype is "VAR" else "p"
+ + node.cpath + ";"]
+
+ assert(found_heartbeat)
+
+ # TODO : filter only requiered external declarations
+ for v in varlist:
+ if v["C_path"].find('.') < 0:
+ extern_variables_declarations += [
+ "extern %(type)s %(C_path)s;" % v]
+
+ # TODO check if programs need to be declared separately
+ # "programs_declarations": "\n".join(["extern %(type)s %(C_path)s;" %
+ # p for p in self._ProgramList]),
+
+ # C code to observe/access HMI tree variables
+ svghmi_c_filepath = paths.AbsNeighbourFile(__file__, "svghmi.c")
+ svghmi_c_file = open(svghmi_c_filepath, 'r')
+ svghmi_c_code = svghmi_c_file.read()
+ svghmi_c_file.close()
+ svghmi_c_code = svghmi_c_code % {
+ "variable_decl_array": ",\n".join(variable_decl_array),
+ "extern_variables_declarations": "\n".join(extern_variables_declarations),
+ "buffer_size": buf_index,
+ "item_count": item_count,
+ "var_access_code": targets.GetCode("var_access.c"),
+ "PLC_ticktime": self.GetCTR().GetTicktime(),
+ "hmi_hash_ints": ",".join(map(str,hmi_tree_root.hash()))
+ }
+
+ gen_svghmi_c_path = os.path.join(buildpath, "svghmi.c")
+ gen_svghmi_c = open(gen_svghmi_c_path, 'w')
+ gen_svghmi_c.write(svghmi_c_code)
+ gen_svghmi_c.close()
+
+ # Python based WebSocket HMITree Server
+ svghmiserverfile = open(paths.AbsNeighbourFile(__file__, "svghmi_server.py"), 'r')
+ svghmiservercode = svghmiserverfile.read()
+ svghmiserverfile.close()
+
+ runtimefile_path = os.path.join(buildpath, "runtime_svghmi.py")
+ runtimefile = open(runtimefile_path, 'w')
+ runtimefile.write(svghmiservercode)
+ runtimefile.close()
+
+ return ((["svghmi"], [(gen_svghmi_c_path, IECCFLAGS)], True), "",
+ ("runtime_svghmi0.py", open(runtimefile_path, "rb")))
+
+
+class HMITreeSelector(wx.TreeCtrl):
+ def __init__(self, parent):
+ global on_hmitree_update
+ wx.TreeCtrl.__init__(self,parent,style=wx.TR_MULTIPLE)# | wx.TR_HIDE_ROOT)
+
+ isz = (16,16)
+ self.il = il = wx.ImageList(*isz)
+ self.fldridx = il.AddIcon(wx.ArtProvider.GetIcon(wx.ART_FOLDER, wx.ART_OTHER, isz))
+ self.fldropenidx = il.AddIcon(wx.ArtProvider.GetIcon(wx.ART_FOLDER_OPEN, wx.ART_OTHER, isz))
+ self.fileidx = il.AddIcon(wx.ArtProvider.GetIcon(wx.ART_NORMAL_FILE, wx.ART_OTHER, isz))
+ self.SetImageList(il)
+
+ on_hmitree_update = self.SVGHMIEditorUpdater()
+ self.MakeTree()
+
+ def _recurseTree(self, current_hmitree_root, current_tc_root):
+ for c in current_hmitree_root.children:
+ if hasattr(c, "children"):
+ display_name = ('{} (class={})'.format(c.name, c.hmiclass)) \
+ if c.hmiclass is not None else c.name
+ tc_child = self.AppendItem(current_tc_root, display_name)
+ self.SetPyData(tc_child, None)
+ self.SetItemImage(tc_child, self.fldridx, wx.TreeItemIcon_Normal)
+ self.SetItemImage(tc_child, self.fldropenidx, wx.TreeItemIcon_Expanded)
+
+ self._recurseTree(c,tc_child)
+ else:
+ display_name = '{} {}'.format(c.nodetype[4:], c.name)
+ tc_child = self.AppendItem(current_tc_root, display_name)
+ self.SetPyData(tc_child, None)
+ self.SetItemImage(tc_child, self.fileidx, wx.TreeItemIcon_Normal)
+ self.SetItemImage(tc_child, self.fileidx, wx.TreeItemIcon_Expanded)
+
+ def MakeTree(self):
+ global hmi_tree_root
+
+ self.Freeze()
+
+ self.root = None
+ self.DeleteAllItems()
+
+ root_display_name = _("Please build to see HMI Tree") if hmi_tree_root is None else "HMI"
+ self.root = self.AddRoot(root_display_name)
+ self.SetPyData(self.root, None)
+ self.SetItemImage(self.root, self.fldridx, wx.TreeItemIcon_Normal)
+ self.SetItemImage(self.root, self.fldropenidx, wx.TreeItemIcon_Expanded)
+
+ if hmi_tree_root is not None:
+ self._recurseTree(hmi_tree_root, self.root)
+
+ self.Thaw()
+
+ def SVGHMIEditorUpdater(self):
+ selfref = weakref.ref(self)
+ def SVGHMIEditorUpdate():
+ o = selfref()
+ if o is not None:
+ wx.CallAfter(o.MakeTree)
+ return SVGHMIEditorUpdate
+
+class HMITreeView(wx.SplitterWindow):
+
+ def __init__(self, parent):
+ wx.SplitterWindow.__init__(self, parent,
+ style=wx.SUNKEN_BORDER | wx.SP_3D)
+
+ self.SelectionTree = HMITreeSelector(self)
+ #self.Staging = wx.Panel(self)
+ #self.SplitHorizontally(self.SelectionTree, self.Staging, 200)
+ self.Initialize(self.SelectionTree)
+
+
+class SVGHMIEditor(ConfTreeNodeEditor):
+ CONFNODEEDITOR_TABS = [
+ (_("HMI Tree"), "CreateHMITreeView")]
+
+ def CreateHMITreeView(self, parent):
+ #self.HMITreeView = HMITreeView(self)
+ return HMITreeSelector(parent)
+
+
+class SVGHMI(object):
+ XSD = """<?xml version="1.0" encoding="utf-8" ?>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="SVGHMI">
+ <xsd:complexType>
+ <xsd:attribute name="OnStart" type="xsd:string" use="optional"/>
+ <xsd:attribute name="OnStop" type="xsd:string" use="optional"/>
+ <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional"/>
+ <xsd:attribute name="WatchdogInitial" type="xsd:integer" use="optional"/>
+ <xsd:attribute name="WatchdogInterval" type="xsd:integer" use="optional"/>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ """
+
+ EditorType = SVGHMIEditor
+
+ ConfNodeMethods = [
+ {
+ "bitmap": "ImportSVG",
+ "name": _("Import SVG"),
+ "tooltip": _("Import SVG"),
+ "method": "_ImportSVG"
+ },
+ {
+ "bitmap": "ImportSVG", # should be something different
+ "name": _("Inkscape"),
+ "tooltip": _("Edit HMI"),
+ "method": "_StartInkscape"
+ },
+
+ # TODO : Launch POEdit button
+ # PO -> SVG layers button
+ # SVG layers -> PO
+
+ # TODO : HMITree button
+ # - can drag'n'drop variabes to Inkscape
+
+ ]
+
+ def _getSVGpath(self, project_path=None):
+ if project_path is None:
+ project_path = self.CTNPath()
+ return os.path.join(project_path, "svghmi.svg")
+
+
+ def OnCTNSave(self, from_project_path=None):
+ if from_project_path is not None:
+ shutil.copyfile(self._getSVGpath(from_project_path),
+ self._getSVGpath())
+ return True
+
+ def GetSVGGeometry(self):
+ # invoke inskscape -S, csv-parse output, produce elements
+ InkscapeGeomColumns = ["Id", "x", "y", "w", "h"]
+
+ inkpath = get_inkscape_path()
+ svgpath = self._getSVGpath()
+ _status, result, _err_result = ProcessLogger(None,
+ inkpath + " -S " + svgpath,
+ no_stdout=True,
+ no_stderr=True).spin()
+ res = []
+ for line in result.split():
+ strippedline = line.strip()
+ attrs = dict(
+ zip(InkscapeGeomColumns, line.strip().split(',')))
+
+ res.append(etree.Element("bbox", **attrs))
+
+ return res
+
+ def GetHMITree(self):
+ global hmi_tree_root
+ res = [hmi_tree_root.etree(add_hash=True)]
+ return res
+
+ def CTNGenerate_C(self, buildpath, locations):
+
+ location_str = "_".join(map(str, self.GetCurrentLocation()))
+ view_name = self.BaseParams.getName()
+
+ svgfile = self._getSVGpath()
+
+ res = ([], "", False)
+
+ target_fname = "svghmi_"+location_str+".xhtml"
+
+ target_path = os.path.join(self._getBuildPath(), target_fname)
+ target_file = open(target_path, 'wb')
+
+ if os.path.exists(svgfile):
+
+ # TODO : move to __init__
+ transform = XSLTransform(os.path.join(ScriptDirectory, "gen_index_xhtml.xslt"),
+ [("GetSVGGeometry", lambda *_ignored:self.GetSVGGeometry()),
+ ("GetHMITree", lambda *_ignored:self.GetHMITree())])
+
+
+ # load svg as a DOM with Etree
+ svgdom = etree.parse(svgfile)
+
+ # call xslt transform on Inkscape's SVG to generate XHTML
+ try:
+ result = transform.transform(svgdom)
+ except XSLTApplyError as e:
+ self.FatalError("SVGHMI " + view_name + ": " + e.message)
+ finally:
+ for entry in transform.get_error_log():
+ message = "SVGHMI: "+ entry.message + "\n"
+ self.GetCTRoot().logger.write_warning(message)
+
+ result.write(target_file, encoding="utf-8")
+ # print(str(result))
+ # print(transform.xslt.error_log)
+
+ # TODO
+ # - Errors on HMI semantics
+ # - ... maybe something to have a global view of what is declared in SVG.
+
+ else:
+ # TODO : use default svg that expose the HMI tree as-is
+ target_file.write("""<!DOCTYPE html>
+<html>
+<body>
+<h1> No SVG file provided </h1>
+</body>
+</html>
+""")
+
+ target_file.close()
+
+ res += ((target_fname, open(target_path, "rb")),)
+
+ svghmi_cmds = {}
+ for thing in ["Start", "Stop", "Watchdog"]:
+ given_command = self.GetParamsAttributes("SVGHMI.On"+thing)["value"]
+ svghmi_cmds[thing] = (
+ "Popen(" +
+ repr(shlex.split(given_command.format(port="8008", name=view_name))) +
+ ")") if given_command else "pass # no command given"
+
+ runtimefile_path = os.path.join(buildpath, "runtime_svghmi1_%s.py" % location_str)
+ runtimefile = open(runtimefile_path, 'w')
+ runtimefile.write("""
+# TODO : multiple watchdog (one for each svghmi instance)
+def svghmi_watchdog_trigger():
+ {svghmi_cmds[Watchdog]}
+
+svghmi_watchdog = None
+
+def _runtime_svghmi1_{location}_start():
+ global svghmi_watchdog
+ svghmi_root.putChild(
+ '{view_name}',
+ NoCacheFile('{xhtml}',
+ defaultType='application/xhtml+xml'))
+
+ {svghmi_cmds[Start]}
+
+ svghmi_watchdog = Watchdog(
+ {watchdog_initial},
+ {watchdog_interval},
+ svghmi_watchdog_trigger)
+
+def _runtime_svghmi1_{location}_stop():
+ global svghmi_watchdog
+ if svghmi_watchdog is not None:
+ svghmi_watchdog.cancel()
+ svghmi_watchdog = None
+
+ svghmi_root.delEntity('{view_name}')
+ {svghmi_cmds[Stop]}
+
+ """.format(location=location_str,
+ xhtml=target_fname,
+ view_name=view_name,
+ svghmi_cmds=svghmi_cmds,
+ watchdog_initial = self.GetParamsAttributes("SVGHMI.WatchdogInitial")["value"],
+ watchdog_interval = self.GetParamsAttributes("SVGHMI.WatchdogInterval")["value"],
+ ))
+
+ runtimefile.close()
+
+ res += (("runtime_svghmi1_%s.py" % location_str, open(runtimefile_path, "rb")),)
+
+ return res
+
+ def _ImportSVG(self):
+ dialog = wx.FileDialog(self.GetCTRoot().AppFrame, _("Choose a SVG file"), os.getcwd(), "", _("SVG files (*.svg)|*.svg|All files|*.*"), wx.OPEN)
+ if dialog.ShowModal() == wx.ID_OK:
+ svgpath = dialog.GetPath()
+ if os.path.isfile(svgpath):
+ shutil.copy(svgpath, self._getSVGpath())
+ else:
+ self.GetCTRoot().logger.write_error(_("No such SVG file: %s\n") % svgpath)
+ dialog.Destroy()
+
+ def _StartInkscape(self):
+ svgfile = self._getSVGpath()
+ open_inkscape = True
+ if not self.GetCTRoot().CheckProjectPathPerm():
+ dialog = wx.MessageDialog(self.GetCTRoot().AppFrame,
+ _("You don't have write permissions.\nOpen Inkscape anyway ?"),
+ _("Open Inkscape"),
+ wx.YES_NO | wx.ICON_QUESTION)
+ open_inkscape = dialog.ShowModal() == wx.ID_YES
+ dialog.Destroy()
+ if open_inkscape:
+ if not os.path.isfile(svgfile):
+ svgfile = None
+ open_svg(svgfile)
+
+ def CTNGlobalInstances(self):
+ # view_name = self.BaseParams.getName()
+ # return [ (view_name + "_" + name, iec_type, "") for name, iec_type in SPECIAL_NODES]
+ # TODO : move to library level for multiple hmi
+ return [(name, iec_type, "") for name, iec_type in SPECIAL_NODES]
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/svghmi_server.py Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,204 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# This file is part of Beremiz
+# Copyright (C) 2019: Edouard TISSERANT
+# See COPYING file for copyrights details.
+
+from __future__ import absolute_import
+import errno
+from threading import RLock, Timer
+
+try:
+ from runtime.spawn_subprocess import Popen
+except ImportError:
+ from subprocess import Popen
+
+from twisted.web.server import Site
+from twisted.web.resource import Resource
+from twisted.internet import reactor
+from twisted.web.static import File
+
+from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol
+from autobahn.websocket.protocol import WebSocketProtocol
+from autobahn.twisted.resource import WebSocketResource
+
+# TODO multiclient :
+# session list lock
+# svghmi_sessions = []
+# svghmi_watchdogs = []
+
+svghmi_session = None
+svghmi_watchdog = None
+
+svghmi_send_collect = PLCBinary.svghmi_send_collect
+svghmi_send_collect.restype = ctypes.c_int # error or 0
+svghmi_send_collect.argtypes = [
+ ctypes.POINTER(ctypes.c_uint32), # size
+ ctypes.POINTER(ctypes.c_void_p)] # data ptr
+# TODO multiclient : switch to arrays
+
+svghmi_recv_dispatch = PLCBinary.svghmi_recv_dispatch
+svghmi_recv_dispatch.restype = ctypes.c_int # error or 0
+svghmi_recv_dispatch.argtypes = [
+ ctypes.c_uint32, # size
+ ctypes.c_char_p] # data ptr
+# TODO multiclient : switch to arrays
+
+class HMISession(object):
+ def __init__(self, protocol_instance):
+ global svghmi_session
+
+ # Single client :
+ # Creating a new HMISession closes pre-existing HMISession
+ if svghmi_session is not None:
+ svghmi_session.close()
+ svghmi_session = self
+ self.protocol_instance = protocol_instance
+
+ # TODO multiclient :
+ # svghmi_sessions.append(self)
+ # get a unique bit index amont other svghmi_sessions,
+ # so that we can match flags passed by C->python callback
+
+ def close(self):
+ global svghmi_session
+ if svghmi_session == self:
+ svghmi_session = None
+ self.protocol_instance.sendClose(WebSocketProtocol.CLOSE_STATUS_CODE_NORMAL)
+
+ def onMessage(self, msg):
+ # pass message to the C side recieve_message()
+ return svghmi_recv_dispatch(len(msg), msg)
+
+ # TODO multiclient : pass client index as well
+
+ def sendMessage(self, msg):
+ self.protocol_instance.sendMessage(msg, True)
+ return 0
+
+class Watchdog(object):
+ def __init__(self, initial_timeout, interval, callback):
+ self._callback = callback
+ self.lock = RLock()
+ self.initial_timeout = initial_timeout
+ self.interval = interval
+ self.callback = callback
+ with self.lock:
+ self._start()
+
+ def _start(self, rearm=False):
+ duration = self.interval if rearm else self.initial_timeout
+ if duration:
+ self.timer = Timer(duration, self.trigger)
+ self.timer.start()
+ else:
+ self.timer = None
+
+ def _stop(self):
+ if self.timer is not None:
+ self.timer.cancel()
+ self.timer = None
+
+ def cancel(self):
+ with self.lock:
+ self._stop()
+
+ def feed(self, rearm=True):
+ with self.lock:
+ self._stop()
+ self._start(rearm)
+
+ def trigger(self):
+ self._callback()
+ # wait for initial timeout on re-start
+ self.feed(rearm=False)
+
+class HMIProtocol(WebSocketServerProtocol):
+
+ def __init__(self, *args, **kwargs):
+ self._hmi_session = None
+ WebSocketServerProtocol.__init__(self, *args, **kwargs)
+
+ def onOpen(self):
+ assert(self._hmi_session is None)
+ self._hmi_session = HMISession(self)
+
+ def onClose(self, wasClean, code, reason):
+ self._hmi_session = None
+
+ def onMessage(self, msg, isBinary):
+ assert(self._hmi_session is not None)
+
+ result = self._hmi_session.onMessage(msg)
+ if result == 1 : # was heartbeat
+ if svghmi_watchdog is not None:
+ svghmi_watchdog.feed()
+
+class HMIWebSocketServerFactory(WebSocketServerFactory):
+ protocol = HMIProtocol
+
+svghmi_root = None
+svghmi_listener = None
+svghmi_send_thread = None
+
+def SendThreadProc():
+ global svghmi_session
+ size = ctypes.c_uint32()
+ ptr = ctypes.c_void_p()
+ res = 0
+ while True:
+ res=svghmi_send_collect(ctypes.byref(size), ctypes.byref(ptr))
+ if res == 0:
+ # TODO multiclient : dispatch to sessions
+ if svghmi_session is not None:
+ svghmi_session.sendMessage(ctypes.string_at(ptr.value,size.value))
+ elif res == errno.ENODATA:
+ # this happens when there is no data after wakeup
+ # because of hmi data refresh period longer than PLC common ticktime
+ pass
+ else:
+ # this happens when finishing
+ break
+
+
+def watchdog_trigger():
+ print("SVGHMI watchdog trigger")
+
+
+# Called by PLCObject at start
+def _runtime_svghmi0_start():
+ global svghmi_listener, svghmi_root, svghmi_send_thread
+
+ svghmi_root = Resource()
+ svghmi_root.putChild("ws", WebSocketResource(HMIWebSocketServerFactory()))
+
+ svghmi_listener = reactor.listenTCP(8008, Site(svghmi_root))
+
+ # start a thread that call the C part of SVGHMI
+ svghmi_send_thread = Thread(target=SendThreadProc, name="SVGHMI Send")
+ svghmi_send_thread.start()
+
+
+# Called by PLCObject at stop
+def _runtime_svghmi0_stop():
+ global svghmi_listener, svghmi_root, svghmi_send_thread, svghmi_session
+
+ if svghmi_session is not None:
+ svghmi_session.close()
+ svghmi_root.delEntity("ws")
+ svghmi_root = None
+ svghmi_listener.stopListening()
+ svghmi_listener = None
+ # plc cleanup calls svghmi_(locstring)_cleanup and unlocks send thread
+ svghmi_send_thread.join()
+ svghmi_send_thread = None
+
+
+class NoCacheFile(File):
+ def render_GET(self, request):
+ request.setHeader(b"Cache-Control", b"no-cache, no-store")
+ return File.render_GET(self, request)
+ render_HEAD = render_GET
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_back.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,17 @@
+// widget_back.ysl2
+
+template "widget[@type='Back']", mode="widget_class"
+ ||
+ class BackWidget extends Widget{
+ on_click(evt) {
+ if(jump_history.length > 1){
+ jump_history.pop();
+ let [page_name, index] = jump_history.pop();
+ switch_page(page_name, index);
+ }
+ }
+ init() {
+ this.element.setAttribute("onclick", "hmi_widgets['"+this.element_id+"'].on_click(evt)");
+ }
+ }
+ ||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_button.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,33 @@
+// widget_button.ysl2
+
+template "widget[@type='Button']", mode="widget_defs" {
+ param "hmi_element";
+ optional_labels("active inactive");
+ | frequency: 5,
+ | on_mouse_down: function(evt) {
+ | if (this.active_style && this.inactive_style) {
+ | this.active_elt.setAttribute("style", this.active_style);
+ | this.inactive_elt.setAttribute("style", "display:none");
+ | }
+ | change_hmi_value(this.indexes[0], "=1");
+ | },
+ | on_mouse_up: function(evt) {
+ | if (this.active_style && this.inactive_style) {
+ | this.active_elt.setAttribute("style", "display:none");
+ | this.inactive_elt.setAttribute("style", this.inactive_style);
+ | }
+ | change_hmi_value(this.indexes[0], "=0");
+ | },
+ | active_style: undefined,
+ | inactive_style: undefined,
+ | init: function() {
+ | this.active_style = this.active_elt ? this.active_elt.style.cssText : undefined;
+ | this.inactive_style = this.inactive_elt ? this.inactive_elt.style.cssText : undefined;
+ | if (this.active_style && this.inactive_style) {
+ | this.active_elt.setAttribute("style", "display:none");
+ | this.inactive_elt.setAttribute("style", this.inactive_style);
+ | }
+ | this.element.setAttribute("onmousedown", "hmi_widgets['«$hmi_element/@id»'].on_mouse_down(evt)");
+ | this.element.setAttribute("onmouseup", "hmi_widgets['«$hmi_element/@id»'].on_mouse_up(evt)");
+ | },
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_circularbar.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,48 @@
+// widget_circularbar.ysl2
+
+
+template "widget[@type='CircularBar']", mode="widget_defs" {
+ param "hmi_element";
+ | frequency: 10,
+ labels("path");
+ optional_labels("value min max");
+ | dispatch: function(value) {
+ | if(this.value_elt)
+ | this.value_elt.textContent = String(value);
+ | let [min,max,start,end] = this.range;
+ | let [cx,cy] = this.center;
+ | let [rx,ry] = this.proportions;
+ | let tip = start + (end-start)*Number(value)/(max-min);
+ | let size = 0;
+ | if (tip-start > Math.PI) {
+ | size = 1;
+ | } else {
+ | size = 0;
+ | }
+ | this.path_elt.setAttribute('d', "M "+(cx+rx*Math.cos(start))+","+(cy+ry*Math.sin(start))+" A "+rx+","+ry+" 0 "+size+" 1 "+(cx+rx*Math.cos(tip))+","+(cy+ry*Math.sin(tip)));
+ | },
+ | range: undefined,
+ | init: function() {
+ | let start = Number(this.path_elt.getAttribute('sodipodi:start'));
+ | let end = Number(this.path_elt.getAttribute('sodipodi:end'));
+ | let cx = Number(this.path_elt.getAttribute('sodipodi:cx'));
+ | let cy = Number(this.path_elt.getAttribute('sodipodi:cy'));
+ | let rx = Number(this.path_elt.getAttribute('sodipodi:rx'));
+ | let ry = Number(this.path_elt.getAttribute('sodipodi:ry'));
+ | if (ry == 0) {
+ | ry = rx;
+ | }
+ | if (start > end) {
+ | end = end + 2*Math.PI;
+ | }
+ | let min = this.min_elt ?
+ | Number(this.min_elt.textContent) :
+ | this.args.length >= 1 ? this.args[0] : 0;
+ | let max = this.max_elt ?
+ | Number(this.max_elt.textContent) :
+ | this.args.length >= 2 ? this.args[1] : 100;
+ | this.range = [min, max, start, end];
+ | this.center = [cx, cy];
+ | this.proportions = [rx, ry];
+ | },
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_custom.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,62 @@
+// widget_custom.ysl2
+//
+// widget entierely defined from JS code in Inkscape description field
+
+// TODO
+
+// a preliminary implementation was initially attempted but disabled
+// code collected around before code refactoring
+
+
+/*const "mark" > =HMI=\n*/
+
+
+ /* TODO re-enable
+ ||
+ function evaluate_js_from_descriptions() {
+ var Page;
+ var Input;
+ var Display;
+ var res = [];
+ ||
+ const "midmark" > \n«$mark»
+ apply """//*[contains(child::svg:desc, $midmark) or \
+ starts-with(child::svg:desc, $mark)]""",2
+ mode="code_from_descs";
+ ||
+ return res;
+ }
+ ||
+ */
+
+ // template "*", mode="code_from_descs" {
+ // ||
+ // {
+ // var path, role, name, priv;
+ // var id = "«@id»";
+ // ||
+
+ // /* if label is used, use it as default name */
+ // if "@inkscape:label"
+ // |> name = "«@inkscape:label»";
+
+ // | /* -------------- */
+
+ // // this breaks indent, but fixing indent could break string literals
+ // value "substring-after(svg:desc, $mark)";
+ // // nobody reads generated code anyhow...
+
+ // ||
+
+ // /* -------------- */
+ // res.push({
+ // path:path,
+ // role:role,
+ // name:name,
+ // priv:priv
+ // })
+ // }
+ // ||
+ // }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_display.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,19 @@
+// widget_display.ysl2
+
+
+template "widget[@type='Display']", mode="widget_defs" {
+ param "hmi_element";
+ | frequency: 5,
+ | dispatch: function(value) {
+ choose {
+ when "$hmi_element[self::svg:text]"{
+ // TODO : care about <tspan> ?
+ | this.element.textContent = String(value);
+ }
+ otherwise {
+ warning > Display widget as a group not implemented
+ }
+ }
+ | },
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_dropdown.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,255 @@
+// widget_dropdown.ysl2
+
+template "widget[@type='DropDown']", mode="widget_defs" {
+ param "hmi_element";
+ labels("text box button");
+||
+ dispatch: function(value) {
+ if(!this.opened) this.set_selection(value);
+ },
+ init: function() {
+ this.button_elt.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_button_click()");
+ // Save original size of rectangle
+ this.box_bbox = this.box_elt.getBBox()
+
+ // Compute margins
+ text_bbox = this.text_elt.getBBox()
+ lmargin = text_bbox.x - this.box_bbox.x;
+ tmargin = text_bbox.y - this.box_bbox.y;
+ this.margins = [lmargin, tmargin].map(x => Math.max(x,0));
+
+ // It is assumed that list content conforms to Array interface.
+ this.content = [
+ ``foreach "arg" | "«@value»",
+ ];
+
+ // Index of first visible element in the menu, when opened
+ this.menu_offset = 0;
+
+ // How mutch to lift the menu vertically so that it does not cross bottom border
+ this.lift = 0;
+
+ // Event handlers cannot be object method ('this' is unknown)
+ // as a workaround, handler given to addEventListener is bound in advance.
+ this.bound_close_on_click_elsewhere = this.close_on_click_elsewhere.bind(this);
+
+ this.opened = false;
+ },
+ // Called when a menu entry is clicked
+ on_selection_click: function(selection) {
+ this.close();
+ let orig = this.indexes[0];
+ let idx = this.offset ? orig - this.offset : orig;
+ apply_hmi_value(idx, selection);
+ },
+ on_button_click: function() {
+ this.open();
+ },
+ on_backward_click: function(){
+ this.scroll(false);
+ },
+ on_forward_click:function(){
+ this.scroll(true);
+ },
+ set_selection: function(value) {
+ let display_str;
+ if(value >= 0 && value < this.content.length){
+ // if valid selection resolve content
+ display_str = this.content[value];
+ this.last_selection = value;
+ } else {
+ // otherwise show problem
+ display_str = "?"+String(value)+"?";
+ }
+ // It is assumed that first span always stays,
+ // and contains selection when menu is closed
+ this.text_elt.firstElementChild.textContent = display_str;
+ },
+ grow_text: function(up_to) {
+ let count = 1;
+ let txt = this.text_elt;
+ let first = txt.firstElementChild;
+ // Real world (pixels) boundaries of current page
+ let bounds = svg_root.getBoundingClientRect();
+ this.lift = 0;
+ while(count < up_to) {
+ let next = first.cloneNode();
+ // relative line by line text flow instead of absolute y coordinate
+ next.removeAttribute("y");
+ next.setAttribute("dy", "1.1em");
+ // default content to allow computing text element bbox
+ next.textContent = "...";
+ // append new span to text element
+ txt.appendChild(next);
+ // now check if text extended by one row fits to page
+ // FIXME : exclude margins to be more accurate on box size
+ let rect = txt.getBoundingClientRect();
+ if(rect.bottom > bounds.bottom){
+ // in case of overflow at the bottom, lift up one row
+ let backup = first.getAttribute("dy");
+ // apply lift asr a dy added too first span (y attrib stays)
+ first.setAttribute("dy", "-"+String((this.lift+1)*1.1)+"em");
+ rect = txt.getBoundingClientRect();
+ if(rect.top > bounds.top){
+ this.lift += 1;
+ } else {
+ // if it goes over the top, then backtrack
+ // restore dy attribute on first span
+ if(backup)
+ first.setAttribute("dy", backup);
+ else
+ first.removeAttribute("dy");
+ // remove unwanted child
+ txt.removeChild(next);
+ return count;
+ }
+ }
+ count++;
+ }
+ return count;
+ },
+ close_on_click_elsewhere: function(e) {
+ // inhibit events not targetting spans (menu items)
+ if(e.target.parentNode !== this.text_elt){
+ e.stopPropagation();
+ // close menu in case click is outside box
+ if(e.target !== this.box_elt)
+ this.close();
+ }
+ },
+ close: function(){
+ // Stop hogging all click events
+ svg_root.removeEventListener("click", this.bound_close_on_click_elsewhere, true);
+ // Restore position and sixe of widget elements
+ this.reset_text();
+ this.reset_box();
+ // Put the button back in place
+ this.element.appendChild(this.button_elt);
+ // Mark as closed (to allow dispatch)
+ this.opened = false;
+ // Dispatch last cached value
+ this.apply_cache();
+ },
+ // Set text content when content is smaller than menu (no scrolling)
+ set_complete_text: function(){
+ let spans = this.text_elt.children;
+ let c = 0;
+ for(let item of this.content){
+ let span=spans[c];
+ span.textContent = item;
+ span.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_selection_click("+c+")");
+ c++;
+ }
+ },
+ // Move partial view :
+ // false : upward, lower value
+ // true : downward, higher value
+ scroll: function(forward){
+ let contentlength = this.content.length;
+ let spans = this.text_elt.children;
+ let spanslength = spans.length;
+ // reduce accounted menu size according to jumps
+ if(this.menu_offset != 0) spanslength--;
+ if(this.menu_offset < contentlength - 1) spanslength--;
+ if(forward){
+ this.menu_offset = Math.min(
+ contentlength - spans.length + 1,
+ this.menu_offset + spanslength);
+ }else{
+ this.menu_offset = Math.max(
+ 0,
+ this.menu_offset - spanslength);
+ }
+ console.log(this.menu_offset);
+ this.set_partial_text();
+ },
+ // Setup partial view text content
+ // with jumps at first and last entry when appropriate
+ set_partial_text: function(){
+ let spans = this.text_elt.children;
+ let contentlength = this.content.length;
+ let spanslength = spans.length;
+ let i = this.menu_offset, c = 0;
+ while(c < spanslength){
+ let span=spans[c];
+ // backward jump only present if not exactly at start
+ if(c == 0 && i != 0){
+ span.textContent = "↑ ↑ ↑";
+ span.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_backward_click()");
+ // presence of forward jump when not right at the end
+ }else if(c == spanslength-1 && i < contentlength - 1){
+ span.textContent = "↓ ↓ ↓";
+ span.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_forward_click()");
+ // otherwise normal content
+ }else{
+ span.textContent = this.content[i];
+ span.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_selection_click("+i+")");
+ i++;
+ }
+ c++;
+ }
+ },
+ open: function(){
+ let length = this.content.length;
+ // systematically reset text, to strip eventual whitespace spans
+ this.reset_text();
+ // grow as much as needed or possible
+ let slots = this.grow_text(length);
+ // Depending on final size
+ if(slots == length) {
+ // show all at once
+ this.set_complete_text();
+ } else {
+ // eventualy align menu to current selection, compensating for lift
+ let offset = this.last_selection - this.lift;
+ if(offset > 0)
+ this.menu_offset = Math.min(offset + 1, length - slots + 1);
+ else
+ this.menu_offset = 0;
+ // show surrounding values
+ this.set_partial_text();
+ }
+ // Now that text size is known, we can set the box around it
+ this.adjust_box_to_text();
+ // Take button out until menu closed
+ this.element.removeChild(this.button_elt);
+ // Rise widget to top by moving it to last position among siblings
+ this.element.parentNode.appendChild(this.element.parentNode.removeChild(this.element));
+ // disable interaction with background
+ svg_root.addEventListener("click", this.bound_close_on_click_elsewhere, true);
+ // mark as open
+ this.opened = true;
+ },
+ // Put text element in normalized state
+ reset_text: function(){
+ let txt = this.text_elt;
+ let first = txt.firstElementChild;
+ // remove attribute eventually added to first text line while opening
+ first.removeAttribute("onclick");
+ first.removeAttribute("dy");
+ // keep only the first line of text
+ for(let span of Array.from(txt.children).slice(1)){
+ txt.removeChild(span)
+ }
+ },
+ // Put rectangle element in saved original state
+ reset_box: function(){
+ let m = this.box_bbox;
+ let b = this.box_elt;
+ b.x.baseVal.value = m.x;
+ b.y.baseVal.value = m.y;
+ b.width.baseVal.value = m.width;
+ b.height.baseVal.value = m.height;
+ },
+ // Use margin and text size to compute box size
+ adjust_box_to_text: function(){
+ let [lmargin, tmargin] = this.margins;
+ let m = this.text_elt.getBBox();
+ let b = this.box_elt;
+ b.x.baseVal.value = m.x - lmargin;
+ b.y.baseVal.value = m.y - tmargin;
+ b.width.baseVal.value = 2 * lmargin + m.width;
+ b.height.baseVal.value = 2 * tmargin + m.height;
+ },
+||
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_foreach.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,105 @@
+
+template "widget[@type='ForEach']", mode="widget_defs" {
+ param "hmi_element";
+
+ const "class","arg[1]/@value";
+
+ const "base_path","path/@value";
+ const "hmi_index_base", "$indexed_hmitree/*[@hmipath = $base_path]";
+ const "hmi_tree_base", "$hmitree/descendant-or-self::*[@path = $hmi_index_base/@path]";
+ const "hmi_tree_items", "$hmi_tree_base/*[@class = $class]";
+ const "hmi_index_items", "$indexed_hmitree/*[@path = $hmi_tree_items/@path]";
+ const "items_paths", "$hmi_index_items/@hmipath";
+ | index_pool: [
+ foreach "$hmi_index_items" {
+ | «@index»`if "position()!=last()" > ,`
+ }
+ | ],
+ | init: function() {
+ const "prefix","concat($class,':')";
+ const "buttons_regex","concat('^',$prefix,'[+\-][0-9]+')";
+ const "buttons", "$hmi_element/*[regexp:test(@inkscape:label, $buttons_regex)]";
+ foreach "$buttons" {
+ const "op","substring-after(@inkscape:label, $prefix)";
+ | id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click('«$op»', evt)");
+ }
+ |
+ | this.items = [
+ const "items_regex","concat('^',$prefix,'[0-9]+')";
+ const "unordered_items","$hmi_element//*[regexp:test(@inkscape:label, $items_regex)]";
+ foreach "$unordered_items" {
+ const "elt_label","concat($prefix, string(position()))";
+ const "elt","$unordered_items[@inkscape:label = $elt_label]";
+ const "pos","position()";
+ const "item_path", "$items_paths[$pos]";
+ | [ /* item="«$elt_label»" path="«$item_path»" */
+ if "count($elt)=0" error > Missing item labeled «$elt_label» in ForEach widget «$hmi_element/@id»
+ foreach "func:refered_elements($elt)[@id = $hmi_elements/@id][not(@id = $elt/@id)]" {
+ if "not(func:is_descendant_path(func:widget(@id)/path/@value, $item_path))"
+ error > Widget id="«@id»" label="«@inkscape:label»" is having wrong path. Accroding to ForEach widget ancestor id="«$hmi_element/@id»", path should be descendant of "«$item_path»".
+ | hmi_widgets["«@id»"]`if "position()!=last()" > ,`
+ }
+ | ]`if "position()!=last()" > ,`
+ }
+ | ]
+ | },
+ | item_offset: 0,
+}
+
+template "widget[@type='ForEach']", mode="widget_class"
+||
+class ForEachWidget extends Widget{
+ unsub(){
+ for(let item of this.items){
+ for(let widget of item) {
+ widget.unsub();
+ }
+ }
+ this.offset = 0;
+ }
+
+ foreach_widgets_do(new_offset, todo){
+ this.offset = new_offset;
+ for(let i = 0; i < this.items.length; i++) {
+ let item = this.items[i];
+ let orig_item_index = this.index_pool[i];
+ let item_index = this.index_pool[i+this.item_offset];
+ let item_index_offset = item_index - orig_item_index;
+ for(let widget of item) {
+ todo(widget).call(widget, new_offset + item_index_offset);
+ }
+ }
+ }
+
+ sub(new_offset=0){
+ this.foreach_widgets_do(new_offset, w=>w.sub);
+ }
+
+ apply_cache() {
+ this.foreach_widgets_do(this.offset, w=>w.apply_cache);
+ }
+
+ on_click(opstr, evt) {
+ let new_item_offset = eval(String(this.item_offset)+opstr);
+ if(new_item_offset + this.items.length > this.index_pool.length) {
+ if(this.item_offset + this.items.length == this.index_pool.length)
+ new_item_offset = 0;
+ else
+ new_item_offset = this.index_pool.length - this.items.length;
+ } else if(new_item_offset < 0) {
+ if(this.item_offset == 0)
+ new_item_offset = this.index_pool.length - this.items.length;
+ else
+ new_item_offset = 0;
+ }
+ this.item_offset = new_item_offset;
+ this.unsub();
+ this.sub(this.offset);
+ update_subscriptions();
+ need_cache_apply.push(this);
+ jumps_need_update = true;
+ requestHMIAnimation();
+ }
+}
+||
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_input.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,50 @@
+// widget_input.ysl2
+
+template "widget[@type='Input']", mode="widget_defs" {
+ param "hmi_element";
+ const "value_elt" {
+ optional_labels("value");
+ }
+ const "have_value","string-length($value_elt)>0";
+ value "$value_elt";
+ if "$have_value"
+ | frequency: 5,
+ | last_val: undefined,
+ | dispatch: function(value) {
+ | this.last_val = value;
+ if "$have_value"
+ | this.value_elt.textContent = String(value);
+
+ | },
+ const "edit_elt_id","$hmi_element/*[@inkscape:label='edit'][1]/@id";
+ | init: function() {
+ if "$edit_elt_id" {
+ | id("«$edit_elt_id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_edit_click()");
+ }
+ foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" {
+ | id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_op_click('«func:escape_quotes(@inkscape:label)»')");
+ }
+ | },
+ | on_op_click: function(opstr) {
+ | let orig = this.indexes[0];
+ | let idx = this.offset ? orig - this.offset : orig;
+ | let new_val = change_hmi_value(idx, opstr);
+ // if "$have_value"{
+ // | this.value_elt.textContent = String(new_val);
+ // /* TODO gray out value until refreshed */
+ // }
+ | },
+ | on_edit_click: function(opstr) {
+ | edit_value("«path/@value»", "«path/@type»", this, this.last_val);
+ | },
+
+ | edit_callback: function(new_val) {
+ | let orig = this.indexes[0];
+ | let idx = this.offset ? orig - this.offset : orig;
+ | apply_hmi_value(idx, new_val);
+ // if "$have_value"{
+ // | this.value_elt.textContent = String(new_val);
+ // /* TODO gray out value until refreshed */
+ // }
+ | },
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_jump.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,125 @@
+// widget_jump.ysl2
+
+function "jump_widget_activity" {
+ param "hmi_element";
+ optional_labels("active inactive");
+}
+
+function "jump_widget_disability" {
+ param "hmi_element";
+ optional_labels("disabled");
+}
+
+template "widget[@type='Jump']", mode="widget_defs" {
+ param "hmi_element";
+ const "activity" call "jump_widget_activity" with "hmi_element", "$hmi_element";
+ const "have_activity","string-length($activity)>0";
+ value "$activity";
+ const "disability" call "jump_widget_disability" with "hmi_element", "$hmi_element";
+ const "have_disability","$have_activity and string-length($disability)>0";
+ value "$disability";
+ if "$have_activity" {
+ | active: false,
+ if "$have_disability" {
+ | disabled: false,
+ | frequency: 2,
+ | dispatch: function(value) {
+ | this.disabled = !Number(value);
+ | this.update();
+ | },
+ }
+ | update: function(){
+ if "$have_disability" {
+ | if(this.disabled) {
+ | /* show disabled */
+ | this.disabled_elt.setAttribute("style", this.active_elt_style);
+ | /* hide inactive */
+ | this.inactive_elt.setAttribute("style", "display:none");
+ | /* hide active */
+ | this.active_elt.setAttribute("style", "display:none");
+ | } else {
+ | /* hide disabled */
+ | this.disabled_elt.setAttribute("style", "display:none");
+ }
+ | if(this.active) {
+ | /* show active */
+ | this.active_elt.setAttribute("style", this.active_elt_style);
+ | /* hide inactive */
+ | this.inactive_elt.setAttribute("style", "display:none");
+ | } else {
+ | /* show inactive */
+ | this.inactive_elt.setAttribute("style", this.inactive_elt_style);
+ | /* hide active */
+ | this.active_elt.setAttribute("style", "display:none");
+ | }
+ if "$have_disability" {
+ | }
+ }
+ | },
+ }
+ | on_click: function(evt) {
+ | const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined;
+ | const name = this.args[0];
+ | switch_page(name, index);
+ | },
+ if "$have_activity" {
+ | notify_page_change: function(page_name, index){
+ | const ref_index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined;
+ | const ref_name = this.args[0];
+ | this.active =((ref_name == undefined || ref_name == page_name) && index == ref_index);
+ | this.update();
+ | },
+ }
+ | init: function() {
+ /* registering event this way does not "click" through svg:use
+ | this.element.onclick = evt => switch_page(this.args[0]);
+ event must be registered by adding attribute to element instead
+ TODO : generalize mouse event handling by global event capture + getElementsAtPoint()
+ */
+ | this.element.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click(evt)");
+ if "$have_activity" {
+ | this.active_elt_style = this.active_elt.getAttribute("style");
+ | this.inactive_elt_style = this.inactive_elt.getAttribute("style");
+ }
+ choose {
+ when "$have_disability" {
+ | this.disabled_elt_style = this.disabled_elt.getAttribute("style");
+ }
+ otherwise {
+ | this.unsubscribable = true;
+ }
+ }
+ | },
+}
+
+template "widget[@type='Jump']", mode="per_page_widget_template"{
+ param "page_desc";
+ /* check that given path is compatible with page's reference path */
+ if "path" {
+ /* when no page name provided, check for same page */
+ const "target_page_name" choose {
+ when "arg" value "arg[1]/@value";
+ otherwise value "$page_desc/arg[1]/@value";
+ }
+ const "target_page_path" choose {
+ when "arg" value "$hmi_pages_descs[arg[1]/@value = $target_page_name]/path[1]/@value";
+ otherwise value "$page_desc/path[1]/@value";
+ }
+
+ if "not(func:same_class_paths($target_page_path, path[1]/@value))"
+ error > Jump id="«@id»" to page "«$target_page_name»" with incompatible path "«path[1]/@value» (must be same class as "«$target_page_path»")
+ }
+}
+
+emit "declarations:jump"
+||
+var jumps_need_update = false;
+var jump_history = [[default_page, undefined]];
+
+function update_jumps() {
+ page_desc[current_visible_page].jumps.map(w=>w.notify_page_change(current_visible_page,current_page_index));
+ jumps_need_update = false;
+};
+
+||
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_keypad.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,107 @@
+// widget_keypad.ysl2
+
+emit "declarations:keypad" {
+ |
+ | var keypads = {
+ foreach "$keypads_descs"{
+ const "keypad_id","@id";
+ foreach "arg"{
+ const "g", "$geometry[@Id = $keypad_id]";
+ | "«@value»":["«$keypad_id»", «$g/@x», «$g/@y»],
+ }
+ }
+ | }
+}
+
+template "widget[@type='Keypad']", mode="widget_defs" {
+ param "hmi_element";
+ labels("Esc Enter BackSpace Keys Info Value");
+ optional_labels("Sign Space NumDot");
+ activable_labels("CapsLock Shift");
+ | init: function() {
+ foreach "$hmi_element/*[@inkscape:label = 'Keys']/*" {
+ | id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_key_click('«func:escape_quotes(@inkscape:label)»')");
+ }
+ foreach "str:split('Esc Enter BackSpace Sign Space NumDot CapsLock Shift')" {
+ | if(this.«.»_elt)
+ | this.«.»_elt.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_«.»_click()");
+ }
+ | },
+ | on_key_click: function(symbols) {
+ | var syms = symbols.split(" ");
+ | this.shift |= this.caps;
+ | this.editstr += syms[this.shift?syms.length-1:0];
+ | this.shift = false;
+ | this.update();
+ | },
+ | on_Esc_click: function() {
+ | end_modal.call(this);
+ | },
+ | on_Enter_click: function() {
+ | end_modal.call(this);
+ | callback_obj = this.result_callback_obj;
+ | callback_obj.edit_callback(this.editstr);
+ | },
+ | on_BackSpace_click: function() {
+ | this.editstr = this.editstr.slice(0,this.editstr.length-1);
+ | this.update();
+ | },
+ | on_Sign_click: function() {
+ | if(this.editstr[0] == "-")
+ | this.editstr = this.editstr.slice(1,this.editstr.length);
+ | else
+ | this.editstr = "-" + this.editstr;
+ | this.update();
+ | },
+ | on_NumDot_click: function() {
+ | if(this.editstr.indexOf(".") == "-1"){
+ | this.editstr += ".";
+ | this.update();
+ | }
+ | },
+ | on_Space_click: function() {
+ | this.editstr += " ";
+ | this.update();
+ | },
+ | caps: false,
+ | _caps: undefined,
+ | on_CapsLock_click: function() {
+ | this.caps = !this.caps;
+ | this.update();
+ | },
+ | shift: false,
+ | _shift: undefined,
+ | on_Shift_click: function() {
+ | this.shift = !this.shift;
+ | this.caps = false;
+ | this.update();
+ | },
+ const "g", "$geometry[@Id = $hmi_element/@id]";
+ | coordinates: [«$g/@x», «$g/@y»],
+ | editstr: "",
+ | _editstr: undefined,
+ | result_callback_obj: undefined,
+ | start_edit: function(info, valuetype, callback_obj, initial) {
+ | show_modal.call(this);
+ | this.editstr = initial;
+ | this.result_callback_obj = callback_obj;
+ | this.Info_elt.textContent = info;
+ | this.shift = false;
+ | this.caps = false;
+ | this.update();
+ | },
+ | update: function() {
+ | if(this.editstr != this._editstr){
+ | this._editstr = this.editstr;
+ | this.Value_elt.textContent = this.editstr;
+ | }
+ | if(this.shift != this._shift){
+ | this._shift = this.shift;
+ | (this.shift?widget_active_activable:widget_inactive_activable)(this.Shift_sub);
+ | }
+ | if(this.caps != this._caps){
+ | this._caps = this.caps;
+ | (this.caps?widget_active_activable:widget_inactive_activable)(this.CapsLock_sub);
+ | }
+ | },
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_meter.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,31 @@
+// widget_meter.ysl2
+
+
+template "widget[@type='Meter']", mode="widget_defs" {
+ param "hmi_element";
+ | frequency: 10,
+ labels("needle range");
+ optional_labels("value min max");
+ | dispatch: function(value) {
+ | if(this.value_elt)
+ | this.value_elt.textContent = String(value);
+ | let [min,max,totallength] = this.range;
+ | let length = Math.max(0,Math.min(totallength,(Number(value)-min)*totallength/(max-min)));
+ | let tip = this.range_elt.getPointAtLength(length);
+ | this.needle_elt.setAttribute('d', "M "+this.origin.x+","+this.origin.y+" "+tip.x+","+tip.y);
+ | },
+ | origin: undefined,
+ | range: undefined,
+ | init: function() {
+ | let min = this.min_elt ?
+ | Number(this.min_elt.textContent) :
+ | this.args.length >= 1 ? this.args[0] : 0;
+ | let max = this.max_elt ?
+ | Number(this.max_elt.textContent) :
+ | this.args.length >= 2 ? this.args[1] : 100;
+ | this.range = [min, max, this.range_elt.getTotalLength()]
+ | this.origin = this.needle_elt.getPointAtLength(0);
+ | },
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_switch.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,32 @@
+// widget_switch.ysl2
+
+template "widget[@type='Switch']", mode="widget_class"
+ ||
+ class SwitchWidget extends Widget{
+ frequency = 5;
+ dispatch(value) {
+ for(let choice of this.choices){
+ if(value != choice.value){
+ choice.elt.setAttribute("style", "display:none");
+ } else {
+ choice.elt.setAttribute("style", choice.style);
+ }
+ }
+ }
+ }
+ ||
+
+template "widget[@type='Switch']", mode="widget_defs" {
+ param "hmi_element";
+ | choices: [
+ const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;
+ foreach "$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]" {
+ const "literal", "regexp:match(@inkscape:label,$regex)[2]";
+ | {
+ | elt:id("«@id»"),
+ | style:"«@style»",
+ | value:«$literal»
+ | }`if "position()!=last()" > ,`
+ }
+ | ],
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_tooglebutton.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,30 @@
+// widget_tooglebutton.ysl2
+
+template "widget[@type='ToggleButton']", mode="widget_defs" {
+ param "hmi_element";
+ labels("active inactive");
+ | frequency: 5,
+ | state: 0,
+ | dispatch: function(value) {
+ | this.state = value;
+ | if (this.state) {
+ | this.active_elt.setAttribute("style", this.active_style);
+ | this.inactive_elt.setAttribute("style", "display:none");
+ | this.state = 0;
+ | } else {
+ | this.inactive_elt.setAttribute("style", this.inactive_style);
+ | this.active_elt.setAttribute("style", "display:none");
+ | this.state = 1;
+ | }
+ | },
+ | on_click: function(evt) {
+ | change_hmi_value(this.indexes[0], "="+this.state);
+ | },
+ | active_style: undefined,
+ | inactive_style: undefined,
+ | init: function() {
+ | this.active_style = this.active_elt.style.cssText;
+ | this.inactive_style = this.inactive_elt.style.cssText;
+ | this.element.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click(evt)");
+ | },
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widgets_common.ysl2 Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,189 @@
+// widgets_common.ysl2
+
+in xsl decl labels(*ptr, name="defs_by_labels") alias call-template {
+ with "hmi_element", "$hmi_element";
+ with "labels"{text *ptr};
+ content;
+};
+
+decl optional_labels(*ptr) alias - {
+ /* TODO add some per label xslt variable to check if exist */
+ labels(*ptr){
+ with "mandatory","'no'";
+ content;
+ }
+};
+
+decl activable_labels(*ptr) alias - {
+ optional_labels(*ptr) {
+ with "subelements","'active inactive'";
+ content;
+ }
+};
+
+template "svg:*", mode="hmi_widgets" {
+ const "widget", "func:widget(@id)";
+ const "eltid","@id";
+ const "args" foreach "$widget/arg" > "«@value»"`if "position()!=last()" > ,`
+ const "indexes" foreach "$widget/path" {
+ choose {
+ when "not(@index)" {
+ warning > Widget «$widget/@type» id="«$eltid»" : No match for path "«@value»" in HMI tree
+ }
+ otherwise {
+ > «@index»`if "position()!=last()" > ,`
+ }
+ }
+ }
+
+ | "«@id»": new «$widget/@type»Widget ("«@id»",[«$args»],[«$indexes»],{
+ apply "$widget", mode="widget_defs" with "hmi_element",".";
+ | })`if "position()!=last()" > ,`
+}
+
+def "func:unique_types" {
+ param "elts_with_type";
+ choose {
+ when "count($elts_with_type) > 1" {
+ const "prior_results","func:unique_types($elts_with_type[position()!=last()])";
+ choose {
+ when "$elts_with_type[last()][@type = $prior_results/@type]"{
+ // type already in
+ result "$prior_results";
+ }
+ otherwise {
+ result "$prior_results | $elts_with_type[last()]";
+ }
+ }
+ }
+ otherwise {
+ result "$elts_with_type";
+ }
+ }
+}
+
+emit "preamble:widget-base-class" {
+ ||
+ class Widget {
+ offset = 0;
+ frequency = 10; /* FIXME arbitrary default max freq. Obtain from config ? */
+ unsubscribable = false;
+ constructor(elt_id,args,indexes,members){
+ this.element_id = elt_id;
+ this.element = id(elt_id);
+ this.args = args;
+ this.indexes = indexes;
+ Object.keys(members).forEach(prop => this[prop]=members[prop]);
+ }
+
+ unsub(){
+ /* remove subsribers */
+ if(!this.unsubscribable) for(let index of this.indexes){
+ let idx = index + this.offset;
+ subscribers[idx].delete(this);
+ }
+ this.offset = 0;
+ }
+
+ sub(new_offset=0){
+ /* set the offset because relative */
+ this.offset = new_offset;
+ /* add this's subsribers */
+ if(!this.unsubscribable) for(let index of this.indexes){
+ subscribers[index + new_offset].add(this);
+ }
+ need_cache_apply.push(this);
+ }
+
+ apply_cache() {
+ if(!this.unsubscribable) for(let index of this.indexes){
+ /* dispatch current cache in newly opened page widgets */
+ let realindex = index+this.offset;
+ let cached_val = cache[realindex];
+ if(cached_val != undefined)
+ dispatch_value_to_widget(this, realindex, cached_val, cached_val);
+ }
+ }
+
+ }
+ ||
+}
+
+emit "preamble:hmi-classes" {
+ const "used_widget_types", "func:unique_types($parsed_widgets/widget)";
+ apply "$used_widget_types", mode="widget_class";
+}
+
+template "widget", mode="widget_class"
+||
+class «@type»Widget extends Widget{
+ /* empty class, as «@type» widget didn't provide any */
+}
+||
+
+const "excluded_types", "str:split('Page Lang List')";
+const "excluded_ids","$parsed_widgets/widget[not(@type = $excluded_types)]/@id";
+
+emit "preamble:hmi-elements" {
+ | var hmi_widgets = {
+ apply "$hmi_elements[@id = $excluded_ids]", mode="hmi_widgets";
+ | }
+}
+
+function "defs_by_labels" {
+ param "labels","''";
+ param "mandatory","'yes'";
+ param "subelements","/..";
+ param "hmi_element";
+ const "widget_type","@type";
+ foreach "str:split($labels)" {
+ const "name",".";
+ const "elt","$result_svg_ns//*[@id = $hmi_element/@id]//*[@inkscape:label=$name][1]";
+ choose {
+ when "not($elt/@id)" {
+ if "$mandatory='yes'" {
+ error > «$widget_type» widget must have a «$name» element
+ }
+ // otherwise produce nothing
+ }
+ otherwise {
+ | «$name»_elt: id("«$elt/@id»"),
+ if "$subelements" {
+ | «$name»_sub: {
+ foreach "str:split($subelements)" {
+ const "subname",".";
+ const "subelt","$elt/*[@inkscape:label=$subname][1]";
+ choose {
+ when "not($subelt/@id)" {
+ if "$mandatory='yes'" {
+ error > «$widget_type» widget must have a «$name»/«$subname» element
+ }
+ | /* missing «$name»/«$subname» element */
+ }
+ otherwise {
+ | "«$subname»": id("«$subelt/@id»")`if "position()!=last()" > ,`
+ }
+ }
+ }
+ | },
+ }
+ }
+ }
+ }
+}
+
+def "func:escape_quotes" {
+ param "txt";
+ // have to use a python string to enter escaped quote
+ const "frst", !"substring-before($txt,'\"')"!;
+ const "frstln", "string-length($frst)";
+ choose {
+ when "$frstln > 0 and string-length($txt) > $frstln" {
+ result !"concat($frst,'\\\"',func:escape_quotes(substring-after($txt,'\"')))"!;
+ }
+ otherwise {
+ result "$txt";
+ }
+ }
+}
+
--- a/targets/Linux/plc_Linux_main.c Wed Jun 17 14:32:55 2020 +0200
+++ b/targets/Linux/plc_Linux_main.c Thu Jun 18 11:00:26 2020 +0200
@@ -235,3 +235,18 @@
{
pthread_mutex_lock(&python_mutex);
}
+
+static pthread_cond_t svghmi_send_WakeCond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t svghmi_send_WakeCondLock = PTHREAD_MUTEX_INITIALIZER;
+
+void SVGHMI_SuspendFromPythonThread(void)
+{
+ pthread_mutex_lock(&svghmi_send_WakeCondLock);
+ pthread_cond_wait(&svghmi_send_WakeCond, &svghmi_send_WakeCondLock);
+ pthread_mutex_unlock(&svghmi_send_WakeCondLock);
+}
+
+void SVGHMI_WakeupFromRTThread(void)
+{
+ pthread_cond_signal(&svghmi_send_WakeCond);
+}
--- a/targets/Xenomai/plc_Xenomai_main.c Wed Jun 17 14:32:55 2020 +0200
+++ b/targets/Xenomai/plc_Xenomai_main.c Thu Jun 18 11:00:26 2020 +0200
@@ -26,6 +26,8 @@
#define PLC_STATE_WAITDEBUG_PIPE_CREATED 64
#define PLC_STATE_WAITPYTHON_FILE_OPENED 128
#define PLC_STATE_WAITPYTHON_PIPE_CREATED 256
+#define PLC_STATE_SVGHMI_FILE_OPENED 512
+#define PLC_STATE_SVGHMI_PIPE_CREATED 1024
#define WAITDEBUG_PIPE_DEVICE "/dev/rtp0"
#define WAITDEBUG_PIPE_MINOR 0
@@ -35,6 +37,8 @@
#define WAITPYTHON_PIPE_MINOR 2
#define PYTHON_PIPE_DEVICE "/dev/rtp3"
#define PYTHON_PIPE_MINOR 3
+#define SVGHMI_PIPE_DEVICE "/dev/rtp4"
+#define SVGHMI_PIPE_MINOR 4
#define PIPE_SIZE 1
// rt-pipes commands
@@ -68,10 +72,12 @@
RT_PIPE WaitPython_pipe;
RT_PIPE Debug_pipe;
RT_PIPE Python_pipe;
+RT_PIPE svghmi_pipe;
int WaitDebug_pipe_fd;
int WaitPython_pipe_fd;
int Debug_pipe_fd;
int Python_pipe_fd;
+int svghmi_pipe_fd;
int PLC_shutdown = 0;
@@ -114,6 +120,16 @@
PLC_state &= ~PLC_STATE_TASK_CREATED;
}
+ if (PLC_state & PLC_STATE_SVGHMI_PIPE_CREATED) {
+ rt_pipe_delete(&svghmi_pipe);
+ PLC_state &= ~PLC_STATE_SVGHMI_PIPE_CREATED;
+ }
+
+ if (PLC_state & PLC_STATE_SVGHMI_FILE_OPENED) {
+ close(svghmi_pipe_fd);
+ PLC_state &= ~PLC_STATE_SVGHMI_FILE_OPENED;
+ }
+
if (PLC_state & PLC_STATE_WAITDEBUG_PIPE_CREATED) {
rt_pipe_delete(&WaitDebug_pipe);
PLC_state &= ~PLC_STATE_WAITDEBUG_PIPE_CREATED;
@@ -240,6 +256,16 @@
_startPLCLog(FO WAITPYTHON_PIPE_DEVICE);
PLC_state |= PLC_STATE_WAITPYTHON_FILE_OPENED;
+ /* create svghmi_pipe */
+ if(rt_pipe_create(&svghmi_pipe, "svghmi_pipe", SVGHMI_PIPE_MINOR, PIPE_SIZE) < 0)
+ _startPLCLog(FO "svghmi_pipe real-time end");
+ PLC_state |= PLC_STATE_SVGHMI_PIPE_CREATED;
+
+ /* open svghmi_pipe*/
+ if((svghmi_pipe_fd = open(SVGHMI_PIPE_DEVICE, O_RDWR)) == -1)
+ _startPLCLog(FO SVGHMI_PIPE_DEVICE);
+ PLC_state |= PLC_STATE_SVGHMI_FILE_OPENED;
+
/*** create PLC task ***/
if(rt_task_create(&PLC_task, "PLC_task", 0, 50, T_JOINABLE))
_startPLCLog("Failed creating PLC task");
@@ -395,6 +421,18 @@
} /* as plc does not wait for lock. */
}
+void SVGHMI_SuspendFromPythonThread(void)
+{
+ char cmd = 1; /*whatever*/
+ read(svghmi_pipe_fd, &cmd, sizeof(cmd));
+}
+
+void SVGHMI_WakeupFromRTThread(void)
+{
+ char cmd;
+ rt_pipe_write(&svghmi_pipe, &cmd, sizeof(cmd), P_NORMAL);
+}
+
#ifndef HAVE_RETAIN
int CheckRetainBuffer(void)
{
--- a/targets/plc_debug.c Wed Jun 17 14:32:55 2020 +0200
+++ b/targets/plc_debug.c Thu Jun 18 11:00:26 2020 +0200
@@ -100,7 +100,7 @@
void __init_debug(void)
{
/* init local static vars */
-#ifndef TARGET_ONLINE_DEBUG_DISABLE
+#ifndef TARGET_ONLINE_DEBUG_DISABLE
buffer_cursor = debug_buffer;
buffer_state = BUFFER_FREE;
#endif
@@ -109,9 +109,9 @@
InitRetain();
/* Iterate over all variables to fill debug buffer */
if(CheckRetainBuffer()){
- __for_each_variable_do(RemindIterator);
+ __for_each_variable_do(RemindIterator);
}else{
- char mstr[] = "RETAIN memory invalid - defaults used";
+ char mstr[] = "RETAIN memory invalid - defaults used";
LogMessage(LOG_WARNING, mstr, sizeof(mstr));
}
retain_offset = 0;
@@ -124,7 +124,7 @@
void __cleanup_debug(void)
{
-#ifndef TARGET_ONLINE_DEBUG_DISABLE
+#ifndef TARGET_ONLINE_DEBUG_DISABLE
buffer_cursor = debug_buffer;
InitiateDebugTransfer();
#endif
@@ -150,16 +150,14 @@
if(flags & ( __IEC_DEBUG_FLAG | __IEC_RETAIN_FLAG)){
USINT size = __get_type_enum_size(dsc->type);
-#ifndef TARGET_ONLINE_DEBUG_DISABLE
+#ifndef TARGET_ONLINE_DEBUG_DISABLE
if(flags & __IEC_DEBUG_FLAG){
/* copy visible variable to buffer */;
if(do_debug){
/* compute next cursor positon.
No need to check overflow, as BUFFER_SIZE
is computed large enough */
- if((dsc->type == STRING_ENUM) ||
- (dsc->type == STRING_P_ENUM) ||
- (dsc->type == STRING_O_ENUM)){
+ if(__Is_a_string(dsc)){
/* optimization for strings */
size = ((STRING*)visible_value_p)->len + 1;
}
@@ -174,7 +172,7 @@
memcpy(real_value_p, visible_value_p, size);
}
}
-#endif
+#endif
if(flags & __IEC_RETAIN_FLAG){
/* compute next cursor positon*/
--- a/targets/var_access.c Wed Jun 17 14:32:55 2020 +0200
+++ b/targets/var_access.c Thu Jun 18 11:00:26 2020 +0200
@@ -14,6 +14,10 @@
forced_value_p = &((__IEC_##TYPENAME##_p *)varp)->fvalue;\
break;
+#define __Is_a_string(dsc) (dsc->type == STRING_ENUM) ||\
+ (dsc->type == STRING_P_ENUM) ||\
+ (dsc->type == STRING_O_ENUM)
+
static void* UnpackVar(__Unpack_desc_type *dsc, void **real_value_p, char *flags)
{
void *varp = dsc->ptr;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi/beremiz.xml Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="PYRO://127.0.0.1:61284">
+ <TargetType/>
+ <Libraries Enable_SVGHMI_Library="true"/>
+</BeremizRoot>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi/plc.xml Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,517 @@
+<?xml version='1.0' encoding='utf-8'?>
+<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
+ <fileHeader companyName="Unknown" productName="Unnamed" productVersion="1" creationDateTime="2019-08-06T14:23:42"/>
+ <contentHeader name="Unnamed" modificationDateTime="2020-04-14T15:53:44">
+ <coordinateInfo>
+ <fbd>
+ <scaling x="5" y="5"/>
+ </fbd>
+ <ld>
+ <scaling x="0" y="0"/>
+ </ld>
+ <sfc>
+ <scaling x="0" y="0"/>
+ </sfc>
+ </coordinateInfo>
+ </contentHeader>
+ <types>
+ <dataTypes/>
+ <pous>
+ <pou name="MainStuff" pouType="program">
+ <interface>
+ <localVars>
+ <variable name="TargetPressure">
+ <type>
+ <derived name="HMI_INT"/>
+ </type>
+ </variable>
+ <variable name="selection">
+ <type>
+ <derived name="HMI_INT"/>
+ </type>
+ </variable>
+ <variable name="Pump0">
+ <type>
+ <derived name="PumpControl"/>
+ </type>
+ </variable>
+ </localVars>
+ </interface>
+ <body>
+ <FBD>
+ <block localId="4" typeName="PumpControl" instanceName="Pump0" executionOrderId="0" height="40" width="127">
+ <position x="595" y="50"/>
+ <inputVariables>
+ <variable formalParameter="TargetPressure">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="5">
+ <position x="595" y="80"/>
+ <position x="570" y="80"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables/>
+ </block>
+ <inVariable localId="5" executionOrderId="0" height="30" width="125" negated="false">
+ <position x="445" y="65"/>
+ <connectionPointOut>
+ <relPosition x="125" y="15"/>
+ </connectionPointOut>
+ <expression>TargetPressure</expression>
+ </inVariable>
+ </FBD>
+ </body>
+ </pou>
+ <pou name="PumpControl" pouType="functionBlock">
+ <interface>
+ <localVars>
+ <variable name="Pump">
+ <type>
+ <derived name="HMI_NODE"/>
+ </type>
+ </variable>
+ <variable name="Pressure">
+ <type>
+ <derived name="HMI_INT"/>
+ </type>
+ </variable>
+ </localVars>
+ <inputVars>
+ <variable name="TargetPressure">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </inputVars>
+ <localVars>
+ <variable name="Sloth">
+ <type>
+ <derived name="HMI_INT"/>
+ </type>
+ </variable>
+ <variable name="boolout">
+ <type>
+ <derived name="HMI_BOOL"/>
+ </type>
+ </variable>
+ <variable name="boolin">
+ <type>
+ <derived name="HMI_BOOL"/>
+ </type>
+ <initialValue>
+ <simpleValue value="True"/>
+ </initialValue>
+ </variable>
+ <variable name="strout">
+ <type>
+ <derived name="HMI_STRING"/>
+ </type>
+ </variable>
+ <variable name="strin">
+ <type>
+ <derived name="HMI_STRING"/>
+ </type>
+ <initialValue>
+ <simpleValue value="blup"/>
+ </initialValue>
+ </variable>
+ </localVars>
+ </interface>
+ <body>
+ <FBD>
+ <inVariable localId="5" executionOrderId="0" height="30" width="125" negated="false">
+ <position x="150" y="100"/>
+ <connectionPointOut>
+ <relPosition x="125" y="15"/>
+ </connectionPointOut>
+ <expression>TargetPressure</expression>
+ </inVariable>
+ <inOutVariable localId="4" executionOrderId="0" height="30" width="60" negatedOut="false" negatedIn="false">
+ <position x="510" y="80"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="6" formalParameter="OUT">
+ <position x="510" y="95"/>
+ <position x="470" y="95"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="60" y="15"/>
+ </connectionPointOut>
+ <expression>Sloth</expression>
+ </inOutVariable>
+ <block localId="6" typeName="ADD" executionOrderId="0" height="60" width="65">
+ <position x="405" y="65"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="4">
+ <position x="405" y="95"/>
+ <position x="385" y="95"/>
+ <position x="385" y="50"/>
+ <position x="580" y="50"/>
+ <position x="580" y="95"/>
+ <position x="570" y="95"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="405" y="115"/>
+ <position x="360" y="115"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="1" executionOrderId="0" height="30" width="75" negated="false">
+ <position x="150" y="135"/>
+ <connectionPointOut>
+ <relPosition x="75" y="15"/>
+ </connectionPointOut>
+ <expression>Pressure</expression>
+ </inVariable>
+ <block localId="7" typeName="SUB" executionOrderId="0" height="60" width="65">
+ <position x="295" y="85"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="5">
+ <position x="295" y="115"/>
+ <position x="275" y="115"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="1">
+ <position x="295" y="135"/>
+ <position x="285" y="135"/>
+ <position x="285" y="150"/>
+ <position x="225" y="150"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="2" executionOrderId="0" height="30" width="60" negated="false">
+ <position x="240" y="190"/>
+ <connectionPointOut>
+ <relPosition x="60" y="15"/>
+ </connectionPointOut>
+ <expression>Sloth</expression>
+ </inVariable>
+ <outVariable localId="3" executionOrderId="0" height="30" width="75" negated="false">
+ <position x="435" y="205"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="8" formalParameter="OUT">
+ <position x="435" y="220"/>
+ <position x="410" y="220"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Pressure</expression>
+ </outVariable>
+ <block localId="8" typeName="DIV" executionOrderId="0" height="60" width="65">
+ <position x="345" y="190"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="2">
+ <position x="345" y="220"/>
+ <position x="335" y="220"/>
+ <position x="335" y="205"/>
+ <position x="300" y="205"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="9">
+ <position x="345" y="240"/>
+ <position x="300" y="240"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="9" executionOrderId="0" height="30" width="60" negated="false">
+ <position x="240" y="225"/>
+ <connectionPointOut>
+ <relPosition x="60" y="15"/>
+ </connectionPointOut>
+ <expression>100</expression>
+ </inVariable>
+ <block localId="10" typeName="CONCAT" executionOrderId="0" height="60" width="65">
+ <position x="360" y="345"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="13" formalParameter="OUT">
+ <position x="360" y="375"/>
+ <position x="330" y="375"/>
+ <position x="330" y="332"/>
+ <position x="440" y="332"/>
+ <position x="440" y="300"/>
+ <position x="430" y="300"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="14">
+ <position x="360" y="395"/>
+ <position x="322" y="395"/>
+ <position x="322" y="400"/>
+ <position x="285" y="400"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <outVariable localId="11" executionOrderId="0" height="30" width="58" negated="false">
+ <position x="495" y="355"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="10" formalParameter="OUT">
+ <position x="495" y="370"/>
+ <position x="450" y="370"/>
+ <position x="450" y="375"/>
+ <position x="425" y="375"/>
+ </connection>
+ </connectionPointIn>
+ <expression>strout</expression>
+ </outVariable>
+ <inVariable localId="12" executionOrderId="0" height="30" width="125" negated="false">
+ <position x="145" y="285"/>
+ <connectionPointOut>
+ <relPosition x="125" y="15"/>
+ </connectionPointOut>
+ <expression>TargetPressure</expression>
+ </inVariable>
+ <block localId="13" typeName="INT_TO_STRING" executionOrderId="0" height="40" width="115">
+ <position x="315" y="270"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="12">
+ <position x="315" y="300"/>
+ <position x="270" y="300"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="115" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="14" executionOrderId="0" height="30" width="50" negated="false">
+ <position x="235" y="385"/>
+ <connectionPointOut>
+ <relPosition x="50" y="15"/>
+ </connectionPointOut>
+ <expression>strin</expression>
+ </inVariable>
+ <inVariable localId="15" executionOrderId="0" height="30" width="60" negated="false">
+ <position x="690" y="210"/>
+ <connectionPointOut>
+ <relPosition x="60" y="15"/>
+ </connectionPointOut>
+ <expression>boolin</expression>
+ </inVariable>
+ <outVariable localId="16" executionOrderId="0" height="30" width="70" negated="false">
+ <position x="915" y="240"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="17" formalParameter="OUT">
+ <position x="915" y="255"/>
+ <position x="880" y="255"/>
+ </connection>
+ </connectionPointIn>
+ <expression>boolout</expression>
+ </outVariable>
+ <block localId="17" typeName="AND" executionOrderId="0" height="60" width="65">
+ <position x="815" y="225"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="15">
+ <position x="815" y="255"/>
+ <position x="762" y="255"/>
+ <position x="762" y="225"/>
+ <position x="750" y="225"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="21" formalParameter="OUT">
+ <position x="815" y="275"/>
+ <position x="750" y="275"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="18" executionOrderId="0" height="30" width="75" negated="false">
+ <position x="455" y="260"/>
+ <connectionPointOut>
+ <relPosition x="75" y="15"/>
+ </connectionPointOut>
+ <expression>Pressure</expression>
+ </inVariable>
+ <block localId="19" typeName="MOD" executionOrderId="0" height="60" width="65">
+ <position x="585" y="245"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="18">
+ <position x="585" y="275"/>
+ <position x="530" y="275"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="20">
+ <position x="585" y="295"/>
+ <position x="555" y="295"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="20" executionOrderId="0" height="30" width="20" negated="false">
+ <position x="535" y="280"/>
+ <connectionPointOut>
+ <relPosition x="20" y="15"/>
+ </connectionPointOut>
+ <expression>2</expression>
+ </inVariable>
+ <block localId="21" typeName="EQ" executionOrderId="0" height="60" width="65">
+ <position x="685" y="245"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="19" formalParameter="OUT">
+ <position x="685" y="275"/>
+ <position x="650" y="275"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="22">
+ <position x="685" y="295"/>
+ <position x="670" y="295"/>
+ <position x="670" y="330"/>
+ <position x="650" y="330"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="22" executionOrderId="0" height="30" width="20" negated="false">
+ <position x="630" y="315"/>
+ <connectionPointOut>
+ <relPosition x="20" y="15"/>
+ </connectionPointOut>
+ <expression>0</expression>
+ </inVariable>
+ </FBD>
+ </body>
+ </pou>
+ </pous>
+ </types>
+ <instances>
+ <configurations>
+ <configuration name="config">
+ <resource name="resource1">
+ <task name="task0" priority="0" interval="T#20ms">
+ <pouInstance name="instance0" typeName="MainStuff"/>
+ </task>
+ </resource>
+ </configuration>
+ </configurations>
+ </instances>
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi/svghmi_0@svghmi/baseconfnode.xml Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BaseParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" IEC_Channel="0" Name="svghmi_0"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi/svghmi_0@svghmi/confnode.xml Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SVGHMI xmlns:xsd="http://www.w3.org/2001/XMLSchema" OnWatchdog="echo Watchdog for {name} !" OnStart="xdg-open http://127.0.0.1:{port}/{name}" OnStop="echo Closing {name}" WatchdogInitial="10" WatchdogInterval="5"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Thu Jun 18 11:00:26 2020 +0200
@@ -0,0 +1,2659 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="1280"
+ height="720"
+ viewBox="0 0 1280 720"
+ version="1.1"
+ id="hmi0"
+ sodipodi:docname="svghmi.svg"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
+ <metadata
+ id="metadata4542">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs2">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="30 : 418 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="1358 : 3.9999991 : 1"
+ inkscape:persp3d-origin="670 : 298 : 1"
+ id="perspective503" />
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 360 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="1376 : 388 : 1"
+ inkscape:persp3d-origin="640 : 240 : 1"
+ id="perspective445" />
+ <inkscape:tag
+ id="Set 1"
+ inkscape:label="HMI:AccessList@Admin"
+ inkscape:expanded="true">
+ <inkscape:tagref
+ xlink:href="#text995"
+ id="tagref192" />
+ <inkscape:tagref
+ xlink:href="#g991"
+ id="tagref194" />
+ </inkscape:tag>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient962">
+ <stop
+ style="stop-color:#ff3000;stop-opacity:1;"
+ offset="0"
+ id="stop958" />
+ <stop
+ style="stop-color:#0022ff;stop-opacity:1"
+ offset="1"
+ id="stop960" />
+ </linearGradient>
+ <marker
+ inkscape:isstock="true"
+ style="overflow:visible"
+ id="marker926"
+ refX="0"
+ refY="0"
+ orient="auto"
+ inkscape:stockid="Arrow2Lend">
+ <path
+ transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
+ d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+ style="fill:#ff3000;fill-opacity:1;fill-rule:evenodd;stroke:#ff3000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
+ id="path924"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <inkscape:tag
+ id="Set 3"
+ inkscape:expanded="true"
+ inkscape:label="HMI:Translate">
+ <inkscape:tagref
+ xlink:href="#text831"
+ id="tagref1085" />
+ <inkscape:tagref
+ xlink:href="#text827"
+ id="tagref1087" />
+ <inkscape:tagref
+ xlink:href="#text4497"
+ id="tagref1089" />
+ <inkscape:tagref
+ xlink:href="#home_jmp"
+ id="tagref1091" />
+ <inkscape:tagref
+ xlink:href="#setting_jmp"
+ id="tagref1093" />
+ </inkscape:tag>
+ <marker
+ inkscape:stockid="Arrow2Lend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow2Lend"
+ style="overflow:visible"
+ inkscape:isstock="true"
+ inkscape:collect="always">
+ <path
+ inkscape:connector-curvature="0"
+ id="path895"
+ style="fill:#ff3000;fill-opacity:1;fill-rule:evenodd;stroke:#ff3000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
+ d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+ transform="matrix(-1.1,0,0,-1.1,-1.1,0)" />
+ </marker>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient962"
+ id="linearGradient964"
+ x1="113.38908"
+ y1="-62.210247"
+ x2="113.38908"
+ y2="4.0725975"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.5,0,0,0.5,73.144796,-1.4471993)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:document-units="px"
+ inkscape:current-layer="hmi0"
+ showgrid="false"
+ units="px"
+ inkscape:zoom="0.5"
+ inkscape:cx="523.16321"
+ inkscape:cy="-1.5475559"
+ inkscape:window-width="1920"
+ inkscape:window-height="1348"
+ inkscape:window-x="3815"
+ inkscape:window-y="700"
+ inkscape:window-maximized="0"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <rect
+ sodipodi:insensitive="true"
+ inkscape:label="HMI:Page:Conf"
+ y="780"
+ x="0"
+ height="720"
+ width="1280"
+ id="rect1016"
+ style="color:#000000;fill:#000000" />
+ <g
+ id="g1082"
+ inkscape:label="HMI:Jump:Home"
+ transform="translate(-940,-558)">
+ <g
+ id="g1152"
+ inkscape:label="button">
+ <path
+ 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:#ff6600;stroke-width:5;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"
+ d="m 1217.4113,1410.4016 -22,24.5657 c -10.7925,12.0511 6.1317,35.5791 -13.5791,35.5791 h -174.2877 c -19.71078,0 -2.7866,-23.528 -13.57905,-35.5791 l -22,-24.5657 127.74845,-48.4334 z"
+ id="rect1022"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cssssccc" />
+ </g>
+ <g
+ id="g1149"
+ inkscape:label="text">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="1090.7626"
+ y="1436.9814"
+ id="home_jmp"
+ inkscape:label="home_jmp"><tspan
+ sodipodi:role="line"
+ id="tspan1028"
+ x="1090.7626"
+ y="1436.9814"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px">Home</tspan></text>
+ </g>
+ </g>
+ <rect
+ style="color:#000000;fill:#4d4d4d"
+ id="page0"
+ width="1280"
+ height="720"
+ x="0"
+ y="0"
+ inkscape:label="HMI:Page:Home"
+ sodipodi:insensitive="true" />
+ <g
+ id="g1077"
+ inkscape:label="HMI:Jump:Conf">
+ <g
+ id="g1159"
+ inkscape:label="button">
+ <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:#ff6600;stroke-width:5;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"
+ id="rect1020"
+ width="245.44583"
+ height="95.723877"
+ x="971.96545"
+ y="594.82263"
+ ry="35.579063"
+ inkscape:label="button" />
+ </g>
+ <g
+ id="g1156"
+ inkscape:label="text">
+ <text
+ inkscape:label="setting_jmp"
+ id="setting_jmp"
+ y="656.98151"
+ x="1090.7626"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px"
+ y="656.98151"
+ x="1090.7626"
+ id="tspan1024"
+ sodipodi:role="line">Settings</tspan></text>
+ </g>
+ </g>
+ <g
+ id="g84"
+ inkscape:label="HMI:Input@/TARGETPRESSURE">
+ <text
+ inkscape:label="value"
+ id="text5151"
+ y="218.24219"
+ x="136.32812"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="stroke-width:1px"
+ y="218.24219"
+ x="136.32812"
+ id="tspan5149"
+ sodipodi:role="line">8888</tspan></text>
+ <path
+ transform="scale(1,-1)"
+ sodipodi:type="star"
+ 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:#ff6600;stroke-width:5;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"
+ id="path89"
+ sodipodi:sides="3"
+ sodipodi:cx="596.74072"
+ sodipodi:cy="-216.2599"
+ sodipodi:r1="59.825443"
+ sodipodi:r2="29.912722"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 648.55108,-186.34718 -103.62071,0 51.81035,-89.73817 z"
+ inkscape:transform-center-y="14.956363"
+ inkscape:label="-100" />
+ <path
+ inkscape:label="-10"
+ inkscape:transform-center-y="7.4781812"
+ d="m 622.6459,-170.03172 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="14.956361"
+ sodipodi:r1="29.912722"
+ sodipodi:cy="-184.98808"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="3"
+ id="path88"
+ 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:#ff6600;stroke-width:5;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"
+ sodipodi:type="star"
+ transform="scale(1,-1)" />
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff00ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;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"
+ id="rect85"
+ width="407.7037"
+ height="128"
+ x="139.85185"
+ y="95.40741"
+ onclick=""
+ inkscape:label="edit" />
+ <path
+ inkscape:label="+100"
+ inkscape:transform-center-y="-14.956361"
+ d="m 648.55108,135.08534 -103.62071,0 51.81035,-89.738161 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="29.912722"
+ sodipodi:r1="59.825443"
+ sodipodi:cy="105.17262"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="3"
+ id="path87"
+ 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:#ff6600;stroke-width:5;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"
+ sodipodi:type="star" />
+ <path
+ sodipodi:type="star"
+ 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:#ff6600;stroke-width:5;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"
+ id="path86"
+ sodipodi:sides="3"
+ sodipodi:cx="596.74072"
+ sodipodi:cy="136.44444"
+ sodipodi:r1="29.912722"
+ sodipodi:r2="14.956361"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 622.6459,151.4008 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:transform-center-y="-7.4781804"
+ inkscape:label="+10" />
+ <path
+ sodipodi:type="star"
+ 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:#ff6600;stroke-width:5;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"
+ id="path91"
+ sodipodi:sides="4"
+ sodipodi:cx="80.740723"
+ sodipodi:cy="165.17262"
+ sodipodi:r1="57.015106"
+ sodipodi:r2="29.912722"
+ sodipodi:arg1="0.77793027"
+ sodipodi:arg2="1.5633284"
+ inkscape:flatsided="true"
+ inkscape:rounded="-0.65084865"
+ inkscape:randomized="0"
+ d="M 121.35644,205.1862 C 158.18649,167.80191 3.342862,168.95829 40.72715,205.78834 78.111437,242.61839 76.95506,87.774762 40.125008,125.15905 3.2949549,162.54334 158.13858,161.38696 120.7543,124.55691 83.370008,87.726855 84.526385,242.57048 121.35644,205.1862 Z"
+ inkscape:transform-center-y="-14.956361"
+ inkscape:label="=0" />
+ </g>
+ <text
+ inkscape:label="HMI:Display@/PUMP0/PRESSURE"
+ id="text823"
+ y="218.24219"
+ x="756.32812"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="fill:#ffffff;fill-opacity:1;stroke-width:1px"
+ y="218.24219"
+ x="756.32812"
+ id="tspan821"
+ sodipodi:role="line">8888</tspan></text>
+ <g
+ id="g4523"
+ transform="matrix(3.7795276,0,0,3.7795276,308.51002,630.30393)"
+ inkscape:label="HMI:Meter@/PUMP0/SLOTH">
+ <path
+ 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:#3ee800;stroke-width:26.45833397;stroke-miterlimit:4;stroke-dasharray:2.64583333, 2.64583333;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="path4499"
+ sodipodi:type="arc"
+ sodipodi:cx="128.02208"
+ sodipodi:cy="2.2017097"
+ sodipodi:rx="64.411957"
+ sodipodi:ry="64.411957"
+ sodipodi:start="3.1415927"
+ sodipodi:end="4.712389"
+ d="M 63.610123,2.2017068 A 64.411957,64.411957 0 0 1 128.02208,-62.210247"
+ sodipodi:open="true"
+ inkscape:label="range" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ff3000;stroke-width:2.96333337;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0, 32.59666667;stroke-dashoffset:29.63333321;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
+ d="M 130.96206,4.0725977 79.111776,-41.363223"
+ id="path4501"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc"
+ inkscape:label="needle" />
+ <text
+ inkscape:label="min"
+ id="text4505"
+ y="4.9187088"
+ x="49.132977"
+ style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:125%;font-family:sans-serif;text-align:end;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="text-align:end;text-anchor:end;fill:#ff6600;stroke-width:0.26458332px"
+ y="4.9187088"
+ x="49.132977"
+ id="tspan4503"
+ sodipodi:role="line">0</tspan></text>
+ <text
+ inkscape:label="max"
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="127.48073"
+ y="-78.144218"
+ id="text4509"><tspan
+ sodipodi:role="line"
+ id="tspan4507"
+ x="127.48073"
+ y="-78.144218"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.26458332px">10000</tspan></text>
+ <text
+ inkscape:label="value"
+ id="text4517"
+ y="-6.1937833"
+ x="113.53007"
+ style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ id="tspan4515"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.26458332px"
+ y="-6.1937833"
+ x="113.53007"
+ sodipodi:role="line">000</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:7.5467205px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="124.77896"
+ y="1.1408259"
+ id="text4521"
+ inkscape:label="unit"><tspan
+ sodipodi:role="line"
+ x="124.77896"
+ y="1.1408259"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.26458332px"
+ id="tspan4519">bar</tspan></text>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="256.63086"
+ y="77.142853"
+ id="text827"
+ inkscape:label="setpoint_label"><tspan
+ sodipodi:role="line"
+ id="tspan825"
+ x="256.63086"
+ y="77.142853">SetPoint</tspan></text>
+ <text
+ id="text831"
+ y="77.142853"
+ x="899.01367"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="actual_label"><tspan
+ y="77.142853"
+ x="899.01367"
+ id="tspan829"
+ sodipodi:role="line">Actual</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="420.37848"
+ y="399.41504"
+ id="text4497"
+ inkscape:label="pressure_label"><tspan
+ sodipodi:role="line"
+ id="tspan4495"
+ x="420.37848"
+ y="399.41504"
+ style="fill:#ff6600;stroke-width:0.99999994px">Pressure</tspan></text>
+ <g
+ id="layer4"
+ inkscape:label="HMI:Lang:cn"
+ style="display:none"
+ inkscape:groupmode="layer">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:80px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:vertical-lr;text-anchor:middle;display:inline;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="83.669571"
+ y="136.78285"
+ id="text948-6"
+ inkscape:label="setpoint_label"><tspan
+ sodipodi:role="line"
+ id="tspan946-2"
+ x="136.78285"
+ y="83.669571"
+ style="stroke-width:1px">设定值</tspan></text>
+ <text
+ id="text952-9"
+ y="137.16286"
+ x="703.711"
+ style="font-style:normal;font-weight:normal;font-size:80px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;writing-mode:vertical-lr;display:inline;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="actual_label"><tspan
+ y="703.711"
+ x="137.16286"
+ id="tspan950-1"
+ sodipodi:role="line"
+ style="text-align:center;writing-mode:vertical-lr;text-anchor:middle;stroke-width:1px">当前值</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:80px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;writing-mode:vertical-lr;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="480.61847"
+ y="278.37503"
+ id="text956-2"
+ inkscape:label="pressure_label"><tspan
+ sodipodi:role="line"
+ id="tspan954-7"
+ x="278.37503"
+ y="480.61847"
+ style="writing-mode:vertical-lr;fill:#ff6600;stroke-width:0.99999994px">压力</tspan></text>
+ <text
+ inkscape:label="setting_jmp"
+ id="text1097"
+ y="656.98151"
+ x="1090.7626"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px"
+ y="656.98151"
+ x="1090.7626"
+ id="tspan1095"
+ sodipodi:role="line">设置</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="1090.7626"
+ y="1436.9814"
+ id="text1101"
+ inkscape:label="home_jmp"><tspan
+ sodipodi:role="line"
+ x="1090.7626"
+ y="1436.9814"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px"
+ id="tspan1107">家</tspan></text>
+ </g>
+ <g
+ id="layer2"
+ inkscape:label="HMI:Lang:fr"
+ style="display:none"
+ inkscape:groupmode="layer">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="340.9082"
+ y="77.142853"
+ id="text948"
+ inkscape:label="setpoint_label"><tspan
+ sodipodi:role="line"
+ id="tspan946"
+ x="340.9082"
+ y="77.142853">Valeur de consigne</tspan></text>
+ <text
+ id="text952"
+ y="77.142853"
+ x="960.9082"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="actual_label"><tspan
+ y="77.142853"
+ x="960.9082"
+ id="tspan950"
+ sodipodi:role="line"
+ style="text-align:center;text-anchor:middle">Valeur courante</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="420.37848"
+ y="399.41504"
+ id="text956"
+ inkscape:label="pressure_label"><tspan
+ sodipodi:role="line"
+ id="tspan954"
+ x="420.37848"
+ y="399.41504"
+ style="fill:#ff6600;stroke-width:0.99999994px">Pression</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="1090.7626"
+ y="656.98151"
+ id="setting_jmp-0"
+ inkscape:label="setting_jmp"><tspan
+ sodipodi:role="line"
+ id="tspan1024-9"
+ x="1090.7626"
+ y="656.98151"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px">Settings</tspan></text>
+ <text
+ inkscape:label="home_jmp"
+ id="home_jmp-3"
+ y="1436.9814"
+ x="1090.7626"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px"
+ y="1436.9814"
+ x="1090.7626"
+ id="tspan1028-6"
+ sodipodi:role="line">Home</tspan></text>
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="HMI:Lang:si"
+ style="display:none"
+ inkscape:groupmode="layer">
+ <text
+ id="text930"
+ y="77.142853"
+ x="338.67188"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="setpoint_label"><tspan
+ y="77.142853"
+ x="338.67188"
+ id="tspan928"
+ sodipodi:role="line">nastavljena vrednost</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="959.38477"
+ y="77.142853"
+ id="text934"
+ inkscape:label="actual_label"><tspan
+ sodipodi:role="line"
+ id="tspan932"
+ x="959.38477"
+ y="77.142853">dejanska vrednost</tspan></text>
+ <text
+ id="text938"
+ y="399.41504"
+ x="420.37848"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="pressure_label"><tspan
+ style="fill:#ff6600;stroke-width:0.99999994px"
+ y="399.41504"
+ x="420.37848"
+ id="tspan936"
+ sodipodi:role="line">pritisk</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="1090.7626"
+ y="656.98151"
+ id="setting_jmp-06"
+ inkscape:label="setting_jmp"><tspan
+ sodipodi:role="line"
+ id="tspan1024-2"
+ x="1090.7626"
+ y="656.98151"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px">Settings</tspan></text>
+ <text
+ inkscape:label="home_jmp"
+ id="home_jmp-6"
+ y="1436.9814"
+ x="1090.7626"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px"
+ y="1436.9814"
+ x="1090.7626"
+ id="tspan1028-1"
+ sodipodi:role="line">Home</tspan></text>
+ </g>
+ <g
+ inkscape:label="HMI:Meter@/PUMP0/SLOTH"
+ transform="matrix(7.5590552,0,0,7.5590552,-244.3956,1321.2434)"
+ id="g110">
+ <path
+ 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:none;stroke-width:0;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"
+ d="M 113.38908,2.2017068 V -62.210247"
+ id="path90"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc"
+ inkscape:label="range" />
+ <path
+ inkscape:label="needle"
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path92"
+ d="M 113.38908,4.0725977 V -62.210247"
+ style="fill:none;fill-rule:evenodd;stroke:url(#linearGradient964);stroke-width:13.22916698;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:29.63333321;stroke-opacity:1" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:5.29166651px;line-height:125%;font-family:sans-serif;text-align:end;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="115.07632"
+ y="9.3424692"
+ id="text96"
+ inkscape:label="min"><tspan
+ sodipodi:role="line"
+ id="tspan94"
+ x="115.07632"
+ y="9.3424692"
+ style="text-align:end;text-anchor:end;fill:#ff6600;stroke-width:0.26458332px">0</tspan></text>
+ <text
+ id="text100"
+ y="-64.195457"
+ x="113.27539"
+ style="font-style:normal;font-weight:normal;font-size:5.29166651px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="max"><tspan
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.26458332px"
+ y="-64.195457"
+ x="113.27539"
+ id="tspan98"
+ sodipodi:role="line">10000</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="-20.624428"
+ y="-109.67243"
+ id="text104"
+ inkscape:label="value"
+ transform="rotate(90)"><tspan
+ sodipodi:role="line"
+ x="-20.624428"
+ y="-109.67243"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.26458332px"
+ id="tspan102">000</tspan></text>
+ <text
+ inkscape:label="unit"
+ id="text108"
+ y="-9.4425077"
+ x="140.65398"
+ style="font-style:normal;font-weight:normal;font-size:7.5467205px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ id="tspan106"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.26458332px"
+ y="-9.4425077"
+ x="140.65398"
+ sodipodi:role="line">€£$¥</tspan></text>
+ </g>
+ <g
+ inkscape:label="HMI:Input@/TARGETPRESSURE"
+ id="g991"
+ transform="translate(-60,900)">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="136.32812"
+ y="218.24219"
+ id="text977"
+ inkscape:label="value"><tspan
+ sodipodi:role="line"
+ id="tspan975"
+ x="136.32812"
+ y="218.24219"
+ style="stroke-width:1px">8888</tspan></text>
+ <rect
+ inkscape:label="edit"
+ onclick=""
+ y="95.40741"
+ x="139.85185"
+ height="128"
+ width="407.7037"
+ id="rect983"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff00ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;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" />
+ <g
+ id="g1086"
+ inkscape:label="=0"
+ transform="translate(-416.52022,170.47452)">
+ <path
+ inkscape:connector-curvature="0"
+ id="path989"
+ d="m 797.19546,145.18619 -80.62929,0.60214 -0.60215,-80.629288 80.6293,-0.60214 z"
+ inkscape:transform-center-y="-14.956361"
+ 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:none;stroke-width:5;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" />
+ <text
+ id="text1048"
+ y="111.05016"
+ x="733.58197"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="stroke-width:0.5px"
+ y="111.05016"
+ x="733.58197"
+ id="tspan1046"
+ sodipodi:role="line">→0←</tspan></text>
+ </g>
+ <g
+ id="g1091"
+ inkscape:label="-10"
+ transform="translate(-416.52022,170.47452)">
+ <path
+ inkscape:transform-center-x="14.956371"
+ inkscape:transform-center-y="-3.6154501e-05"
+ d="m 622.6459,-170.03172 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="14.956361"
+ sodipodi:r1="29.912722"
+ sodipodi:cy="-184.98808"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="3"
+ id="path981"
+ 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:none;stroke-width:5;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"
+ sodipodi:type="star"
+ transform="matrix(0,-2.0000001,1.9999999,0,1034.195,1298.6541)" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="633.09552"
+ y="111.05016"
+ id="text1059"><tspan
+ sodipodi:role="line"
+ id="tspan1057"
+ x="633.09552"
+ y="111.05016"
+ style="stroke-width:0.5px">-10</tspan></text>
+ </g>
+ <g
+ id="g1096"
+ inkscape:label="-100"
+ transform="translate(-416.52022,170.47452)">
+ <path
+ inkscape:transform-center-x="14.956364"
+ transform="rotate(-90,746.45698,-44.543641)"
+ sodipodi:type="star"
+ 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:none;stroke-width:5;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"
+ id="path979"
+ sodipodi:sides="3"
+ sodipodi:cx="596.74072"
+ sodipodi:cy="-216.2599"
+ sodipodi:r1="59.825443"
+ sodipodi:r2="29.912722"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 648.55108,-186.34718 -103.62071,0 51.81035,-89.73817 z"
+ inkscape:transform-center-y="-5.9989963e-06" />
+ <text
+ id="text1063"
+ y="111.05016"
+ x="537.25018"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="stroke-width:0.5px"
+ y="111.05016"
+ x="537.25018"
+ id="tspan1061"
+ sodipodi:role="line">-100</tspan></text>
+ </g>
+ <g
+ id="g1076"
+ inkscape:label="+100"
+ transform="translate(-416.52022,170.47452)">
+ <path
+ inkscape:transform-center-x="-14.956365"
+ transform="matrix(0,-1,-1,0,1043.9134,701.91334)"
+ inkscape:transform-center-y="-5.5023185e-06"
+ d="m 648.55108,135.08534 -103.62071,0 51.81035,-89.738161 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="29.912722"
+ sodipodi:r1="59.825443"
+ sodipodi:cy="105.17262"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="3"
+ id="path985"
+ 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:none;stroke-width:5;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"
+ sodipodi:type="star" />
+ <text
+ id="text1067"
+ y="111.05016"
+ x="925.82605"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="stroke-width:0.5px"
+ y="111.05016"
+ x="925.82605"
+ id="tspan1065"
+ sodipodi:role="line">+100</tspan></text>
+ </g>
+ <g
+ id="g1081"
+ inkscape:label="+10"
+ transform="translate(-416.52022,170.47452)">
+ <path
+ inkscape:transform-center-x="-14.956349"
+ transform="matrix(0,-2.0000001,-1.9999999,0,1122.1514,1298.6541)"
+ sodipodi:type="star"
+ 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:none;stroke-width:5;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"
+ id="path987"
+ sodipodi:sides="3"
+ sodipodi:cx="596.74072"
+ sodipodi:cy="136.44444"
+ sodipodi:r1="29.912722"
+ sodipodi:r2="14.956361"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 622.6459,151.4008 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:transform-center-y="-3.3040441e-05" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="842.71497"
+ y="111.05016"
+ id="text1071"><tspan
+ sodipodi:role="line"
+ id="tspan1069"
+ x="842.71497"
+ y="111.05016"
+ style="stroke-width:0.5px">+10</tspan></text>
+ </g>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#82ff77;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
+ x="736.32812"
+ y="1478.2422"
+ id="text995"
+ inkscape:label="HMI:Display@/PUMP0/PRESSURE"><tspan
+ sodipodi:role="line"
+ id="tspan993"
+ x="736.32812"
+ y="1478.2422"
+ style="fill:#82ff77;fill-opacity:1;stroke-width:1px;">8888</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:80px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="38.164062"
+ y="449.12109"
+ id="text134"
+ inkscape:label="HMI:Display@/PUMP0/STROUT"><tspan
+ sodipodi:role="line"
+ id="tspan132"
+ x="38.164062"
+ y="449.12109"
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0.5px">8888</tspan></text>
+ <text
+ inkscape:label="HMI:Display@/PUMP0/BOOLOUT"
+ id="text138"
+ y="549.12109"
+ x="38.164062"
+ style="font-style:normal;font-weight:normal;font-size:80px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0.5px"
+ y="549.12109"
+ x="38.164062"
+ id="tspan136"
+ sodipodi:role="line">8888</tspan></text>
+ <g
+ transform="matrix(0.5,0,0,0.5,-9.889736,205.71623)"
+ id="g208-1"
+ inkscape:label="HMI:Input@/PUMP0/STRIN"
+ style="stroke-width:2">
+ <text
+ inkscape:label="value"
+ id="text164"
+ y="218.24219"
+ x="136.32812"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="stroke-width:2px"
+ y="218.24219"
+ x="136.32812"
+ id="tspan162"
+ sodipodi:role="line">8888</tspan></text>
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff00ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;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"
+ id="rect166"
+ width="407.7037"
+ height="128"
+ x="139.85185"
+ y="95.40741"
+ onclick=""
+ inkscape:label="edit" />
+ <g
+ transform="translate(-416.52022,170.47452)"
+ inkscape:label="+"dhu""
+ id="g174"
+ style="stroke-width:2">
+ <path
+ 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:none;stroke-width:10;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"
+ inkscape:transform-center-y="-14.956361"
+ d="m 797.19546,145.18619 -80.62929,0.60214 -0.60215,-80.629288 80.6293,-0.60214 z"
+ id="path168"
+ inkscape:connector-curvature="0" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="733.58197"
+ y="111.05016"
+ id="text172"><tspan
+ sodipodi:role="line"
+ id="tspan170"
+ x="733.58197"
+ y="111.05016"
+ style="stroke-width:1px">dhu</tspan></text>
+ </g>
+ <g
+ transform="translate(-416.52022,170.47452)"
+ inkscape:label="="plop""
+ id="g182"
+ style="stroke-width:2">
+ <path
+ transform="matrix(0,-2.0000001,1.9999999,0,1034.195,1298.6541)"
+ sodipodi:type="star"
+ 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:none;stroke-width:10;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"
+ id="path176"
+ sodipodi:sides="3"
+ sodipodi:cx="596.74072"
+ sodipodi:cy="-184.98808"
+ sodipodi:r1="29.912722"
+ sodipodi:r2="14.956361"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 622.6459,-170.03172 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:transform-center-y="-3.6154501e-05"
+ inkscape:transform-center-x="14.956371" />
+ <text
+ id="text180"
+ y="111.05016"
+ x="633.09552"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="stroke-width:1px"
+ y="111.05016"
+ x="633.09552"
+ id="tspan178"
+ sodipodi:role="line">plop</tspan></text>
+ </g>
+ <g
+ transform="translate(-416.52022,170.47452)"
+ inkscape:label="="mhoo""
+ id="g190"
+ style="stroke-width:2">
+ <path
+ inkscape:transform-center-y="-5.9989963e-06"
+ d="m 648.55108,-186.34718 -103.62071,0 51.81035,-89.73817 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="29.912722"
+ sodipodi:r1="59.825443"
+ sodipodi:cy="-216.2599"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="3"
+ id="path184"
+ 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:none;stroke-width:10;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"
+ sodipodi:type="star"
+ transform="rotate(-90,746.45698,-44.543641)"
+ inkscape:transform-center-x="14.956364" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="537.25018"
+ y="111.05016"
+ id="text188"><tspan
+ sodipodi:role="line"
+ id="tspan186"
+ x="537.25018"
+ y="111.05016"
+ style="stroke-width:1px">mhoo</tspan></text>
+ </g>
+ <g
+ transform="translate(-416.52022,170.47452)"
+ inkscape:label="="yodl""
+ id="g198"
+ style="stroke-width:2">
+ <path
+ sodipodi:type="star"
+ 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:none;stroke-width:10;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"
+ id="path192"
+ sodipodi:sides="3"
+ sodipodi:cx="596.74072"
+ sodipodi:cy="105.17262"
+ sodipodi:r1="59.825443"
+ sodipodi:r2="29.912722"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 648.55108,135.08534 -103.62071,0 51.81035,-89.738161 z"
+ inkscape:transform-center-y="-5.5023185e-06"
+ transform="matrix(0,-1,-1,0,1043.9134,701.91334)"
+ inkscape:transform-center-x="-14.956365" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="925.82605"
+ y="111.05016"
+ id="text196"><tspan
+ sodipodi:role="line"
+ id="tspan194"
+ x="925.82605"
+ y="111.05016"
+ style="stroke-width:1px">yodl</tspan></text>
+ </g>
+ <g
+ transform="translate(-416.52022,170.47452)"
+ inkscape:label="="mhe""
+ id="g206-1"
+ style="stroke-width:2">
+ <path
+ inkscape:transform-center-y="-3.3040441e-05"
+ d="m 622.6459,151.4008 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="14.956361"
+ sodipodi:r1="29.912722"
+ sodipodi:cy="136.44444"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="3"
+ id="path200"
+ 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:none;stroke-width:10;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"
+ sodipodi:type="star"
+ transform="matrix(0,-2.0000001,-1.9999999,0,1122.1514,1298.6541)"
+ inkscape:transform-center-x="-14.956349" />
+ <text
+ id="text204"
+ y="111.05016"
+ x="842.71497"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="stroke-width:1px"
+ y="111.05016"
+ x="842.71497"
+ id="tspan202"
+ sodipodi:role="line">mhe</tspan></text>
+ </g>
+ </g>
+ <g
+ inkscape:label="HMI:Keypad:HMI_INT:HMI_REAL"
+ id="g2432"
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ transform="matrix(3.3549332,0,0,3.14525,-181.87457,2336.0198)">
+ <path
+ sodipodi:nodetypes="ccccc"
+ inkscape:label="Background"
+ inkscape:connector-curvature="0"
+ id="path2136"
+ d="M 54.211099,1.2654702 H 435.73881 V 230.18209 H 54.211099 Z"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.6;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.16776976;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" />
+ <rect
+ ry="3.8152773"
+ rx="3.8152773"
+ y="15.77106"
+ x="64.024963"
+ height="30.150299"
+ width="361.89996"
+ id="rect2426"
+ 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:#fffff5;fill-opacity:1;fill-rule:nonzero;stroke:#202326;stroke-width:0;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"
+ inkscape:label="Field" />
+ <text
+ id="text2430"
+ y="37.408375"
+ x="72.50132"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.0763855px;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:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.47690967px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="Value"><tspan
+ style="text-align:start;text-anchor:start;stroke-width:0.47690967px"
+ y="37.408375"
+ x="72.50132"
+ id="tspan2428"
+ sodipodi:role="line">number</tspan></text>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ inkscape:label="Enter"
+ id="g4947"
+ transform="matrix(1.6700128,0,0,1.6700128,-826.83854,-145.60855)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;stroke:none;stroke-width:0.10074362;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path193"
+ d="m 750,175 c 0,-2 -1,-3 -3,-3 h -20 c -1,0 -3,1 -3,3 v 43 c 0,1 2,2 3,2 h 20 c 2,0 3,-1 3,-2 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m -1244.2949,1166.5938 v 15.791 h -38.6875 v -2.9981 l -6.9199,4 6.9199,4 v -2.998 h 40.6836 v -17.7949 z"
+ transform="matrix(0.28557246,0,0,0.28557246,1098.7155,-140.51013)"
+ id="path6545-4"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ inkscape:label="Keys"
+ id="g4993"
+ transform="matrix(1.6700128,0,0,1.6700128,-826.83854,-145.60855)">
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="7"
+ id="g4892">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,120 h 20 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ id="path163"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text331"
+ y="129.38269"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">7</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="4"
+ id="g4907">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,146 h 20 c 2,0 3,1 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path169"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text335"
+ y="154.10822"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">4</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="1"
+ id="g4922">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,172 h 20 c 2,0 3,1 3,3 v 17 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -17 c 0,-2 2,-3 3,-3 z"
+ id="path175"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text339"
+ y="179.82285"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">1</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="8"
+ id="g4897">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 668,120 h 19 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -19 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ id="path165"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text347"
+ y="129.38269"
+ x="667.07562"
+ transform="scale(1.0007154,0.99928514)">8</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="5"
+ id="g4912">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 668,146 h 19 c 2,0 3,1 3,3 v 18 c 0,2 -1,3 -3,3 h -19 c -1,0 -3,-1 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path171"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text351"
+ y="154.10822"
+ x="667.07562"
+ transform="scale(1.0007154,0.99928514)">5</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="2"
+ id="g4927">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 668,172 h 19 c 2,0 3,1 3,3 v 17 c 0,1 -1,3 -3,3 h -19 c -1,0 -3,-2 -3,-3 v -17 c 0,-2 2,-3 3,-3 z"
+ id="path177"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text355"
+ y="179.82285"
+ x="667.07562"
+ transform="scale(1.0007154,0.99928514)">2</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="9"
+ id="g4902">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,120 h 20 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ id="path167"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text363"
+ y="129.38269"
+ x="695.75708"
+ transform="scale(1.0007154,0.99928514)">9</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="6"
+ id="g4917">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,146 h 20 c 2,0 3,1 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path173"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text367"
+ y="154.10822"
+ x="695.75708"
+ transform="scale(1.0007154,0.99928514)">6</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="3"
+ id="g4932">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,172 h 20 c 2,0 3,1 3,3 v 17 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -17 c 0,-2 2,-3 3,-3 z"
+ id="path179"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text371"
+ y="179.82285"
+ x="695.75708"
+ transform="scale(1.0007154,0.99928514)">3</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="0"
+ id="g4937">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,220 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 h 49 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 z"
+ id="path373"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text377"
+ y="205.53712"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">0</text>
+ </g>
+ </g>
+ <g
+ id="g3113"
+ inkscape:label="Esc"
+ transform="translate(-318.22576)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path167-3"
+ d="m 387.26079,54.792986 h 33.40019 c 3.34,0 5.01006,3.34003 5.01006,5.010045 v 30.060225 c 0,3.340029 -1.67006,5.010032 -5.01006,5.010032 h -33.40019 c -1.67006,0 -5.01007,-1.670003 -5.01007,-5.010032 V 59.803031 c 0,-1.670015 3.34001,-5.010045 5.01007,-5.010045 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="394.42801"
+ y="78.632088"
+ id="text469-4"
+ style="font-weight:normal;font-size:10.63882256px;font-family:Arial;fill:#ffffff;fill-rule:evenodd;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928511)">Esc</text>
+ </g>
+ <g
+ id="g3109"
+ inkscape:label="BackSpace"
+ transform="translate(0,-43.420332)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path173-1"
+ d="m 387.26079,98.213318 h 33.40019 c 3.34,0 5.01006,1.670013 5.01006,5.010032 v 30.06024 c 0,3.34002 -1.67006,5.01003 -5.01006,5.01003 h -33.40019 c -1.67006,0 -5.01007,-1.67001 -5.01007,-5.01003 v -30.06024 c 0,-3.340019 3.34001,-5.010032 5.01007,-5.010032 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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:#2b2828;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m -1278.9668,1041.3047 -6.9199,4 6.9199,4 v -3 h 33.416 v -1.9981 h -33.416 z"
+ transform="matrix(0.47690966,0,0,0.47690966,1008.0304,-380.26227)"
+ id="path11623-1-0-2"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g787"
+ inkscape:label="Sign"
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ transform="matrix(1.6700128,0,0,1.6700128,-678.20742,-102.18822)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path781"
+ d="m 638,120 h 20 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="642.1239"
+ y="135.09822"
+ id="text783"
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ transform="scale(1.0007154,0.99928514)">+/-</text>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.31375408px;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;fill-rule:evenodd;stroke:none;stroke-width:0.30784383px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="252.9579"
+ y="12.333653"
+ id="text509"
+ transform="scale(0.96824589,1.0327955)"
+ inkscape:label="Info"><tspan
+ sodipodi:role="line"
+ id="tspan507"
+ x="252.9579"
+ y="12.333653"
+ style="stroke-width:0.30784383px">information</tspan></text>
+ <g
+ transform="matrix(1.6700128,0,0,1.6700128,-826.83854,-145.60856)"
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ id="g4942"
+ inkscape:label="NumDot">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,197 h 20 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -20 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 z"
+ id="path181"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:6.96602964px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text771"
+ y="204.54802"
+ x="696.7464"
+ transform="scale(1.0007154,0.99928514)">.</text>
+ </g>
+ </g>
+ <g
+ transform="matrix(3.3549332,0,0,3.14525,-181.87457,1556.0198)"
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4278"
+ inkscape:label="HMI:Keypad:HMI_STRING">
+ <path
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.6;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.16776976;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"
+ d="M 54.211084,1.2654702 H 435.7388 V 230.18209 H 54.211084 Z"
+ id="rect1006-3"
+ inkscape:connector-curvature="0"
+ inkscape:label="Background"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path185"
+ d="m 162,197 h -11 c -2,0 -3,1 -3,3 v 18 c 0,2 1,3 3,3 h 11 168 18 c 0,0 1,-1 1,-3 v -18 c 0,-2 -1,-3 -1,-3 h -18 z"
+ inkscape:connector-curvature="0"
+ inkscape:label="Space" />
+ <g
+ id="g4380"
+ inkscape:label="Keys"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-19.076386)">
+ <g
+ id="g4283"
+ inkscape:label="q Q"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path41"
+ d="m 95,121 h 19 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 H 95 c -1,0 -3,-2 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="99.378708"
+ y="138.28395"
+ id="text203"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">Q</text>
+ </g>
+ <g
+ id="g4337"
+ inkscape:label="w W"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path43"
+ d="m 124,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="127.0709"
+ y="138.28395"
+ id="text207"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">W</text>
+ </g>
+ <g
+ id="g4332"
+ inkscape:label="e E"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path45"
+ d="m 154,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="159.70854"
+ y="138.28395"
+ id="text211"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">E</text>
+ </g>
+ <g
+ id="g4326"
+ inkscape:label="r R"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path47"
+ d="m 184,121 h 19 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -19 c -1,0 -3,-2 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="188.39003"
+ y="138.28395"
+ id="text215"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">R</text>
+ </g>
+ <g
+ id="g4321"
+ inkscape:label="t T"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path49"
+ d="m 213,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 v -18 c 0,-2 1,-3 2,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="219.04961"
+ y="138.28395"
+ id="text219"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">T</text>
+ </g>
+ <g
+ id="g4316"
+ inkscape:label="y Y"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path51"
+ d="m 243,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 v -18 c 0,-2 1,-3 2,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="248.72017"
+ y="138.28395"
+ id="text223"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">Y</text>
+ </g>
+ <g
+ id="g4311"
+ inkscape:label="u U"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path53"
+ d="m 273,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 v -18 c 0,-2 1,-3 2,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="278.39075"
+ y="138.28395"
+ id="text227"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">U</text>
+ </g>
+ <g
+ id="g4306"
+ inkscape:label="i I"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path55"
+ d="m 302,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 v -18 c 0,-2 1,-3 2,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="311.02859"
+ y="138.28395"
+ id="text231"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">I</text>
+ </g>
+ <g
+ id="g4301"
+ inkscape:label="o O"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path57"
+ d="m 332,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 v -18 c 0,-2 1,-3 2,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="336.74319"
+ y="138.28395"
+ id="text235"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">O</text>
+ </g>
+ <g
+ id="g4296"
+ inkscape:label="p P"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-9.5381931)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path59"
+ d="m 362,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 v -18 c 0,-2 1,-3 2,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="367.40256"
+ y="138.28395"
+ id="text239"
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928514)">P</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4511"
+ inkscape:label="a A">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 103,147 h 19 c 1,0 3,1 3,2 v 19 c 0,1 -2,2 -3,2 h -19 c -2,0 -3,-1 -3,-2 v -19 c 0,-1 1,-2 3,-2 z"
+ id="path65"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text243"
+ y="163.99854"
+ x="107.29005"
+ transform="scale(1.0007154,0.99928514)">A</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4516"
+ inkscape:label="s S">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 132,147 h 20 c 1,0 3,1 3,2 v 19 c 0,1 -2,2 -3,2 h -20 c -2,0 -3,-1 -3,-2 v -19 c 0,-1 1,-2 3,-2 z"
+ id="path67"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text247"
+ y="163.99854"
+ x="137.95012"
+ transform="scale(1.0007154,0.99928514)">S</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4521"
+ inkscape:label="d D">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 162,147 h 20 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -20 c -2,0 -3,-1 -3,-2 v -19 c 0,-1 1,-2 3,-2 z"
+ id="path69"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text251"
+ y="163.99854"
+ x="166.63159"
+ transform="scale(1.0007154,0.99928514)">D</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4526"
+ inkscape:label="f F">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 192,147 h 19 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -19 c -2,0 -3,-1 -3,-2 v -19 c 0,-1 1,-2 3,-2 z"
+ id="path71"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text255"
+ y="163.99854"
+ x="197.29166"
+ transform="scale(1.0007154,0.99928514)">F</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4531"
+ inkscape:label="g G">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 221,147 h 20 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -20 c -2,0 -3,-1 -3,-2 v -19 c 0,-1 1,-2 3,-2 z"
+ id="path73"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text259"
+ y="163.99854"
+ x="225.97284"
+ transform="scale(1.0007154,0.99928514)">G</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4536"
+ inkscape:label="h H">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 251,147 h 20 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -20 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 z"
+ id="path75"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text263"
+ y="163.99854"
+ x="255.64342"
+ transform="scale(1.0007154,0.99928514)">H</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4541"
+ inkscape:label="j J">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 281,147 h 19 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -19 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 z"
+ id="path77"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text267"
+ y="163.99854"
+ x="287.29208"
+ transform="scale(1.0007154,0.99928514)">J</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4546"
+ inkscape:label="k K">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 310,147 h 20 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -20 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 z"
+ id="path79"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text271"
+ y="163.99854"
+ x="314.98465"
+ transform="scale(1.0007154,0.99928514)">K</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4551"
+ inkscape:label="l L">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 340,147 h 20 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -20 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 z"
+ id="path81"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text275"
+ y="163.99854"
+ x="345.64444"
+ transform="scale(1.0007154,0.99928514)">L</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4586"
+ inkscape:label="z Z"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 113,172 h 21 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -21 c -1,0 -2,-1 -2,-3 v -17 c 0,-1 1,-3 2,-3 z"
+ id="path87-3"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text279"
+ y="188.72411"
+ x="119.15855"
+ transform="scale(1.0007154,0.99928514)">Z</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4581"
+ inkscape:label="x X"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 143,172 h 21 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -21 c -1,0 -2,-1 -2,-3 v -17 c 0,-1 1,-3 2,-3 z"
+ id="path89-6"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text283"
+ y="188.72411"
+ x="148.82933"
+ transform="scale(1.0007154,0.99928514)">X</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4576"
+ inkscape:label="c C"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 173,172 h 21 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -21 c -1,0 -2,-1 -2,-3 v -17 c 0,-1 1,-3 2,-3 z"
+ id="path91-7"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text287"
+ y="188.72411"
+ x="178.50011"
+ transform="scale(1.0007154,0.99928514)">C</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4571"
+ inkscape:label="v V"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 202,172 h 21 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -21 c 0,0 -1,-1 -1,-3 v -17 c 0,-1 1,-3 1,-3 z"
+ id="path195"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text291"
+ y="188.72411"
+ x="208.16988"
+ transform="scale(1.0007154,0.99928514)">V</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4566"
+ inkscape:label="b B"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 233,172 h 20 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -20 c -2,0 -3,-1 -3,-3 v -17 c 0,-1 1,-3 3,-3 z"
+ id="path93"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text295"
+ y="188.72411"
+ x="237.84096"
+ transform="scale(1.0007154,0.99928514)">B</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4561"
+ inkscape:label="n N"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 263,172 h 20 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -20 c -2,0 -3,-1 -3,-3 v -17 c 0,-1 1,-3 3,-3 z"
+ id="path95"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text299"
+ y="188.72411"
+ x="267.51193"
+ transform="scale(1.0007154,0.99928514)">N</text>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4556"
+ inkscape:label="m M"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 293,172 h 19 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -19 c -2,0 -3,-1 -3,-3 v -17 c 0,-1 1,-3 3,-3 z"
+ id="path97"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text303"
+ y="188.72411"
+ x="296.1933"
+ transform="scale(1.0007154,0.99928514)">M</text>
+ </g>
+ <g
+ id="g4818"
+ inkscape:label=". :"
+ style="stroke-width:0.47631353"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 352,172 h 20 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -20 c -2,0 -3,-1 -3,-3 v -17 c 0,-1 1,-3 3,-3 z"
+ id="path101"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ transform="scale(1.0007154,0.99928513)"
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;fill-rule:evenodd;stroke-width:0.36866826"
+ id="text719"
+ y="189.66107"
+ x="359.58276">.</text>
+ <text
+ x="359.58276"
+ y="181.64532"
+ id="text4834"
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;fill-rule:evenodd;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928512)">:</text>
+ </g>
+ <g
+ id="g4813"
+ inkscape:label=", ;"
+ style="stroke-width:0.47631353"
+ transform="translate(0,9.5381929)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 322,172 h 20 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 h -20 c -2,0 -3,-1 -3,-3 v -17 c 0,-1 1,-3 3,-3 z"
+ id="path99"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;fill-rule:evenodd;stroke-width:0.36866826"
+ id="text727"
+ y="181.64532"
+ x="330.00806"
+ transform="scale(1.0007154,0.99928512)">;</text>
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;fill-rule:evenodd;stroke-width:0.36866826"
+ y="189.66107"
+ x="330.00806"
+ transform="scale(1.0007154,0.99928512)"
+ id="text4826">,</text>
+ </g>
+ <g
+ style="stroke-width:0.47631353"
+ inkscape:label="1"
+ id="g2845"
+ transform="translate(-13.353469,-45.783327)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 95,121 h 19 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 H 95 c -1,0 -3,-2 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path2839"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2841"
+ y="138.28395"
+ x="101.07153"
+ transform="scale(1.0007154,0.99928513)">1</text>
+ </g>
+ <g
+ style="stroke-width:0.47631353"
+ inkscape:label="2"
+ id="g2853"
+ transform="translate(-13.353469,-45.783327)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 124,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path2847"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2849"
+ y="138.28395"
+ x="130.18704"
+ transform="scale(1.0007154,0.99928513)">2</text>
+ </g>
+ <g
+ inkscape:label="3"
+ id="g2861"
+ style="stroke-width:0.47631353"
+ transform="translate(-13.353469,-45.783327)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 154,121 h 20 c 2,0 3,1 3,3 v 18 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path2855"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2857"
+ y="138.28395"
+ x="159.70854"
+ transform="scale(1.0007154,0.99928514)">3</text>
+ </g>
+ <g
+ id="g2957"
+ inkscape:label="4"
+ transform="translate(0,-19.076386)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 170.64653,94.293059 h 19 c 2,0 3,1 3,3 v 18.000001 c 0,1 -1,3 -3,3 h -19 c -1,0 -3,-2 -3,-3 V 97.293059 c 0,-2 2,-3 3,-3 z"
+ id="path2865"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2867"
+ y="111.55791"
+ x="176.39188"
+ transform="scale(1.0007154,0.99928514)">4</text>
+ </g>
+ <g
+ id="g2962"
+ inkscape:label="5"
+ transform="translate(0,-19.076386)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 199.64653,94.293059 h 20 c 2,0 3,1 3,3 v 18.000001 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 V 97.293059 c 0,-2 1,-3 2,-3 z"
+ id="path2873"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2875"
+ y="111.55791"
+ x="205.70567"
+ transform="scale(1.0007154,0.99928514)">5</text>
+ </g>
+ <g
+ id="g2967"
+ inkscape:label="6"
+ transform="translate(0,-19.076386)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 229.64653,94.293059 h 20 c 2,0 3,1 3,3 v 18.000001 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 V 97.293059 c 0,-2 1,-3 2,-3 z"
+ id="path2881"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2883"
+ y="111.55791"
+ x="236.15851"
+ transform="scale(1.0007154,0.99928514)">6</text>
+ </g>
+ <g
+ id="g2972"
+ inkscape:label="7"
+ transform="translate(0,-19.076386)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 259.64653,94.293059 h 20 c 2,0 3,1 3,3 v 18.000001 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 V 97.293059 c 0,-2 1,-3 2,-3 z"
+ id="path2889"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2891"
+ y="111.55791"
+ x="266.06564"
+ transform="scale(1.0007154,0.99928514)">7</text>
+ </g>
+ <g
+ id="g2977"
+ inkscape:label="8"
+ transform="translate(0,-19.076386)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 288.64653,94.293059 h 20 c 2,0 3,1 3,3 v 18.000001 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 V 97.293059 c 0,-2 1,-3 2,-3 z"
+ id="path2897"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2899"
+ y="111.55791"
+ x="295.08231"
+ transform="scale(1.0007154,0.99928514)">8</text>
+ </g>
+ <g
+ id="g2982"
+ inkscape:label="9 -"
+ transform="translate(0,-19.076386)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 318.64653,94.293059 h 20 c 2,0 3,1 3,3 v 18.000001 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 V 97.293059 c 0,-2 1,-3 2,-3 z"
+ id="path2905"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2907"
+ y="111.55791"
+ x="325.05408"
+ transform="scale(1.0007154,0.99928514)">9</text>
+ <text
+ transform="scale(1.0007154,0.99928511)"
+ x="335.72681"
+ y="102.42173"
+ id="text806"
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;fill-rule:evenodd;stroke-width:0.36866826">-</text>
+ </g>
+ <g
+ id="g2987"
+ inkscape:label="0 +"
+ transform="translate(0,-19.076386)">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 348.64653,94.293059 h 20 c 2,0 3,1 3,3 v 18.000001 c 0,1 -1,3 -3,3 h -20 c -1,0 -2,-2 -2,-3 V 97.293059 c 0,-2 1,-3 2,-3 z"
+ id="path2913"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:13.93205929px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text2915"
+ y="111.55791"
+ x="355.05984"
+ transform="scale(1.0007154,0.99928514)">0</text>
+ <text
+ transform="scale(1.0007154,0.99928511)"
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;fill-rule:evenodd;stroke-width:0.36866826"
+ id="text804"
+ y="102.42173"
+ x="365.30151">+</text>
+ </g>
+ </g>
+ <g
+ transform="translate(335.89988,-58.934803)"
+ id="g3544"
+ inkscape:label="Esc"
+ style="stroke-width:0.47631353">
+ <path
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path105"
+ d="m 47.948645,115.07509 h 39.076386 c 1,0 3,1 3,3 v 18 c 0,1 -2,3 -3,3 H 47.948645 c -2,0 -3,-2 -3,-3 v -18 c 0,-2 1,-3 3,-3 z"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssssss" />
+ <text
+ transform="scale(1.0007154,0.99928512)"
+ style="font-weight:normal;font-size:9.37966251px;font-family:Arial;fill:#ffffff;fill-rule:evenodd;stroke-width:0.36866826"
+ id="text469"
+ y="130.02028"
+ x="59.288635">Esc</text>
+ </g>
+ <g
+ inkscape:label="Enter"
+ id="g4291"
+ style="stroke-width:0.47631353"
+ transform="translate(0,-19.076386)">
+ <path
+ sodipodi:nodetypes="sssssssss"
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;stroke:none;stroke-width:0.16824313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3616"
+ d="m 368.68274,170 c -1,0 -2,-1 -2,-3 v -17 c 0,-1 1,-3 2,-3 h 54.24217 c 2,0 3,2 3,3 v 17 c 0,2 -1,3 -3,3 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m -260.23633,1080.8125 v 15.7949 h -38.68555 v -3 l -6.91992,4 6.91992,4 v -3.0019 h 40.6836 v -17.793 z"
+ transform="matrix(0.47690966,0,0,0.47690966,531.12074,-361.18588)"
+ id="path6545"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ inkscape:label="BackSpace"
+ id="g4287"
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ transform="translate(2.3648311e-6,-28.614579)">
+ <path
+ sodipodi:nodetypes="sssssssss"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3624"
+ d="m 391.97749,144 c -1,0 -2,-1 -2,-3 v -17 c 0,-1 1,-3 2,-3 h 30.94742 c 2,0 3,2 3,3 v 17 c 0,2 -1,3 -3,3 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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:#2b2828;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m -268.72656,1011.1777 -6.91992,4 6.91992,4 v -3.0019 h 29.18945 v -1.9981 h -29.18945 z"
+ transform="matrix(0.47690966,0,0,0.47690966,531.12074,-351.64769)"
+ id="path11623-1-0"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g934"
+ inkscape:label="CapsLock">
+ <g
+ inkscape:label="inactive"
+ id="g942"
+ style="display:inline;fill-rule:evenodd;stroke-width:0.47631353"
+ transform="translate(0,-19.076386)">
+ <path
+ sodipodi:nodetypes="sssssssss"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path936"
+ d="m 67.025031,170 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 H 92 c 2,0 4,1 4,2 v 19 c 0,1 -2,2 -4,2 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="69.789322"
+ y="156.71973"
+ id="text938-5"
+ style="font-weight:normal;font-size:8.66233635px;font-family:Arial;fill:#2b2828;stroke-width:0.36866823"
+ transform="scale(1.0007154,0.99928515)">Caps</text>
+ <text
+ x="69.789322"
+ y="166.5585"
+ id="text940"
+ style="font-weight:normal;font-size:8.66233635px;font-family:Arial;fill:#2b2828;stroke-width:0.36866823"
+ transform="scale(1.0007154,0.99928515)">Lock</text>
+ </g>
+ <g
+ transform="translate(0,-19.076386)"
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ id="g4429"
+ inkscape:label="active">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 67.025031,170 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 H 92 c 2,0 4,1 4,2 v 19 c 0,1 -2,2 -4,2 z"
+ id="path199"
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;stroke:none;stroke-width:0.16824313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:nodetypes="sssssssss" />
+ <text
+ transform="scale(1.0007154,0.99928515)"
+ style="font-weight:normal;font-size:8.66233635px;font-family:Arial;fill:#ffffff;stroke-width:0.36866823"
+ id="text647"
+ y="156.71973"
+ x="69.789322">Caps</text>
+ <text
+ transform="scale(1.0007154,0.99928515)"
+ style="font-weight:normal;font-size:8.66233635px;font-family:Arial;fill:#ffffff;stroke-width:0.36866823"
+ id="text651"
+ y="166.5585"
+ x="69.789322">Lock</text>
+ </g>
+ </g>
+ <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:#fffff5;fill-opacity:1;fill-rule:nonzero;stroke:#202326;stroke-width:0;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"
+ id="rect2130"
+ width="361.89996"
+ height="30.150299"
+ x="64.024956"
+ y="15.771065"
+ rx="3.8152773"
+ ry="3.8152773"
+ inkscape:label="Field" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.0763855px;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:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.47690967px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="72.50132"
+ y="38.296417"
+ id="text1309"
+ inkscape:label="Value"><tspan
+ sodipodi:role="line"
+ id="tspan1307"
+ x="72.50132"
+ y="38.296417"
+ style="text-align:start;text-anchor:start;stroke-width:0.47690967px">text</tspan></text>
+ <g
+ id="g437"
+ inkscape:label="Shift">
+ <g
+ id="g421"
+ inkscape:label="inactive">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 379.96247,185.46181 c -1,0 -2,-1 -2,-3 v -17 c 0,-1 1,-3 2,-3 h 42.96244 c 2,0 3,2 3,3 v 17 c 0,2 -1,3 -3,3 z"
+ id="path910"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:nodetypes="sssssssss" />
+ <text
+ style="font-weight:normal;font-size:8.92098808px;font-family:Arial;fill:#2b2828;stroke-width:0.36866826"
+ id="text912"
+ y="177.90059"
+ x="392.55679"
+ transform="scale(1.0007154,0.99928513)">Shift</text>
+ <path
+ sodipodi:nodetypes="sssssssss"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path856"
+ d="m 67.025031,185.46181 c -1,0 -3,-1 -3,-3 v -17 c 0,-1 2,-3 3,-3 H 104 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="75.85218"
+ y="177.90059"
+ id="text858"
+ style="font-weight:normal;font-size:8.92098808px;font-family:Arial;fill:#2b2828;fill-rule:evenodd;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928513)">Shift</text>
+ </g>
+ <g
+ id="g413"
+ inkscape:label="active">
+ <path
+ sodipodi:nodetypes="sssssssss"
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;stroke:none;stroke-width:0.16824313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path551"
+ d="m 379.96247,185.46181 c -1,0 -2,-1 -2,-3 v -17 c 0,-1 1,-3 2,-3 h 42.96244 c 2,0 3,2 3,3 v 17 c 0,2 -1,3 -3,3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ transform="scale(1.0007154,0.99928513)"
+ x="392.55679"
+ y="177.90059"
+ id="text629"
+ style="font-weight:normal;font-size:8.92098808px;font-family:Arial;fill:#ffffff;stroke-width:0.36866826">Shift</text>
+ <path
+ inkscape:connector-curvature="0"
+ d="m 67.025031,185.46181 c -1,0 -3,-1 -3,-3 v -17 c 0,-1 2,-3 3,-3 H 104 c 1,0 2,2 2,3 v 17 c 0,2 -1,3 -2,3 z"
+ id="path879"
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:nodetypes="sssssssss" />
+ <text
+ transform="scale(1.0007154,0.99928513)"
+ style="font-weight:normal;font-size:8.92098808px;font-family:Arial;fill:#ffffff;fill-rule:evenodd;stroke-width:0.36866826"
+ id="text881"
+ y="177.90059"
+ x="75.85218">Shift</text>
+ </g>
+ </g>
+ <text
+ transform="scale(0.96824588,1.0327955)"
+ id="text471"
+ y="12.333657"
+ x="252.9579"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.31375408px;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;fill-rule:evenodd;stroke:none;stroke-width:0.30784383px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="Info"><tspan
+ style="stroke-width:0.30784383px"
+ y="12.333657"
+ x="252.9579"
+ id="tspan469"
+ sodipodi:role="line">information</tspan></text>
+ </g>
+ <g
+ id="g14237"
+ inkscape:label="HMI:DropDown:1:2:3:4:5:6:7:8:9:10@/SELECTION"
+ transform="translate(0,-640)">
+ <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:5;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"
+ id="rect14212"
+ width="391.99988"
+ height="130.9433"
+ x="864.00842"
+ y="923.98993"
+ rx="7"
+ ry="7"
+ inkscape:label="box" />
+ <text
+ id="text14183"
+ y="1011.9975"
+ x="881.44226"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;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:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#d42aff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="text"><tspan
+ style="text-align:start;text-anchor:start;fill:#d42aff;stroke-width:1px"
+ y="1011.9975"
+ x="881.44226"
+ sodipodi:role="line"
+ id="tspan421">sel_0</tspan></text>
+ <path
+ sodipodi:type="star"
+ style="opacity:1;vector-effect:none;fill:#a7a5a6;fill-opacity:1;stroke:none;stroke-width:0.35277769;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path424"
+ sodipodi:sides="3"
+ sodipodi:cx="1200.5"
+ sodipodi:cy="975"
+ sodipodi:r1="43.683521"
+ sodipodi:r2="21.841761"
+ sodipodi:arg1="1.5707963"
+ sodipodi:arg2="2.6179939"
+ inkscape:flatsided="false"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 1200.5,1018.6835 -18.9155,-32.76262 -18.9155,-32.76264 37.831,0 37.831,0 -18.9155,32.76264 z"
+ inkscape:transform-center-y="10.92088"
+ inkscape:label="button" />
+ </g>
+ <g
+ id="g14232"
+ inkscape:label="HMI:ScrollbarTemplate"
+ transform="translate(0,-640)">
+ <rect
+ ry="7"
+ rx="7"
+ y="938.1615"
+ x="1676.4542"
+ height="412.77173"
+ width="59.554077"
+ id="rect14179"
+ 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:#010000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ inkscape:label="border" />
+ <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:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;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"
+ id="rect14189"
+ width="34.127792"
+ height="137.37276"
+ x="1689.1526"
+ y="1005.6711"
+ rx="7"
+ ry="7"
+ inkscape:label="cursor" />
+ <path
+ sodipodi:nodetypes="cccc"
+ inkscape:connector-curvature="0"
+ id="rect14207"
+ d="m 1706.2165,965.67108 17.0639,17.37276 h -34.1278 z"
+ 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:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;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"
+ inkscape:label="up" />
+ <path
+ 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:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;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"
+ d="m 1706.2165,1323.0438 17.0639,-17.3727 h -34.1278 z"
+ id="path14210"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc"
+ inkscape:label="down" />
+ </g>
+ <text
+ id="text14183-9"
+ y="205.03906"
+ x="1493.8926"
+ 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"
+ xml:space="preserve"
+ inkscape:label="HMI:List:Primes"><tspan
+ style="stroke-width:1px"
+ y="205.03906"
+ x="1493.8926"
+ id="tspan14181-1"
+ sodipodi:role="line">one</tspan><tspan
+ style="stroke-width:1px"
+ y="255.03906"
+ x="1493.8926"
+ sodipodi:role="line"
+ id="tspan14257">two</tspan><tspan
+ style="stroke-width:1px"
+ y="305.03906"
+ x="1493.8926"
+ sodipodi:role="line"
+ id="tspan14259">three</tspan><tspan
+ style="stroke-width:1px"
+ y="355.03906"
+ x="1493.8926"
+ sodipodi:role="line"
+ id="tspan14261">five</tspan><tspan
+ style="stroke-width:1px"
+ y="405.03906"
+ x="1493.8926"
+ sodipodi:role="line"
+ id="tspan14263">seven</tspan><tspan
+ style="stroke-width:1px"
+ y="455.03906"
+ x="1493.8926"
+ sodipodi:role="line"
+ id="tspan14265">eleven</tspan></text>
+ <g
+ id="g14274"
+ inkscape:label="HMI:List:HoodNames:ForEach:HOOD:NAME@/" />
+ <g
+ inkscape:label="HMI:Input@/SELECTION"
+ id="g446"
+ transform="matrix(0.5,0,0,0.5,911.19929,420.35813)">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="136.32812"
+ y="218.24219"
+ id="text432"
+ inkscape:label="value"><tspan
+ sodipodi:role="line"
+ id="tspan430"
+ x="136.32812"
+ y="218.24219"
+ style="stroke-width:1px">8888</tspan></text>
+ <path
+ transform="scale(1,-1)"
+ sodipodi:type="star"
+ 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:#ff6600;stroke-width:5;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"
+ id="path436"
+ sodipodi:sides="3"
+ sodipodi:cx="596.74072"
+ sodipodi:cy="-224.98808"
+ sodipodi:r1="29.912722"
+ sodipodi:r2="14.956361"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 622.6459,-210.03172 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:transform-center-y="7.4781812"
+ inkscape:label="-1" />
+ <rect
+ inkscape:label="edit"
+ onclick=""
+ y="95.40741"
+ x="139.85185"
+ height="128"
+ width="407.7037"
+ id="rect438"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff00ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;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" />
+ <path
+ inkscape:label="+1"
+ inkscape:transform-center-y="-7.4781804"
+ d="m 622.6459,111.4008 -51.81035,0 25.90517,-44.869079 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="14.956361"
+ sodipodi:r1="29.912722"
+ sodipodi:cy="96.444443"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="3"
+ id="path442"
+ 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:#ff6600;stroke-width:5;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"
+ sodipodi:type="star" />
+ <path
+ inkscape:label="=0"
+ inkscape:transform-center-y="-10.828983"
+ d="m 626.14807,189.68763 -58.37872,0.43598 -0.43597,-58.37872 58.37871,-0.43597 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5633284"
+ sodipodi:arg1="0.77793027"
+ sodipodi:r2="21.657967"
+ sodipodi:r1="41.281136"
+ sodipodi:cy="160.71626"
+ sodipodi:cx="596.74072"
+ sodipodi:sides="4"
+ id="path444"
+ 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:#ff6600;stroke-width:5;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"
+ sodipodi:type="star"
+ inkscape:transform-center-x="1.0089177e-06" />
+ </g>
+ <g
+ transform="translate(-867.71696,-14.163562)"
+ id="g443"
+ inkscape:label="HMI:Button@/SELECTION">
+ <g
+ id="g435"
+ inkscape:label="bg">
+ <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:#ff6600;stroke-width:5;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"
+ id="rect433"
+ width="245.44583"
+ height="95.723877"
+ x="971.96545"
+ y="594.82263"
+ ry="35.579063"
+ inkscape:label="button" />
+ </g>
+ <g
+ id="g441"
+ inkscape:label="text">
+ <text
+ inkscape:label="setting_jmp"
+ id="text439"
+ y="656.98151"
+ x="1090.7626"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px"
+ y="656.98151"
+ x="1090.7626"
+ id="tspan437"
+ sodipodi:role="line">up</tspan></text>
+ </g>
+ </g>
+ <g
+ id="g5053"
+ inkscape:label="HMI:Switch@/PUMP0/BOOLOUT">
+ <g
+ sodipodi:type="inkscape:box3d"
+ id="g473"
+ style="fill:#ff0000;stroke:#ff00ff"
+ inkscape:perspectiveID="#perspective445"
+ inkscape:corner0="-0.22508846 : -0.3474613 : 0 : 1"
+ inkscape:corner7="-0.30162293 : -0.45734167 : 0.25 : 1"
+ inkscape:label="true">
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path461"
+ style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="6"
+ d="M 825.90072,963.24473 V 1105.042 L 960.08286,916.47892 V 809.26931 Z"
+ points="825.90072,1105.042 960.08286,916.47892 960.08286,809.26931 825.90072,963.24473 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path463"
+ style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="13"
+ d="m 825.90072,1105.042 90.50967,81.6485 121.15161,-225.30347 -77.47914,-44.90811 z"
+ points="916.41039,1186.6905 1037.562,961.38703 960.08286,916.47892 825.90072,1105.042 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path465"
+ style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="11"
+ d="m 960.08286,809.26931 77.47914,36.25624 v 115.86148 l -77.47914,-44.90811 z"
+ points="1037.562,845.52555 1037.562,961.38703 960.08286,916.47892 960.08286,809.26931 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path467"
+ style="fill:#4d4d9f;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="5"
+ d="M 825.90072,963.24473 916.41039,1029.3537 1037.562,845.52555 960.08286,809.26931 Z"
+ points="916.41039,1029.3537 1037.562,845.52555 960.08286,809.26931 825.90072,963.24473 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path469"
+ style="fill:#d7d7ff;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="14"
+ d="m 916.41039,1029.3537 v 157.3368 L 1037.562,961.38703 V 845.52555 Z"
+ points="916.41039,1186.6905 1037.562,961.38703 1037.562,845.52555 916.41039,1029.3537 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path471"
+ style="fill:#8686bf;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="3"
+ d="m 825.90072,963.24473 90.50967,66.10897 v 157.3368 l -90.50967,-81.6485 z"
+ points="916.41039,1029.3537 916.41039,1186.6905 825.90072,1105.042 825.90072,963.24473 " />
+ </g>
+ <g
+ sodipodi:type="inkscape:box3d"
+ id="g501"
+ style="fill:#ff0000;stroke:#ff00ff"
+ inkscape:perspectiveID="#perspective503"
+ inkscape:corner0="-0.22508846 : -0.3474613 : 0 : 1"
+ inkscape:corner7="-0.30162293 : -0.45734167 : 0.25 : 1"
+ inkscape:label="false">
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path489"
+ style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="6"
+ d="M 855.90072,905.24473 V 1047.042 L 978.37453,966.29311 V 859.08349 Z"
+ points="855.90072,1047.042 978.37453,966.29311 978.37453,859.08349 855.90072,905.24473 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path491"
+ style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="13"
+ d="m 855.90072,1047.042 90.50967,81.6485 108.49841,-108.7886 -76.53427,-53.60879 z"
+ points="946.41039,1128.6905 1054.9088,1019.9019 978.37453,966.29311 855.90072,1047.042 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path493"
+ style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="11"
+ d="m 978.37453,859.08349 76.53427,44.9569 v 115.86151 l -76.53427,-53.60879 z"
+ points="1054.9088,904.04039 1054.9088,1019.9019 978.37453,966.29311 978.37453,859.08349 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path495"
+ style="fill:#4d389f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="5"
+ d="m 855.90072,905.24473 90.50967,66.109 108.49841,-67.31334 -76.53427,-44.9569 z"
+ points="946.41039,971.35373 1054.9088,904.04039 978.37453,859.08349 855.90072,905.24473 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path497"
+ style="fill:#d78bff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="14"
+ d="M 946.41039,971.35373 V 1128.6905 L 1054.9088,1019.9019 V 904.04039 Z"
+ points="946.41039,1128.6905 1054.9088,1019.9019 1054.9088,904.04039 946.41039,971.35373 " />
+ <path
+ sodipodi:type="inkscape:box3dside"
+ id="path499"
+ style="fill:#8667bf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+ inkscape:box3dsidetype="3"
+ d="m 855.90072,905.24473 90.50967,66.109 v 157.33677 l -90.50967,-81.6485 z"
+ points="946.41039,971.35373 946.41039,1128.6905 855.90072,1047.042 855.90072,905.24473 " />
+ </g>
+ </g>
+</svg>