source: flair-dev/trunk/include/FlairCore/DataPlot.h@ 9

Last change on this file since 9 was 2, checked in by Sanahuja Guillaume, 9 years ago

initial commit flaircore

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