added activity detection

This commit is contained in:
kazu
2016-04-21 08:56:15 +02:00
parent ecd34cf6d3
commit 6f0d56fbef
10 changed files with 210 additions and 18 deletions

View File

@@ -0,0 +1,35 @@
#ifndef SENSORREADERACCEL_H
#define SENSORREADERACCEL_H
#include "../reader/SensorReader.h"
#include <cassert>
class SensorReaderAccel {
public:
/** get wifi observation data from one CSV entry */
static void read(const SensorEntry& se, float dst[3]) {
std::string tmp = se.data;
size_t pos1 = tmp.find(';');
size_t pos2 = tmp.find(';', pos1+1);
size_t pos3 = tmp.find(';', pos2+1);
if (pos1 == std::string::npos) {throw 1;}
if (pos2 == std::string::npos) {throw 1;}
dst[0] = std::stof( tmp.substr(0, pos1) );
dst[1] = std::stof( tmp.substr(pos1+1, pos2-pos1-1) );
dst[2] = std::stof( tmp.substr(pos2+1, pos3-pos2-1) );
int j = 0; (void) j;
}
};
#endif // SENSORREADERACCEL_H