switched to a monospace font in the cfg tool, padded the hashrates to appear as decimal centered, and left justified hostnames for better readability.

This commit is contained in:
UpstreamData
2022-02-22 10:49:23 -07:00
parent ef0a507306
commit bb89be64f4
5 changed files with 21 additions and 18 deletions

View File

@@ -39,13 +39,13 @@ async def export_csv(file_location, ip_list_selected):
async with aiofiles.open(file_location, mode='w') as file:
for item in ip_list_selected:
await file.write(str(
", ".join([str(part) for part in item])
", ".join([str(part).rstrip().lstrip() for part in item])
) + "\n")
else:
async with aiofiles.open(file_location, mode='w') as file:
for item in window['ip_table'].Values:
await file.write(str(
", ".join([str(part) for part in item])
", ".join([str(part).rstrip().lstrip() for part in item])
) + "\n")
await update_ui_with_data("status", "")

View File

@@ -209,7 +209,7 @@ async def refresh_data(ip_list: list):
if data_point["IP"] in ordered_all_ips:
ip_table_index = ordered_all_ips.index(data_point["IP"])
ip_table_data[ip_table_index] = [
data_point["IP"], data_point["model"], data_point["host"], str(data_point['TH/s']) + " TH/s",
data_point["IP"], data_point["model"], data_point["host"], str(data_point['TH/s']) + " TH/s ",
data_point["temp"],
data_point['user'], str(data_point['wattage']) + " W"
]
@@ -222,7 +222,7 @@ async def refresh_data(ip_list: list):
for item, _ in enumerate(window["ip_table"].Values):
if len(window["ip_table"].Values[item]) > hr_idx:
if not window["ip_table"].Values[item][hr_idx] == '':
hashrate_list.append(float(window["ip_table"].Values[item][hr_idx].replace(" TH/s", "")))
hashrate_list.append(float(window["ip_table"].Values[item][hr_idx].replace(" TH/s ", "")))
else:
hashrate_list.append(0)
else:
@@ -276,14 +276,14 @@ async def scan_and_get_data(network):
if data_point["IP"] in ordered_all_ips:
ip_table_index = ordered_all_ips.index(data_point["IP"])
ip_table_data[ip_table_index] = [
data_point["IP"], data_point["model"], data_point["host"], str(data_point['TH/s']) + " TH/s",
data_point["IP"], data_point["model"], data_point["host"], str(data_point['TH/s']) + " TH/s ",
data_point["temp"],
data_point['user'], str(data_point['wattage']) + " W"
]
window["ip_table"].update(ip_table_data)
progress_bar_len += 1
asyncio.create_task(update_prog_bar(progress_bar_len))
hashrate_list = [float(item[3].replace(" TH/s", "")) for item in window["ip_table"].Values if not item[3] == '']
hashrate_list = [float(item[3].replace(" TH/s ", "")) for item in window["ip_table"].Values if not item[3] == '']
total_hr = round(sum(hashrate_list), 2)
await update_ui_with_data("hr_total", f"{total_hr} TH/s")
await update_ui_with_data("status", "")
@@ -323,14 +323,14 @@ async def get_formatted_data(ip: ipaddress.ip_address):
if "Temperature" in miner_data['summary'][0]['SUMMARY'][0].keys():
if not round(miner_data['summary'][0]['SUMMARY'][0]["Temperature"]) == 0:
temps = miner_data['summary'][0]['SUMMARY'][0]["Temperature"]
# hashrate data, this is the only place to get this for most miners as far as I know
# hashrate data
if 'MHS av' in miner_data['summary'][0]['SUMMARY'][0].keys():
th5s = round(await safe_parse_api_data(miner_data, 'summary', 0, 'SUMMARY', 0, 'MHS av') / 1000000, 2)
th5s = format(round(await safe_parse_api_data(miner_data, 'summary', 0, 'SUMMARY', 0, 'MHS av') / 1000000, 2), ".2f").rjust(6, " ")
elif 'GHS av' in miner_data['summary'][0]['SUMMARY'][0].keys():
if not miner_data['summary'][0]['SUMMARY'][0]['GHS av'] == "":
th5s = round(
th5s = format(round(
float(await safe_parse_api_data(miner_data, 'summary', 0, 'SUMMARY', 0, 'GHS av')) / 1000,
2)
2), ".2f").rjust(6, " ")
# alternate temperature data, for BraiinsOS
if "temps" in miner_data.keys():

View File

@@ -40,7 +40,7 @@ async def set_progress_bar_len(amount):
async def sort_data(index: int or str):
if window["scan"].disabled:
if window["scan"].Disabled:
print("disabled")
return
await update_ui_with_data("status", "Sorting Data")

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,7 @@
import asyncio
import sys
import PySimpleGUI as sg
import tkinter as tk
from tools.cfg_util.cfg_util_sg.layout import window, generate_config_layout
from tools.cfg_util.cfg_util_sg.func.miners import send_config, miner_light, refresh_data, generate_config, import_config, \
@@ -18,6 +19,8 @@ async def ui():
window.read(timeout=0)
table = window["ip_table"].Widget
table.bind("<Control-Key-c>", lambda x: copy_from_table(table))
# left justify the hostnames
table.column(2, anchor=tk.W)
while True:
event, value = window.read(timeout=10)
if event in (None, 'Close', sg.WIN_CLOSED):