fixed some issues
some new helper methods added listener-support to offline-reader
This commit is contained in:
@@ -15,22 +15,37 @@ class WiFiFingerprints {
|
||||
|
||||
private:
|
||||
|
||||
/** the file to save the calibration model to */
|
||||
std::string file;
|
||||
// /** the file to save the calibration model to */
|
||||
// std::string file;
|
||||
|
||||
/** all fingerprints (position -> measurements) within the model */
|
||||
std::vector<WiFiFingerprint> fingerprints;
|
||||
|
||||
public:
|
||||
|
||||
WiFiFingerprints(const std::string& file) : file(file) {
|
||||
load();
|
||||
/** empty ctor */
|
||||
WiFiFingerprints() {
|
||||
|
||||
}
|
||||
|
||||
/** ctor from file */
|
||||
WiFiFingerprints(const std::string& file) {
|
||||
load(file);
|
||||
}
|
||||
|
||||
const std::vector<WiFiFingerprint>& getFingerprints() const {
|
||||
return fingerprints;
|
||||
}
|
||||
|
||||
std::vector<WiFiFingerprint>& getFingerprints() {
|
||||
return fingerprints;
|
||||
}
|
||||
|
||||
/** attach the given fingerprint */
|
||||
void add(const WiFiFingerprint& fp) {
|
||||
fingerprints.push_back(fp);
|
||||
}
|
||||
|
||||
/** get all fingerprints that measured exactly the given mac [no VAP grouping] */
|
||||
const std::vector<WiFiFingerprint> getFingerprintsFor(const MACAddress& mac) const {
|
||||
|
||||
@@ -58,7 +73,7 @@ public:
|
||||
}
|
||||
|
||||
/** deserialize the model */
|
||||
void load() {
|
||||
void load(const std::string& file) {
|
||||
|
||||
// open and check
|
||||
std::ifstream inp(file.c_str());
|
||||
@@ -87,7 +102,7 @@ public:
|
||||
|
||||
|
||||
/** serialize the model */
|
||||
void save() {
|
||||
void save(const std::string& file) {
|
||||
|
||||
// open and check
|
||||
std::ofstream out(file.c_str());
|
||||
|
||||
Reference in New Issue
Block a user