From 9de0b7f8937b7f6ce990132609f0b26851b31f2b Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 3 Jan 2025 15:36:22 +0100 Subject: Monitor CPU --- UI.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'UI.cpp') diff --git a/UI.cpp b/UI.cpp index f0eb0c3..e1d33c9 100644 --- a/UI.cpp +++ b/UI.cpp @@ -1,15 +1,30 @@ #include "UI.h" +#include "cpuload.h" + +#include #include +#include + +#include void UI::draw() { + std::vector cpuloads = get_cpu_loads(); + std::cout << std::endl; std::cout << "- -- BPM +" << std::endl; std::cout << "Mode: Click __/__ (Clock Internal)" << std::endl; std::cout << "Status:" << std::endl; std::cout << " Alive/not alive" << std::endl; - std::cout << " CPU: --% --% ..." << std::endl; + + std::cout << " CPU:"; + for (auto& i: cpuloads) { + std::cout << fmt::format(" {:2}%", i); + } + int max = *std::max_element(cpuloads.begin(), cpuloads.end()); + std::cout << fmt::format(", max. {:2}%", max) << std::endl; + std::cout << " Notes/Channels: -- -- -- ... (Choose)" << std::endl; std::cout << " Timestamp: ------" << std::endl; std::cout << " Active sensing: ---" << std::endl; -- cgit v1.2.3