|
@@ -1,13 +1,18 @@
|
|
|
|
+import queue
|
|
import time
|
|
import time
|
|
|
|
|
|
from sensors.connection import globalArduinoSlave
|
|
from sensors.connection import globalArduinoSlave
|
|
|
|
+import logHandler
|
|
|
|
|
|
conn = globalArduinoSlave()
|
|
conn = globalArduinoSlave()
|
|
|
|
|
|
|
|
|
|
class MagneticSensor:
|
|
class MagneticSensor:
|
|
- def __init__(self):
|
|
|
|
- pass
|
|
|
|
|
|
+ def __init__(self, conf):
|
|
|
|
+ self.conf = conf
|
|
|
|
+ self.queue = queue.Queue()
|
|
|
|
+ self.log_handler = logHandler.get_log_handler() # neu
|
|
|
|
+ #pass
|
|
|
|
|
|
def start(self):
|
|
def start(self):
|
|
if not conn.isConnected():
|
|
if not conn.isConnected():
|
|
@@ -21,4 +26,8 @@ class MagneticSensor:
|
|
pass
|
|
pass
|
|
|
|
|
|
def read(self):
|
|
def read(self):
|
|
- return conn.getMagneticField()
|
|
|
|
|
|
+ return conn.getMagneticField()
|
|
|
|
+
|
|
|
|
+ def stop(self): # neu
|
|
|
|
+ self.log_handler.log_and_print("stop magnetic sensor")
|
|
|
|
+ conn.close
|