Petit Poucet
 
Loading...
Searching...
No Matches
petitpoucet::ui Namespace Reference

Namespace for the user interface. More...

Functions

void configfromUserInput (std::string &casterName, std::string &serialPortName)
 Function to ask the user to define the config parameters.
 
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, the function returns 0, otherwise it returns 1.
 
int giveChoiceMultipleOptions (std::vector< std::string > options, std::string &message)
 Function to ask the user to choose between multiple options.
 
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.
 
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.
 
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 certain amount of time.
 
void padMessage (std::string &message, int padding)
 Function to pad a message with a certain number of dashes on each side.
 

Variables

int WINDOW_WIDTH = 80
 The width of the terminal interface.
 

Detailed Description

Namespace for the user interface.

Function Documentation

◆ configfromUserInput()

void petitpoucet::ui::configfromUserInput ( std::string &  casterName,
std::string &  serialPortName 
)

Function to ask the user to define the config parameters.

Parameters
casterNameThe reference to the name of the caster.
serialPortNameThe reference to the name of the serial port.

◆ giveChoiceMultipleOptions()

int petitpoucet::ui::giveChoiceMultipleOptions ( std::vector< std::string >  options,
std::string &  message 
)

Function to ask the user to choose between multiple options.

Parameters
optionsThe options to choose from.
messageThe message to display to the user to explain the choice presented.
Returns
The index of the chosen option.

◆ giveChoiceTwoOptions()

int petitpoucet::ui::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, the function returns 0, otherwise it returns 1.

Parameters
option1The first option.
option2The second option.
messageThe message to display to the user to explain the choice presented.

◆ interfaceForInstantaneousPosition()

void petitpoucet::ui::interfaceForInstantaneousPosition ( int  minimumSNR,
petitpoucet::serverinterface::PPServerOptions  options,
std::string  casterName,
std::string  serialPortName,
petitpoucet::serverinterface::CoordinateSystem  coordinateSystem 
)

User interface for getting the instantaneous position.

Parameters
allowableSNRThe minimum signal to noise ratio to trigger the instantaneous position recording.
optionsThe options for the server.
casterNameThe name of the caster.
serialPortNameThe name of the serial port.
coordinateSystemThe coordinate system to use.

◆ interfaceForPositionOverTime()

void petitpoucet::ui::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.

Parameters
minimumSNRThe minimum signal to noise ratio to trigger the instantaneous position recording.
optionsThe options for the server.
casterNameThe name of the caster.
serialPortNameThe name of the serial port.
coordinateSystemThe coordinate system to use.

◆ interfaceForPositionOverTimeWithLabelsAndTimer()

void petitpoucet::ui::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 certain amount of time.

Parameters
minimumSNRThe minimum signal to noise ratio to trigger the instantaneous position recording.
optionsThe options for the server.
casterNameThe name of the caster.
serialPortNameThe name of the serial port.
coordinateSystemThe coordinate system to use.
recordingTimeThe time to record the position for.
labelsThe labels to associate with the position.

◆ padMessage()

void petitpoucet::ui::padMessage ( std::string &  message,
int  padding 
)

Function to pad a message with a certain number of dashes on each side.

Parameters
messageThe message to pad.
paddingThe number of dashes to add on each side.

Variable Documentation

◆ WINDOW_WIDTH

int petitpoucet::ui::WINDOW_WIDTH = 80

The width of the terminal interface.