summaryrefslogtreecommitdiffhomepage
path: root/UI.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-03 15:36:22 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-03 15:36:22 +0100
commit9de0b7f8937b7f6ce990132609f0b26851b31f2b (patch)
treea69f73358c9b75e5a11c9ed18d934964461360bf /UI.cpp
parent05895c86bddf50aacb3bb5e6a6bcc073965341ef (diff)
Monitor CPU
Diffstat (limited to 'UI.cpp')
-rw-r--r--UI.cpp17
1 files changed, 16 insertions, 1 deletions
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 <algorithm>
#include <iostream>
+#include <string>
+
+#include <fmt/format.h>
void UI::draw()
{
+ std::vector<int> 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;