Changeset 16 in flair-src for trunk/demos/Sinus/src/Sinus.h


Ignore:
Timestamp:
04/08/16 15:48:40 (7 years ago)
Author:
Bayard Gildas
Message:

Reformatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/Sinus/src/Sinus.h

    r14 r16  
    1515#define SINUS_H
    1616
    17 //necessary includes, as IODevice and Thread are bases of our class
     17// necessary includes, as IODevice and Thread are bases of our class
    1818#include <IODevice.h>
    1919#include <Thread.h>
    2020
    21 //forward declaration for other classes
     21// forward declaration for other classes
    2222namespace flair {
    23     namespace core {
    24         class FrameworkManager;
    25         class cvmatrix;
    26     }
    27     namespace gui {
    28         class Tab;
    29         class TabWidget;
    30         class GridLayout;
    31         class DoubleSpinBox;
    32         class SpinBox;
    33         class DataPlot1D;
    34     }
     23namespace core {
     24class FrameworkManager;
     25class cvmatrix;
     26}
     27namespace gui {
     28class Tab;
     29class TabWidget;
     30class GridLayout;
     31class DoubleSpinBox;
     32class SpinBox;
     33class DataPlot1D;
     34}
    3535}
    3636
    37 //sinus is a class generating a sinus signal
    38 //in this example, it emulates a sensonr, so we extend the namespace sensor
    39 //it derives frome
     37// sinus is a class generating a sinus signal
     38// in this example, it emulates a sensonr, so we extend the namespace sensor
     39// it derives frome
    4040// IODevice: as it has an ouput
    4141// Thread: is it a thread
    42 namespace flair { namespace sensor {
    43     class Sinus : public core::IODevice, public core::Thread {
    44         public:
    45             /*!
    46             * \brief Constructor
    47             *
    48             * Builds a sinus generator
    49             *
    50             * \param parent the FrameworkManager to use
    51             * \param name object name
    52             * \param priority Thread priority, 50 by default (1:mini, 99:maxi)
    53             */
    54             Sinus(const core::FrameworkManager* parent,std::string name,int priority=50);
     42namespace flair {
     43namespace sensor {
     44class Sinus : public core::IODevice, public core::Thread {
     45public:
     46  /*!
     47  * \brief Constructor
     48  *
     49  * Builds a sinus generator
     50  *
     51  * \param parent the FrameworkManager to use
     52  * \param name object name
     53  * \param priority Thread priority, 50 by default (1:mini, 99:maxi)
     54  */
     55  Sinus(const core::FrameworkManager *parent, std::string name,
     56        int priority = 50);
    5557
    56             /*!
    57             * \brief Destructor
    58             */
    59             ~Sinus();
     58  /*!
     59  * \brief Destructor
     60  */
     61  ~Sinus();
    6062
    61             /*!
    62             * \brief Output matrix
    63             *
    64             * allows to access output matrix, to get signal value or to put it in a graph.  \n
    65             *
    66             * \return un pointeur vers la matrice de sortie
    67             */
    68             core::cvmatrix *GetMatrix(void) const;
     63  /*!
     64  * \brief Output matrix
     65  *
     66  * allows to access output matrix, to get signal value or to put it in a graph.
     67  *\n
     68  *
     69  * \return un pointeur vers la matrice de sortie
     70  */
     71  core::cvmatrix *GetMatrix(void) const;
    6972
    70             /*!
    71             * \brief Value
    72             *
    73             * this method is equivalent to GetMatrix()->Value(0,0)
    74             *
    75             * \return actual signal value
    76             */
    77             float GetValue(void) const;
     73  /*!
     74  * \brief Value
     75  *
     76  * this method is equivalent to GetMatrix()->Value(0,0)
     77  *
     78  * \return actual signal value
     79  */
     80  float GetValue(void) const;
    7881
    79             /*!
    80             * \brief Use defautl plot
    81             *
    82             * this method put a graph in a specific tab
    83             *
    84             */
    85             void UseDefaultPlot(void);
     82  /*!
     83  * \brief Use defautl plot
     84  *
     85  * this method put a graph in a specific tab
     86  *
     87  */
     88  void UseDefaultPlot(void);
    8689
    87             /*!
    88             * \brief SetupLayout
    89             *
    90             * this method allows to add other widgets in the sinus tab.
    91             *
    92             * \return the GridLayout
    93             */
    94             gui::GridLayout *GetSetupLayout(void) const;
     90  /*!
     91  * \brief SetupLayout
     92  *
     93  * this method allows to add other widgets in the sinus tab.
     94  *
     95  * \return the GridLayout
     96  */
     97  gui::GridLayout *GetSetupLayout(void) const;
    9598
    96             /*!
    97             * \brief Plot
    98             *
    99             * this method allows to add other curves in the graph
    100             *
    101             * \return the DataPlot1D
    102             */
    103             gui::DataPlot1D *GetPlot(void) const;
     99  /*!
     100  * \brief Plot
     101  *
     102  * this method allows to add other curves in the graph
     103  *
     104  * \return the DataPlot1D
     105  */
     106  gui::DataPlot1D *GetPlot(void) const;
    104107
    105         private:
    106             //UpdateFrom method from base class IODevice
    107             //sinus is like a sensor, so it does not have input; we define an empty method
    108             void UpdateFrom(const core::io_data *data){};
    109             void Run(void);
     108private:
     109  // UpdateFrom method from base class IODevice
     110  // sinus is like a sensor, so it does not have input; we define an empty
     111  // method
     112  void UpdateFrom(const core::io_data *data){};
     113  void Run(void);
    110114
    111             core::cvmatrix *output;
    112             gui::Tab* mainTab;
    113             gui::TabWidget* tabWidget;
    114             gui::DataPlot1D* plot;
    115             gui::DoubleSpinBox *frequency,*amplitude,*offset;
    116             gui::SpinBox *period;
    117             gui::GridLayout* setupLayout;
    118     };
    119 }// end namespace sensor
    120 }// end namespace flair
     115  core::cvmatrix *output;
     116  gui::Tab *mainTab;
     117  gui::TabWidget *tabWidget;
     118  gui::DataPlot1D *plot;
     119  gui::DoubleSpinBox *frequency, *amplitude, *offset;
     120  gui::SpinBox *period;
     121  gui::GridLayout *setupLayout;
     122};
     123} // end namespace sensor
     124} // end namespace flair
    121125#endif // SINUS_H
Note: See TracChangeset for help on using the changeset viewer.