Commit 18fc550e authored by Pedro Henrique Kopper's avatar Pedro Henrique Kopper

Decouple interface listing from graph

parent 1677fc75
# Comente fora as interfaces não utilizadas para reduzir o tamanho do programa # Comente fora as interfaces não utilizadas para reduzir o tamanho do programa
from interfaces.Mock import * from interfaces.Mock import *
\ No newline at end of file
INTERFACES = {
'mock': Mock
}
\ No newline at end of file
...@@ -5,9 +5,6 @@ from interfaces import * ...@@ -5,9 +5,6 @@ from interfaces import *
from config import Config from config import Config
class Graph(QThread): class Graph(QThread):
INTERFACES = {
'mock': Mock
}
def __init__(self, graph, interval, logger, parent=None): def __init__(self, graph, interval, logger, parent=None):
super(Graph, self).__init__(parent) super(Graph, self).__init__(parent)
self.running = True self.running = True
...@@ -22,7 +19,7 @@ class Graph(QThread): ...@@ -22,7 +19,7 @@ class Graph(QThread):
self.config = Config().data self.config = Config().data
self._configurePlots() self._configurePlots()
device = self.config["device"] device = self.config["device"]
self.interface = self.INTERFACES[device["type"]](device["location"], device["channels"]) self.interface = INTERFACES[device["type"]](device["location"], device["channels"])
def run(self): def run(self):
while self.running: while self.running:
......
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