author | Edouard Tisserant |
Tue, 08 Nov 2022 11:02:35 +0100 | |
changeset 3662 | 364f2409eeda |
parent 3596 | 9c725829d8f0 |
child 3920 | 0d491fada1ad |
permissions | -rw-r--r-- |
2944 | 1 |
// widget_button.ysl2 |
2 |
||
3241
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
3 |
widget_desc("Button") { |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
4 |
longdesc |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
5 |
|| |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
6 |
Button widget takes one boolean variable path, and reflect current true |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
7 |
or false value by showing "active" or "inactive" labeled element |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
8 |
respectively. Pressing and releasing button changes variable to true and |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
9 |
false respectively. Potential inconsistency caused by quick consecutive |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
10 |
presses on the button is mitigated by using a state machine that wait for |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
11 |
previous state change to be reflected on variable before applying next one. |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
12 |
|| |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
13 |
|
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
14 |
shortdesc > Push button reflecting consistently given boolean variable |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
15 |
|
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
16 |
path name="value" accepts="HMI_BOOL" > Boolean variable |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
17 |
|
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
18 |
} |
fe945f1f48b7
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3232
diff
changeset
|
19 |
|
3085 | 20 |
// Finite state machine |
21 |
decl fsm(name); |
|
22 |
decl state(name); |
|
23 |
decl on_mouse(position); |
|
24 |
decl on_dispatch(value); |
|
25 |
decl jump(state); |
|
26 |
decl show(eltname); |
|
27 |
decl hmi_value(value); |
|
28 |
||
3232
7bdb766c2a4d
SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3086
diff
changeset
|
29 |
gen_index_xhtml { |
7bdb766c2a4d
SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3086
diff
changeset
|
30 |
|
3413
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
31 |
const "_push_button_fsm" fsm { |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
32 |
state "init" { |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
33 |
on_dispatch "false" jump "reflect_off"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
34 |
on_dispatch "true" jump "reflect_on"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
35 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
36 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
37 |
state "reflect_on" { |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
38 |
show "active"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
39 |
on_mouse "down" jump "on"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
40 |
on_mouse "up" jump "off"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
41 |
on_dispatch "false" jump "reflect_off"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
42 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
43 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
44 |
state "on" { |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
45 |
hmi_value "true"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
46 |
show "active"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
47 |
on_mouse "up" jump "off"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
48 |
on_dispatch "false" jump "reflect_off"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
49 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
50 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
51 |
state "reflect_off" { |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
52 |
show "inactive"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
53 |
on_mouse "down" jump "on"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
54 |
on_mouse "up" jump "off"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
55 |
on_dispatch "true" jump "reflect_on"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
56 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
57 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
58 |
state "off" { |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
59 |
hmi_value "false"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
60 |
show "inactive"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
61 |
on_mouse "down" jump "on"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
62 |
on_dispatch "true" jump "reflect_on"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
63 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
64 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
65 |
|
3085 | 66 |
// State machine to drive HMI_BOOL on a potentially laggy connection |
67 |
const "_button_fsm" fsm { |
|
68 |
state "init" { |
|
69 |
on_dispatch "false" jump "released"; |
|
70 |
on_dispatch "true" jump "pressed"; |
|
71 |
} |
|
72 |
||
73 |
state "pressing" { |
|
74 |
// show "waitactive"; |
|
75 |
hmi_value "true"; |
|
76 |
on_dispatch "true" jump "pressed"; |
|
77 |
on_mouse "up" jump "shortpress"; |
|
78 |
} |
|
79 |
state "pressed" { |
|
80 |
show "active"; |
|
81 |
on_mouse "up" jump "releasing"; |
|
82 |
on_dispatch "false" jump "released"; |
|
83 |
} |
|
84 |
state "shortpress" { |
|
85 |
on_dispatch "true" jump "releasing"; |
|
86 |
on_mouse "down" jump "pressing"; |
|
87 |
} |
|
88 |
||
89 |
state "releasing" { |
|
90 |
// show "waitinactive"; |
|
91 |
hmi_value "false"; |
|
92 |
on_dispatch "false" jump "released"; |
|
93 |
on_mouse "down" jump "shortrelease"; |
|
94 |
} |
|
95 |
state "released" { |
|
96 |
show "inactive"; |
|
97 |
on_mouse "down" jump "pressing"; |
|
98 |
on_dispatch "true" jump "pressed"; |
|
99 |
} |
|
100 |
state "shortrelease" { |
|
101 |
on_dispatch "false" jump "pressing"; |
|
102 |
on_mouse "up" jump "releasing"; |
|
103 |
} |
|
104 |
} |
|
105 |
||
106 |
template "fsm", mode="dispatch_transition" { |
|
107 |
| switch (this.state) { |
|
108 |
apply "state", mode="dispatch_transition"; |
|
109 |
| } |
|
110 |
} |
|
111 |
template "state", mode="dispatch_transition" { |
|
112 |
| case "«@name»": |
|
3086 | 113 |
apply "on-dispatch"; |
3085 | 114 |
| break; |
115 |
} |
|
116 |
template "on-dispatch" { |
|
3086 | 117 |
| if(value == «@value») { |
118 |
apply "jump", mode="transition"; |
|
119 |
| } |
|
3085 | 120 |
} |
121 |
||
122 |
template "fsm", mode="mouse_transition" { |
|
123 |
param "position"; |
|
124 |
| switch (this.state) { |
|
125 |
apply "state", mode="mouse_transition" with "position", "$position"; |
|
126 |
| } |
|
127 |
} |
|
128 |
template "state", mode="mouse_transition" { |
|
129 |
param "position"; |
|
130 |
| case "«@name»": |
|
131 |
apply "on-mouse[@position = $position]"; |
|
132 |
| break; |
|
133 |
} |
|
134 |
template "on-mouse" { |
|
3086 | 135 |
// up or down state is already assumed because apply statement filters it |
136 |
apply "jump", mode="transition"; |
|
3085 | 137 |
} |
138 |
||
139 |
template "jump", mode="transition" { |
|
140 |
| this.state = "«@state»"; |
|
141 |
| this.«@state»_action(); |
|
142 |
} |
|
143 |
||
144 |
template "fsm", mode="actions" { |
|
145 |
apply "state", mode="actions"; |
|
146 |
} |
|
147 |
template "state", mode="actions" { |
|
3086 | 148 |
| «@name»_action(){ |
3419 | 149 |
// | console.log("Entering state «@name»", this.frequency); |
3085 | 150 |
apply "*", mode="actions"; |
3086 | 151 |
| } |
3085 | 152 |
} |
153 |
template "show", mode="actions" { |
|
3596
9c725829d8f0
SVGHMI: continue rework of Jump widget to cope with Enable Expressions.
Edouard Tisserant
parents:
3520
diff
changeset
|
154 |
| this.activity_state = «@eltname = 'active'»; |
3085 | 155 |
| this.request_animate(); |
156 |
} |
|
157 |
template "hmi-value", mode="actions" { |
|
3086 | 158 |
| this.apply_hmi_value(0, «@value»); |
3085 | 159 |
} |
160 |
||
3232
7bdb766c2a4d
SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3086
diff
changeset
|
161 |
} |
7bdb766c2a4d
SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3086
diff
changeset
|
162 |
|
3413
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
163 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
164 |
function "generated_button_class" { |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
165 |
param "fsm"; |
3009 | 166 |
|
3085 | 167 |
| state = "init"; |
3059
e0db3f6a5f39
Button and toggle reworked to use animate and dispatch
usveticic
parents:
3058
diff
changeset
|
168 |
|
3085 | 169 |
| dispatch(value) { |
170 |
apply "$fsm", mode="dispatch_transition"; |
|
171 |
| } |
|
3056
827bf284feec
Button, ToggleButton and slider updated. Error to warning when building
usveticic
parents:
3024
diff
changeset
|
172 |
|
3085 | 173 |
| onmouseup(evt) { |
174 |
| svg_root.removeEventListener("pointerup", this.bound_onmouseup, true); |
|
175 |
apply "$fsm", mode="mouse_transition" with "position", "'up'"; |
|
176 |
| } |
|
177 |
| onmousedown(evt) { |
|
178 |
| svg_root.addEventListener("pointerup", this.bound_onmouseup, true); |
|
179 |
apply "$fsm", mode="mouse_transition" with "position", "'down'"; |
|
180 |
| } |
|
3009 | 181 |
|
3085 | 182 |
apply "$fsm", mode="actions"; |
3056
827bf284feec
Button, ToggleButton and slider updated. Error to warning when building
usveticic
parents:
3024
diff
changeset
|
183 |
|
3085 | 184 |
| init() { |
185 |
| this.bound_onmouseup = this.onmouseup.bind(this); |
|
186 |
| this.element.addEventListener("pointerdown", this.onmousedown.bind(this)); |
|
3596
9c725829d8f0
SVGHMI: continue rework of Jump widget to cope with Enable Expressions.
Edouard Tisserant
parents:
3520
diff
changeset
|
187 |
| this.activity_state = undefined; |
3085 | 188 |
| } |
3024 | 189 |
} |
3009 | 190 |
|
3413
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
191 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
192 |
widget_class("Button"){ |
3417
9b9775d230f5
SVGHMI: fix again appication of frequency value when given in label. Use it on PushButton instance in svghmi test.
Edouard Tisserant
parents:
3413
diff
changeset
|
193 |
| frequency = 5; |
3413
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
194 |
const "fsm","exsl:node-set($_button_fsm)"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
195 |
call "generated_button_class" with "fsm", "$fsm"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
196 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
197 |
|
3232
7bdb766c2a4d
SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3086
diff
changeset
|
198 |
widget_defs("Button") { |
3520
b27e50143083
SVGHMI: generalize detach/re-attach of binary choices for ToggleButton, PushButton, Button and Keypad's Shit and CapsLock.
Edouard Tisserant
parents:
3419
diff
changeset
|
199 |
activable(); |
3000
a9a45977bac0
SVGHMI: prefer apply_hmi_value() to change_hmi_value() when possible
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2976
diff
changeset
|
200 |
} |
3413
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
201 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
202 |
widget_class("PushButton"){ |
3417
9b9775d230f5
SVGHMI: fix again appication of frequency value when given in label. Use it on PushButton instance in svghmi test.
Edouard Tisserant
parents:
3413
diff
changeset
|
203 |
| frequency = 20; |
3413
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
204 |
const "fsm","exsl:node-set($_push_button_fsm)"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
205 |
call "generated_button_class" with "fsm", "$fsm"; |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
206 |
} |
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
207 |
|
2e84a2782295
SVGHMI: Add pushbutton widget, that can take reflect short press in variable, but has no garantee on consistency.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3241
diff
changeset
|
208 |
widget_defs("PushButton") { |
3520
b27e50143083
SVGHMI: generalize detach/re-attach of binary choices for ToggleButton, PushButton, Button and Keypad's Shit and CapsLock.
Edouard Tisserant
parents:
3419
diff
changeset
|
209 |
activable(); |
b27e50143083
SVGHMI: generalize detach/re-attach of binary choices for ToggleButton, PushButton, Button and Keypad's Shit and CapsLock.
Edouard Tisserant
parents:
3419
diff
changeset
|
210 |
} |
b27e50143083
SVGHMI: generalize detach/re-attach of binary choices for ToggleButton, PushButton, Button and Keypad's Shit and CapsLock.
Edouard Tisserant
parents:
3419
diff
changeset
|
211 |