source: flair-src/trunk/lib/FlairCore/src/DataPlot.h@ 397

Last change on this file since 397 was 15, checked in by Bayard Gildas, 9 years ago

sources reformatted with flair-format-dir script

File size: 2.2 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
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
18class DataPlot_impl;
19
20namespace flair {
21namespace core {
22class IODataElement;
23}
24}
25namespace flair {
26namespace gui {
27class LayoutPosition;
28
29/*! \class DataPlot
30*
31* \brief Abstract class to display plots on ground station
32*
33*/
34class DataPlot : public SendData {
35public:
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;
48
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);
62
63 /*!
64 * \brief Destructor
65 *
66 */
67 ~DataPlot();
68
69protected:
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);
78
79private:
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;
88
89 /*!
90 * \brief Extra Xml event
91 *
92 * Reimplemented from SendData.
93 */
94 void ExtraXmlEvent(void){};
95
96 class DataPlot_impl *pimpl_;
97};
98
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*/
108void RGBFromColor(DataPlot::Color_t color, uint8_t &r, uint8_t &g, uint8_t &b);
109
110} // end namespace gui
111} // end namespace flair
112
113#endif // DATAPLOT_H
Note: See TracBrowser for help on using the repository browser.