added bosminer board data
This commit is contained in:
@@ -253,6 +253,12 @@ class BOSMiner(BaseMiner):
|
||||
"Temperature": 0,
|
||||
"Pool User": "Unknown",
|
||||
"Wattage": 0,
|
||||
"Total": 0,
|
||||
"Ideal": self.nominal_chips * 3,
|
||||
"Left Board": 0,
|
||||
"Center Board": 0,
|
||||
"Right Board": 0,
|
||||
"Nominal": False,
|
||||
"Split": "0",
|
||||
"Pool 1": "Unknown",
|
||||
"Pool 1 User": "Unknown",
|
||||
@@ -271,7 +277,7 @@ class BOSMiner(BaseMiner):
|
||||
miner_data = None
|
||||
for i in range(DATA_RETRIES):
|
||||
miner_data = await self.api.multicommand(
|
||||
"summary", "temps", "tunerstatus", "pools"
|
||||
"summary", "temps", "tunerstatus", "pools", "devdetails"
|
||||
)
|
||||
if miner_data:
|
||||
break
|
||||
@@ -281,6 +287,7 @@ class BOSMiner(BaseMiner):
|
||||
temps = miner_data.get("temps")[0]
|
||||
tunerstatus = miner_data.get("tunerstatus")[0]
|
||||
pools = miner_data.get("pools")[0]
|
||||
devdetails = miner_data.get("devdetails")[0]
|
||||
|
||||
if summary:
|
||||
hr = summary.get("SUMMARY")
|
||||
@@ -351,4 +358,19 @@ class BOSMiner(BaseMiner):
|
||||
if wattage:
|
||||
data["Wattage"] = wattage
|
||||
|
||||
if devdetails:
|
||||
boards = devdetails.get("DEVDETAILS")
|
||||
if boards:
|
||||
if len(boards) > 0:
|
||||
board_map = {0: "Left Board", 1: "Center Board", 2: "Right Board"}
|
||||
offset = boards[0]["ID"]
|
||||
for board in boards:
|
||||
id = board["ID"] - offset
|
||||
chips = board["Chips"]
|
||||
data["Total"] += chips
|
||||
data[board_map[id]] = chips
|
||||
|
||||
if data["Total"] == data["Ideal"]:
|
||||
data["Nominal"] = True
|
||||
|
||||
return data
|
||||
|
||||
@@ -95,8 +95,8 @@ TABLE_HEADERS = {
|
||||
"BOARDS": [
|
||||
"IP",
|
||||
"Model",
|
||||
"Total Chips",
|
||||
"Nominal Chips",
|
||||
"Ideal",
|
||||
"Total",
|
||||
"Left Board",
|
||||
"Center Board",
|
||||
"Right Board",
|
||||
@@ -174,8 +174,8 @@ TEMP_COL_WIDTH = 8
|
||||
USER_COL_WIDTH = 33
|
||||
WATTAGE_COL_WIDTH = 10
|
||||
SPLIT_COL_WIDTH = 8
|
||||
TOTAL_CHIP_WIDTH = 14
|
||||
NOMINAL_CHIP_WIDTH = 16
|
||||
TOTAL_CHIP_WIDTH = 8
|
||||
IDEAL_CHIP_WIDTH = 8
|
||||
SCAN_COL_WIDTHS = [
|
||||
IP_COL_WIDTH,
|
||||
MODEL_COL_WIDTH,
|
||||
@@ -277,7 +277,7 @@ def get_boards_layout():
|
||||
IP_COL_WIDTH,
|
||||
MODEL_COL_WIDTH,
|
||||
TOTAL_CHIP_WIDTH,
|
||||
NOMINAL_CHIP_WIDTH,
|
||||
IDEAL_CHIP_WIDTH,
|
||||
]
|
||||
add_length = TABLE_TOTAL_WIDTH - sum(BOARDS_COL_WIDTHS)
|
||||
for i in range(3):
|
||||
|
||||
@@ -3,24 +3,17 @@ import asyncio
|
||||
from miners.miner_factory import MinerFactory
|
||||
from network import MinerNetwork
|
||||
from tools.cfg_util.decorators import disable_buttons
|
||||
from tools.cfg_util.layout import window, update_prog_bar
|
||||
from tools.cfg_util.layout import window, update_prog_bar, TABLE_HEADERS
|
||||
from tools.cfg_util.tables import clear_tables, TableManager
|
||||
|
||||
progress_bar_len = 0
|
||||
|
||||
DEFAULT_DATA = [
|
||||
"Model",
|
||||
"Hostname",
|
||||
"Hashrate",
|
||||
"Temperature",
|
||||
"Pool User",
|
||||
"Pool 1",
|
||||
"Pool 1 User",
|
||||
"Pool 2",
|
||||
"Pool 2 User",
|
||||
"Wattage",
|
||||
"Split",
|
||||
]
|
||||
|
||||
DEFAULT_DATA = set()
|
||||
|
||||
for table in TABLE_HEADERS:
|
||||
for header in TABLE_HEADERS[table]:
|
||||
DEFAULT_DATA.add(header)
|
||||
|
||||
|
||||
async def btn_all():
|
||||
|
||||
@@ -174,6 +174,7 @@ class TableManager(metaclass=Singleton):
|
||||
|
||||
def _get_sort(self, data_key: str):
|
||||
if self.sort_key not in self.data[data_key]:
|
||||
print(self.data[data_key])
|
||||
return ""
|
||||
|
||||
if self.sort_key == "IP":
|
||||
@@ -188,7 +189,15 @@ class TableManager(metaclass=Singleton):
|
||||
self.data[data_key]["Hashrate"].replace(" ", "").replace("TH/s", "")
|
||||
)
|
||||
|
||||
if self.sort_key in ["Wattage", "Temp"]:
|
||||
if self.sort_key in [
|
||||
"Wattage",
|
||||
"Temp",
|
||||
"Total",
|
||||
"Ideal",
|
||||
"Left Chips",
|
||||
"Center Chips",
|
||||
"Right Chips",
|
||||
]:
|
||||
if isinstance(self.data[data_key][self.sort_key], str):
|
||||
return -300
|
||||
|
||||
|
||||
Reference in New Issue
Block a user