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 RadioReceiver.h
|
---|
7 | * \brief Base class for radio receiver
|
---|
8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
9 | * \date 2014/07/08
|
---|
10 | * \version 4.0
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef RADIORECEIVER_H
|
---|
14 | #define RADIORECEIVER_H
|
---|
15 |
|
---|
16 | #include <IODevice.h>
|
---|
17 | #include <stdint.h>
|
---|
18 |
|
---|
19 | namespace flair {
|
---|
20 | namespace core {
|
---|
21 | class cvmatrix;
|
---|
22 | }
|
---|
23 | namespace gui {
|
---|
24 | class Tab;
|
---|
25 | class TabWidget;
|
---|
26 | class Layout;
|
---|
27 | }
|
---|
28 | }
|
---|
29 |
|
---|
30 | namespace flair {
|
---|
31 | namespace sensor {
|
---|
32 | /*! \class RadioReceiver
|
---|
33 | *
|
---|
34 | * \brief Base class for radio receiver
|
---|
35 | */
|
---|
36 | class RadioReceiver : public core::IODevice {
|
---|
37 | public:
|
---|
38 | /*!
|
---|
39 | * \brief Constructor
|
---|
40 | *
|
---|
41 | * Construct a RadioReceiver.
|
---|
42 | * It will be child of the FrameworkManager.
|
---|
43 | *
|
---|
44 | * \param name name
|
---|
45 | * \param nb_channels number of supported channels
|
---|
46 | */
|
---|
47 | RadioReceiver(std::string name,
|
---|
48 | unsigned int nb_channels);
|
---|
49 |
|
---|
50 | /*!
|
---|
51 | * \brief Destructor
|
---|
52 | *
|
---|
53 | */
|
---|
54 | ~RadioReceiver();
|
---|
55 |
|
---|
56 | /*!
|
---|
57 | * \brief get channel value
|
---|
58 | *
|
---|
59 | * \param id channel id
|
---|
60 | * \return value of the channel, between 0 and 1.
|
---|
61 | * Returns -1 if channel is out of bound
|
---|
62 | */
|
---|
63 | float ChannelValue(unsigned int id) const;
|
---|
64 |
|
---|
65 | /*!
|
---|
66 | * \brief Is transmitter connected?
|
---|
67 | *
|
---|
68 | * \return true if transmitter is connected
|
---|
69 | */
|
---|
70 | bool IsConnected(void) const;
|
---|
71 |
|
---|
72 | /*!
|
---|
73 | * \brief Setup Layout
|
---|
74 | *
|
---|
75 | * \return a Layout available
|
---|
76 | */
|
---|
77 | gui::Layout *GetLayout(void) const;
|
---|
78 |
|
---|
79 | private:
|
---|
80 | /*!
|
---|
81 | * \brief Update using provided datas
|
---|
82 | *
|
---|
83 | * Reimplemented from IODevice.
|
---|
84 | *
|
---|
85 | * \param data data from the parent to process
|
---|
86 | */
|
---|
87 | void UpdateFrom(const core::io_data *data){};
|
---|
88 |
|
---|
89 | core::cvmatrix *output;
|
---|
90 | bool is_connected;
|
---|
91 | unsigned int nb_channels;
|
---|
92 | gui::Tab *main_tab;
|
---|
93 | gui::TabWidget *tab;
|
---|
94 | gui::Tab *setup_tab;
|
---|
95 | };
|
---|
96 | } // end namespace sensor
|
---|
97 | } // end namespace flair
|
---|
98 | #endif // RADIORECEIVER_H
|
---|