# HG changeset patch # User Edouard Tisserant # Date 1660232352 -7200 # Node ID 0c96269bf63bd4a6f7bd891578fa49486cd91062 # Parent cbf99c4122bdaa5b1805390348ec1300a598e0da# Parent c5070b6973ba5354aced3496b394fc15c02c1510 Merge changes from default in wxPython4 diff -r cbf99c4122bd -r 0c96269bf63b ProjectController.py --- a/ProjectController.py Wed Aug 10 16:44:58 2022 +0200 +++ b/ProjectController.py Thu Aug 11 17:39:12 2022 +0200 @@ -1578,12 +1578,16 @@ return debug_status, ticks, buffers RegisterDebugVariableErrorCodes = { + # Connector only can return None + None : _("Debug: connection problem.\n"), # TRACE_LIST_OVERFLOW 1 : _("Debug: Too many variables traced. Max 1024.\n"), # FORCE_LIST_OVERFLOW 2 : _("Debug: Too many variables forced. Max 256.\n"), # FORCE_BUFFER_OVERFLOW - 3 : _("Debug: Cumulated forced variables size too large. Max 1KB.\n") + 3 : _("Debug: Cumulated forced variables size too large. Max 1KB.\n"), + # DEBUG_SUSPENDED + 4 : _("Debug: suspended.\n") } def RegisterDebugVarToConnector(self): @@ -1626,7 +1630,8 @@ self.DebugToken = None self.logger.write_warning( self.RegisterDebugVariableErrorCodes.get( - -res, _("Debug: Unknown error"))) + -res if res is not None else None, + _("Debug: Unknown error"))) else: self.TracedIECPath = [] self._connector.SetTraceVariablesList([]) diff -r cbf99c4122bd -r 0c96269bf63b runtime/PLCObject.py --- a/runtime/PLCObject.py Wed Aug 10 16:44:58 2022 +0200 +++ b/runtime/PLCObject.py Thu Aug 11 17:39:12 2022 +0200 @@ -466,7 +466,7 @@ self.PythonThreadAcknowledge(cmd) self.PythonRuntimeCall("start") self.LogMessage("Python extensions started") - self.PostStartPLC() + self._PostStartPLC() self.PythonThreadLoop() self.PythonRuntimeCall("stop", reverse_order=True) elif cmd == "Finish": @@ -504,6 +504,13 @@ """ pass + def _PostStartPLC(self): + try: + self.PostStartPLC() + except Exception: + self.LogMessage(0, 'Post Start Exception'+'\n'.join( + traceback.format_exception(*sys.exc_info()))) + def PostStartPLC(self): """ Here goes actions to be taken after PLC is started, @@ -730,7 +737,7 @@ return self.DebugToken else: self._suspendDebug(True) - return None + return 4 # DEBUG_SUSPENDED def _TracesSwap(self): self.LastSwapTrace = time() diff -r cbf99c4122bd -r 0c96269bf63b svghmi/hmi_tree.ysl2 --- a/svghmi/hmi_tree.ysl2 Wed Aug 10 16:44:58 2022 +0200 +++ b/svghmi/hmi_tree.ysl2 Thu Aug 11 17:39:12 2022 +0200 @@ -121,6 +121,7 @@ > «$indent» «local-name()» foreach "@*" > «local-name()»="«.»" > \n + if "text()" > «text()»\n apply "*", mode="testtree" { with "indent" value "concat($indent,'>')" }; diff -r cbf99c4122bd -r 0c96269bf63b svghmi/parse_labels.ysl2 --- a/svghmi/parse_labels.ysl2 Wed Aug 10 16:44:58 2022 +0200 +++ b/svghmi/parse_labels.ysl2 Thu Aug 11 17:39:12 2022 +0200 @@ -15,9 +15,29 @@ // const "pathregex",!"'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"!; +const "newline" | +const "twonewlines", "concat($newline,$newline)"; + template "*", mode="parselabel" { - const "label","@inkscape:label"; + const "part","@inkscape:label"; + const "desc", "svg:desc"; + + // add svg:desc field if continuation "\" marker is found at the end of label + const "len","string-length($part)"; + const "has_continuation", "substring($part,$len,1)='\\'"; + const "label" choose{ + when "$has_continuation" { + const "_continuation", "substring-before($desc, $twonewlines)"; + const "continuation" choose { + when "$_continuation" value "$_continuation"; + otherwise value "$desc"; + } + value "concat(substring($part,1,$len - 1),translate($continuation,$newline,''))"; + } + otherwise value "$part"; + } + const "id","@id"; const "description", "substring-after($label,'HMI:')"; @@ -100,7 +120,15 @@ } } } - if "svg:desc" desc value "svg:desc/text()"; + choose{ + when "$has_continuation" { + const "_continuation", "substring-after($desc, $twonewlines)"; + if "$_continuation" + desc value "$_continuation"; + } + otherwise + if "$desc" desc value "$desc/text()"; + } } } diff -r cbf99c4122bd -r 0c96269bf63b svghmi/widget_jump.ysl2 --- a/svghmi/widget_jump.ysl2 Wed Aug 10 16:44:58 2022 +0200 +++ b/svghmi/widget_jump.ysl2 Thu Aug 11 17:39:12 2022 +0200 @@ -84,6 +84,9 @@ dispatch(value) { this.disabled = !Number(value); + + // TODO : use RequestAnimate and animate() + this.update_state(); } || @@ -142,6 +145,7 @@ } } +/* TODO: move to detachable pages ysl2 */ emit "cssdefs:jump" || .fade-out-page { diff -r cbf99c4122bd -r 0c96269bf63b svghmi/widget_multistate.ysl2 --- a/svghmi/widget_multistate.ysl2 Wed Aug 10 16:44:58 2022 +0200 +++ b/svghmi/widget_multistate.ysl2 Thu Aug 11 17:39:12 2022 +0200 @@ -36,6 +36,7 @@ choice.elt.setAttribute("style", choice.style); } } + // TODO : use RequestAnimate and animate() } on_click(evt) { diff -r cbf99c4122bd -r 0c96269bf63b targets/plc_debug.c --- a/targets/plc_debug.c Wed Aug 10 16:44:58 2022 +0200 +++ b/targets/plc_debug.c Thu Aug 11 17:39:12 2022 +0200 @@ -140,7 +140,7 @@ InitRetain(); /* Iterate over all variables to fill debug buffer */ if(CheckRetainBuffer()){ - static unsigned int retain_offset = 0; + unsigned int retain_offset = 0; retain_list_collect_cursor = 0; /* iterate over retain list */ @@ -322,7 +322,7 @@ LeaveDebugSection(); } #endif - static unsigned int retain_offset = 0; + unsigned int retain_offset = 0; /* when not debugging, do only retain */ retain_list_collect_cursor = 0; diff -r cbf99c4122bd -r 0c96269bf63b tests/projects/svghmi/plc.xml --- a/tests/projects/svghmi/plc.xml Wed Aug 10 16:44:58 2022 +0200 +++ b/tests/projects/svghmi/plc.xml Thu Aug 11 17:39:12 2022 +0200 @@ -1,7 +1,7 @@ - + @@ -25,11 +25,20 @@ + + + + + + + + + diff -r cbf99c4122bd -r 0c96269bf63b tests/projects/svghmi_scrollbar/svghmi_0@svghmi/svghmi.svg --- a/tests/projects/svghmi_scrollbar/svghmi_0@svghmi/svghmi.svg Wed Aug 10 16:44:58 2022 +0200 +++ b/tests/projects/svghmi_scrollbar/svghmi_0@svghmi/svghmi.svg Thu Aug 11 17:39:12 2022 +0200 @@ -60,12 +60,12 @@ showgrid="false" units="px" inkscape:zoom="0.64" - inkscape:cx="-438.80601" - inkscape:cy="183.59799" - inkscape:window-width="3200" - inkscape:window-height="1672" + inkscape:cx="476.03774" + inkscape:cy="444.53549" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" - inkscape:window-y="54" + inkscape:window-y="27" inkscape:window-maximized="1" showguides="true" inkscape:guide-bbox="true" @@ -745,8 +745,14 @@ + @.range +@.position +@.size + +my tailor is rich + deedewesfsdf +cedwee