Refactoring FirmwareInterface / EepromInterface
This commit is contained in:
@@ -21,7 +21,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
|
||||
ui->sourceCB->removeItem(0);
|
||||
|
||||
int limit = GetEepromInterface()->getCapability(OffsetWeight);
|
||||
int limit = GetCurrentFirmware()->getCapability(OffsetWeight);
|
||||
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
|
||||
@@ -29,12 +29,12 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
|
||||
ui->MixDR_CB->setChecked(md->noExpo==0);
|
||||
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs) || !GetEepromInterface()->getCapability(MixesWithoutExpo)) {
|
||||
if (GetCurrentFirmware()->getCapability(VirtualInputs) || !GetCurrentFirmware()->getCapability(MixesWithoutExpo)) {
|
||||
ui->MixDR_CB->hide();
|
||||
ui->label_MixDR->hide();
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
if (!GetCurrentFirmware()->getCapability(VirtualInputs)) {
|
||||
ui->trimCB->addItem(tr("Rud"));
|
||||
ui->trimCB->addItem(tr("Ele"));
|
||||
ui->trimCB->addItem(tr("Thr"));
|
||||
@@ -43,7 +43,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
|
||||
ui->trimCB->setCurrentIndex(1 - md->carryTrim);
|
||||
|
||||
int namelength = GetEepromInterface()->getCapability(HasMixerNames);
|
||||
int namelength = GetCurrentFirmware()->getCapability(HasMixerNames);
|
||||
if (!namelength) {
|
||||
ui->label_name->hide();
|
||||
ui->mixerName->hide();
|
||||
@@ -54,7 +54,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
ui->mixerName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->mixerName->setText(md->name);
|
||||
|
||||
if (!GetEepromInterface()->getCapability(FlightPhases)) {
|
||||
if (!GetCurrentFirmware()->getCapability(FlightPhases)) {
|
||||
ui->label_phases->hide();
|
||||
for (int i=0; i<9; i++) {
|
||||
lb_fp[i]->hide();
|
||||
@@ -69,7 +69,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
}
|
||||
mask <<= 1;
|
||||
}
|
||||
for (int i=GetEepromInterface()->getCapability(FlightPhases); i<9;i++) {
|
||||
for (int i=GetCurrentFirmware()->getCapability(FlightPhases); i<9;i++) {
|
||||
lb_fp[i]->hide();
|
||||
cb_fp[i]->hide();
|
||||
}
|
||||
@@ -78,8 +78,8 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
populateSwitchCB(ui->switchesCB, md->swtch, generalSettings);
|
||||
ui->warningCB->setCurrentIndex(md->mixWarn);
|
||||
ui->mltpxCB->setCurrentIndex(md->mltpx);
|
||||
int scale=GetEepromInterface()->getCapability(SlowScale);
|
||||
float range=GetEepromInterface()->getCapability(SlowRange);
|
||||
int scale=GetCurrentFirmware()->getCapability(SlowScale);
|
||||
float range=GetCurrentFirmware()->getCapability(SlowRange);
|
||||
ui->slowDownSB->setMaximum(range/scale);
|
||||
ui->slowDownSB->setSingleStep(1.0/scale);
|
||||
ui->slowDownSB->setDecimals((scale==1 ? 0 :1));
|
||||
@@ -142,7 +142,7 @@ void MixerDialog::valuesChanged()
|
||||
lock = true;
|
||||
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
|
||||
md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt(), &model);
|
||||
if (!GetEepromInterface()->getCapability(VirtualInputs) && GetEepromInterface()->getCapability(MixesWithoutExpo)) {
|
||||
if (!GetCurrentFirmware()->getCapability(VirtualInputs) && GetCurrentFirmware()->getCapability(MixesWithoutExpo)) {
|
||||
bool drVisible = (md->srcRaw.type == SOURCE_TYPE_STICK && md->srcRaw.index < NUM_STICKS);
|
||||
ui->MixDR_CB->setEnabled(drVisible);
|
||||
ui->label_MixDR->setEnabled(drVisible);
|
||||
@@ -152,7 +152,7 @@ void MixerDialog::valuesChanged()
|
||||
md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||
md->mixWarn = ui->warningCB->currentIndex();
|
||||
md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex();
|
||||
int scale=GetEepromInterface()->getCapability(SlowScale);
|
||||
int scale=GetCurrentFirmware()->getCapability(SlowScale);
|
||||
md->delayDown = round(ui->delayDownSB->value()*scale);
|
||||
md->delayUp = round(ui->delayUpSB->value()*scale);
|
||||
md->speedDown = round(ui->slowDownSB->value()*scale);
|
||||
|
||||
Reference in New Issue
Block a user