minor changes
This commit is contained in:
parent
b3bbcf730b
commit
17fe582924
23
test.py
23
test.py
@ -3,12 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import struct
|
import struct
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import random
|
import random
|
||||||
|
import serial
|
||||||
# import serial
|
|
||||||
import sys
|
import sys
|
||||||
from tkinter.tix import CELL
|
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, QTimer, QThread, QObject, pyqtSignal
|
from PyQt5.QtCore import Qt, QTimer, QThread, QObject, pyqtSignal
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
@ -338,7 +335,7 @@ class Worker(QObject):
|
|||||||
i = 1
|
i = 1
|
||||||
while self.continue_run: # give the loop a stoppable condition
|
while self.continue_run: # give the loop a stoppable condition
|
||||||
data.fill_dummy_data()
|
data.fill_dummy_data()
|
||||||
# self.charger_communication()
|
self.charger_communication()
|
||||||
# QThread.sleep(1)
|
# QThread.sleep(1)
|
||||||
|
|
||||||
self.finished.emit() # emit the finished signal when the loop is done
|
self.finished.emit() # emit the finished signal when the loop is done
|
||||||
@ -432,12 +429,16 @@ class Worker(QObject):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
data = AccumulatorData()
|
data = AccumulatorData()
|
||||||
rx_buf = bytes()
|
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)
|
app = QApplication(sys.argv)
|
||||||
gui = Window()
|
gui = Window()
|
||||||
@ -448,6 +449,4 @@ if __name__ == "__main__":
|
|||||||
timer.timeout.connect(gui.update)
|
timer.timeout.connect(gui.update)
|
||||||
timer.start(1000) # every 1,000 milliseconds
|
timer.start(1000) # every 1,000 milliseconds
|
||||||
|
|
||||||
# update_display()
|
|
||||||
|
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user