performance enhancements

memory enhancements
prevent starting sensors more than once
fix for wifi lag issues
map scaling for huge buildings
This commit is contained in:
2016-10-01 10:21:15 +02:00
parent 833327bafd
commit 44f9b6ac80
16 changed files with 197 additions and 26 deletions

View File

@@ -9,6 +9,8 @@
#include "../../misc/Debug.h"
#include "../WiFiSensor.h"
#include <Indoor/misc/Debug.h>
class WiFiSensorAndroid : public WiFiSensor {
private:
@@ -30,11 +32,11 @@ public:
// do NOT start twice!
if (started) {return;}
started = true;
// start scanning
int res = QAndroidJniObject::callStaticMethod<int>("indoor/java/WiFi", "start", "()I");
if (res != 1337) {throw Exception("error while starting WiFi");}
started = true;
}
@@ -46,7 +48,11 @@ public:
return started;
}
/** called from java. handle the given incoming scan result */
/**
* called from WiFi.java
* handle the given incoming scan result
* just a bit curious, thus std::string instead of std::string&
*/
void handle(const std::string data) {
// to-be-constructed sensor data
@@ -68,6 +74,16 @@ public:
// call listeners
informListeners(sensorData);
// interval debug
// static Timestamp lastTS;
// const Timestamp diff = curTS - lastTS;
// Log::add("wifi", std::to_string(diff.ms()));
// if (diff.ms() > 650) {
// Log::add("wifi", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
// }
// lastTS = curTS;
}
};