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

@@ -22,6 +22,8 @@ private:
;
}
bool started = false;
public:
/** singleton access */
@@ -36,18 +38,26 @@ public:
void start() override {
if (started) {return;}
started = true;
auto onSensorData = [&] () {
GyroscopeData data(degToRad(gyro.reading()->x()), degToRad(gyro.reading()->y()), degToRad(gyro.reading()->z()));
informListeners(data);
// const Timestamp now = Timestamp::fromRunningTime();
// Log::add("123", "ts:" + std::to_string(now.ms()));
};
// gyroscope is usually not as fast as the acceleromter -> limiting not needed
//gyro.setDataRate(200);
gyro.connect(&gyro, &QGyroscope::readingChanged, onSensorData);
gyro.start();
}
bool isRunning() const override {
return gyro.isActive();
return started;
}
void stop() override {