gpu refactor

This commit is contained in:
Drath
2025-09-22 21:00:40 +02:00
parent 499eaac37b
commit f72a6ca139
3 changed files with 57 additions and 49 deletions

View File

@@ -101,16 +101,16 @@ void displayThread(std::stop_token st, Sensors* s) {
{
std::lock_guard<std::mutex> lock(s->mtx);
auto gpu_temps = (s->gpu.hotspot_temp) ? "/" + std::to_string(s->gpu.hotspot_temp) : "";
gpu_temps += (s->gpu.mem_temp) ? "/" + std::to_string(s->gpu.mem_temp) : "";
auto gpu_temps = (s->gpu.temp_hotspot) ? "/" + std::to_string(s->gpu.temp_hotspot) : "";
gpu_temps += (s->gpu.temp_mem) ? "/" + std::to_string(s->gpu.temp_mem) : "";
lcd.writeBuf(0, 0, pad(s->td[1], 11, true) + " " + s->td[0] + lcd.bar(1, s->gpu.core_usage / 100.0) + pad(s->loadavg, 17));
lcd.writeBuf(0, 0, pad(s->td[1], 11, true) + " " + s->td[0] + lcd.bar(1, s->gpu.usage_core / 100.0) + pad(s->loadavg, 17));
lcd.writeBuf(1, 0, pad(std::to_string(s->cpu.tctl) + "/" + std::to_string(s->cpu.tccd1) + lcd.cc[0], 8, true));
lcd.writeBuf(1, 8, pad(pBytes(s->ram.used, true) + "B", 7, true));
lcd.writeBuf(1, 16, pad(pNum(s->hass_state) + "W", 4));
lcd.writeBuf(1, 22, pad(pBytes(s->gpu.vram_used) + "B", 7));
lcd.writeBuf(1, 29, pad(std::to_string(s->gpu.edge_temp) + gpu_temps + lcd.cc[0], 11));
lcd.writeBuf(1, 29, pad(std::to_string(s->gpu.temp_edge) + gpu_temps + lcd.cc[0], 11));
lcd.writeBuf(2, 0, pad(pNum(s->cpu.ptotal, 1) + "W", 8, true));
lcd.writeBuf(2, 8, "home:" + pad(pBytes(s->home.free), 5));
@@ -121,7 +121,7 @@ void displayThread(std::stop_token st, Sensors* s) {
lcd.writeBuf(3, 0, pad(pNum(s->cpu.vcore, 3) + "V", 7, true));
lcd.writeBuf(3, 7, std::to_string(s->cpu.avg_freq) + "MHz");
lcd.writeBuf(3, 21, pad(std::to_string(s->gpu.core_clock) + "/" + std::to_string(s->gpu.mem_clock) + "MHz ", 13));
lcd.writeBuf(3, 21, pad(std::to_string(s->gpu.clock_core) + "/" + std::to_string(s->gpu.clock_mem) + "MHz ", 13));
lcd.writeBuf(3, 34, pad(pNum(s->gpu.vcore, 3) + "V", 5));
}