[4] | 1 | // %flair:license{
|
---|
[13] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[4] | 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 |
|
---|
[13] | 19 | namespace flair {
|
---|
| 20 | namespace core {
|
---|
| 21 | class FrameworkManager;
|
---|
| 22 | class cvmatrix;
|
---|
[4] | 23 | }
|
---|
[13] | 24 | namespace gui {
|
---|
| 25 | class Tab;
|
---|
| 26 | class TabWidget;
|
---|
| 27 | class Layout;
|
---|
| 28 | }
|
---|
| 29 | }
|
---|
[4] | 30 |
|
---|
[13] | 31 | namespace flair {
|
---|
| 32 | namespace sensor {
|
---|
| 33 | /*! \class RadioReceiver
|
---|
| 34 | *
|
---|
| 35 | * \brief Base class for radio receiver
|
---|
| 36 | */
|
---|
| 37 | class RadioReceiver : public core::IODevice {
|
---|
| 38 | public:
|
---|
| 39 | /*!
|
---|
| 40 | * \brief Constructor
|
---|
| 41 | *
|
---|
| 42 | * Construct a RadioReceiver.
|
---|
| 43 | *
|
---|
| 44 | * \param parent parent
|
---|
| 45 | * \param name name
|
---|
| 46 | * \param nb_channels number of supported channels
|
---|
| 47 | */
|
---|
| 48 | RadioReceiver(const core::FrameworkManager *parent, std::string name,
|
---|
| 49 | unsigned int nb_channels);
|
---|
[4] | 50 |
|
---|
[13] | 51 | /*!
|
---|
| 52 | * \brief Destructor
|
---|
| 53 | *
|
---|
| 54 | */
|
---|
| 55 | ~RadioReceiver();
|
---|
[4] | 56 |
|
---|
[13] | 57 | /*!
|
---|
| 58 | * \brief get channel value
|
---|
| 59 | *
|
---|
| 60 | * \param id channel id
|
---|
| 61 | * \return value of the channel, between 0 and 1.
|
---|
| 62 | * Returns -1 if channel is out of bound
|
---|
| 63 | */
|
---|
| 64 | float ChannelValue(unsigned int id) const;
|
---|
[4] | 65 |
|
---|
[13] | 66 | /*!
|
---|
| 67 | * \brief Is transmitter connected?
|
---|
| 68 | *
|
---|
| 69 | * \return true if transmitter is connected
|
---|
| 70 | */
|
---|
| 71 | bool IsConnected(void) const;
|
---|
[4] | 72 |
|
---|
[13] | 73 | /*!
|
---|
| 74 | * \brief Setup Layout
|
---|
| 75 | *
|
---|
| 76 | * \return a Layout available
|
---|
| 77 | */
|
---|
| 78 | gui::Layout *GetLayout(void) const;
|
---|
[4] | 79 |
|
---|
[13] | 80 | private:
|
---|
| 81 | /*!
|
---|
| 82 | * \brief Update using provided datas
|
---|
| 83 | *
|
---|
| 84 | * Reimplemented from IODevice.
|
---|
| 85 | *
|
---|
| 86 | * \param data data from the parent to process
|
---|
| 87 | */
|
---|
| 88 | void UpdateFrom(const core::io_data *data){};
|
---|
[4] | 89 |
|
---|
[13] | 90 | core::cvmatrix *output;
|
---|
| 91 | bool is_connected;
|
---|
| 92 | unsigned int nb_channels;
|
---|
| 93 | gui::Tab *main_tab;
|
---|
| 94 | gui::TabWidget *tab;
|
---|
| 95 | gui::Tab *setup_tab;
|
---|
| 96 | };
|
---|
[4] | 97 | } // end namespace sensor
|
---|
| 98 | } // end namespace flair
|
---|
| 99 | #endif // RADIORECEIVER_H
|
---|