feat(color): Add OneBit option to color radios (and Companion!!) (#1994)

* Added OneBit option also to color radios

* Try to work around GH repo owner issue

Original by @raphaelcoeffic in https://github.com/EdgeTX/edgetx/commit/bf4b5d8c0c1e386d5a4852a80d459540bab98ed3

* Add Companion support for radios with external module

* Companion housekeeping - do not display unnecessary hardware section headings

* fix: Rebase cleanup

* fix: LVGL changes

* feat: Move sample mode to a new Ext RF block

Co-authored-by: elecpower <neilh713@tpg.com.au>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
Risto
2022-07-22 11:00:20 +10:00
committed by GitHub
co-authored by elecpower Peter Feerick
parent 54aaf5b9d9
commit 2ee75033bb
10 changed files with 167 additions and 9 deletions
+14 -7
View File
@@ -98,6 +98,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
int auxmodelid = editorItemModels->registerItemModel(GeneralSettings::serialModeItemModel(GeneralSettings::SP_AUX1));
int vcpmodelid = editorItemModels->registerItemModel(GeneralSettings::serialModeItemModel(GeneralSettings::SP_VCP));
int baudmodelid = editorItemModels->registerItemModel(GeneralSettings::internalModuleBaudrateItemModel());
int uartmodelid = editorItemModels->registerItemModel(GeneralSettings::uartSampleModeItemModel());
id = editorItemModels->registerItemModel(ModuleData::internalModuleItemModel());
tabFilteredModels->registerItemModel(new FilteredItemModel(editorItemModels->getItemModel(id)), FIM_INTERNALMODULES);
@@ -123,29 +124,26 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
addParams(row, spnStickDeadZone);
}
addSection(tr("Pots"), row);
count = Boards::getCapability(board, Board::Pots);
count -= firmware->getCapability(HasFlySkyGimbals) ? 2 : 0;
if (count > 0) {
addSection(tr("Pots"), row);
for (int i = 0; i < count; i++) {
addPot(i, row);
}
}
addSection(tr("Sliders"), row);
count = Boards::getCapability(board, Board::Sliders);
if (count) {
addSection(tr("Sliders"), row);
for (int i = 0; i < count; i++) {
addSlider(i, row);
}
}
addSection(tr("Switches"), row);
count = Boards::getCapability(board, Board::Switches);
if (count) {
addSection(tr("Switches"), row);
for (int i = 0; i < count; i++) {
addSwitch(i, row);
}
@@ -216,11 +214,20 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
row++;
}
if (Boards::getCapability(board, Board::HasExternalModuleSupport)) {
addLabel(tr("Sample Mode"), row, 0);
AutoComboBox *uartSampleMode = new AutoComboBox(this);
uartSampleMode->setModel(editorItemModels->getItemModel(uartmodelid));
uartSampleMode->setField(generalSettings.uartSampleMode);
addParams(row, uartSampleMode);
}
// All values except 0 are mutually exclusive
ExclusiveComboGroup *exclGroup = new ExclusiveComboGroup(
this, [=](const QVariant &value) { return value == 0; });
addSection(tr("Serial port"), row);
if (firmware->getCapability(HasAuxSerialMode) || firmware->getCapability(HasAux2SerialMode) || firmware->getCapability(HasVCPSerialMode))
addSection(tr("Serial ports"), row);
if (firmware->getCapability(HasAuxSerialMode)) {
QString lbl = "AUX1";