From e0a357b78b64476c166452978dadc1e57f6cb18b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 23 Nov 2024 19:33:29 +0100 Subject: [PATCH] update --- GUI_16_10_staticWorkflow_Multithreading.py | 12 +------ bjoerntest10.py | 42 ++++++++++------------ 2 files changed, 20 insertions(+), 34 deletions(-) diff --git a/GUI_16_10_staticWorkflow_Multithreading.py b/GUI_16_10_staticWorkflow_Multithreading.py index 776caf1..bd58a37 100644 --- a/GUI_16_10_staticWorkflow_Multithreading.py +++ b/GUI_16_10_staticWorkflow_Multithreading.py @@ -930,11 +930,6 @@ class Ui_MainWindow(object): self.checkWaageThread.wait() print("Der CheckWaage-Thread wurde beendet.") - - - - - if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) @@ -942,9 +937,4 @@ if __name__ == "__main__": ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() - sys.exit(app.exec_()) - - - - - + sys.exit(app.exec_()) \ No newline at end of file diff --git a/bjoerntest10.py b/bjoerntest10.py index b54e5a9..c5ae5b1 100644 --- a/bjoerntest10.py +++ b/bjoerntest10.py @@ -28,7 +28,8 @@ import cv2 import os -import sainsmartrelay +import sainsmartrelay # relay control for spotlight +import wledControl # led control for warn light # db_config = { # 'user': 'dbUser', @@ -660,7 +661,10 @@ class Ui_MainWindow(object): tableObject.item(rowID, 3).setBackground(QtGui.QColor(r,g,b)) tableObject.item(rowID, 4).setBackground(QtGui.QColor(r,g,b)) tableObject.item(rowID, 5).setBackground(QtGui.QColor(r,g,b)) - ''' + ''' + + # adding change led color + #wird hier vermutlich nicht mehr benötigt - wurde in die Workerklasse kopiert def readWaage(self): @@ -1076,30 +1080,20 @@ class RelayControl(QtWidgets.QMainWindow): def spot_off(self): print("Turn off light clicked") self.r.turn_off(1) - - def red_on(self): - print("Red light is on") - self.r.turn_on(2) - - def red_off(self): - print("Red light is off") - self.r.turn_off(2) - def yellow_on(self): - print("Yellow light is on") - self.r.turn_on(3) +# new class for warnlight LED control +class LedControl(QtWidgets.QMainWindow): + def __init__(self, ui): + super().__init__() + self.ui = ui + self.w = wledControl.WLEDController(port="/dev/serial/by-path/pci-0000:00:14.0-usbv2-0:1:1.0-port0") + self.w.connect() + self.w.turn_off_all() + self.w.switch_to_yellow() + self.w.change_effect() - def yellow_off(self): - print("Yellow light is off") - self.r.turn_off(3) + #def spot_on(self): - def green_on(self): - print("Green light is on") - self.r.turn_on(4) - - def green_off(self): - print("Green light is off") - self.r.turn_off(4) if __name__ == "__main__": import sys @@ -1112,6 +1106,8 @@ if __name__ == "__main__": camera_app = CameraStreamApp(ui) # initialize relay app relay_app = RelayControl(ui) + # initialize led control app + led_app = LedControl(ui) MainWindow.show() sys.exit(app.exec_()) \ No newline at end of file