Various fixes around Companion trainer mode (#7116)
Various fixes around Companion trainer mode Fixes #7091
This commit is contained in:
@@ -123,6 +123,9 @@ enum TrainerMode {
|
||||
TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_BATTERY_COMPARTMENT,
|
||||
TRAINER_MODE_MASTER_BLUETOOTH,
|
||||
TRAINER_MODE_SLAVE_BLUETOOTH,
|
||||
TRAINER_MODE_MULTI
|
||||
};
|
||||
|
||||
class ModelData {
|
||||
|
||||
@@ -172,7 +172,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
|
||||
ui->txCurrentCalibrationLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_HORUS(board) || IS_JUMPER_T12(board)) {
|
||||
if (IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_HORUS(board)) {
|
||||
ui->bluetoothMode->addItem(tr("OFF"), 0);
|
||||
if (IS_TARANIS_X9E(board)) {
|
||||
ui->bluetoothMode->addItem(tr("Enabled"), 1);
|
||||
|
||||
@@ -195,13 +195,24 @@ ModulePanel::ModulePanel(QWidget * parent, ModelData & model, ModuleData & modul
|
||||
|
||||
ui->label_module->setText(ModuleData::indexToString(moduleIdx, firmware));
|
||||
if (moduleIdx < 0) {
|
||||
if (IS_HORUS(firmware->getBoard())) {
|
||||
if (!IS_TARANIS(firmware->getBoard())) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE, 0, Qt::UserRole - 1);
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE, 0, Qt::UserRole - 1);
|
||||
}
|
||||
if (generalSettings.auxSerialMode != UART_MODE_SBUS_TRAINER) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_BATTERY_COMPARTMENT, 0, Qt::UserRole - 1);
|
||||
}
|
||||
else if (generalSettings.auxSerialMode != UART_MODE_SBUS_TRAINER) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_BATTERY_COMPARTMENT, 0, Qt::UserRole - 1);
|
||||
}
|
||||
|
||||
if (generalSettings.bluetoothMode != 2) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_BLUETOOTH, 0, Qt::UserRole - 1);
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_SLAVE_BLUETOOTH, 0, Qt::UserRole - 1);
|
||||
}
|
||||
|
||||
if (!IS_JUMPER_T16(firmware->getBoard())) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MULTI, 0, Qt::UserRole - 1);
|
||||
}
|
||||
|
||||
ui->trainerMode->setCurrentIndex(model.trainerMode);
|
||||
if (!IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
||||
ui->label_trainerMode->hide();
|
||||
|
||||
@@ -934,6 +934,21 @@
|
||||
<string>Master/SBUS in battery compartment</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Master/Bluetooth</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Slave/Bluetooth</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Master/Multi</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="2">
|
||||
|
||||
Reference in New Issue
Block a user