bx = 0;
by = 0;
bz = 0;
+
+ in_reset = 1;
}
AMeterWidget::~AMeterWidget()
qreal cx, cy, rx, ry;
qreal x1, y1, a;
- a = sqrt(ax * ax + ay * ay + az * az);
-
if (background)
{
paint.drawImage(QPoint(0, 0), *background);
}
+ if (in_reset) {
+ return;
+ }
+
+ a = sqrt(ax * ax + ay * ay + az * az);
paint.setRenderHints(QPainter::Antialiasing);
cx = width() / 2;
ay = reading->y() * r_g;
az = reading->z() * r_g;
- if (smoothing > 0 && smoothing < 4)
+ if (!in_reset && smoothing > 0 && smoothing < 4)
{
k = smoothing_k[smoothing];
ax = ax * k + bx * (1.0 - k);
ay = ay * k + by * (1.0 - k);
az = az * k + bz * (1.0 - k);
}
-
+
+ in_reset = 0;
update();
return true;
}
+void AMeterWidget::reset()
+{
+ in_reset = 0;
+ ax = 0;
+ ay = 0;
+ az = 0;
+}
+
AMeterWidget(QWidget *parent = 0);
~AMeterWidget();
- int setGravity(qreal g);
+ int setGravity(qreal g);
+ void reset();
public slots:
virtual bool filter(QAccelerometerReading *reading);
private:
qreal r_g; // 1/g
- qreal r_a_max; // 1/a_max
+ qreal r_a_max; // 1/a_max
+ int in_reset;
};
#endif // AMETERWIDGET_H
+ameter (1.0.4) unstable; urgency=low
+
+ * Reset the indicator when the screen is locked
+
+ -- Ivan Gorinov <igorinov@gmail.com> Thu, 3 Nov 2011 22:13:26 -0700
+
ameter (1.0.3) unstable; urgency=low
* Added numbers to gravity scale
-ameter_1.0.3_armel.deb user/utilities optional
+ameter_1.0.4_armel.deb user/utilities optional
if (state == MCE_DISPLAY_OFF_STRING)
{
accelerometer->stop();
+ awidget->reset();
} else {
accelerometer->start();
}