Skip to content
Snippets Groups Projects
Commit 266b55fd authored by jkerdreu's avatar jkerdreu
Browse files

Added started

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/fork@1516 b32b6428-25c9-4566-ad07-03861ab6144f
parent 6b36c31d
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ class Engine(object):
def __init__(self,address=config.address,port=config.port,hops=config.hops,key=config.key):
self.devices = [] # list of devices / use (un)register_devices()
self.started = False # engine started or not
self.running = False # engine is running or not
self.callbacks = [] # functions to call every loop
self.timers = [] # functions to call periodic
......@@ -292,12 +293,14 @@ class Engine(object):
for dev in self.devices:
self.send_alive(dev)
dev.update_alive()
self.started = True
def stop(self):
self.running = False
def run(self):
self.start()
if not self.started:
self.start()
self.running = True
while self.running:
self.loop()
......@@ -382,5 +385,3 @@ class Timer(object):
self.func = func
self.period = period
self.deadline = 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment