minor changes

This commit is contained in:
f.geissler 2022-07-19 13:36:40 +02:00
parent b3bbcf730b
commit 17fe582924
1 changed files with 11 additions and 12 deletions

23
test.py
View File

@ -3,12 +3,9 @@
import os
import struct
import time
import random
# import serial
import serial
import sys
from tkinter.tix import CELL
from PyQt5.QtCore import Qt, QTimer, QThread, QObject, pyqtSignal
from PyQt5.QtWidgets import (
@ -338,7 +335,7 @@ class Worker(QObject):
i = 1
while self.continue_run: # give the loop a stoppable condition
data.fill_dummy_data()
# self.charger_communication()
self.charger_communication()
# QThread.sleep(1)
self.finished.emit() # emit the finished signal when the loop is done
@ -432,12 +429,16 @@ class Worker(QObject):
if __name__ == "__main__":
data = AccumulatorData()
rx_buf = bytes()
# if len(sys.argv) != 2:
# print(f"Usage: {sys.argv[0]} SERIAL-PORT", file=sys.stderr)
# sys.exit(os.EX_USAGE)
# SERIAL_PORT = sys.argv[1]
# ser = serial.Serial(SERIAL_PORT, BITRATE, timeout=TIMEOUT)
"""
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} SERIAL-PORT", file=sys.stderr)
sys.exit(os.EX_USAGE)
SERIAL_PORT = sys.argv[1]
print(SERIAL_PORT)
ser = serial.Serial(SERIAL_PORT, BITRATE, timeout=TIMEOUT)
"""
app = QApplication(sys.argv)
gui = Window()
@ -448,6 +449,4 @@ if __name__ == "__main__":
timer.timeout.connect(gui.update)
timer.start(1000) # every 1,000 milliseconds
# update_display()
sys.exit(app.exec_())