added support for pillars

some new helper methods/classes
This commit is contained in:
2018-05-22 11:45:35 +02:00
parent a22290415e
commit 9e6d9f4ce7
13 changed files with 185 additions and 9 deletions

View File

@@ -2,6 +2,7 @@
#define WIFIMEASUREMENTS_H
#include <vector>
#include <algorithm>
#include "WiFiMeasurement.h"
@@ -42,6 +43,14 @@ struct WiFiMeasurements {
}
}
/** get the oldest timestamp among all contained measurements */
Timestamp getOldestTS() const {
auto comp = [] (const WiFiMeasurement& m1, const WiFiMeasurement& m2) {return m1.getTimestamp() < m2.getTimestamp();};
auto it = std::max_element(entries.begin(), entries.end(), comp);
if (it == entries.end()) {throw Exception("no element found");}
return it->getTimestamp();
}
/** create a combination */
static WiFiMeasurements mix(const WiFiMeasurements& a, const WiFiMeasurements& b, float sec = 3) {