# HG changeset patch
# User Edouard Tisserant
# Date 1662112963 -7200
# Node ID f69c68cffec323afdb9f25fb95eb8ab0206e246b
# Parent 9c725829d8f01f4c8a764eadd5781adee923dc50
SVGHMI: Add predefined assignments to jump widget to notify PLC or other widgets about jump.
diff -r 9c725829d8f0 -r f69c68cffec3 svghmi/widget_jump.ysl2
--- a/svghmi/widget_jump.ysl2 Fri Sep 02 10:46:05 2022 +0200
+++ b/svghmi/widget_jump.ysl2 Fri Sep 02 12:02:43 2022 +0200
@@ -13,7 +13,7 @@
- Absolute: force page jump to be not relative even if first path is of type HMI_NODE
- - name=value: Notify jump by setting variable with path having same name assigned
+ - name=value: Notify PLC about jump by setting variable with path having same name assigned
"active"+"inactive" labeled elements can be provided and reflect current
page being shown.
@@ -35,6 +35,10 @@
HMI:Jump:AbsolutePage:Absolute@/PUMP9
HMI:Jump:AbsolutePage:Absolute:notify=1@notify=/PUMP9
+ Jump with feedback
+
+ HMI:Jump:AbsolutePage:notify=1@notify=.did_jump
+
||
shortdesc > Jump to given page
@@ -63,6 +67,7 @@
(that.is_relative && that.indexes.length > 0) ?
that.indexes[0] + that.offset : undefined;
fading_page_switch(name, index);
+ that.notify();
}
}
}
@@ -106,6 +111,16 @@
> ;\n
| },
+ | notify: function() {
+ const "paths","path";
+ foreach "arg[position()>1 and contains(@value,'=')]"{
+ const "name","substring-before(@value,'=')";
+ const "value","substring-after(@value,'=')";
+ const "index" foreach "$paths" if "@assign = $name" value "position()-1";
+ | // «@value»
+ | this.apply_hmi_value(«$index», «$value»);
+ }
+ | },
}
widget_page("Jump"){
diff -r 9c725829d8f0 -r f69c68cffec3 tests/projects/svghmi/svghmi_0@svghmi/svghmi.svg
--- a/tests/projects/svghmi/svghmi_0@svghmi/svghmi.svg Fri Sep 02 10:46:05 2022 +0200
+++ b/tests/projects/svghmi/svghmi_0@svghmi/svghmi.svg Fri Sep 02 12:02:43 2022 +0200
@@ -133,12 +133,12 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:document-units="px"
- inkscape:current-layer="g1450-4-9"
+ inkscape:current-layer="hmi0"
showgrid="false"
units="px"
- inkscape:zoom="1.1339844"
- inkscape:cx="1880.7924"
- inkscape:cy="528.36862"
+ inkscape:zoom="0.40092403"
+ inkscape:cx="323.58553"
+ inkscape:cy="-56.756946"
inkscape:window-width="1600"
inkscape:window-height="836"
inkscape:window-x="0"
@@ -3257,14 +3257,14 @@
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.28600003;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" />
Disabled
Disabled
Disabled
Disabled
up
+
+
+
+
+
+ Home
+
+