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.
 
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 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.

◆ 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.

◆ 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.