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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user