1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

Fix for OP-549 reversed dials by Dmitry Zaitsev

This commit is contained in:
Peter Gunnarsson 2011-08-05 15:33:45 +02:00
parent a7cce25252
commit 12ba6addb0

View File

@ -478,13 +478,13 @@ void DialGadgetWidget::setDialFont(QString fontProps)
// this enables smooth rotation in rotateNeedles below // this enables smooth rotation in rotateNeedles below
void DialGadgetWidget::setNeedle1(double value) { void DialGadgetWidget::setNeedle1(double value) {
if (rotateN1) { if (rotateN1) {
needle1Target = 360*(value*n1Factor-n1MinValue)/(n1MaxValue-n1MinValue); needle1Target = 360*(value*n1Factor)/(n1MaxValue-n1MinValue);
} }
if (horizN1) { if (horizN1) {
needle1Target = (value*n1Factor-n1MinValue)/(n1MaxValue-n1MinValue); needle1Target = (value*n1Factor)/(n1MaxValue-n1MinValue);
} }
if (vertN1) { if (vertN1) {
needle1Target = (value*n1Factor-n1MinValue)/(n1MaxValue-n1MinValue); needle1Target = (value*n1Factor)/(n1MaxValue-n1MinValue);
} }
if (!dialTimer.isActive()) if (!dialTimer.isActive())
dialTimer.start(); dialTimer.start();
@ -497,13 +497,13 @@ void DialGadgetWidget::setNeedle1(double value) {
void DialGadgetWidget::setNeedle2(double value) { void DialGadgetWidget::setNeedle2(double value) {
if (rotateN2) { if (rotateN2) {
needle2Target = 360*(value*n2Factor-n2MinValue)/(n2MaxValue-n2MinValue); needle2Target = 360*(value*n2Factor)/(n2MaxValue-n2MinValue);
} }
if (horizN2) { if (horizN2) {
needle2Target = (value*n2Factor-n2MinValue)/(n2MaxValue-n2MinValue); needle2Target = (value*n2Factor)/(n2MaxValue-n2MinValue);
} }
if (vertN2) { if (vertN2) {
needle2Target = (value*n2Factor-n2MinValue)/(n2MaxValue-n2MinValue); needle2Target = (value*n2Factor)/(n2MaxValue-n2MinValue);
} }
if (!dialTimer.isActive()) if (!dialTimer.isActive())
dialTimer.start(); dialTimer.start();
@ -517,13 +517,13 @@ void DialGadgetWidget::setNeedle2(double value) {
void DialGadgetWidget::setNeedle3(double value) { void DialGadgetWidget::setNeedle3(double value) {
if (rotateN3) { if (rotateN3) {
needle3Target = 360*(value*n3Factor-n3MinValue)/(n3MaxValue-n3MinValue); needle3Target = 360*(value*n3Factor)/(n3MaxValue-n3MinValue);
} }
if (horizN3) { if (horizN3) {
needle3Target = (value*n3Factor-n3MinValue)/(n3MaxValue-n3MinValue); needle3Target = (value*n3Factor)/(n3MaxValue-n3MinValue);
} }
if (vertN3) { if (vertN3) {
needle3Target = (value*n3Factor-n3MinValue)/(n3MaxValue-n3MinValue); needle3Target = (value*n3Factor)/(n3MaxValue-n3MinValue);
} }
if (!dialTimer.isActive()) if (!dialTimer.isActive())
dialTimer.start(); dialTimer.start();