// %flair:license{ // This file is part of the Flair framework distributed under the // CECILL-C License, Version 1.0. // %flair:license} // created: 2016/07/01 // filename: GpsData.cpp // // author: Guillaume Sanahuja // Copyright Heudiasyc UMR UTC/CNRS 7253 // // version: $Id: $ // // purpose: class defining gps datas // // /*********************************************************************/ #include "GpsData.h" #include "Euler.h" #include #include #include using std::string; namespace flair { namespace core { /*! \class GpsDataElement */ class GpsDataElement : public IODataElement { public: GpsDataElement(const GpsData *inGpsdata, string name, GpsData::PlotableData_t inPlotableData) : IODataElement(inGpsdata, name) { gpsdata = inGpsdata; plotableData = inPlotableData; size = 0; } ~GpsDataElement() {} void CopyData(char *dst) const { } FloatType const &GetDataType(void) const { return dataType; } private: const GpsData *gpsdata; GpsData::PlotableData_t plotableData; FloatType dataType; }; GpsData::GpsData(const Object *parent, std::string name, int n) : io_data(parent, name, n), dataType(floatType) { if (n > 1) Warn("n>1 not supported\n"); AppendLogDescription("raw_ax", floatType); AppendLogDescription("raw_ay", floatType); AppendLogDescription("raw_az", floatType); AppendLogDescription("raw_gx", floatType); AppendLogDescription("raw_gy", floatType); AppendLogDescription("raw_gz", floatType); AppendLogDescription("raw_mx", floatType); AppendLogDescription("raw_my", floatType); AppendLogDescription("raw_mz", floatType); } GpsData::~GpsData() {} IODataElement *GpsData::Element(PlotableData_t data_type) const { //return new GpsDataElement(this, name, data_type); } void GpsData::CopyDatas(char *dst) const { GetMutex(); //Queue(&dst, &rawAcc.x, sizeof(rawAcc.x)); ReleaseMutex(); } void GpsData::Queue(char **dst, const void *src, size_t size) const { memcpy(*dst, src, size); *dst += size; } } // end namespace core } // end namespace flair