update
This commit is contained in:
parent
246c48244a
commit
e0a357b78b
@ -930,11 +930,6 @@ class Ui_MainWindow(object):
|
|||||||
self.checkWaageThread.wait()
|
self.checkWaageThread.wait()
|
||||||
print("Der CheckWaage-Thread wurde beendet.")
|
print("Der CheckWaage-Thread wurde beendet.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
@ -943,8 +938,3 @@ if __name__ == "__main__":
|
|||||||
ui.setupUi(MainWindow)
|
ui.setupUi(MainWindow)
|
||||||
MainWindow.show()
|
MainWindow.show()
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,8 @@ import cv2
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import sainsmartrelay
|
import sainsmartrelay # relay control for spotlight
|
||||||
|
import wledControl # led control for warn light
|
||||||
|
|
||||||
# db_config = {
|
# db_config = {
|
||||||
# 'user': 'dbUser',
|
# 'user': 'dbUser',
|
||||||
@ -662,6 +663,9 @@ class Ui_MainWindow(object):
|
|||||||
tableObject.item(rowID, 5).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
|
#wird hier vermutlich nicht mehr benötigt - wurde in die Workerklasse kopiert
|
||||||
def readWaage(self):
|
def readWaage(self):
|
||||||
# in folgender Funktion wird die Waage ausgelesen
|
# in folgender Funktion wird die Waage ausgelesen
|
||||||
@ -1077,29 +1081,19 @@ class RelayControl(QtWidgets.QMainWindow):
|
|||||||
print("Turn off light clicked")
|
print("Turn off light clicked")
|
||||||
self.r.turn_off(1)
|
self.r.turn_off(1)
|
||||||
|
|
||||||
def red_on(self):
|
# new class for warnlight LED control
|
||||||
print("Red light is on")
|
class LedControl(QtWidgets.QMainWindow):
|
||||||
self.r.turn_on(2)
|
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 red_off(self):
|
#def spot_on(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)
|
|
||||||
|
|
||||||
def yellow_off(self):
|
|
||||||
print("Yellow light is off")
|
|
||||||
self.r.turn_off(3)
|
|
||||||
|
|
||||||
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__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
@ -1112,6 +1106,8 @@ if __name__ == "__main__":
|
|||||||
camera_app = CameraStreamApp(ui)
|
camera_app = CameraStreamApp(ui)
|
||||||
# initialize relay app
|
# initialize relay app
|
||||||
relay_app = RelayControl(ui)
|
relay_app = RelayControl(ui)
|
||||||
|
# initialize led control app
|
||||||
|
led_app = LedControl(ui)
|
||||||
|
|
||||||
MainWindow.show()
|
MainWindow.show()
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
Loading…
Reference in New Issue
Block a user