huge commit
- worked on about everything - grid walker using plugable modules - wifi models - new distributions - worked on geometric data-structures - added typesafe timestamps - worked on grid-building - added sensor-classes - added sensor analysis (step-detection, turn-detection) - offline data reader - many test-cases
This commit is contained in:
@@ -79,13 +79,6 @@ template <int maxAccessPoints> struct WiFiGridNode {
|
||||
WiFiGridNode() {;}
|
||||
|
||||
|
||||
|
||||
/** shared vector of all accesspoints the are present within the map. the IDX referes to this vector */
|
||||
static std::vector<AccessPoint>& getMapAPs() {
|
||||
static std::vector<AccessPoint> list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/** get the maximum number of APs each node is able to store */
|
||||
int getMaxAPs() const {return maxAccessPoints;}
|
||||
|
||||
@@ -104,7 +97,7 @@ template <int maxAccessPoints> struct WiFiGridNode {
|
||||
float getRSSI(const MACAddress mac) const {
|
||||
for (const WiFiGridNodeAP ap : strongestAPs) {
|
||||
if (!ap.isValid()) {break;} // reached the end
|
||||
if (getMapAPs()[ap.getAPIdx()].mac == mac) {return ap.getRSSI();}
|
||||
if (getMapAPs()[ap.getAPIdx()].getMAC() == mac) {return ap.getRSSI();}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -117,6 +110,44 @@ template <int maxAccessPoints> struct WiFiGridNode {
|
||||
return getMaxAPs();
|
||||
}
|
||||
|
||||
/** shared vector of all accesspoints the are present within the map. the IDX referes to this vector */
|
||||
static std::vector<AccessPoint>& getMapAPs() {
|
||||
static std::vector<AccessPoint> list;
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
/** serialize static members */
|
||||
static void staticSerialize(std::ostream& out) {
|
||||
|
||||
// number of APs within map
|
||||
const int numAPs = getMapAPs().size();
|
||||
|
||||
// serialize number and APs within map
|
||||
out.write((const char*) &numAPs, sizeof(numAPs));
|
||||
out.write((const char*) getMapAPs().data(), sizeof(getMapAPs()[0])*numAPs);
|
||||
|
||||
}
|
||||
|
||||
/** deserialize static members */
|
||||
static void staticDeserialize(std::istream& inp) {
|
||||
|
||||
// get number of APs within map
|
||||
int numAPs;
|
||||
inp.read((char*) &numAPs, sizeof(numAPs));
|
||||
|
||||
// allocate
|
||||
getMapAPs().resize(numAPs);
|
||||
|
||||
// deserialize APs within map
|
||||
inp.read((char*) getMapAPs().data(), sizeof(getMapAPs()[0])*numAPs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};// __attribute__((packed));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user