Unverified Commit 044b7317 authored by AJ Fite's avatar AJ Fite 🛫

First shot at implementing licor reader

parent 7e53e7f0
...@@ -57,8 +57,9 @@ class LicorThread(QThread): ...@@ -57,8 +57,9 @@ class LicorThread(QThread):
self.event_thread = event_thread self.event_thread = event_thread
def on_created(self, event): def on_created(self, event):
# TODO: Read licor file, convert to float, send to event file = open(event.src_path, "r")
self.event_thread.new_licor.emit(event.src_path) output = float(file.read())
self.event_thread.new_licor.emit(output)
def run(self): def run(self):
datadir = FileHandlerUtils.compute_current_data_dir() datadir = FileHandlerUtils.compute_current_data_dir()
......
...@@ -6,7 +6,7 @@ import pkg_resources ...@@ -6,7 +6,7 @@ import pkg_resources
from PyQt5.QtCore import QProcess, QProcessEnvironment, Qt from PyQt5.QtCore import QProcess, QProcessEnvironment, Qt
from PyQt5.QtGui import QPixmap from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QMainWindow, QApplication, QGraphicsScene from PyQt5.QtWidgets import QMainWindow, QApplication, QGraphicsScene
from .filehandlers import ImageThread from .filehandlers import ImageThread, LicorThread
from .sudo import PasswordWindow from .sudo import PasswordWindow
from .about import AboutDialog from .about import AboutDialog
from .config import Config, ConfigEditor from .config import Config, ConfigEditor
...@@ -28,6 +28,9 @@ class MainWindow(QMainWindow): ...@@ -28,6 +28,9 @@ class MainWindow(QMainWindow):
self.png_watcher = ImageThread() self.png_watcher = ImageThread()
self.png_watcher.new_image.connect(self.update_image) self.png_watcher.new_image.connect(self.update_image)
self.licor_watcher = LicorThread()
self.licor_watcher.new_licor.connect(self.update_licor)
# Register Events # Register Events
self.startCapButton.clicked.connect(self.start_capture) self.startCapButton.clicked.connect(self.start_capture)
self.stopCapButton.clicked.connect(self.stop_capture) self.stopCapButton.clicked.connect(self.stop_capture)
...@@ -102,6 +105,9 @@ class MainWindow(QMainWindow): ...@@ -102,6 +105,9 @@ class MainWindow(QMainWindow):
# TODO: Capture progress # TODO: Capture progress
self.current = (self.current + 1) % Config.dbg_lepton_set self.current = (self.current + 1) % Config.dbg_lepton_set
def update_licor(self, licor):
self.solarIrradiance.display(licor)
# Opens a link # Opens a link
@staticmethod @staticmethod
def open_link(link): def open_link(link):
......
Markdown is supported
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