[2] | 1 | // %flair:license{
|
---|
[13] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[2] | 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file DataPlot2D.h
|
---|
| 7 | * \brief Class displaying a 2D plot on the ground station
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2011/10/07
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef DATAPLOT2D_H
|
---|
| 14 | #define DATAPLOT2D_H
|
---|
| 15 |
|
---|
| 16 | #include <DataPlot.h>
|
---|
| 17 | #include <stdint.h>
|
---|
| 18 |
|
---|
[13] | 19 | namespace flair {
|
---|
| 20 | namespace core {
|
---|
| 21 | class IODataElement;
|
---|
[2] | 22 | }
|
---|
[13] | 23 | }
|
---|
| 24 | namespace flair {
|
---|
| 25 | namespace gui {
|
---|
[2] | 26 |
|
---|
[13] | 27 | class LayoutPosition;
|
---|
[2] | 28 |
|
---|
[13] | 29 | /*! \class DataPlot2D
|
---|
| 30 | *
|
---|
| 31 | * \brief Class displaying a 2D plot on the ground station
|
---|
| 32 | *
|
---|
| 33 | */
|
---|
| 34 | class DataPlot2D : private DataPlot {
|
---|
| 35 | public:
|
---|
| 36 | /*!
|
---|
| 37 | * \brief Constructor
|
---|
| 38 | *
|
---|
| 39 | * Construct a 2D plot at given place position.
|
---|
| 40 | *
|
---|
| 41 | * \param position position to display the plot
|
---|
| 42 | * \param name name
|
---|
| 43 | * \param x_name name of x axis
|
---|
| 44 | * \param xmin default xmin of the plot
|
---|
| 45 | * \param xmax default xmax of the plot
|
---|
| 46 | * \param y_name name of y axis
|
---|
| 47 | * \param ymin default ymin of the plot
|
---|
| 48 | * \param ymax default ymax of the plot
|
---|
| 49 | */
|
---|
| 50 | DataPlot2D(const LayoutPosition *position, std::string name,
|
---|
| 51 | std::string x_name, float xmin, float xmax, std::string y_name,
|
---|
| 52 | float ymin, float ymax);
|
---|
[2] | 53 |
|
---|
[13] | 54 | /*!
|
---|
| 55 | * \brief Destructor
|
---|
| 56 | *
|
---|
| 57 | */
|
---|
| 58 | ~DataPlot2D();
|
---|
[2] | 59 |
|
---|
[13] | 60 | /*!
|
---|
| 61 | * \brief Add a curve from elements to the plot.
|
---|
| 62 | *
|
---|
| 63 | * Curve's color can be selected by its name.
|
---|
| 64 | *
|
---|
| 65 | * \param x_element element to plot for x coordinate
|
---|
| 66 | * \param y_element element to plot for y coordinate
|
---|
| 67 | * \param color color of the curve
|
---|
| 68 | * \param curve_name name of the curve ofr the legend
|
---|
| 69 | */
|
---|
| 70 | void AddCurve(const core::IODataElement *x_element,
|
---|
| 71 | const core::IODataElement *y_element, Color_t color,
|
---|
| 72 | std::string curve_name = "");
|
---|
[2] | 73 |
|
---|
[13] | 74 | /*!
|
---|
| 75 | * \brief Add a curve from elements to the plot.
|
---|
| 76 | *
|
---|
| 77 | * Curve's color can be selected by its RGB components.
|
---|
| 78 | *
|
---|
| 79 | * \param x_element element to plot for x coordinate
|
---|
| 80 | * \param y_element element to plot for y coordinate
|
---|
| 81 | * \param r red component of the curve
|
---|
| 82 | * \param g green component of the curve
|
---|
| 83 | * \param b blue component of the curve
|
---|
| 84 | * \param curve_name name of the curve ofr the legend
|
---|
| 85 | */
|
---|
| 86 | void AddCurve(const core::IODataElement *x_element,
|
---|
| 87 | const core::IODataElement *y_element, uint8_t r = 255,
|
---|
| 88 | uint8_t g = 0, uint8_t b = 0, std::string curve_name = "");
|
---|
| 89 | };
|
---|
[2] | 90 |
|
---|
| 91 | } // end namespace gui
|
---|
| 92 | } // end namespace flair
|
---|
| 93 |
|
---|
| 94 | #endif // DATAPLOT2D_H
|
---|