Replicate same fix to REs
This commit is contained in:
@@ -206,19 +206,17 @@ void FlightMode::update()
|
||||
gvValues[i]->setValue(phasegvar->gvars[i]);
|
||||
}
|
||||
|
||||
for (int i=0; i<reCount; i++) {
|
||||
if (phase.rotaryEncoders[i] < 1024) {
|
||||
reValues[i]->setValue(phase.rotaryEncoders[i]);
|
||||
reValues[i]->setDisabled(false);
|
||||
}
|
||||
else {
|
||||
int idx = phase.rotaryEncoders[i] - 1025;
|
||||
if (idx >= i) idx++;
|
||||
// TODO no!!!!
|
||||
PhaseData *phasere = &model.phaseData[idx];
|
||||
reValues[i]->setValue(phasere->rotaryEncoders[i]);
|
||||
for (int i=0; i<reCount; i++) {
|
||||
reValues[i]->setDisabled(false);
|
||||
int idx = phase.rotaryEncoders[i];
|
||||
PhaseData *phasere = &phase;
|
||||
while (idx >= 1024) {
|
||||
idx -= 1025;
|
||||
phasere = &model.phaseData[idx];
|
||||
idx = phasere->rotaryEncoders[i];
|
||||
reValues[i]->setDisabled(true);
|
||||
}
|
||||
reValues[i]->setValue(phasere->rotaryEncoders[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,21 +335,12 @@ void FlightMode::phaseREUse_currentIndexChanged(int index)
|
||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
||||
int re = comboBox->property("index").toInt();
|
||||
if (index == 0) {
|
||||
// TODO no!!!
|
||||
int value = phase.rotaryEncoders[re];
|
||||
if (value > 1024) {
|
||||
value = 0;
|
||||
}
|
||||
reValues[re]->setValue(value);
|
||||
reValues[re]->setEnabled(true);
|
||||
phase.rotaryEncoders[re] = value;
|
||||
phase.rotaryEncoders[re] = 0;
|
||||
}
|
||||
else {
|
||||
phase.rotaryEncoders[re] = 1024 + index;
|
||||
int value = model.phaseData[index + (index>phaseIdx ? 0 :-1)].rotaryEncoders[re];
|
||||
reValues[re]->setValue(value);
|
||||
reValues[re]->setDisabled(true) ;
|
||||
phase.rotaryEncoders[re] = 1024 + index; ;
|
||||
}
|
||||
update();
|
||||
lock = false;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user