--- a/Beremiz_service.py Mon Mar 17 13:28:06 2025 +0100
+++ b/Beremiz_service.py Mon Mar 17 13:35:42 2025 +0100
@@ -587,15 +587,13 @@
runtime.GetPLCObjectSingleton().AutoLoad(autostart)
-if havetwisted and havewx:
- waker_func = wx.CallAfter
+ waker_func = reactor.callFromThread # This orders ui loop to signal when ready on Stdout
waker_func(print,"UI thread started successfully.")
- # interleaved worker copes with wxreactor by delegating all asynchronous
- # calls to wx's mainloop
+ # interleaved worker delegates all calls to reactor runtime.MainWorker.interleave(waker_func, reactor.stop, FirstWorkerJob)
@@ -607,30 +605,19 @@
+ waker_func = wx.CallAfter + # This orders ui loop to signal when ready on Stdout + waker_func(print,"UI thread started successfully.") + # interleaved worker delegates all calls to reactor + runtime.MainWorker.interleave(waker_func, app.ExitMainLoop, FirstWorkerJob)
except KeyboardInterrupt:
- ui_thread_started = Lock()
- ui_thread_started.acquire()
- reactor.callLater(0, ui_thread_started.release)
- target=partial(reactor.run, installSignalHandlers=False),
- ui_thread_started.acquire()
- print("UI thread started successfully.")
- runtime.MainWorker.runloop(FirstWorkerJob)
- except KeyboardInterrupt: