source: flair-dev/trunk/include/FlairFilter/UavMultiplex.h @ 82

Last change on this file since 82 was 50, checked in by Sanahuja Guillaume, 4 years ago

doc

File size: 4.1 KB
RevLine 
[9]1// %flair:license{
[13]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[9]4// %flair:license}
[6]5/*!
6 * \file UavMultiplex.h
7 * \brief Class defining uav multiplexing
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2014/04/11
10 * \version 4.0
11 */
12
13#ifndef UAVMULTIPLEX_H
14#define UAVMULTIPLEX_H
15
16#include <IODevice.h>
17#include <stdint.h>
18
[13]19namespace flair {
20namespace core {
21class io_data;
[6]22}
[13]23namespace gui {
24class TabWidget;
25class Layout;
26}
27}
[6]28
29class UavMultiplex_impl;
30
[13]31namespace flair {
32namespace filter {
33/*! \class UavMultiplex
34*
35* \brief Class defining uav multiplexing
36*/
37class UavMultiplex : public core::IODevice {
38public:
39  /*!
40  * \brief Constructor
41  *
[50]42  * Construct a uav multiplexing. It will be child of the FrameworkManager.
[13]43  *
44  * \param name name
45  */
[50]46  UavMultiplex(std::string name);
[6]47
[13]48  /*!
49  * \brief Destructor
50  *
51  */
52  ~UavMultiplex();
[6]53
[13]54  /*!
55  * \brief Set roll torque
56  *
57  * roll torque is placed in input(0,0)
58  *
59  * \param value value between -1 and 1
60  */
61  void SetRoll(float value);
[6]62
[13]63  /*!
64  * \brief Set pitch torque
65  *
66  * pitch torque is placed in input(1,0)
67  *
68  * \param value value between -1 and 1
69  */
70  void SetPitch(float value);
[6]71
[13]72  /*!
73  * \brief Set yaw torque
74  *
75  * yaw torque is placed in input(2,0)
76  *
77  * \param value value between -1 and 1
78  */
79  void SetYaw(float value);
[6]80
[13]81  /*!
82  * \brief Set thrust
83  *
84  * thrust is placed in input(3,0)
85  *
86  * \param value value between 0 and 1
87  */
88  void SetThrust(float value);
[6]89
[13]90  /*!
91  * \brief Set roll trim
92  *
93  * trim is placed in input(4,0)
94  *
95  * \param value value
96  */
97  void SetRollTrim(float value);
[6]98
[13]99  /*!
100  * \brief Set pitch trim
101  *
102  * trim is placed in input(5,0)
103  *
104  * \param value value
105  */
106  void SetPitchTrim(float value);
[6]107
[13]108  /*!
109  * \brief Set yaw trim
110  *
111  * trim is placed in input(6,0)
112  *
113  * \param value value
114  */
115  void SetYawTrim(float value);
[6]116
[13]117  /*!
118  * \brief Update using provided datas
119  *
120  * Uses values specified by Set*().
121  *
122  * \param time time of the update
123  */
124  void Update(core::Time time);
[6]125
[13]126  /*!
127  * \brief Lock user interface
128  *
129  * User interface will be grayed out.\n
130  * Use it do disallow changes when flying.
131  *
132  */
133  void LockUserInterface(void) const;
[6]134
[13]135  /*!
136  * \brief Unlock user interface
137  *
138  * User interface will be enabled.\n
139  *
140  */
141  void UnlockUserInterface(void) const;
[6]142
[13]143  /*!
144  * \brief Layout
145  *
146  * Layout to place custom widgets.\n
147  *
148  * \return the layout
149  */
150  gui::Layout *GetLayout(void) const;
[6]151
[13]152  /*!
153  * \brief Use default plot
154  *
155  * Derived class can implement this function do draw default plot.
156  *
157  */
158  virtual void UseDefaultPlot(void){};
[6]159
[13]160  /*!
161  * \brief Motors count
162  *
163  * This function must be reimplemented, in order to get the number of motors.
164  *
165  * \return motors count
166  */
167  virtual uint8_t MotorsCount(void) const = 0;
[6]168
[13]169  /*!
170  * \brief Multiplex value
171  *
172  * Get the mutliplexed value of a motor, if SetMultiplexComboBox() was used.\n
173  *
174  * \param index index of the motor, from 0 to MotorsCount()
175  * \return multiplexed index of the motor
176  */
177  int MultiplexValue(int index) const;
[6]178
[13]179  /*!
180  * \brief Get TabWidget
181  *
182  * Usefull to add tabs.\n
183  *
184  * \return the TabWidget
185  */
186  gui::TabWidget *GetTabWidget(void) const;
[6]187
[13]188protected:
189  /*!
190  * \brief Set multiplex ComboBox
191  *
192  * Draws a ComboBox to define motor multiplexing. \n
193  * This is used to change the order of the output motors.
194  *
195  * \param name description of the motor (ex front left)
196  * \param index index of the motor, from 0 to MotorsCount()
197  */
198  void SetMultiplexComboBox(std::string name, int index);
[6]199
[13]200private:
201  /*!
202  * \brief Update using provided datas
203  *
204  * This function is automatically called by ProcessUpdate()
205  * of the Object::Parent's if its Object::ObjectType is "IODevice". \n
206  * This function must be reimplemented, in order to process the data from the
207  *parent.
208  *
209  * \param data data from the parent to process
210  */
211  virtual void UpdateFrom(const core::io_data *data) = 0;
[6]212
[13]213  UavMultiplex_impl *pimpl_;
214};
[6]215} // end namespace filter
216} // end namespace flair
217#endif // UAVMULTIPLEX_H
Note: See TracBrowser for help on using the repository browser.