diff -r 2e84a2782295 -r 0ff608310312 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Wed Jan 19 08:53:49 2022 +0100 +++ b/svghmi/gen_index_xhtml.xslt Wed Jan 19 08:56:16 2022 +0100 @@ -186,7 +186,7 @@ - + @@ -206,8 +206,8 @@ - - + + @@ -1247,8 +1247,8 @@ - - + + undefined @@ -2214,6 +2214,62 @@ Boolean variable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2344,6 +2400,10 @@ _action(){ + console.log("Entering state + + "); + } @@ -2362,74 +2422,80 @@ ); + + + frequency = 5; + + display = "inactive"; + + state = "init"; + + dispatch(value) { + + + } + + onmouseup(evt) { + + svg_root.removeEventListener("pointerup", this.bound_onmouseup, true); + + + + + } + + onmousedown(evt) { + + svg_root.addEventListener("pointerup", this.bound_onmouseup, true); + + + + + } + + + animate(){ + + if (this.active_elt && this.inactive_elt) { + + + if(this.display == " + + ") + + this. + + _elt.style.display = ""; + + else + + this. + + _elt.style.display = "none"; + + + } + + } + + init() { + + this.bound_onmouseup = this.onmouseup.bind(this); + + this.element.addEventListener("pointerdown", this.onmousedown.bind(this)); + + } + + class ButtonWidget extends Widget{ - frequency = 5; - - display = "inactive"; - - state = "init"; - - dispatch(value) { - - - } - - onmouseup(evt) { - - svg_root.removeEventListener("pointerup", this.bound_onmouseup, true); - - - - - } - - onmousedown(evt) { - - svg_root.addEventListener("pointerup", this.bound_onmouseup, true); - - - - - } - - - animate(){ - - if (this.active_elt && this.inactive_elt) { - - - if(this.display == " - - ") - - this. - - _elt.style.display = ""; - - else - - this. - - _elt.style.display = "none"; - - - } - - } - - init() { - - this.bound_onmouseup = this.onmouseup.bind(this); - - this.element.addEventListener("pointerdown", this.onmousedown.bind(this)); - - } - + + + } @@ -2443,6 +2509,28 @@ + + class + PushButtonWidget + extends Widget{ + + + + + + } + + + + + + + + active inactive + + + + @@ -8713,6 +8801,8 @@ function send_hmi_value(index, value) { + console.log("send_hmi_value("+index+", "+value+")") + if(index > last_remote_index){ updates.set(index, value); @@ -8761,9 +8851,11 @@ function apply_hmi_value(index, new_val) { - let old_val = cache[index]; - - if(new_val != undefined && old_val != new_val) + console.log("apply_hmi_value("+index+", "+new_val+")") + + /*let old_val = cache[index];*/ + + if(new_val != undefined /*&& old_val != new_val*/) send_hmi_value(index, new_val);