chore(cpn): move capabilities from firmware to boards, remove unused (#7070)

This commit is contained in:
Neil Horne
2026-02-06 14:34:41 +10:00
committed by GitHub
parent de5f4eb5dc
commit e4fc09bfea
35 changed files with 2135 additions and 2633 deletions
+10 -15
View File
@@ -104,9 +104,7 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting
connectItemModelEvents(dialogFilteredItemModels->getItemModel(crvid));
int gvid = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_GVarRef)), "GVarRef");
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels,
firmware->getCapability(HasMixerExpo) ? 0 : FilteredItemModel::PositiveFilter);
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, 0);
QStringList headerLabels;
headerLabels << "#";
@@ -118,8 +116,7 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting
headerLabels << tr("Curve") << tr("Plot");
if (firmware->getCapability(PPMCenter))
headerLabels << tr("PPM Center");
if (firmware->getCapability(SYMLimits))
headerLabels << tr("Linear Subtrim");
headerLabels << tr("Linear Subtrim");
TableLayout *tableLayout = new TableLayout(this, chnCapability, headerLabels);
for (int i = 0; i < chnCapability; i++) {
@@ -192,13 +189,11 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting
}
// Symetrical limits
if (firmware->getCapability(SYMLimits)) {
symlimitsChk[i] = new QCheckBox(this);
symlimitsChk[i]->setProperty("index", i);
symlimitsChk[i]->setChecked(model.limitData[i].symetrical);
connect(symlimitsChk[i], SIGNAL(toggled(bool)), this, SLOT(symlimitsEdited()));
tableLayout->addWidget(i, col++, symlimitsChk[i]);
}
symlimitsChk[i] = new QCheckBox(this);
symlimitsChk[i]->setProperty("index", i);
symlimitsChk[i]->setChecked(model.limitData[i].symetrical);
connect(symlimitsChk[i], SIGNAL(toggled(bool)), this, SLOT(symlimitsEdited()));
tableLayout->addWidget(i, col++, symlimitsChk[i]);
}
update();
@@ -301,12 +296,12 @@ void ChannelsPanel::updateLine(int i)
chnMin[i]->setValue(chn.min);
chnMax[i]->setValue(chn.max);
invCB[i]->setCurrentIndex((chn.revert) ? 1 : 0);
if (firmware->getCapability(PPMCenter)) {
centerSB[i]->setValue(chn.ppmCenter + 1500);
}
if (firmware->getCapability(SYMLimits)) {
symlimitsChk[i]->setChecked(chn.symetrical);
}
symlimitsChk[i]->setChecked(chn.symetrical);
lock = false;
}
+18 -60
View File
@@ -75,14 +75,12 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
"RawSource GVars");
connectItemModelEvents(tabFilterFactory->getItemModel(rawSourceGVarsId));
if (!firmware->getCapability(VoicesAsNumbers)) {
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
for (int i = 0; i < fswCapability; i++) {
if (functions[i].func == FuncPlayPrompt || functions[i].func == FuncBackgroundMusic) {
QString temp = functions[i].paramarm;
if (!temp.isEmpty()) {
tracksSet.insert(temp);
}
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
for (int i = 0; i < fswCapability; i++) {
if (functions[i].func == FuncPlayPrompt || functions[i].func == FuncBackgroundMusic) {
QString temp = functions[i].paramarm;
if (!temp.isEmpty()) {
tracksSet.insert(temp);
}
}
}
@@ -270,15 +268,10 @@ bool CustomFunctionsPanel::playSound(int index)
if (!QDir(path).exists())
return false; // unlikely
if (firmware->getCapability(VoicesAsNumbers)) { // AVR
path.append(QString("/%1.wav").arg(int(fswtchParam[index]->value()), 4, 10, QChar('0')));
}
else {
QString lang(generalSettings.ttsLanguage);
if (lang.isEmpty())
lang = "en";
path.append(QString("/SOUNDS/%1/%2.wav").arg(lang).arg(fswtchParamArmT[index]->currentText()));
}
QString lang(generalSettings.ttsLanguage);
if (lang.isEmpty())
lang = "en";
path.append(QString("/SOUNDS/%1/%2.wav").arg(lang).arg(fswtchParamArmT[index]->currentText()));
}
if (!QFileInfo::exists(path) || !QFileInfo(path).isReadable()) {
@@ -488,7 +481,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool changed)
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
else if (func == FuncPlaySound || func == FuncPlayHaptic || func == FuncPlayValue || func == FuncPlayPrompt || func == FuncPlayBoth || func == FuncBackgroundMusic || func == FuncSetScreen) {
else if (func == FuncPlaySound || func == FuncPlayHaptic || func == FuncPlayValue || func == FuncPlayPrompt || func == FuncBackgroundMusic || func == FuncSetScreen) {
if (func != FuncBackgroundMusic) {
if (changed)
cfn.repeatParam = fswtchRepeat[i]->currentData().toInt();
@@ -502,49 +495,14 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool changed)
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_REPEAT;
}
else if (func == FuncPlayPrompt || func == FuncPlayBoth) {
if (firmware->getCapability(VoicesAsNumbers)) {
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(0);
if (func == FuncPlayPrompt) {
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM | CUSTOM_FUNCTION_REPEAT | CUSTOM_FUNCTION_GV_TOOGLE;
}
else {
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM | CUSTOM_FUNCTION_REPEAT;
fswtchParamGV[i]->setChecked(false);
}
fswtchParam[i]->setMaximum(func == FuncPlayBoth ? 254 : 255);
if (changed) {
if (fswtchParamGV[i]->isChecked()) {
fswtchParam[i]->setMinimum(1);
cfn.param = std::min(fswtchParam[i]->value(), 5.0) + (fswtchParamGV[i]->isChecked() ? 250 : 0);
}
else {
cfn.param = fswtchParam[i]->value();
}
}
if (cfn.param > 250 && (func != FuncPlayBoth)) {
fswtchParamGV[i]->setChecked(true);
fswtchParam[i]->setValue(cfn.param - 250);
fswtchParam[i]->setMaximum(5);
}
else {
fswtchParamGV[i]->setChecked(false);
fswtchParam[i]->setValue(cfn.param);
}
if (cfn.param < 251)
widgetsMask |= CUSTOM_FUNCTION_PLAY;
else if (func == FuncPlayPrompt) {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (changed) {
Helpers::getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, firmware->getCapability(VoicesMaxLength));
}
else {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (changed) {
Helpers::getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, firmware->getCapability(VoicesMaxLength));
}
Helpers::populateFileComboBox(fswtchParamArmT[i], tracksSet, cfn.paramarm);
if (fswtchParamArmT[i]->currentText() != CPN_STR_NONE_ITEM) {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
Helpers::populateFileComboBox(fswtchParamArmT[i], tracksSet, cfn.paramarm);
if (fswtchParamArmT[i]->currentText() != CPN_STR_NONE_ITEM) {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
}
else if (func == FuncBackgroundMusic) {
+1 -2
View File
@@ -67,8 +67,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
connect(offsetEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); });
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels,
firmware->getCapability(HasInputDiff) ? 0 : FilteredItemModel::PositiveFilter);
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, 0);
curveGroup = new CurveReferenceUIManager(ui->cboCurveType, ui->chkCurveUseSource, ui->sbCurveValue, ui->cboCurveSource, ui->cboCurveFunc,
ui->imgCurve, ed->curve, model, sharedItemModels, curveRefFilteredItemModels, esMdl, this);
+10 -17
View File
@@ -62,23 +62,16 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
ui->swtch->hide();
}
// FadeIn / FadeOut
if (firmware->getCapability(FlightModesHaveFades)) {
int scale = firmware->getCapability(SlowScale);
int range = firmware->getCapability(SlowRange);
ui->fadeIn->setMaximum(float(range) / scale);
ui->fadeIn->setSingleStep(1.0 / scale);
ui->fadeIn->setDecimals((scale == 1 ? 0 :1) );
connect(ui->fadeIn, SIGNAL(editingFinished()), this, SLOT(phaseFadeIn_editingFinished()));
ui->fadeOut->setMaximum(float(range) / scale);
ui->fadeOut->setSingleStep(1.0 / scale);
ui->fadeOut->setDecimals((scale == 1 ? 0 :1));
connect(ui->fadeOut, SIGNAL(editingFinished()), this, SLOT(phaseFadeOut_editingFinished()));
}
else {
ui->fadeIn->setDisabled(true);
ui->fadeOut->setDisabled(true);
}
int scale = firmware->getCapability(SlowScale);
int range = firmware->getCapability(SlowRange);
ui->fadeIn->setMaximum(float(range) / scale);
ui->fadeIn->setSingleStep(1.0 / scale);
ui->fadeIn->setDecimals((scale == 1 ? 0 :1) );
connect(ui->fadeIn, SIGNAL(editingFinished()), this, SLOT(phaseFadeIn_editingFinished()));
ui->fadeOut->setMaximum(float(range) / scale);
ui->fadeOut->setSingleStep(1.0 / scale);
ui->fadeOut->setDecimals((scale == 1 ? 0 :1));
connect(ui->fadeOut, SIGNAL(editingFinished()), this, SLOT(phaseFadeOut_editingFinished()));
// The trims
QString labels[CPN_MAX_TRIMS];
+1 -2
View File
@@ -36,8 +36,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
RawSwitch::LogicalSwitchesContext);
connectItemModelEvents(rawSwitchFilteredModel);
const int srcGroups = firmware->getCapability(GvarsInCS) ? 0 : (RawSource::AllSourceGroups & ~RawSource::GVarsGroup);
rawSourceFilteredModel = new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource), srcGroups);
rawSourceFilteredModel = new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource));
connectItemModelEvents(rawSourceFilteredModel);
lsCapability = firmware->getCapability(LogicalSwitches);
+1 -16
View File
@@ -79,21 +79,13 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
connect(offsetEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); });
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels,
firmware->getCapability(HasMixerExpo) ? 0 : FilteredItemModel::PositiveFilter);
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, 0);
curveGroup = new CurveReferenceUIManager(ui->cboCurveType, ui->chkCurveUseSource, ui->sbCurveValue, ui->cboCurveSource, ui->cboCurveFunc,
ui->imgCurve, md->curve, model, sharedItemModels, curveRefFilteredItemModels, esMdl, this);
connect(curveGroup, &CurveReferenceUIManager::resized, this, [=] () { shrink(); });
ui->MixDR_CB->setChecked(md->noExpo == 0);
if (!firmware->getCapability(HasNoExpo)) {
ui->MixDR_CB->hide();
ui->label_MixDR->hide();
}
if (index == 0 || model.mixData[index - 1].destCh != mixdata->destCh) {
ui->mltpxCB->hide();
ui->mltpxLbl->hide();
@@ -182,7 +174,6 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
connect(ui->mixerName, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
connect(ui->sourceCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(ui->trimCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(ui->MixDR_CB, SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(ui->warningCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(ui->mltpxCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
@@ -227,13 +218,7 @@ void MixerDialog::valuesChanged()
if (!lock) {
lock = true;
md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt());
if (firmware->getCapability(HasNoExpo)) {
bool drVisible = (md->srcRaw.type == SOURCE_TYPE_INPUT && md->srcRaw.index < CPN_MAX_STICKS);
ui->MixDR_CB->setEnabled(drVisible);
ui->label_MixDR->setEnabled(drVisible);
}
md->carryTrim = -(ui->trimCB->currentIndex() - 1);
md->noExpo = ui->MixDR_CB->checkState() ? 0 : 1;
md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
md->mixWarn = ui->warningCB->currentIndex();
md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex();
+338 -353
View File
@@ -29,6 +29,288 @@
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0">
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Offset</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="switchesCB"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mixerName"/>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="warningCB">
<item>
<property name="text">
<string>OFF</string>
</property>
</item>
<item>
<property name="text">
<string>1 Beep</string>
</property>
</item>
<item>
<property name="text">
<string>2 Beeps</string>
</property>
</item>
<item>
<property name="text">
<string>3 Beeps</string>
</property>
</item>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="cboCurveType">
<property name="whatsThis">
<string>The curve used by the mix</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_name">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="mltpxLbl">
<property name="text">
<string>Multiplex</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Warning</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Switch</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_curve">
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QComboBox" name="mltpxCB">
<item>
<property name="text">
<string>ADD</string>
</property>
</item>
<item>
<property name="text">
<string>MULTIPLY</string>
</property>
</item>
<item>
<property name="text">
<string>REPLACE</string>
</property>
</item>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="trimCB">
<item>
<property name="text">
<string>No</string>
</property>
</item>
<item>
<property name="text">
<string>Yes</string>
</property>
</item>
</widget>
</item>
<item row="6" column="1" colspan="2">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="4">
<widget class="QLabel" name="lb_FP4">
<property name="text">
<string notr="true">4</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="lb_FP3">
<property name="text">
<string notr="true">3</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="lb_FP7">
<property name="text">
<string notr="true">7</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_FP0">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="lb_FP2">
<property name="text">
<string notr="true">2</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QCheckBox" name="cb_FP6">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="8">
<widget class="QCheckBox" name="cb_FP8">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QLabel" name="lb_FP8">
<property name="text">
<string notr="true">8</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="7">
<widget class="QCheckBox" name="cb_FP7">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="cb_FP1">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QCheckBox" name="cb_FP5">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lb_FP1">
<property name="text">
<string notr="true">1</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lb_FP0">
<property name="text">
<string notr="true">0</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="lb_FP6">
<property name="text">
<string notr="true">6</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="cb_FP2">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="lb_FP5">
<property name="text">
<string notr="true">5</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="cb_FP4">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="cb_FP3">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="9">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,1">
<item>
@@ -51,7 +333,7 @@
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -63,9 +345,6 @@
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sourceCB"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="trimLabel">
<property name="text">
@@ -73,146 +352,10 @@
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="switchesCB"/>
</item>
<item row="3" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,1">
<item>
<widget class="QCheckBox" name="chkOffsetUseSource">
<property name="text">
<string>Source</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cboOffsetSource">
<property name="whatsThis">
<string>The source for the mixer</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbOffsetValue"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Warning</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Weight</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Switch</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QComboBox" name="mltpxCB">
<item>
<property name="text">
<string>ADD</string>
</property>
</item>
<item>
<property name="text">
<string>MULTIPLY</string>
</property>
</item>
<item>
<property name="text">
<string>REPLACE</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_MixDR">
<widget class="QLabel" name="label_phases">
<property name="text">
<string>Include DR/Expo</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Source</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="mltpxLbl">
<property name="text">
<string>Multiplex</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_curve">
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mixerName"/>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="trimCB">
<item>
<property name="text">
<string>No</string>
</property>
</item>
<item>
<property name="text">
<string>Yes</string>
</property>
</item>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="cboCurveType">
<property name="whatsThis">
<string>The curve used by the mix</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="MixDR_CB">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_name">
<property name="text">
<string>Name</string>
<string>Modes</string>
</property>
</widget>
</item>
@@ -260,7 +403,7 @@
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -272,211 +415,54 @@
</item>
</layout>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_phases">
<item row="3" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,1">
<item>
<widget class="QCheckBox" name="chkOffsetUseSource">
<property name="text">
<string>Source</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cboOffsetSource">
<property name="whatsThis">
<string>The source for the mixer</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbOffsetValue"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sourceCB"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Modes</string>
<string>Weight</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QComboBox" name="warningCB">
<item>
<property name="text">
<string>OFF</string>
</property>
</item>
<item>
<property name="text">
<string>1 Beep</string>
</property>
</item>
<item>
<property name="text">
<string>2 Beeps</string>
</property>
</item>
<item>
<property name="text">
<string>3 Beeps</string>
</property>
</item>
</widget>
</item>
<item row="7" column="1" colspan="2">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="4">
<widget class="QLabel" name="lb_FP4">
<property name="text">
<string notr="true">4</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="lb_FP3">
<property name="text">
<string notr="true">3</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="lb_FP7">
<property name="text">
<string notr="true">7</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_FP0">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="lb_FP2">
<property name="text">
<string notr="true">2</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QCheckBox" name="cb_FP6">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="8">
<widget class="QCheckBox" name="cb_FP8">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QLabel" name="lb_FP8">
<property name="text">
<string notr="true">8</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="7">
<widget class="QCheckBox" name="cb_FP7">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="cb_FP1">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QCheckBox" name="cb_FP5">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lb_FP1">
<property name="text">
<string notr="true">1</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lb_FP0">
<property name="text">
<string notr="true">0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="lb_FP6">
<property name="text">
<string notr="true">6</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="cb_FP2">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="lb_FP5">
<property name="text">
<string notr="true">5</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="cb_FP4">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="cb_FP3">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="9">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Offset</string>
<string>Source</string>
</property>
</widget>
</item>
@@ -491,10 +477,10 @@
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
@@ -516,7 +502,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If Slow is not zero then the speed of the mix will be set by the value specified -&amp;gt; the value states the number of seconds it takes to transit from -100 to 100.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
@@ -543,7 +529,7 @@ p, li { white-space: pre-wrap; }
<string>Up</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
@@ -553,7 +539,7 @@ p, li { white-space: pre-wrap; }
<string>Down</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
@@ -580,7 +566,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If Slow is not zero then the speed of the mix will be set by the value specified -&amp;gt; the value states the number of seconds it takes to transit from -100 to 100.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
@@ -609,7 +595,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If Slow is not zero then the speed of the mix will be set by the value specified -&amp;gt; the value states the number of seconds it takes to transit from -100 to 100.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
@@ -632,7 +618,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If Slow is not zero then the speed of the mix will be set by the value specified -&amp;gt; the value states the number of seconds it takes to transit from -100 to 100.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
@@ -651,7 +637,7 @@ p, li { white-space: pre-wrap; }
<string>Precision</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
@@ -706,7 +692,6 @@ p, li { white-space: pre-wrap; }
<tabstop>cboCurveSource</tabstop>
<tabstop>sbCurveValue</tabstop>
<tabstop>trimCB</tabstop>
<tabstop>MixDR_CB</tabstop>
<tabstop>cb_FP0</tabstop>
<tabstop>cb_FP1</tabstop>
<tabstop>cb_FP2</tabstop>
+2 -4
View File
@@ -112,10 +112,8 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
addTab(new CustomFunctionsPanel(this, &model, generalSettings, firmware, sharedItemModels), tr("Special Functions"));
s1.report("Special Functions");
if (firmware->getCapability(Telemetry)) {
addTab(new TelemetryPanel(this, model, generalSettings, firmware, sharedItemModels), tr("Telemetry"));
s1.report("Telemetry");
}
addTab(new TelemetryPanel(this, model, generalSettings, firmware, sharedItemModels), tr("Telemetry"));
s1.report("Telemetry");
if (Boards::getCapability(firmware->getBoard(), Board::HasColorLcd)) {
addTab(new ColorCustomScreensPanel(this, model, generalSettings, firmware, sharedItemModels), tr("Custom Screens"));
-10
View File
@@ -178,20 +178,10 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
ui->throttleSource->setModel(panelFilteredModels->getItemModel(FIM_THRSOURCE));
ui->throttleSource->setField(model.thrTraceSrc, this);
if (!firmware->getCapability(HasDisplayText)) {
ui->displayText->hide();
ui->editChecklist->hide();
}
if (!firmware->getCapability(GlobalFunctions)) {
ui->gfEnabled->hide();
}
if (!firmware->getCapability(HasADCJitterFilter))
{
ui->jitterFilter->hide();
}
// Beep Center checkboxes
prevFocus = ui->trimsDisplay;
+2 -2
View File
@@ -451,8 +451,8 @@ void ModulePanel::update()
ui->channelsCount->setEnabled(mask & MASK_CHANNELS_COUNT);
ui->channelsCount->setMaximum(module.getMaxChannelCount());
ui->channelsCount->setValue(module.channelsCount);
ui->channelsCount->setSingleStep(firmware->getCapability(HasPPMStart) ? 1 : 2);
ui->channelsCount->setSingleStep(1);
// CRSF
ui->label_crsfArmingMode->setVisible(mask & MASK_CSRF_ARMING_MODE);
ui->crsfArmingMode->setVisible(mask & MASK_CSRF_ARMING_MODE);
+4 -16
View File
@@ -63,20 +63,10 @@ TimerPanel::TimerPanel(QWidget * parent, ModelData & model, TimerData & timer, G
connect(ui->countdownBeep, SIGNAL(currentDataChanged(int)), this, SLOT(onCountdownBeepChanged(int)));
ui->minuteBeep->setField(timer.minuteBeep, this);
if (firmware->getCapability(PermTimers)) {
ui->persistent->setModel(panelItemModels->getItemModel(AIM_TIMER_PERSISTENT));
ui->persistent->setField(timer.persistent, this);
}
else {
ui->persistent->hide();
ui->persistentValue->hide();
}
ui->persistent->setModel(panelItemModels->getItemModel(AIM_TIMER_PERSISTENT));
ui->persistent->setField(timer.persistent, this);
ui->countdownStart->setModel(panelItemModels->getItemModel(AIM_TIMER_COUNTDOWNSTART));
ui->countdownStart->setField(timer.countdownStart, this);
ui->showElapsed->setModel(panelItemModels->getItemModel(AIM_TIMER_SHOWELAPSED));
ui->showElapsed->setField(timer.showElapsed, this);
@@ -126,10 +116,8 @@ void TimerPanel::update()
ui->countdownStart->setEnabled(true);
}
if (firmware->getCapability(PermTimers)) {
ui->persistent->updateValue();
ui->persistentValue->setText(timer.pvalueToString());
}
ui->persistent->updateValue();
ui->persistentValue->setText(timer.pvalueToString());
if (timer.val) {
ui->showElapsed->setEnabled(true);
+4 -13
View File
@@ -434,9 +434,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
if (sensorCapability > CPN_MAX_SENSORS) // TODO should be role of getCapability
sensorCapability = CPN_MAX_SENSORS;
if (firmware->getCapability(NoTelemetryProtocol)) {
model.frsky.usrProto = 1;
}
model.frsky.usrProto = 1;
ui->varioSource->setModel(panelFilteredItemModels->getItemModel(FIM_TELEVARIOSRC));
ui->varioSource->setField(model.frsky.varioSource, this);
@@ -542,16 +540,9 @@ void TelemetryPanel::setup()
}
ui->altimetryGB->setVisible(firmware->getCapability(HasVario)),
ui->frskyProtoCB->setDisabled(firmware->getCapability(NoTelemetryProtocol));
if (firmware->getCapability(Telemetry)) {
ui->frskyProtoCB->addItem(tr("Winged Shadow How High"));
}
else {
ui->frskyProtoCB->addItem(tr("Winged Shadow How High (not supported)"));
}
ui->variousGB->hide();
ui->frskyProtoCB->setDisabled(true);
ui->frskyProtoCB->addItem(tr("Winged Shadow How High"));
ui->variousGB->hide(); // TODO remove from ui design and code
lock = false;
}