Merge default in wxPython4 wxPython4
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 09 Nov 2022 12:30:45 +0100
branchwxPython4
changeset 3665 db7e4952b64f
parent 3660 0e41dbe6ddcd (current diff)
parent 3664 7e8db0b44e42 (diff)
child 3666 bf3b5f58c832
Merge default in wxPython4
svghmi/gen_index_xhtml.xslt
svghmi/svghmi.py
--- a/svghmi/gen_index_xhtml.xslt	Fri Nov 04 22:14:14 2022 +0100
+++ b/svghmi/gen_index_xhtml.xslt	Wed Nov 09 12:30:45 2022 +0100
@@ -12514,12 +12514,6 @@
 </xsl:text>
           <xsl:text>
 </xsl:text>
-          <xsl:text>    // forget subscriptions remotely
-</xsl:text>
-          <xsl:text>    send_reset();
-</xsl:text>
-          <xsl:text>
-</xsl:text>
           <xsl:text>    // forget earlier subscriptions locally
 </xsl:text>
           <xsl:text>    reset_subscription_periods();
--- a/svghmi/svghmi.js	Fri Nov 04 22:14:14 2022 +0100
+++ b/svghmi/svghmi.js	Wed Nov 09 12:30:45 2022 +0100
@@ -428,18 +428,22 @@
     e.preventDefault();
 });
 
-var screensaver_timer = null;
-function reset_screensaver_timer() {
-    if(screensaver_timer){
-        window.clearTimeout(screensaver_timer);
-    }
-    screensaver_timer = window.setTimeout(() => {
-        switch_page("ScreenSaver");
-        screensaver_timer = null;
-    }, screensaver_delay*1000);
-}
-if(screensaver_delay)
+if(screensaver_delay){
+    var screensaver_timer = null;
+    function reset_screensaver_timer() {
+        if(screensaver_timer){
+            window.clearTimeout(screensaver_timer);
+        }
+        screensaver_timer = window.setTimeout(() => {
+            switch_page("ScreenSaver");
+            screensaver_timer = null;
+        }, screensaver_delay*1000);
+    }
     document.body.addEventListener('pointerdown', reset_screensaver_timer);
+    // initialize screensaver
+    reset_screensaver_timer();
+}
+
 
 function detach_detachables() {
 
@@ -601,9 +605,6 @@
 // show main page
 switch_page(default_page);
 
-// initialize screensaver
-reset_screensaver_timer();
-
 var reconnect_delay = 0;
 var periodic_reconnect_timer;
 
@@ -621,9 +622,6 @@
         }, 3600000);
     }
 
-    // forget subscriptions remotely
-    send_reset();
-
     // forget earlier subscriptions locally
     reset_subscription_periods();
 
--- a/svghmi/svghmi.py	Fri Nov 04 22:14:14 2022 +0100
+++ b/svghmi/svghmi.py	Wed Nov 09 12:30:45 2022 +0100
@@ -657,8 +657,10 @@
     global browser_proc
     restart_proc = {svghmi_cmds[Watchdog]}
     waitpid_timeout(restart_proc, "SVGHMI watchdog triggered command")
+    stop_proc = {svghmi_cmds[Stop]}
+    waitpid_timeout(stop_proc, "SVGHMI stop command")
     waitpid_timeout(browser_proc, "SVGHMI browser process")
-    browser_proc = None
+    browser_proc = {svghmi_cmds[Start]}
 
 max_svghmi_sessions = {maxConnections_total}
 
--- a/svghmi/svghmi_server.py	Fri Nov 04 22:14:14 2022 +0100
+++ b/svghmi/svghmi_server.py	Wed Nov 09 12:30:45 2022 +0100
@@ -223,6 +223,7 @@
         _hmi_session = HMISession(self)
         registered = svghmi_session_manager.register(_hmi_session)
         self._hmi_session = _hmi_session
+        self._hmi_session.reset()
 
     def onClose(self, wasClean, code, reason):
         global svghmi_session_manager