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