# HG changeset patch # User Edouard Tisserant # Date 1659433854 -7200 # Node ID 6c7a7b22bec91b4f0455f738167667a94d681c60 # Parent 58c09e84c3694282462dee8ba9f6ab9bf088d67f IDE+Runtime: fix exception when reconnecting with non-empty trace/force list. Sometimes, remote call to SetTraceVariableList returned None just after reconnecting: - changed caller to accept None (in case of connection problem) - changer SetTraceVariable list to return 4 (DEBUG_SUSPENDED) if debug is suspended diff -r 58c09e84c369 -r 6c7a7b22bec9 ProjectController.py --- a/ProjectController.py Fri Jul 22 12:14:52 2022 +0200 +++ b/ProjectController.py Tue Aug 02 11:50:54 2022 +0200 @@ -1577,12 +1577,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): @@ -1625,7 +1629,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 58c09e84c369 -r 6c7a7b22bec9 runtime/PLCObject.py --- a/runtime/PLCObject.py Fri Jul 22 12:14:52 2022 +0200 +++ b/runtime/PLCObject.py Tue Aug 02 11:50:54 2022 +0200 @@ -730,7 +730,7 @@ return self.DebugToken else: self._suspendDebug(True) - return None + return 4 # DEBUG_SUSPENDED def _TracesSwap(self): self.LastSwapTrace = time() diff -r 58c09e84c369 -r 6c7a7b22bec9 svghmi/widget_jump.ysl2 --- a/svghmi/widget_jump.ysl2 Fri Jul 22 12:14:52 2022 +0200 +++ b/svghmi/widget_jump.ysl2 Tue Aug 02 11:50:54 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 58c09e84c369 -r 6c7a7b22bec9 svghmi/widget_multistate.ysl2 --- a/svghmi/widget_multistate.ysl2 Fri Jul 22 12:14:52 2022 +0200 +++ b/svghmi/widget_multistate.ysl2 Tue Aug 02 11:50:54 2022 +0200 @@ -36,6 +36,7 @@ choice.elt.setAttribute("style", choice.style); } } + // TODO : use RequestAnimate and animate() } on_click(evt) { diff -r 58c09e84c369 -r 6c7a7b22bec9 tests/projects/svghmi/plc.xml --- a/tests/projects/svghmi/plc.xml Fri Jul 22 12:14:52 2022 +0200 +++ b/tests/projects/svghmi/plc.xml Tue Aug 02 11:50:54 2022 +0200 @@ -1,7 +1,7 @@ - + @@ -25,11 +25,20 @@ + + + + + + + + +