1 | /*!
|
---|
2 | * \file Pid.h
|
---|
3 | * \brief Class defining a PID
|
---|
4 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
5 | * \date 2011/05/01
|
---|
6 | * \version 4.0
|
---|
7 | */
|
---|
8 |
|
---|
9 | #ifndef PID_H
|
---|
10 | #define PID_H
|
---|
11 |
|
---|
12 | #include <ControlLaw.h>
|
---|
13 |
|
---|
14 | namespace flair
|
---|
15 | {
|
---|
16 | namespace gui
|
---|
17 | {
|
---|
18 | class LayoutPosition;
|
---|
19 | }
|
---|
20 | }
|
---|
21 |
|
---|
22 | class Pid_impl;
|
---|
23 |
|
---|
24 | namespace flair
|
---|
25 | {
|
---|
26 | namespace filter
|
---|
27 | {
|
---|
28 | /*! \class Pid
|
---|
29 | *
|
---|
30 | * \brief Class defining a PID
|
---|
31 | */
|
---|
32 | class Pid : public ControlLaw
|
---|
33 | {
|
---|
34 | friend class ::Pid_impl;
|
---|
35 |
|
---|
36 | public:
|
---|
37 | /*!
|
---|
38 | * \brief Constructor
|
---|
39 | *
|
---|
40 | * Construct a PID at given position. \n
|
---|
41 | * The PID will automatically be child of position->getLayout() Layout. After calling this function,
|
---|
42 | * position will be deleted as it is no longer usefull. \n
|
---|
43 | *
|
---|
44 | * \param position position to display settings
|
---|
45 | * \param name name
|
---|
46 | */
|
---|
47 | Pid(const gui::LayoutPosition* position,std::string name);
|
---|
48 |
|
---|
49 | /*!
|
---|
50 | * \brief Destructor
|
---|
51 | *
|
---|
52 | */
|
---|
53 | ~Pid();
|
---|
54 |
|
---|
55 | /*!
|
---|
56 | * \brief Reset integral
|
---|
57 | *
|
---|
58 | */
|
---|
59 | void Reset(void);
|
---|
60 |
|
---|
61 | /*!
|
---|
62 | * \brief Set input values
|
---|
63 | *
|
---|
64 | * \param p proportional value
|
---|
65 | * \param d derivative value
|
---|
66 | */
|
---|
67 | void SetValues(float p,float d);
|
---|
68 |
|
---|
69 | /*!
|
---|
70 | * \brief Use default plot
|
---|
71 | *
|
---|
72 | * Plot the output values at position. \n
|
---|
73 | * Plot consists of 4 curves: proportional part,
|
---|
74 | * derivative part, integral part and
|
---|
75 | * the sum of the three. \n
|
---|
76 | * After calling this function, position will be deleted as it is no longer usefull. \n
|
---|
77 | *
|
---|
78 | * \param position position to display plot
|
---|
79 | */
|
---|
80 | void UseDefaultPlot(const gui::LayoutPosition* position);
|
---|
81 |
|
---|
82 | private:
|
---|
83 | /*!
|
---|
84 | * \brief Update using provided datas
|
---|
85 | *
|
---|
86 | * Reimplemented from IODevice.
|
---|
87 | *
|
---|
88 | * \param data data from the parent to process
|
---|
89 | */
|
---|
90 | void UpdateFrom(const core::io_data *data);
|
---|
91 |
|
---|
92 | Pid_impl* pimpl_;
|
---|
93 | };
|
---|
94 | } // end namespace filter
|
---|
95 | } // end namespace flair
|
---|
96 | #endif // PID_H
|
---|