22 lines
641 B
Python
22 lines
641 B
Python
import sys
|
|
from PyQt5.QtWidgets import QApplication
|
|
from GUI import MainWindow
|
|
from DeviceController import DeviceController
|
|
|
|
def main():
|
|
app = QApplication(sys.argv)
|
|
win = MainWindow()
|
|
|
|
ctrl = DeviceController(serial="TEST123")
|
|
widget = win.add_list_item("TEST123", 0)
|
|
|
|
# 'checked' wird von Qt geliefert; wir fangen es in der Lambda ab
|
|
widget.btn_start.clicked.connect(lambda checked=False: (ctrl.start(), widget.set_running(True)))
|
|
widget.btn_stop.clicked.connect (lambda checked=False: (ctrl.stop(), widget.set_running(False)))
|
|
|
|
win.show()
|
|
sys.exit(app.exec_())
|
|
|
|
if __name__ == "__main__":
|
|
main()
|