Page 1 of 1

has deviceStartComm completed?

PostPosted: Sat Aug 07, 2021 11:59 am
by berkinet
Hopefully a simple question. Is there a way to know when deviceStartComm() completes? In other words, when all existing devices have been passed to the method.

Re: has deviceStartComm completed?

PostPosted: Sat Aug 07, 2021 1:25 pm
by FlyingDiver
Implement this:

Code: Select all
    def _postStartup(self):
        super(Plugin, self)._postStartup()
        # your code here


Your code will run after all the devices have been started (which is what the superclass call does).

The next thing that happens after that is the call to runConcurrentThread(), so you might put stuff there as well.

Re: has deviceStartComm completed?

PostPosted: Sat Aug 07, 2021 2:03 pm
by berkinet
FlyingDiver wrote:
...
Code: Select all
    def _postStartup(self):
        super(Plugin, self)._postStartup()
        # your code here
... ...The next thing that happens after that is the call to runConcurrentThread(), so you might put stuff there as well.
Thanks, That's perfect. I am not implementing runConcurrentThread in this plugin, thus the need for exactly what you suggested.

Thanks

Re: has deviceStartComm completed?

PostPosted: Sat Aug 07, 2021 2:56 pm
by FlyingDiver
berkinet wrote:
Thanks, That's perfect. I am not implementing runConcurrentThread in this plugin, thus the need for exactly what you suggested.


Which is exactly why I needed it as well. Also, putting stuff in runConcurrentThread() has it's own problems if the thread crashes and get restarted,