added stuff for bluetooth
worked on resampling methods
This commit is contained in:
@@ -24,11 +24,20 @@ struct BeaconMeasurements {
|
||||
|
||||
/** remove entries older then 3000 ms*/
|
||||
void removeOld(const Timestamp latestTS) {
|
||||
auto lambda = [latestTS] (const BeaconMeasurement& e) {
|
||||
Timestamp age = latestTS - e.getTimestamp();
|
||||
return age > Timestamp::fromMS(1000*3);
|
||||
};
|
||||
entries.erase(std::remove_if(entries.begin(), entries.end(), lambda), entries.end());
|
||||
|
||||
std::vector<BeaconMeasurement>::iterator it;
|
||||
for (it = entries.begin(); it != entries.end(); ++it){
|
||||
if(latestTS - it->getTimestamp() > Timestamp::fromMS(1000*3)){
|
||||
entries.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void add(const BeaconMeasurement& entry){
|
||||
entries.push_back(entry);
|
||||
|
||||
//remove entries that are to old (3000ms)
|
||||
removeOld(entry.getTimestamp());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user