While I understand it is possible to use the Thread Monitor to see what classes are already running, is it possible for a script to get access to this same information?
I'd like a script to be able to check if another specific class is already running and take action as required.
For example:
import jmri
?
class Test(jmri.jmrit.automat.AbstractAutomaton):
? ? def init(self):
? ? ? ? print 'init Test'
? ? ? ? # Pseudo-code #
? ? ? ? if CLASS(THE_OTHER_CLASS).IS_RUNNING:
? ? ? ? ? ? print "The Other Class is already running"
? ? ? ? else:
? ? ? ? ? ? print "The Other Class is NOT running"
? ? ? ? return
?
? ? def handle(self):
? ? ? ? do stuff here
? ? ? ? return False
Test().start()
If this can't be done directly I can see a way to do it with internal sensors, but the direct approach would be neater.
Thanks,
Trevor