Changeset 51 in flair-src for trunk/lib/FlairCore/src/GpsData.h


Ignore:
Timestamp:
07/26/16 17:32:57 (8 years ago)
Author:
Sanahuja Guillaume
Message:

gps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/GpsData.h

    r45 r51  
    1414
    1515#include <io_data.h>
    16 #include <IODataElement.h>
    17 #include <Vector3D.h>
    1816
    1917namespace flair {
    2018namespace core {
     19
     20  class IODataElement;
     21  class Vector3D;
    2122
    2223/*! \class GpsData
     
    3536    std::string GetDescription() const { return "gps data"; }
    3637    size_t GetSize() const {
    37       return 0;
     38      size_t size = 0;
     39      size += 2*doubleType.GetSize(); // Latitude, Longitude
     40      size += floatType.GetSize(); // Altitude
     41      size += UInt8Type.GetSize(); // NumberOfSatellites
     42      size += UInt8Type.GetSize(); // FixQuality_t
     43      size += 5*floatType.GetSize();//e,n,u,ve,vn
     44      return size;
    3845    }
    3946
     
    4653  */
    4754  typedef enum {
    48 
     55    Latitude /*! latitude in degrees */,
     56    Longitude /*! longitude in degrees */,
     57    Altitude /*! altitude */,
     58    NumberOfSatellites /*! number of satellites */,
     59    FixQuality /*! fix quality */,
     60    East /*! east */,
     61    North /*! north */,
     62    Up /*! up */,
     63    EastVelocity /*! east velocity*/,
     64    NorthVelocity /*! north velocity*/,
    4965  } PlotableData_t;
     66
     67  /*!
     68  \enum FixQuality_t
     69  \brief Fix qualty indicators
     70  */
     71  enum class FixQuality_t : uint8_t {
     72    Invalid = 0,    /*!< invalid */
     73    Gps = 1,        /*!< Gps */
     74    DGps = 2,       /*!< Differential Gps */
     75    Pps = 3,        /*!< Pps */
     76    Rtk = 4,        /*!< RTK */
     77    RtkFloat = 5,   /*!< RTK float */
     78    Estimated = 6,  /*!< Estimated */
     79    Manual = 7,     /*!< Manual */
     80    Simulation = 8, /*!< Simulation */
     81  };
    5082
    5183  /*!
     
    77109  IODataElement *Element(PlotableData_t data_type) const;
    78110
     111  /*!
     112  * \brief Get latitude, longitude and altitude
     113  *
     114  * This method is mutex protected.
     115  *
     116  * \param latitude latitude
     117  * \param longitude longitude
     118  * \param altitude altitude
     119  *
     120  */
     121  void GetLla(double &latitude, double &longitude,
     122                          float &altitude) const;
     123
     124  /*!
     125  * \brief Set latitude, longitude and altitude
     126  *
     127  * This method is mutex protected.
     128  *
     129  * \param latitude latitude
     130  * \param longitude longitude
     131  * \param altitude altitude
     132  *
     133  */
     134  void SetLla(double latitude,double longitude,
     135                          float altitude);
     136
     137
     138  /*!
     139  * \brief Get east, north and up
     140  *
     141  * This method is mutex protected.
     142  *
     143  * \param east east
     144  * \param north north
     145  * \param up up
     146  *
     147  */
     148  void GetEnu(float &east, float &north,
     149                          float &up) const;
     150
     151  /*!
     152  * \brief Set east, north and up
     153  *
     154  * This method is mutex protected.
     155  *
     156  * \param east east
     157  * \param north north
     158  * \param up up
     159  *
     160  */
     161  void SetEnu(float east, float north,
     162                          float up);
     163
     164  /*!
     165  * \brief Get east and north velocities
     166  *
     167  * This method is mutex protected.
     168  *
     169  * \param eastVelocity east velocity
     170  * \param northVelocity north velocity
     171  *
     172  */
     173  void GetVelocity(float &eastVelocity, float &northVelocity) const;
     174
     175  /*!
     176  * \brief Set east and north velocities
     177  *
     178  * This method is mutex protected.
     179  *
     180  * \param eastVelocity east velocity
     181  * \param northVelocity north velocity
     182  *
     183  */
     184  void SetVelocity(float eastVelocity, float northVelocity);
     185
     186  /*!
     187  * \brief Get number of satellites
     188  *
     189  * \return number of satellites
     190  *
     191  */
     192  uint8_t GetNumberOfSatellites(void) const;
     193
     194  /*!
     195  * \brief Set number of satellites
     196  *
     197  * \param numberOfSatellites number of satellites
     198  *
     199  */
     200  void SetNumberOfSatellites(uint8_t numberOfSatellites);
     201
     202  /*!
     203  * \brief Get fix quality
     204  *
     205  * \return fix quality
     206  *
     207  */
     208  FixQuality_t GetFixQuality(void) const;
     209
     210  /*!
     211  * \brief Set fix quality
     212  *
     213  * \param fixQuality fix quality
     214  *
     215  */
     216  void SetFixQuality(FixQuality_t fixQuality);
    79217
    80218  Type const &GetDataType() const { return dataType; }
     
    91229  void CopyDatas(char *dst) const;
    92230
    93 
    94 
    95231  void Queue(char **dst, const void *src, size_t size) const;
    96232  Type dataType;
     233  double latitude,longitude;
     234  float altitude;
     235  uint8_t numberOfSatellites;
     236  FixQuality_t fixQuality;
     237  float east,north,up,eastVelocity,northVelocity;
    97238};
    98239
Note: See TracChangeset for help on using the changeset viewer.