# HG changeset patch
# User Edouard Tisserant
# Date 1636377036 -3600
# Node ID ecefd38d5c7d3be6428fcbf7718d433546836d1e
# Parent 608f48ad3dfcebee15a2efef64b93b58b9969513
SVGHMI: update tests/evghmi to reflect/test latest changes. update generated XSLT.
diff -r 608f48ad3dfc -r ecefd38d5c7d svghmi/analyse_widget.xslt
--- a/svghmi/analyse_widget.xslt Mon Nov 08 14:09:44 2021 +0100
+++ b/svghmi/analyse_widget.xslt Mon Nov 08 14:10:36 2021 +0100
@@ -471,7 +471,7 @@
- Documentation to be written. see svbghmi exemple.
+ Documentation to be written. see svghmi exemple.
@@ -566,6 +566,37 @@
+
+
+
+
+
+ ListSwitch widget displays one item of an HMI:List depending on value of
+
+ given variable. Main element of the widget must be a clone of the list or
+
+ of an item of that list.
+
+
+
+ Given variable's current value is compared to list items
+
+ label. For exemple if given variable type
+
+ is HMI_INT and value is 1, then item with label '1' will be displayed.
+
+ If matching variable of type HMI_STRING, then no quotes are needed.
+
+ For exemple, 'hello' match HMI_STRING 'hello'.
+
+
+
+ Displays item of an HMI:List whose label matches value.
+
+
+ value to compare to labels
+
+
@@ -687,7 +718,7 @@
- Show elements whose label match value.
+ Show elements whose label matches value.
value to compare to labels
diff -r 608f48ad3dfc -r ecefd38d5c7d svghmi/gen_index_xhtml.xslt
--- a/svghmi/gen_index_xhtml.xslt Mon Nov 08 14:09:44 2021 +0100
+++ b/svghmi/gen_index_xhtml.xslt Mon Nov 08 14:10:36 2021 +0100
@@ -572,7 +572,7 @@
-
+
@@ -846,7 +846,7 @@
-
+
@@ -4583,7 +4583,7 @@
- Documentation to be written. see svbghmi exemple.
+ Documentation to be written. see svghmi exemple.
@@ -4833,13 +4833,13 @@
id("
- ").setAttribute("xlink:href",
+ ").href.baseVal =
"#"+hmi_widgets["
"].items[
- ]);
+ ];
@@ -5675,9 +5675,9 @@
items: {
-
+ "
- : "
+ ": "
",
@@ -5685,6 +5685,60 @@
},
+
+
+
+
+
+ ListSwitch widget displays one item of an HMI:List depending on value of
+
+ given variable. Main element of the widget must be a clone of the list or
+
+ of an item of that list.
+
+
+
+ Given variable's current value is compared to list items
+
+ label. For exemple if given variable type
+
+ is HMI_INT and value is 1, then item with label '1' will be displayed.
+
+ If matching variable of type HMI_STRING, then no quotes are needed.
+
+ For exemple, 'hello' match HMI_STRING 'hello'.
+
+
+
+ Displays item of an HMI:List whose label matches value.
+
+
+ value to compare to labels
+
+
+
+ class
+ ListSwitchWidget
+ extends Widget{
+
+ frequency = 5;
+
+ }
+
+
+
+
+
+
+ dispatch: function(value) {
+
+ this.element.href.baseVal = "#"+hmi_widgets["
+
+ "].items[value];
+
+ },
+
+
@@ -7239,7 +7293,7 @@
- Show elements whose label match value.
+ Show elements whose label matches value.
value to compare to labels
@@ -8432,6 +8486,8 @@
// subscribe to per instance current page hmi variable
+ // PLC must prefix page name with "!" for page switch to happen
+
subscribers(current_page_var_index).add({
frequency: 1,
@@ -8440,7 +8496,9 @@
new_hmi_value: function(index, value, oldval) {
- switch_page(value);
+ if(value.startsWith("!"))
+
+ switch_page(value.slice(1));
}
@@ -8946,13 +9004,11 @@
- apply_hmi_value(current_page_var_index,
-
- page_index == undefined
-
- ? page_name
-
- : page_name + "@" + hmitree_paths[page_index]);
+ apply_hmi_value(current_page_var_index, page_index == undefined
+
+ ? page_name
+
+ : page_name + "@" + hmitree_paths[page_index]);
diff -r 608f48ad3dfc -r ecefd38d5c7d tests/svghmi/plc.xml
--- a/tests/svghmi/plc.xml Mon Nov 08 14:09:44 2021 +0100
+++ b/tests/svghmi/plc.xml Mon Nov 08 14:10:36 2021 +0100
@@ -1,7 +1,7 @@
-
+
@@ -376,7 +376,7 @@
- 'RelativePageTest@/TRUMP2'
+ '!RelativePageTest@/PUMP2'
diff -r 608f48ad3dfc -r ecefd38d5c7d tests/svghmi/svghmi_0@svghmi/svghmi.svg
--- a/tests/svghmi/svghmi_0@svghmi/svghmi.svg Mon Nov 08 14:09:44 2021 +0100
+++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Mon Nov 08 14:10:36 2021 +0100
@@ -128,14 +128,14 @@
inkscape:current-layer="hmi0"
showgrid="false"
units="px"
- inkscape:zoom="0.42177818"
- inkscape:cx="543.13877"
- inkscape:cy="-467.92793"
- inkscape:window-width="2400"
- inkscape:window-height="2096"
- inkscape:window-x="3200"
+ inkscape:zoom="0.84355636"
+ inkscape:cx="-1054.5035"
+ inkscape:cy="482.64214"
+ inkscape:window-width="1600"
+ inkscape:window-height="836"
+ inkscape:window-x="0"
inkscape:window-y="27"
- inkscape:window-maximized="0"
+ inkscape:window-maximized="1"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-global="true"
@@ -7538,4 +7538,26 @@
y="606.89435"
style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px"
id="tspan1330">000
+
+