GUI round 10 (batch 1): firmware family colour + FW Version, CPU/Board split, per-board chip temp, error count
build-test-release / release (push) Successful in 11m23s
build-test-release / release (push) Successful in 11m23s
#3 Firmware column now shows the firmware FAMILY, coloured (Stock=default, VNish=green, Braiins=purple, LuxOS=gold, BixBit=pink, ePIC=light-blue, Hive=orange, Alkane=navy -- Alkane wired for our future scannable firmware); the version moves to a new "FW Version" column. #4 Control board split into a "CPU" column (AML/CVI/BBB/XIL, WhatsMiner H3/H6/H616) and a "Board" column (C76/C88/CBE/C49/C55, CB2/CB4/CB6). Fixed the AMLogic 140mm heuristic so S21 Pro -> CBE (was C76). The combined ControlBoard column stays available (hidden). #5 "Worker" now shows just the rig name; a new "Pool account" column holds the account (pool username "account.rig" split on the first dot). #6 Chip temp shows per-hashboard temps as integers ("77 / 64 / 74"), each coloured on the blue-to-red scale, falling back to the integer average. #7 Errors column shows just the count (a number, even for one; no "errors" word); the hover tooltip lists the messages, now concise -- Info dropped, the repetitive "[Error]"/"[Warning]" prefixes stripped, and duplicates collapsed. Default profile updated to show Firmware/FW Version/CPU/Board/Errors. 80 offline tests pass; headless self-test PASS; screenshot-verified the colours, splits, per-board temps and error counts in the offline demo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
This commit is contained in:
@@ -143,6 +143,23 @@ fn ratio_color(pal: &Palette, ratio: f64) -> (u8, u8, u8) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Colour for a firmware family (round-10 #3). Stock -- and any family we don't
|
||||
/// recognise -- returns None so the Firmware cell keeps the theme default text
|
||||
/// colour (which tracks light/dark and focus). The rest get a distinctive,
|
||||
/// fixed hue chosen to read on both light and dark backgrounds.
|
||||
fn firmware_color(family: &str) -> Option<(u8, u8, u8)> {
|
||||
Some(match family.trim().to_ascii_lowercase().as_str() {
|
||||
"braiins" => (150, 90, 210), // purple
|
||||
"luxos" | "lux" => (185, 150, 20), // yellow/gold
|
||||
"vnish" => (40, 165, 70), // green
|
||||
"bixbit" => (225, 105, 175), // pink
|
||||
"epic" => (70, 160, 225), // light blue
|
||||
"hive" | "hiveos" => (235, 140, 35), // orange
|
||||
"alkane" => (80, 100, 205), // navy
|
||||
_ => return None, // Stock / unknown -> theme default
|
||||
})
|
||||
}
|
||||
|
||||
/// Colour for a chip-temperature reading: cool blue at/below 40 C fading to hot
|
||||
/// red at/above 90 C, so a hot miner reads red at a glance.
|
||||
fn temp_color(pal: &Palette, temp_c: f64) -> (u8, u8, u8) {
|
||||
@@ -190,6 +207,25 @@ fn encode_temp_cell(pal: &Palette, plain: &str, temp_c: f64) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
/// Segment-encoded per-hashboard Chip-temp cell ("77 / 64 / 74"): each board's
|
||||
/// temperature coloured on the blue-to-red scale, the " / " separators in the
|
||||
/// default text colour. Falls back to the single average when there are no
|
||||
/// per-board readings.
|
||||
fn encode_board_temps_cell(pal: &Palette, temps: &[f64], avg: f64) -> String {
|
||||
if temps.is_empty() {
|
||||
let plain = if avg > 0.0 { format!("{avg:.0}") } else { String::new() };
|
||||
return encode_temp_cell(pal, &plain, avg);
|
||||
}
|
||||
let mut segs: Vec<(Option<(u8, u8, u8)>, String)> = Vec::with_capacity(temps.len() * 2 - 1);
|
||||
for (i, &t) in temps.iter().enumerate() {
|
||||
if i > 0 {
|
||||
segs.push((None, " / ".to_string()));
|
||||
}
|
||||
segs.push((Some(temp_color(pal, t)), format!("{t:.0}")));
|
||||
}
|
||||
encode_segments(&segs)
|
||||
}
|
||||
|
||||
/// Segment-encoded single-colour cell (Access/Errors): `plain` in `color`, or
|
||||
/// the default text colour when `color` is None.
|
||||
fn encode_flag_cell(plain: &str, color: Option<(u8, u8, u8)>) -> String {
|
||||
@@ -662,7 +698,7 @@ impl App {
|
||||
Some((sc, false)) if sc == c => title.push_str(" v"),
|
||||
_ => {}
|
||||
}
|
||||
if matches!(c, Column::Hashrate | Column::Hashboards | Column::TotalChips | Column::ChipTemp | Column::Cooling | Column::Locked | Column::Error | Column::Status) {
|
||||
if matches!(c, Column::Hashrate | Column::Hashboards | Column::TotalChips | Column::ChipTemp | Column::Cooling | Column::Locked | Column::Error | Column::Status | Column::Firmware) {
|
||||
// These columns show two-tone / multi-tone text (actual vs.
|
||||
// expected, or one colour per fan) via a custom renderer that
|
||||
// parses the segment-encoded cell value fill_rows writes.
|
||||
@@ -737,7 +773,7 @@ impl App {
|
||||
});
|
||||
encode_combined_cell(&self.pal, actual, expected, " / ", ratio)
|
||||
}
|
||||
Column::ChipTemp => encode_temp_cell(&self.pal, &c.cell(r), r.chip_temp_c),
|
||||
Column::ChipTemp => encode_board_temps_cell(&self.pal, &r.board_temps, r.chip_temp_c),
|
||||
Column::Cooling => encode_cooling_cell(&self.pal, &r.fan_rpms),
|
||||
Column::Locked => {
|
||||
// green = unlocked/writable, red = locked/view-only.
|
||||
@@ -752,6 +788,7 @@ impl App {
|
||||
let color = (!r.errors.is_empty()).then_some(self.pal.red);
|
||||
encode_flag_cell(&c.cell(r), color)
|
||||
}
|
||||
Column::Firmware => encode_flag_cell(&c.cell(r), firmware_color(&r.firmware)),
|
||||
Column::Status => {
|
||||
// Status keeps its status colour on its own cell (the
|
||||
// row is no longer tinted wholesale).
|
||||
@@ -2688,7 +2725,7 @@ impl App {
|
||||
for (j, c) in cols.iter().enumerate() {
|
||||
let want = c.cell(r);
|
||||
let raw = t.dvlc_get_cell(disp_row, j).unwrap_or_default();
|
||||
let got = if matches!(c, Column::Hashrate | Column::Hashboards | Column::TotalChips | Column::ChipTemp | Column::Cooling | Column::Locked | Column::Error | Column::Status) {
|
||||
let got = if matches!(c, Column::Hashrate | Column::Hashboards | Column::TotalChips | Column::ChipTemp | Column::Cooling | Column::Locked | Column::Error | Column::Status | Column::Firmware) {
|
||||
decode_segments_plain(&raw)
|
||||
} else {
|
||||
raw
|
||||
|
||||
Reference in New Issue
Block a user