# HG changeset patch # User Edouard Tisserant # Date 1642588864 -3600 # Node ID 9b9775d230f5f5cb44ef0999ffaf01ccd396b393 # Parent 0ff608310312e552e2d5175db6a4a8d02fae9ef8 SVGHMI: fix again appication of frequency value when given in label. Use it on PushButton instance in svghmi test. diff -r 0ff608310312 -r 9b9775d230f5 svghmi/svghmi.js --- a/svghmi/svghmi.js Wed Jan 19 08:56:16 2022 +0100 +++ b/svghmi/svghmi.js Wed Jan 19 11:41:04 2022 +0100 @@ -26,6 +26,8 @@ console.log(err); } } + if(widget.forced_frequency !== undefined) + widget.frequency = widget.forced_frequency; }); }; diff -r 0ff608310312 -r 9b9775d230f5 svghmi/widget_button.ysl2 --- a/svghmi/widget_button.ysl2 Wed Jan 19 08:56:16 2022 +0100 +++ b/svghmi/widget_button.ysl2 Wed Jan 19 11:41:04 2022 +0100 @@ -163,7 +163,6 @@ function "generated_button_class" { param "fsm"; - | frequency = 5; | display = "inactive"; | state = "init"; @@ -202,6 +201,7 @@ widget_class("Button"){ + | frequency = 5; const "fsm","exsl:node-set($_button_fsm)"; call "generated_button_class" with "fsm", "$fsm"; } @@ -211,6 +211,7 @@ } widget_class("PushButton"){ + | frequency = 20; const "fsm","exsl:node-set($_push_button_fsm)"; call "generated_button_class" with "fsm", "$fsm"; } diff -r 0ff608310312 -r 9b9775d230f5 svghmi/widgets_common.ysl2 --- a/svghmi/widgets_common.ysl2 Wed Jan 19 08:56:16 2022 +0100 +++ b/svghmi/widgets_common.ysl2 Wed Jan 19 11:41:04 2022 +0100 @@ -174,7 +174,6 @@ 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; @@ -183,6 +182,7 @@ this.inhibit = indexes.map(() => undefined); this.pending = indexes.map(() => undefined); this.bound_unhinibit = this.unhinibit.bind(this); + this.forced_frequency = freq; } unsub(){ diff -r 0ff608310312 -r 9b9775d230f5 tests/svghmi/svghmi_0@svghmi/svghmi.svg --- a/tests/svghmi/svghmi_0@svghmi/svghmi.svg Wed Jan 19 08:56:16 2022 +0100 +++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Wed Jan 19 11:41:04 2022 +0100 @@ -128,11 +128,11 @@ inkscape:current-layer="hmi0" showgrid="false" units="px" - inkscape:zoom="0.40092402" - inkscape:cx="-239.69441" - inkscape:cy="-2504.0401" - inkscape:window-width="3840" - inkscape:window-height="2096" + inkscape:zoom="0.20046201" + inkscape:cx="1401.1703" + inkscape:cy="-1495.7332" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -7612,7 +7612,7 @@