SLProject  4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SENSOrientationRecorderDataHandler Class Reference

#include <SENSRecorderDataHandler.h>

Inheritance diagram for SENSOrientationRecorderDataHandler:
[legend]

Public Member Functions

 SENSOrientationRecorderDataHandler ()
 
void writeLineToFile (ofstream &file, const OrientationInfo &data) override
 called in thread store routine for every new line More...
 
- Public Member Functions inherited from SENSRecorderDataHandler< OrientationInfo >
 SENSRecorderDataHandler (const std::string &name)
 
virtual ~SENSRecorderDataHandler ()
 
void start (const std::string &outputDir)
 start the store thread More...
 
void stop ()
 stop the store thread and clear values in queue More...
 
void add (OrientationInfo &&item)
 add new value to store queue More...
 
bool getErrorMsg (std::string &msg)
 get error msg (valid if function returns true) More...
 

Additional Inherited Members

- Protected Member Functions inherited from SENSRecorderDataHandler< OrientationInfo >
virtual void writeOnThreadStart ()
 called in thread store routine when thread starts More...
 
virtual void writeHeaderToFile (ofstream &file)
 called in thread store routine when file could be opened More...
 
virtual void writeOnThreadFinish ()
 called in thread store routine when thread finished More...
 
- Protected Attributes inherited from SENSRecorderDataHandler< OrientationInfo >
std::string _outputDir
 output directory More...
 

Detailed Description

Constructor & Destructor Documentation

◆ SENSOrientationRecorderDataHandler()

SENSOrientationRecorderDataHandler::SENSOrientationRecorderDataHandler ( )

Definition at line 143 of file SENSRecorderDataHandler.cpp.

144  : SENSRecorderDataHandler("orientation")
145 {
146 }

Member Function Documentation

◆ writeLineToFile()

void SENSOrientationRecorderDataHandler::writeLineToFile ( ofstream &  file,
const OrientationInfo data 
)
overridevirtual

called in thread store routine for every new line

Implements SENSRecorderDataHandler< OrientationInfo >.

Definition at line 148 of file SENSRecorderDataHandler.cpp.

149 {
150  //reading (https://stackoverflow.com/questions/31255486/c-how-do-i-convert-a-stdchronotime-point-to-long-and-back)
151  //long readTimePt;
152  //microseconds readTimePtUs(readTimePt);
153  //time_point<high_resolution_clock> dt(readTimePt);
154 
155  file << std::chrono::time_point_cast<SENSMicroseconds>(data.second).time_since_epoch().count() << " "
156  << data.first.quatX << " "
157  << data.first.quatY << " "
158  << data.first.quatZ << " "
159  << data.first.quatW << "\n";
160 }

The documentation for this class was generated from the following files: