# HG changeset patch # User Edouard Tisserant # Date 1634649303 -7200 # Node ID c6de1a6cb6554afbec63e9910cd1f7f02e8bf7f7 # Parent dce1d541331031eef6ae2461e1f55114f77bc814# Parent d8e99ecde9a27784770d237281219618124a48db Merge changes about wamp reconnecting options, and added missing parts so that these changes make sense. diff -r d8e99ecde9a2 -r c6de1a6cb655 runtime/WampClient.py --- a/runtime/WampClient.py Mon Oct 11 09:04:53 2021 +0200 +++ b/runtime/WampClient.py Tue Oct 19 15:15:03 2021 +0200 @@ -75,7 +75,14 @@ "ID": "wamptest", "active": False, "realm": "Automation", - "url": "ws://127.0.0.1:8888" + "url": "ws://127.0.0.1:8888", + "clientFactoryOptions": { + "maxDelay": 300 + }, + "protocolOptions": { + "autoPingInterval": 10, + "autoPingTimeout": 5 + } } # Those two lists are meant to be filled by customized runtime @@ -180,7 +187,8 @@ def setClientFactoryOptions(self, options): for key, value in options.items(): - setattr(self, key, value) + if key in ["maxDelay", "initialDelay", "maxRetries", "factor", "jitter"]: + setattr(self, key, value) def buildProtocol(self, addr): self.resetDelay() @@ -218,7 +226,7 @@ if os.path.exists(_WampConf): try: WampClientConf = json.load(open(_WampConf)) - UpdateWithDefault(WampClientConf, defaultWampConfig) + UpdateWithDefault(WampClientConf, defaultWampConfig) except ValueError: pass @@ -378,7 +386,12 @@ # WEB CONFIGURATION INTERFACE WAMP_SECRET_URL = "secret" -webExposedConfigItems = ['active', 'url', 'ID'] +webExposedConfigItems = [ + 'active', 'url', 'ID', + "clientFactoryOptions.maxDelay", + "protocolOptions.autoPingInterval", + "protocolOptions.autoPingTimeout" +] def wampConfigDefault(ctx, argument): @@ -460,8 +473,17 @@ default=wampConfigDefault)), ("url", annotate.String(label=_("WAMP Server URL"), - default=wampConfigDefault))] - + default=wampConfigDefault)), + ("clientFactoryOptions.maxDelay", + annotate.Integer(label=_("Max reconnection delay (s)"), + default=wampConfigDefault)), + ("protocolOptions.autoPingInterval", + annotate.Integer(label=_("Auto ping interval (s)"), + default=wampConfigDefault)), + ("protocolOptions.autoPingTimeout", + annotate.Integer(label=_("Auto ping timeout (s)"), + default=wampConfigDefault)) + ] def deliverWampSecret(ctx, segments): # filename = segments[1].decode('utf-8') diff -r d8e99ecde9a2 -r c6de1a6cb655 svghmi/svghmi.py --- a/svghmi/svghmi.py Mon Oct 11 09:04:53 2021 +0200 +++ b/svghmi/svghmi.py Tue Oct 19 15:15:03 2021 +0200 @@ -56,6 +56,8 @@ def Generate_C(self, buildpath, varlist, IECCFLAGS): global hmi_tree_root, on_hmitree_update, maxConnectionsTotal + maxConnectionsTotal = 0 + already_found_watchdog = False found_SVGHMI_instance = False for CTNChild in self.GetCTR().IterChildren():