Flair
Framework Libre Air
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
flair::gui::DataPlot2D Class Reference

Class displaying a 2D plot on the ground station. More...

#include <DataPlot2D.h>

+ Inheritance diagram for flair::gui::DataPlot2D:

Public Member Functions

 DataPlot2D (const LayoutPosition *position, std::string name, std::string x_name, float xmin, float xmax, std::string y_name, float ymin, float ymax)
 Constructor. More...
 
 ~DataPlot2D ()
 Destructor. More...
 
void AddCurve (const core::IODataElement *x_element, const core::IODataElement *y_element, Color_t color, std::string curve_name="")
 Add a curve from elements to the plot. More...
 
void AddCurve (const core::IODataElement *x_element, const core::IODataElement *y_element, uint8_t r=255, uint8_t g=0, uint8_t b=0, std::string curve_name="")
 Add a curve from elements to the plot. More...
 

Detailed Description

Class displaying a 2D plot on the ground station.

Constructor & Destructor Documentation

flair::gui::DataPlot2D::DataPlot2D ( const LayoutPosition position,
std::string  name,
std::string  x_name,
float  xmin,
float  xmax,
std::string  y_name,
float  ymin,
float  ymax 
)

Constructor.

Construct a 2D plot at given place position.

Parameters
positionposition to display the plot
namename
x_namename of x axis
xmindefault xmin of the plot
xmaxdefault xmax of the plot
y_namename of y axis
ymindefault ymin of the plot
ymaxdefault ymax of the plot
flair::gui::DataPlot2D::~DataPlot2D ( )

Destructor.

Member Function Documentation

void flair::gui::DataPlot2D::AddCurve ( const core::IODataElement x_element,
const core::IODataElement y_element,
Color_t  color,
std::string  curve_name = "" 
)

Add a curve from elements to the plot.

Curve's color can be selected by its name.

Parameters
x_elementelement to plot for x coordinate
y_elementelement to plot for y coordinate
colorcolor of the curve
curve_namename of the curve ofr the legend
void flair::gui::DataPlot2D::AddCurve ( const core::IODataElement x_element,
const core::IODataElement y_element,
uint8_t  r = 255,
uint8_t  g = 0,
uint8_t  b = 0,
std::string  curve_name = "" 
)

Add a curve from elements to the plot.

Curve's color can be selected by its RGB components.

Parameters
x_elementelement to plot for x coordinate
y_elementelement to plot for y coordinate
rred component of the curve
ggreen component of the curve
bblue component of the curve
curve_namename of the curve ofr the legend