source: flair-src/trunk/lib/FlairCore/src/SendData.h @ 437

Last change on this file since 437 was 437, checked in by Sanahuja Guillaume, 3 months ago

prepare for graphs buffering

File size: 2.3 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 SendData.h
7 * \brief Abstract class for sending datas to ground station
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2012/03/07
10 * \version 4.0
11 */
12
13#ifndef SENDDATA_H
14#define SENDDATA_H
15
16#include <Widget.h>
17
18class SendData_impl;
19
20namespace flair {
21namespace gui {
22class LayoutPosition;
23
24/*! \class SendData
25*
26* \brief Abstract class for sending datas to ground station
27*
28*/
29class SendData : public Widget {
30public:
31  /*!
32  * \brief Constructor
33  *
34  */
35  SendData(const LayoutPosition *position, std::string name, std::string type,
36           uint16_t default_periodms = 100, bool default_enabled = false, uint16_t default_nb_buffering=1);
37
38  /*!
39  * \brief Destructor
40  *
41  */
42  virtual ~SendData();
43
44  /*!
45  * \brief Copy datas to specified buffer
46  *
47  * This method must be reimplemented, in order to send datas to ground station.
48  *
49  * \param buf output buffer
50  */
51  virtual void CopyDatas(char *buf) const = 0;
52
53  size_t SendSize(void) const;
54  uint16_t SendPeriod(void) const; // in ms
55  bool IsEnabled(void) const;
56  uint16_t NbBuffering(void) const;
57
58protected:
59  /*!
60  * \brief Notify that SenData's datas have changed
61  *
62  * This method must be called when the datas have changed. \n
63  * Normally, it occurs when a curve is added to a plot for example. \n
64  * This method automatically blocks and unblocks the communication.
65  *
66  */
67  void SetSendSize(size_t value);
68
69  /*!
70  * \brief Extra Xml event
71  *
72  * This method must be reimplemented to handle extra xml event. \n
73  * It is automatically called when something changed from
74  * ground station, through XmlEvent method. \n
75  */
76  virtual void ExtraXmlEvent(void) = 0;
77
78private:
79  /*!
80  * \brief XmlEvent from ground station
81  *
82  * Reimplemented from Widget. \n
83  * This method handles period and enabled properties of the SendData. \n
84  * Then it calls ExtraXmlEvent to handle specific xml events of reimplemented
85  *class.
86  *
87  */
88  void XmlEvent(void);
89
90  void SetSendPeriod(uint16_t value);
91  void SetNbBuffering(uint16_t value);
92  void SetEnabled(bool value);
93
94  class SendData_impl *pimpl_;
95};
96
97} // end namespace core
98} // end namespace flair
99
100#endif // SENDDATA_H
Note: See TracBrowser for help on using the repository browser.