[4] | 1 | // %flair:license{
|
---|
[13] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[4] | 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file SimuGps.h
|
---|
| 7 | * \brief Class for a simulation GPS
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2013/08/23
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef SIMUGPS_H
|
---|
| 14 | #define SIMUGPS_H
|
---|
| 15 |
|
---|
| 16 | #include <Thread.h>
|
---|
[32] | 17 | #include <NmeaGps.h>
|
---|
[4] | 18 |
|
---|
[13] | 19 | namespace flair {
|
---|
[32] | 20 | namespace core {
|
---|
| 21 | class SharedMem;
|
---|
| 22 | }
|
---|
| 23 | namespace gui {
|
---|
| 24 | class SpinBox;
|
---|
| 25 | class DoubleSpinBox;
|
---|
| 26 | }
|
---|
[4] | 27 | }
|
---|
| 28 |
|
---|
[13] | 29 | namespace flair {
|
---|
| 30 | namespace sensor {
|
---|
| 31 | /*! \class SimuGps
|
---|
| 32 | *
|
---|
| 33 | * \brief Class for a simulation GPS
|
---|
| 34 | */
|
---|
[32] | 35 | class SimuGps : public core::Thread, public NmeaGps {
|
---|
[13] | 36 | public:
|
---|
| 37 | /*!
|
---|
| 38 | * \brief Constructor
|
---|
| 39 | *
|
---|
[32] | 40 | * Construct a simulation GPS. Control part.
|
---|
[50] | 41 | * It will be child of the FrameworkManager.
|
---|
| 42 | *
|
---|
[13] | 43 | * \param name name
|
---|
| 44 | * \param NMEAFlags NMEA sentances to enable
|
---|
[50] | 45 | * \param modelId Model id
|
---|
| 46 | * \param deviceId Gps id of the Model
|
---|
[13] | 47 | * \param priority priority of the Thread
|
---|
| 48 | */
|
---|
[50] | 49 | SimuGps(std::string name,
|
---|
| 50 | NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority);
|
---|
[4] | 51 |
|
---|
[13] | 52 | /*!
|
---|
[32] | 53 | * \brief Constructor
|
---|
| 54 | *
|
---|
| 55 | * Construct a simulation GPS. Simulation part.\n
|
---|
| 56 | * The Thread of this class should not be run.
|
---|
| 57 | *
|
---|
| 58 | * \param parent parent
|
---|
| 59 | * \param name name
|
---|
[50] | 60 | * \param modelId Model id
|
---|
| 61 | * \param deviceId Gps id of the Model
|
---|
[32] | 62 | */
|
---|
[50] | 63 | SimuGps(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
|
---|
[32] | 64 |
|
---|
| 65 | /*!
|
---|
[13] | 66 | * \brief Destructor
|
---|
| 67 | *
|
---|
| 68 | */
|
---|
| 69 | ~SimuGps();
|
---|
[4] | 70 |
|
---|
[13] | 71 | private:
|
---|
| 72 | /*!
|
---|
| 73 | * \brief Update using provided datas
|
---|
| 74 | *
|
---|
| 75 | * Reimplemented from IODevice.
|
---|
| 76 | *
|
---|
| 77 | * \param data data from the parent to process
|
---|
| 78 | */
|
---|
[32] | 79 | void UpdateFrom(const core::io_data *data);
|
---|
[4] | 80 |
|
---|
[13] | 81 | /*!
|
---|
| 82 | * \brief Run function
|
---|
| 83 | *
|
---|
| 84 | * Reimplemented from Thread.
|
---|
| 85 | *
|
---|
| 86 | */
|
---|
| 87 | void Run(void);
|
---|
[32] | 88 |
|
---|
| 89 | typedef struct {
|
---|
[34] | 90 | float e;
|
---|
| 91 | float n;
|
---|
| 92 | float u;
|
---|
| 93 | float ve;
|
---|
| 94 | float vn;
|
---|
[32] | 95 | } gps_states_t;
|
---|
[50] | 96 |
|
---|
| 97 | std::string ShMemName(uint32_t modelId,uint32_t deviceId);
|
---|
[32] | 98 |
|
---|
| 99 | core::SharedMem *shmem;
|
---|
| 100 | gui::SpinBox *dataRate,*fixQuality,*numberOfSatellites;
|
---|
| 101 | gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef;
|
---|
[13] | 102 | };
|
---|
[4] | 103 | } // end namespace sensor
|
---|
[50] | 104 | } // end namespace flair
|
---|
[4] | 105 | #endif // SIMUGPS_H
|
---|