[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[7] | 5 | /*!
|
---|
| 6 | * \file Pid.h
|
---|
| 7 | * \brief Class defining a PID
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2011/05/01
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef PID_H
|
---|
| 14 | #define PID_H
|
---|
| 15 |
|
---|
| 16 | #include <ControlLaw.h>
|
---|
| 17 |
|
---|
[15] | 18 | namespace flair {
|
---|
| 19 | namespace gui {
|
---|
| 20 | class LayoutPosition;
|
---|
[7] | 21 | }
|
---|
[15] | 22 | }
|
---|
[7] | 23 |
|
---|
| 24 | class Pid_impl;
|
---|
| 25 |
|
---|
[15] | 26 | namespace flair {
|
---|
| 27 | namespace filter {
|
---|
| 28 | /*! \class Pid
|
---|
| 29 | *
|
---|
| 30 | * \brief Class defining a PID
|
---|
| 31 | */
|
---|
| 32 | class Pid : public ControlLaw {
|
---|
| 33 | friend class ::Pid_impl;
|
---|
[7] | 34 |
|
---|
[15] | 35 | public:
|
---|
| 36 | /*!
|
---|
| 37 | * \brief Constructor
|
---|
| 38 | *
|
---|
| 39 | * Construct a PID at given position. \n
|
---|
| 40 | * The PID will automatically be child of position->getLayout() Layout. After
|
---|
| 41 | *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);
|
---|
[7] | 48 |
|
---|
[15] | 49 | /*!
|
---|
| 50 | * \brief Destructor
|
---|
| 51 | *
|
---|
| 52 | */
|
---|
| 53 | ~Pid();
|
---|
[7] | 54 |
|
---|
[15] | 55 | /*!
|
---|
| 56 | * \brief Reset integral
|
---|
| 57 | *
|
---|
| 58 | */
|
---|
| 59 | void Reset(void);
|
---|
[7] | 60 |
|
---|
[15] | 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);
|
---|
[7] | 68 |
|
---|
[15] | 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
|
---|
| 77 | *usefull. \n
|
---|
| 78 | *
|
---|
| 79 | * \param position position to display plot
|
---|
| 80 | */
|
---|
| 81 | void UseDefaultPlot(const gui::LayoutPosition *position);
|
---|
[7] | 82 |
|
---|
[15] | 83 | private:
|
---|
| 84 | /*!
|
---|
| 85 | * \brief Update using provided datas
|
---|
| 86 | *
|
---|
| 87 | * Reimplemented from IODevice.
|
---|
| 88 | *
|
---|
| 89 | * \param data data from the parent to process
|
---|
| 90 | */
|
---|
| 91 | void UpdateFrom(const core::io_data *data);
|
---|
[7] | 92 |
|
---|
[15] | 93 | Pid_impl *pimpl_;
|
---|
| 94 | };
|
---|
[7] | 95 | } // end namespace filter
|
---|
| 96 | } // end namespace flair
|
---|
| 97 | #endif // PID_H
|
---|