[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 DataPlot.h
|
---|
| 7 | * \brief Abstract class to display plots on ground station
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2013/04/10
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef DATAPLOT_H
|
---|
| 14 | #define DATAPLOT_H
|
---|
| 15 |
|
---|
| 16 | #include <SendData.h>
|
---|
| 17 |
|
---|
| 18 | class DataPlot_impl;
|
---|
| 19 |
|
---|
[13] | 20 | namespace flair {
|
---|
| 21 | namespace core {
|
---|
| 22 | class IODataElement;
|
---|
[2] | 23 | }
|
---|
[13] | 24 | }
|
---|
| 25 | namespace flair {
|
---|
| 26 | namespace gui {
|
---|
| 27 | class LayoutPosition;
|
---|
[2] | 28 |
|
---|
[13] | 29 | /*! \class DataPlot
|
---|
| 30 | *
|
---|
| 31 | * \brief Abstract class to display plots on ground station
|
---|
| 32 | *
|
---|
| 33 | */
|
---|
| 34 | class DataPlot : public SendData {
|
---|
| 35 | public:
|
---|
| 36 | /*!
|
---|
| 37 | \enum Color_t
|
---|
| 38 | \brief Types of colors
|
---|
| 39 | */
|
---|
| 40 | typedef enum {
|
---|
| 41 | Red /*! red */,
|
---|
| 42 | Blue /*! blue */,
|
---|
| 43 | Green /*! green */,
|
---|
| 44 | Yellow /*! yellow */,
|
---|
| 45 | Black /*! black */,
|
---|
| 46 | White /*! white */,
|
---|
| 47 | } Color_t;
|
---|
[2] | 48 |
|
---|
[13] | 49 | /*!
|
---|
| 50 | * \brief Constructor
|
---|
| 51 | *
|
---|
| 52 | * Type must agree with predifined (hard coded) types
|
---|
| 53 | * in ground station code. After calling this constructor,
|
---|
| 54 | * position will be deleted as it is no longer usefull.
|
---|
| 55 | * The DataPlot will automatically be child of position->getLayout() Layout.
|
---|
| 56 | *
|
---|
| 57 | * \param position position
|
---|
| 58 | * \param name nom
|
---|
| 59 | * \param type type
|
---|
| 60 | */
|
---|
| 61 | DataPlot(const LayoutPosition *position, std::string name, std::string type);
|
---|
[2] | 62 |
|
---|
[13] | 63 | /*!
|
---|
| 64 | * \brief Destructor
|
---|
| 65 | *
|
---|
| 66 | */
|
---|
| 67 | ~DataPlot();
|
---|
[2] | 68 |
|
---|
[13] | 69 | protected:
|
---|
| 70 | /*!
|
---|
| 71 | * \brief Add an IODataElement to the plot.
|
---|
| 72 | *
|
---|
| 73 | * This method registers element for sending.
|
---|
| 74 | *
|
---|
| 75 | * \param element element to plot
|
---|
| 76 | */
|
---|
| 77 | void AddDataToSend(const core::IODataElement *element);
|
---|
[2] | 78 |
|
---|
[13] | 79 | private:
|
---|
| 80 | /*!
|
---|
| 81 | * \brief Copy datas to specified buffer
|
---|
| 82 | *
|
---|
| 83 | * Reimplemented from SendData.
|
---|
| 84 | *
|
---|
| 85 | * \param buf output buffer
|
---|
| 86 | */
|
---|
| 87 | void CopyDatas(char *buf) const;
|
---|
[2] | 88 |
|
---|
[13] | 89 | /*!
|
---|
| 90 | * \brief Extra Xml event
|
---|
| 91 | *
|
---|
| 92 | * Reimplemented from SendData.
|
---|
| 93 | */
|
---|
| 94 | void ExtraXmlEvent(void){};
|
---|
[2] | 95 |
|
---|
[13] | 96 | class DataPlot_impl *pimpl_;
|
---|
| 97 | };
|
---|
[2] | 98 |
|
---|
[13] | 99 | /*!
|
---|
| 100 | * \brief Get RGB components from color type
|
---|
| 101 | *
|
---|
| 102 | *
|
---|
| 103 | * \param color input color
|
---|
| 104 | * \param r output component
|
---|
| 105 | * \param g output component
|
---|
| 106 | * \param b output component
|
---|
| 107 | */
|
---|
| 108 | void RGBFromColor(DataPlot::Color_t color, uint8_t &r, uint8_t &g, uint8_t &b);
|
---|
[2] | 109 |
|
---|
| 110 | } // end namespace gui
|
---|
| 111 | } // end namespace flair
|
---|
| 112 |
|
---|
| 113 | #endif // DATAPLOT_H
|
---|