This commit is contained in:
Your Name 2024-11-23 19:33:29 +01:00
parent 246c48244a
commit e0a357b78b
2 changed files with 20 additions and 34 deletions

View File

@ -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_())

View File

@ -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_())