lock missing in telemetry bars screen

This commit is contained in:
bsongis
2014-03-17 11:50:39 +01:00
parent a082a9a53e
commit 4202492b1a
2 changed files with 16 additions and 7 deletions
+3
View File
@@ -133,6 +133,7 @@ RawSourceRange RawSource::getRange(bool singleprec)
result.max = 225;
break;
case TELEMETRY_SOURCE_RPM:
case TELEMETRY_SOURCE_RPM_MAX:
result.step = singleprec ? 50 : 1;
result.max = singleprec ? 12750 : 20000;
break;
@@ -140,6 +141,7 @@ RawSourceRange RawSource::getRange(bool singleprec)
result.max = 100;
break;
case TELEMETRY_SOURCE_SPEED:
case TELEMETRY_SOURCE_SPEED_MAX:
result.step = singleprec ? 4 : 1;
result.max = singleprec ? 944 : 2000;
if (model && !model->frsky.imperial) {
@@ -148,6 +150,7 @@ RawSourceRange RawSource::getRange(bool singleprec)
}
break;
case TELEMETRY_SOURCE_DIST:
case TELEMETRY_SOURCE_DIST_MAX:
result.step = singleprec ? 8 : 1;
result.max = singleprec ? 2040 : 10000;
break;
+13 -7
View File
@@ -382,6 +382,8 @@ void TelemetryCustomScreen::update()
void TelemetryCustomScreen::updateBar(int line)
{
lock = true;
int index = screen.body.bars[line].source;
barsCB[line]->setCurrentIndex(index);
if (index) {
@@ -407,6 +409,8 @@ void TelemetryCustomScreen::updateBar(int line)
minSB[line]->setDisabled(true);
maxSB[line]->setDisabled(true);
}
lock = false;
}
void TelemetryCustomScreen::on_screenType_currentIndexChanged(int index)
@@ -428,13 +432,15 @@ void TelemetryCustomScreen::customFieldChanged(int value)
void TelemetryCustomScreen::barSourceChanged(int index)
{
QComboBox * cb = qobject_cast<QComboBox*>(sender());
int line = cb->property("index").toInt();
screen.body.bars[line].source = index;
screen.body.bars[line].barMin = 0;
screen.body.bars[line].barMax = 0;
updateBar(line);
emit modified();
if (!lock) {
QComboBox * cb = qobject_cast<QComboBox*>(sender());
int line = cb->property("index").toInt();
screen.body.bars[line].source = index;
screen.body.bars[line].barMin = 0;
screen.body.bars[line].barMax = 0;
updateBar(line);
emit modified();
}
}
void TelemetryCustomScreen::barMinChanged(double value)