dataDumper.h
Go to the documentation of this file.
1 #ifndef DATA_DUMPER_H
2 #define DATA_DUMPER_H
3 
4 #include <string>
5 #include <vector>
6 
7 #define DEBUG_DUMP_ENABLED 0
8 //#define DEBUG_DUMP_TO_CONSOLE_ENABLED
9 
11 {
12 public:
13  static DataDumper &instance()
14  {
15  static DataDumper _instance;
16  return _instance;
17  }
18 
20  {}
21 
22  int pushData(double timeStamp, std::string info, double val);
23 
24  int writeDataToCsv(std::string fileName);
25 
27 
28  int dumpUcharBufferToConsole(unsigned char *buffer, int bufLen);
29 
35  static std::string binDataToAsciiString(const uint8_t* binary_data, int length);
36 
37  int testbed();
38 
39 private:
40  const int maxFifoSize = 10000;
41  std::vector<double> timeStampVec;
42  std::vector<std::string> infoVec;
43  std::vector<double> dataVec;
45 
47  {
48  timeStampVec.resize(maxFifoSize);
49  infoVec.resize(maxFifoSize);
50  dataVec.resize(maxFifoSize);
51  pushCounter = 0;
52  } // verhindert, dass ein Objekt von au�erhalb von N erzeugt wird.
53  // protected, wenn man von der Klasse noch erben m�chte
54  DataDumper(const DataDumper &); /* verhindert, dass eine weitere Instanz via
55  Kopier-Konstruktor erstellt werden kann */
56  DataDumper &operator=(const DataDumper &); //Verhindert weitere Instanz durch Kopie
57  std::string dumpFileName;
58 };
59 
60 /* Verwendung:
61 DataDumper& s = DataDumper::instance();
62 s.xyz();
63 //oder
64 DataDumper::instance().xyz(); */
65 #endif
DataDumper::pushCounter
int pushCounter
Definition: dataDumper.h:44
DataDumper::operator=
DataDumper & operator=(const DataDumper &)
DataDumper::dumpUcharBufferToConsole
int dumpUcharBufferToConsole(unsigned char *buffer, int bufLen)
Definition: dataDumper.cpp:67
DataDumper::maxFifoSize
const int maxFifoSize
Definition: dataDumper.h:40
DataDumper::instance
static DataDumper & instance()
Definition: dataDumper.h:13
DataDumper::writeToFileNameWhenBufferIsFull
int writeToFileNameWhenBufferIsFull(std::string filename)
Definition: dataDumper.cpp:61
DataDumper::binDataToAsciiString
static std::string binDataToAsciiString(const uint8_t *binary_data, int length)
Definition: dataDumper.cpp:108
DataDumper::dataVec
std::vector< double > dataVec
Definition: dataDumper.h:43
imu_timestamp_test.filename
string filename
Definition: imu_timestamp_test.py:69
DataDumper::timeStampVec
std::vector< double > timeStampVec
Definition: dataDumper.h:41
DataDumper::infoVec
std::vector< std::string > infoVec
Definition: dataDumper.h:42
DataDumper::DataDumper
DataDumper()
Definition: dataDumper.h:46
DataDumper::~DataDumper
~DataDumper()
Definition: dataDumper.h:19
DataDumper
Definition: dataDumper.h:10
DataDumper::testbed
int testbed()
Definition: dataDumper.cpp:127
DataDumper::writeDataToCsv
int writeDataToCsv(std::string fileName)
Definition: dataDumper.cpp:39
DataDumper::pushData
int pushData(double timeStamp, std::string info, double val)
Definition: dataDumper.cpp:13
DataDumper::dumpFileName
std::string dumpFileName
Definition: dataDumper.h:57


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Thu Sep 8 2022 02:30:19