umstellung auf sym files und datenbank im fraunhofer

This commit is contained in:
Philipp Rauch 2014-01-15 18:02:59 +01:00
parent 0c9a1d2f2c
commit 580a93d620
7 changed files with 89 additions and 52 deletions

View file

@ -31,6 +31,12 @@ class Switch(Thread):
self.source = source
def initialisiere(self):
'''
initialize the swich with the given source and creates a queue and a query
it calls the setup method from the source module
@return: queue and query
'''
if self.source == MYSQL:
self.cursor = database.setup(conf)
elif self.source == MODBUS:
@ -49,6 +55,10 @@ class Switch(Thread):
return self.queue, self.query
def run(self):
'''
The loop method of the source module is called with a parameter from the query.
Its output is written to the queue.
'''
while True:
# Queue implementaion
# Queue contains the tablename for query