Petit Poucet
 
Loading...
Searching...
No Matches
TerminalInterface.hh
Go to the documentation of this file.
1#include <string> // for operator+, to_string
2#include <iostream>
3#include <fstream>
4#include <atomic>
5#include <chrono>
6#include <mutex>
7#include <thread>
8#include <numeric>
9#include <vector>
10
11
12#include "ftxui/component/captured_mouse.hpp"
13#include "ftxui/component/component.hpp"
14#include "ftxui/component/component_base.hpp"
15#include "ftxui/component/component_options.hpp"
16#include "ftxui/component/screen_interactive.hpp"
17#include "ftxui/dom/elements.hpp"
18#include "ftxui/screen/color.hpp"
19
20#include "../Server/ServerInterface.hh"
21
25namespace petitpoucet::ui
26{
32 void configfromUserInput(std::string &casterName, std::string &serialPortName);
33
40 int giveChoiceTwoOptions(std::string option1, std::string option2, std::string &message);
41
48 int giveChoiceMultipleOptions(std::vector<std::string> options, std::string &message);
49
58 void interfaceForInstantaneousPosition(int minimumSNR,
60 std::string casterName,
61 std::string serialPortName,
63
72 void interfaceForPositionOverTime(int minimumSNR,
74 std::string casterName,
75 std::string serialPortName,
77
90 std::string casterName,
91 std::string serialPortName,
93 std::chrono::seconds recordingTime,
94 std::vector<std::string> labels);
95
99 int WINDOW_WIDTH = 80;
100
106 void padMessage(std::string &message, int padding);
107} // namespace petitpoucet::ui
This class stores the options for the PPServer when setup by PPServerInterface::SetupServer.
Definition ServerInterface.hh:53
CoordinateSystem
Enum for the different coordinate systems. Destined to be expanded.
Definition ServerInterface.hh:44
Namespace for the user interface.
Definition TerminalInterface.cc:4
void configfromUserInput(std::string &casterName, std::string &serialPortName)
Function to ask the user to define the config parameters.
Definition TerminalInterface.cc:5
int giveChoiceTwoOptions(std::string option1, std::string option2, std::string &message)
Function to ask the user to choose between two options. If the user chooses the first option,...
Definition TerminalInterface.cc:36
void interfaceForPositionOverTime(int minimumSNR, petitpoucet::serverinterface::PPServerOptions options, std::string casterName, std::string serialPortName, petitpoucet::serverinterface::CoordinateSystem coordinateSystem)
User interface for getting the position over time, where the user triggers and stops the measurment.
Definition TerminalInterface.cc:211
void padMessage(std::string &message, int padding)
Function to pad a message with a certain number of dashes on each side.
Definition TerminalInterface.cc:715
int giveChoiceMultipleOptions(std::vector< std::string > options, std::string &message)
Function to ask the user to choose between multiple options.
Definition TerminalInterface.cc:70
void interfaceForInstantaneousPosition(int minimumSNR, petitpoucet::serverinterface::PPServerOptions options, std::string casterName, std::string serialPortName, petitpoucet::serverinterface::CoordinateSystem coordinateSystem)
User interface for getting the instantaneous position.
Definition TerminalInterface.cc:106
void interfaceForPositionOverTimeWithLabelsAndTimer(int minimumSNR, petitpoucet::serverinterface::PPServerOptions options, std::string casterName, std::string serialPortName, petitpoucet::serverinterface::CoordinateSystem coordinateSystem, std::chrono::seconds recordingTime, std::vector< std::string > labels)
User interface for getting the position over time, where a timer is used to record the position for a...
Definition TerminalInterface.cc:425
int WINDOW_WIDTH
The width of the terminal interface.
Definition TerminalInterface.hh:99