wip
This commit is contained in:
parent
1a63355a85
commit
a5d57c3bd9
|
|
@ -1,8 +1,13 @@
|
||||||
[hardware_config]
|
[hardware_config]
|
||||||
tecna_t3: present
|
archive_synchronizer: present
|
||||||
neo_pixels: present
|
|
||||||
galaxy_camera: present
|
galaxy_camera: present
|
||||||
|
label_printer: present
|
||||||
multicomp: present
|
multicomp: present
|
||||||
|
neo_pixels: present
|
||||||
|
remote_api: present
|
||||||
|
tecna_t3: present
|
||||||
|
vision_saver: present
|
||||||
|
vision: present
|
||||||
|
|
||||||
[galaxy_camera]
|
[galaxy_camera]
|
||||||
horizontal_resolution: 2448
|
horizontal_resolution: 2448
|
||||||
|
|
@ -39,18 +44,18 @@ printer: zd421
|
||||||
|
|
||||||
|
|
||||||
[tecna_t3]
|
[tecna_t3]
|
||||||
port: COM3
|
; port: ?
|
||||||
baudrate: 115200
|
baudrate: 115200
|
||||||
admin_pin: 603
|
admin_pin: 603
|
||||||
modify_pin: 603
|
modify_pin: 603
|
||||||
select_pin: 603
|
select_pin: 603
|
||||||
|
|
||||||
[multicomp]
|
[multicomp]
|
||||||
port: COM3
|
; port: ?
|
||||||
baudrate: 115200
|
baudrate: 115200
|
||||||
|
|
||||||
[neo_pixels]
|
[neo_pixels]
|
||||||
port: COM1
|
; port: ?
|
||||||
baudrate: 9600
|
baudrate: 9600
|
||||||
|
|
||||||
[vision]
|
[vision]
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,3 @@ port: /dev/ttyUSB0
|
||||||
|
|
||||||
[neo_pixels]
|
[neo_pixels]
|
||||||
port: /dev/ttyACM0
|
port: /dev/ttyACM0
|
||||||
baudrate: 9600
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,15 @@
|
||||||
|
[hardware_config]
|
||||||
|
archive_synchronizer: absent
|
||||||
|
galaxy_camera: present
|
||||||
|
label_printer: present
|
||||||
|
neo_pixels: present
|
||||||
|
remote_api: present
|
||||||
|
tecna_t3: present
|
||||||
|
vision_saver: present
|
||||||
|
vision: present
|
||||||
|
|
||||||
[tecna_t3]
|
[tecna_t3]
|
||||||
port: COM5
|
port: COM5
|
||||||
|
|
||||||
[neo_pixels]
|
[neo_pixels]
|
||||||
port: COM4
|
port: COM4
|
||||||
baudrate: 9600
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
[hardware_config]
|
[hardware_config]
|
||||||
|
archive_synchronizer: absent
|
||||||
|
label_printer: present
|
||||||
|
multicomp: present
|
||||||
|
remote_api: present
|
||||||
tecna_t3: present
|
tecna_t3: present
|
||||||
neo_pixels: absent
|
|
||||||
galaxy_camera: absent
|
|
||||||
multimeter: present
|
|
||||||
vision_saver: absent
|
|
||||||
vision: absent
|
|
||||||
|
|
||||||
|
[tecna_t3]
|
||||||
|
port: COM5
|
||||||
|
|
||||||
|
[multicomp]
|
||||||
|
port: COM4
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,19 @@
|
||||||
|
[hardware_config]
|
||||||
|
archive_synchronizer: absent
|
||||||
|
galaxy_camera: present
|
||||||
|
label_printer: present
|
||||||
|
multicomp: present
|
||||||
|
neo_pixels: present
|
||||||
|
remote_api: present
|
||||||
|
tecna_t3: present
|
||||||
|
vision_saver: present
|
||||||
|
vision: present
|
||||||
|
|
||||||
[tecna_t3]
|
[tecna_t3]
|
||||||
port: /dev/ttyUSB0
|
port: /dev/ttyUSB0
|
||||||
|
|
||||||
[multicomp]
|
[multicomp]
|
||||||
port: /dev/ttyUSB1
|
port: /dev/ttyACM0
|
||||||
|
|
||||||
|
[neo_pixels]
|
||||||
|
port: /dev/ttyACM1
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,3 @@ port: COM4
|
||||||
|
|
||||||
[neo_pixels]
|
[neo_pixels]
|
||||||
port: COM3
|
port: COM3
|
||||||
baudrate: 9600
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
13
src/main.py
13
src/main.py
|
|
@ -54,7 +54,7 @@ try:
|
||||||
# IMPORT PROJECT ONLY AFTER SETTING UP SIGNAL, FAULTHANDLER AND LOGGHING
|
# IMPORT PROJECT ONLY AFTER SETTING UP SIGNAL, FAULTHANDLER AND LOGGHING
|
||||||
from components import (ArchiveSynchronizer, GalaxyCamera, Multicomp730424,
|
from components import (ArchiveSynchronizer, GalaxyCamera, Multicomp730424,
|
||||||
NeoPixels, Os_Label_Printer, RemoteAPI,
|
NeoPixels, Os_Label_Printer, RemoteAPI,
|
||||||
TecnaMarpossProvasetT3P, VisionSaver)
|
TecnaMarpossProvasetT3P, Vision, VisionSaver)
|
||||||
from lib.db import Users
|
from lib.db import Users
|
||||||
from lib.helpers import ConfigReader
|
from lib.helpers import ConfigReader
|
||||||
from PyQt5.QtCore import QObject, QThread, pyqtSignal
|
from PyQt5.QtCore import QObject, QThread, pyqtSignal
|
||||||
|
|
@ -77,14 +77,21 @@ try:
|
||||||
self.config = ConfigReader()
|
self.config = ConfigReader()
|
||||||
# INIT COMPONENT
|
# INIT COMPONENT
|
||||||
self.components_specs = {
|
self.components_specs = {
|
||||||
# "archive_synchronizer": {"c": ArchiveSynchronizer},
|
"archive_synchronizer": {"c": ArchiveSynchronizer},
|
||||||
|
"galaxy_camera": {"c": GalaxyCamera, "k": {"paused": True}},
|
||||||
"label_printer": {"c": Os_Label_Printer, "t": False},
|
"label_printer": {"c": Os_Label_Printer, "t": False},
|
||||||
"multicomp": {"c": Multicomp730424, "k": {"paused": True}},
|
"multicomp": {"c": Multicomp730424, "k": {"paused": True}},
|
||||||
|
"neo_pixels": {"c": NeoPixels, "t": False},
|
||||||
"remote_api": {"c": RemoteAPI, "k": {"main": self}},
|
"remote_api": {"c": RemoteAPI, "k": {"main": self}},
|
||||||
|
"tecna_t3": {"c": TecnaMarpossProvasetT3P, "k": {"paused": True}},
|
||||||
|
"vision_saver": {"c": VisionSaver, "t": False},
|
||||||
|
"vision": {"c": Vision, "k": {"paused": True}},
|
||||||
}
|
}
|
||||||
for component_name in list(self.components_specs):
|
for component_name in list(self.components_specs):
|
||||||
if self.config.get("hardware_config", {}).get(component_name, None) != "present":
|
if self.config.get("hardware_config", {}).get(component_name, None) != "present":
|
||||||
self.components_specs.pop(component_name)
|
self.components_specs.pop(component_name, None)
|
||||||
|
elif component_name not in self.components_specs:
|
||||||
|
raise AssertionError(f"{component_name!r} is not a valid component name")
|
||||||
self.components = {}
|
self.components = {}
|
||||||
self.threads = {}
|
self.threads = {}
|
||||||
for component_name, spec in self.components_specs.items():
|
for component_name, spec in self.components_specs.items():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user