[397] | 1 | // %flair:license{
|
---|
| 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
| 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file IpcPressureSensor.h
|
---|
| 7 | * \brief Class for an ipc PressureSensor
|
---|
| 8 | * \author Sébastien Ambroziak, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2021/03/03
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef IPCPRESSURESENSOR_H
|
---|
| 14 | #define IPCPRESSURESENSOR_H
|
---|
| 15 |
|
---|
| 16 | #include <PressureSensor.h>
|
---|
| 17 | #include <Thread.h>
|
---|
| 18 |
|
---|
| 19 | namespace flair {
|
---|
| 20 | namespace core {
|
---|
| 21 | class SharedMem;
|
---|
| 22 | }
|
---|
| 23 | namespace gui {
|
---|
| 24 | class SpinBox;
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | template <typename T>
|
---|
| 29 | class ShmReceiver;
|
---|
| 30 |
|
---|
| 31 | namespace flair {
|
---|
| 32 | namespace sensor {
|
---|
| 33 | /*! \class IpcPressureSensor
|
---|
| 34 | *
|
---|
| 35 | * \brief Class for an ipc PressureSensor
|
---|
| 36 | */
|
---|
| 37 | class IpcPressureSensor : public core::Thread, public PressureSensor {
|
---|
| 38 | public:
|
---|
| 39 | /*!
|
---|
| 40 | * \brief Constructor
|
---|
| 41 | *
|
---|
| 42 | * Construct an IpcPressureSensor.
|
---|
| 43 | * It will be child of the FrameworkManager.
|
---|
| 44 | *
|
---|
| 45 | * \param name name
|
---|
| 46 | * \param priority priority of the Thread
|
---|
| 47 | * \param ipc_name name of the ipc
|
---|
| 48 | * \param ipc_channel ipc channel number
|
---|
| 49 | */
|
---|
| 50 | IpcPressureSensor(std::string name,
|
---|
| 51 | uint8_t priority, const char* ipc_name, int ipc_channel);
|
---|
| 52 |
|
---|
| 53 | /*!
|
---|
| 54 | * \brief Destructor
|
---|
| 55 | *
|
---|
| 56 | */
|
---|
| 57 | ~IpcPressureSensor();
|
---|
| 58 |
|
---|
| 59 | protected:
|
---|
| 60 | /*!
|
---|
| 61 | * \brief SharedMem to access datas
|
---|
| 62 | *
|
---|
| 63 | */
|
---|
| 64 |
|
---|
| 65 | private:
|
---|
| 66 | /*!
|
---|
| 67 | * \brief Update using provided datas
|
---|
| 68 | *
|
---|
| 69 | * Reimplemented from IODevice.
|
---|
| 70 | *
|
---|
| 71 | * \param data data from the parent to process
|
---|
| 72 | */
|
---|
| 73 | void UpdateFrom(const core::io_data *data){};
|
---|
| 74 |
|
---|
| 75 | /*!
|
---|
| 76 | * \brief Run function
|
---|
| 77 | *
|
---|
| 78 | * Reimplemented from Thread.
|
---|
| 79 | *
|
---|
| 80 | */
|
---|
| 81 | void Run(void);
|
---|
| 82 |
|
---|
| 83 | gui::SpinBox *data_rate;
|
---|
| 84 | ShmReceiver<float>* receiver;
|
---|
| 85 | };
|
---|
| 86 | } // end namespace sensor
|
---|
| 87 | } // end namespace flair
|
---|
| 88 | #endif // IPCPRESSURESENSOR_H
|
---|