# HG changeset patch # User Edouard Tisserant # Date 1642502105 -3600 # Node ID 3e162ea3c726cca3c3f524716fe108252ecf76ce # Parent eac5832a14894442a7e1c6d8a8320a3099029059# Parent 2f5c30054d5026c956b81ff807fab3c6e2dd3596 Merge diff -r 2f5c30054d50 -r 3e162ea3c726 svghmi/analyse_widget.xslt --- a/svghmi/analyse_widget.xslt Mon Jan 17 15:17:47 2022 +0100 +++ b/svghmi/analyse_widget.xslt Tue Jan 18 11:35:05 2022 +0100 @@ -18,14 +18,26 @@ - + + + + + + + + + + + + + - + @@ -37,6 +49,11 @@ + + + + + diff -r 2f5c30054d50 -r 3e162ea3c726 svghmi/gen_dnd_widget_svg.xslt --- a/svghmi/gen_dnd_widget_svg.xslt Mon Jan 17 15:17:47 2022 +0100 +++ b/svghmi/gen_dnd_widget_svg.xslt Tue Jan 18 11:35:05 2022 +0100 @@ -20,14 +20,26 @@ - + + + + + + + + + + + + + - + @@ -39,6 +51,11 @@ + + + + + diff -r 2f5c30054d50 -r 3e162ea3c726 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Mon Jan 17 15:17:47 2022 +0100 +++ b/svghmi/gen_index_xhtml.xslt Tue Jan 18 11:35:05 2022 +0100 @@ -175,14 +175,26 @@ - + + + + + + + + + + + + + - + @@ -194,6 +206,11 @@ + + + + + @@ -998,7 +1015,7 @@ - + @@ -1228,13 +1245,25 @@ + + + + + + + undefined + + + " ": new Widget (" - ",[ + ", + + ,[ ],[ @@ -1424,12 +1453,14 @@ - constructor(elt_id,args,indexes,minmaxes,members){ + constructor(elt_id, freq, args, indexes, minmaxes, members){ this.element_id = elt_id; this.element = id(elt_id); + if(freq !== undefined) this.frequency = freq; + this.args = args; this.indexes = indexes; diff -r 2f5c30054d50 -r 3e162ea3c726 svghmi/parse_labels.ysl2 --- a/svghmi/parse_labels.ysl2 Mon Jan 17 15:17:47 2022 +0100 +++ b/svghmi/parse_labels.ysl2 Tue Jan 18 11:35:05 2022 +0100 @@ -2,7 +2,7 @@ // Parses: -// "HMI:WidgetType:param1:param2@path1,path1min,path1max@path2" +// "HMI:WidgetType|freq:param1:param2@path1,path1min,path1max@path2" // // Into: // widget type="WidgetType" id="blah456" { @@ -28,15 +28,23 @@ otherwise value "$description"; } - const "_type", "substring-before($args,':')"; - const "type" choose { - when "$_type" value "$_type"; + const "_typefreq", "substring-before($args,':')"; + const "typefreq" choose { + when "$_typefreq" value "$_typefreq"; otherwise value "$args"; } + const "freq", "substring-after($typefreq,':')"; + + const "_type", "substring-before($typefreq,'|')"; + const "type" choose { + when "$_type" value "$_type"; + otherwise value "$typefreq"; + } if "$type" widget { attrib "id" > «$id» attrib "type" > «$type» + if "freq" attrib "frequency" > «$freq» foreach "str:split(substring-after($args, ':'), ':')" { arg { attrib "value" > «.» diff -r 2f5c30054d50 -r 3e162ea3c726 svghmi/widgets_common.ysl2 --- a/svghmi/widgets_common.ysl2 Mon Jan 17 15:17:47 2022 +0100 +++ b/svghmi/widgets_common.ysl2 Tue Jan 18 11:35:05 2022 +0100 @@ -83,7 +83,14 @@ if "position()!=last()" > , } - | "«@id»": new «$widget/@type»Widget ("«@id»",[«$args»],[«$indexes»],[«$minmaxes»],{ + const "freq" choose { + when "$widget/freq" + > «$widget/freq» + otherwise + > undefined + } + + | "«@id»": new «$widget/@type»Widget ("«@id»",«$freq»,[«$args»],[«$indexes»],[«$minmaxes»],{ apply "$widget", mode="widget_defs" with "hmi_element","."; | })`if "position()!=last()" > ,` } @@ -164,9 +171,10 @@ unsubscribable = false; pending_animate = false; - constructor(elt_id,args,indexes,minmaxes,members){ + constructor(elt_id, freq, args, indexes, minmaxes, members){ this.element_id = elt_id; this.element = id(elt_id); + if(freq !== undefined) this.frequency = freq; this.args = args; this.indexes = indexes; this.minmaxes = minmaxes; diff -r 2f5c30054d50 -r 3e162ea3c726 tests/svghmi/svghmi_0@svghmi/confnode.xml --- a/tests/svghmi/svghmi_0@svghmi/confnode.xml Mon Jan 17 15:17:47 2022 +0100 +++ b/tests/svghmi/svghmi_0@svghmi/confnode.xml Tue Jan 18 11:35:05 2022 +0100 @@ -1,2 +1,2 @@ - + diff -r 2f5c30054d50 -r 3e162ea3c726 tests/svghmi/svghmi_0@svghmi/svghmi.svg --- a/tests/svghmi/svghmi_0@svghmi/svghmi.svg Mon Jan 17 15:17:47 2022 +0100 +++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Tue Jan 18 11:35:05 2022 +0100 @@ -128,9 +128,9 @@ inkscape:current-layer="hmi0" showgrid="false" units="px" - inkscape:zoom="0.84355636" - inkscape:cx="-1054.5035" - inkscape:cy="482.64214" + inkscape:zoom="0.59648442" + inkscape:cx="816.53059" + inkscape:cy="446.56258" inkscape:window-width="1600" inkscape:window-height="836" inkscape:window-x="0" @@ -2240,49 +2240,6 @@ inkscape:transform-center-x="1.0089177e-06" /> - - - - up - - - @@ -3595,25 +3552,25 @@ 8888 Multiple variables @@ -7560,4 +7517,176 @@ x="0" transform="translate(-2307.336,1146.3377)" inkscape:label="HMI:ListSwitch@/ALARMSTATUS" /> + + + + + up + + + + + + + up + + + + + + + up + + + + + + + up + +