source: flair-src/trunk/lib/FlairCore/src/GpsData.cpp @ 42

Last change on this file since 42 was 42, checked in by Sanahuja Guillaume, 5 years ago

m

File size: 2.1 KB
RevLine 
[42]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//  created:    2016/07/01
6//  filename:   GpsData.cpp
7//
8//  author:     Guillaume Sanahuja
9//              Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11//  version:    $Id: $
12//
13//  purpose:    class defining gps datas
14//
15//
16/*********************************************************************/
17
18#include "GpsData.h"
19#include "Euler.h"
20#include <math.h>
21#include <string.h>
22#include <stdlib.h>
23
24using std::string;
25
26namespace flair {
27namespace core {
28
29/*! \class GpsDataElement
30    */
31class GpsDataElement : public IODataElement {
32public:
33  GpsDataElement(const GpsData *inGpsdata, string name,
34                 GpsData::PlotableData_t inPlotableData)
35      : IODataElement(inGpsdata, name) {
36    gpsdata = inGpsdata;
37    plotableData = inPlotableData;
38
39    size = 0;
40  }
41
42  ~GpsDataElement() {}
43
44  void CopyData(char *dst) const {
45
46
47  }
48
49  FloatType const &GetDataType(void) const { return dataType; }
50
51private:
52  const GpsData *gpsdata;
53  GpsData::PlotableData_t plotableData;
54  FloatType dataType;
55};
56
57GpsData::GpsData(const Object *parent, std::string name, int n)
58    : io_data(parent, name, n), dataType(floatType) {
59  if (n > 1)
60    Warn("n>1 not supported\n");
61
62  AppendLogDescription("raw_ax", floatType);
63  AppendLogDescription("raw_ay", floatType);
64  AppendLogDescription("raw_az", floatType);
65
66  AppendLogDescription("raw_gx", floatType);
67  AppendLogDescription("raw_gy", floatType);
68  AppendLogDescription("raw_gz", floatType);
69
70  AppendLogDescription("raw_mx", floatType);
71  AppendLogDescription("raw_my", floatType);
72  AppendLogDescription("raw_mz", floatType);
73}
74
75GpsData::~GpsData() {}
76
77
78IODataElement *GpsData::Element(PlotableData_t data_type) const {
79
80  //return new GpsDataElement(this, name, data_type);
81}
82
83void GpsData::CopyDatas(char *dst) const {
84  GetMutex();
85
86  //Queue(&dst, &rawAcc.x, sizeof(rawAcc.x));
87
88  ReleaseMutex();
89}
90
91void GpsData::Queue(char **dst, const void *src, size_t size) const {
92  memcpy(*dst, src, size);
93  *dst += size;
94}
95
96} // end namespace core
97} // end namespace flair
Note: See TracBrowser for help on using the repository browser.