Unverified Commit 09e8eb81 authored by AJ Fite's avatar AJ Fite 🛫
Browse files

Initial work on thread safe licor

parent 04882a00
......@@ -46,14 +46,32 @@ class ImageThread(QThread):
# TODO: This needs to be thread safe
class CSVHandler(PatternMatchingEventHandler):
patterns = ["*.csv"]
main = None
class LicorThread(QThread):
new_licor = pyqtSignal(float)
def __init__(self, mainwindow):
self.main = mainwindow
class LicorHandler(PatternMatchingEventHandler):
patterns = ["*.txt"]
def on_created(self, event):
print("New CSV")
def __init__(self, event_thread):
self.event_thread = event_thread
def on_created(self, event):
# TODO: Read licor file, convert to float, send to event
def run(self):
datadir = FileHandlerUtils.compute_current_data_dir()
if not os.path.exists(datadir):
# Wait for lepton-grabber to make the directory rather than failing
# here or waiting for the data directory to be created just create
# it ourselves
observer = Observer()
# FIXME: When this ticks over to the next day it fails to update
observer.schedule(self.LicorHandler(self), path=datadir)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment