summaryrefslogtreecommitdiffhomepage
path: root/UI.cpp
blob: e1d33c94c685f361a76dcaeafd3822b218e070c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#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:";
  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;
  std::cout << "  Clock: ____" << std::endl;
  std::cout << "  Click: ____" << std::endl;
}