Fix hostblock

This commit is contained in:
2025-12-29 17:31:42 +00:00
parent 09e4965245
commit b3ec7a01a7
2 changed files with 13 additions and 2 deletions
+10 -1
View File
@@ -16,6 +16,11 @@ namespace display::ui::hostblock
CPU_BAR_HEIGHT,
display::ui::bar::Orientation::Vertical,
display::ui::bar::Style{display::graphics::Color{40, 40, 40}, display::graphics::Color{0, 180, 0}, display::graphics::Color{80, 80, 80}, true}),
cpuTempBar(
CPU_BAR_TEMP_WIDTH,
CPU_BAR_HEIGHT,
display::ui::bar::Orientation::Vertical,
display::ui::bar::Style{display::graphics::Color{40, 40, 40}, display::graphics::Color{0, 180, 0}, display::graphics::Color{80, 80, 80}, true}),
memBar(
BLOCK_WIDTH - PADDING * 2,
MEM_BAR_HEIGHT,
@@ -69,7 +74,7 @@ namespace display::ui::hostblock
int col = i % CPU_MAX_PER_ROW;
int bx = x + PADDING +
col * (CPU_BAR_WIDTH + CPU_BAR_GAP);
col * (CPU_BAR_WIDTH + CPU_BAR_TEMP_WIDTH - 1 + CPU_BAR_GAP);
int by = cursorY +
row * (CPU_BAR_HEIGHT + CPU_BAR_GAP);
@@ -77,6 +82,10 @@ namespace display::ui::hostblock
float value = std::clamp(metrics.cpu.coreLoads[i] / 100.0f, 0.0f, 1.0f);
cpuBar.draw(fb, bx, by, value);
value = std::clamp(metrics.cpu.coreTemps[i].current / metrics.cpu.coreTemps[i].max, 0.0f, 1.0f);
cpuTempBar.draw(fb, bx + CPU_BAR_WIDTH - 1, by, value);
}
cursorY += CPU_ROWS * CPU_BAR_HEIGHT +