mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-30 00:39:32 +00:00
Display fix
This commit is contained in:
@@ -159,7 +159,7 @@ class Server:
|
||||
logging.info("Got connection from: {}".format(str(addr)))
|
||||
conn.setblocking(False)
|
||||
|
||||
if not any(client_addr == addr[0] for client_addr in Client.clients.keys()):
|
||||
if not any([client_addr == addr[0] for client_addr in Client.clients.keys()]):
|
||||
client = Client(addr[0])
|
||||
logging.info("New client")
|
||||
else:
|
||||
|
||||
@@ -112,15 +112,15 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
if col == 1:
|
||||
data = value
|
||||
elif col == 2:
|
||||
data = "{} V.".format(round(float(value), 3))
|
||||
data = "{}".format(round(float(value), 3))
|
||||
elif col == 3:
|
||||
batt_percent = ((float(value) - 3.2) / (4.2 - 3.2)) * 100 # TODO config
|
||||
data = "{} %".format(round(batt_percent, 3))
|
||||
data = "{}".format(round(batt_percent, 3))
|
||||
elif col == 4:
|
||||
data = str(value)
|
||||
elif col == 5:
|
||||
data = time.ctime(int(value))
|
||||
data2 = "{} sec.".format(round(int(value) - time.time(), 3))
|
||||
data2 = "{}".format(round(int(value) - time.time(), 3))
|
||||
self.signals.update_data_signal.emit(row, col + 1, data2)
|
||||
else:
|
||||
print("No column matched for response")
|
||||
|
||||
Reference in New Issue
Block a user