# HG changeset patch
# User Edouard Tisserant
# Date 1669199655 -3600
# Node ID 747ffdafbe31c09334afd6b46dd264c07776b137
# Parent a3c509e66695c84ee2ed5dd10a41821fed43481c
SVGHMI: update generated xslt
diff -r a3c509e66695 -r 747ffdafbe31 svghmi/analyse_widget.xslt
--- a/svghmi/analyse_widget.xslt Wed Nov 23 11:30:30 2022 +0100
+++ b/svghmi/analyse_widget.xslt Wed Nov 23 11:34:15 2022 +0100
@@ -854,6 +854,46 @@
Value to display
+
+
+
+
+
+
+
+ Arguments are either:
+
+
+
+ - XXX reference path TODO
+
+
+
+ - name=value: setting variable with literal value.
+
+ - name=other_name: copy variable content into another
+
+
+
+ "active"+"inactive" labeled elements can be provided to show feedback when pressed
+
+
+
+ Exemples:
+
+
+
+ HMI:Page:notify=1@notify=/PLCVAR
+
+ HMI:Page:ack=2:notify=1@ack=.local_var@notify=/PLCVAR
+
+
+
+
+
+ Page
+
+
diff -r a3c509e66695 -r 747ffdafbe31 svghmi/gen_index_xhtml.xslt
--- a/svghmi/gen_index_xhtml.xslt Wed Nov 23 11:30:30 2022 +0100
+++ b/svghmi/gen_index_xhtml.xslt Wed Nov 23 11:34:15 2022 +0100
@@ -734,6 +734,21 @@
+
+
+
+
+ /*
+
+ */
+
+
+
+ class PageWidget extends Widget{}
+
+
+
+
@@ -787,7 +802,15 @@
-
+
+
+
+ Page id="
+
+ " : only one root path can be declared
+
+
+
"
@@ -804,31 +827,35 @@
],
-
-
+
+
Page id="
" : No match for path "
-
+
" in HMI tree
page_index:
-
+
,
page_class: "
-
+
",
widgets: [
+ [hmi_widgets["
+
+ "], []],
+
-
+
,
@@ -1440,7 +1467,7 @@
,{
- assignments: [],
+ enable_assignments: [],
compute_enable: function(value, oldval, varnum) {
@@ -1456,13 +1483,13 @@
if(varnum ==
- ) this.assignments[
+ ) this.enable_assignments[
] = value;
let
- = this.assignments[
+ = this.enable_assignments[
];
@@ -2388,7 +2415,9 @@
+
+
@@ -2402,7 +2431,7 @@
var hmi_widgets = {
-
+
}
@@ -6367,10 +6396,10 @@
-
+
-
+
@@ -7195,6 +7224,128 @@
],
+
+
+
+
+
+
+
+ Arguments are either:
+
+
+
+ - XXX reference path TODO
+
+
+
+ - name=value: setting variable with literal value.
+
+ - name=other_name: copy variable content into another
+
+
+
+ "active"+"inactive" labeled elements can be provided to show feedback when pressed
+
+
+
+ Exemples:
+
+
+
+ HMI:Page:notify=1@notify=/PLCVAR
+
+ HMI:Page:ack=2:notify=1@ack=.local_var@notify=/PLCVAR
+
+
+
+
+
+ Page
+
+
+
+
+
+
+
+
+ /disabled
+
+
+
+
+
+
+ assignments: {},
+
+ dispatch: function(value, oldval, varnum) {
+
+
+
+
+
+
+
+
+ if(varnum ==
+
+ ) this.assignments["
+
+ "] = value;
+
+
+
+
+
+ },
+
+ assign: function() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ const
+
+ = this.assignments["
+
+ "];
+
+ if(
+
+ != undefined)
+
+ this.apply_hmi_value(
+
+ ,
+
+ );
+
+
+
+ this.apply_hmi_value(
+
+ ,
+
+ );
+
+
+
+
+ },
+
+
@@ -12322,6 +12473,12 @@
+ // when entering a page, assignments are evaluated
+
+ new_desc.widgets[0][0].assign();
+
+
+
return true;
};