Implement R9M Companion support (#5157)
also implement (like with multi) own pxx struct for pxx options
This commit is contained in:
committed by
Bertrand Songis
parent
2f7694dee7
commit
8e84724c62
@@ -170,6 +170,7 @@ void TimerPanel::on_name_editingFinished()
|
||||
#define MASK_MULTIMODULE 128
|
||||
#define MASK_ANTENNA 256
|
||||
#define MASK_MULTIOPTION 512
|
||||
#define MASK_R9M 1024
|
||||
|
||||
quint8 ModulePanel::failsafesValueDisplayType = ModulePanel::FAILSAFE_DISPLAY_PERCENT;
|
||||
|
||||
@@ -366,11 +367,12 @@ void ModulePanel::update()
|
||||
if (moduleIdx >= 0) {
|
||||
mask |= MASK_PROTOCOL;
|
||||
switch (protocol) {
|
||||
case PULSES_PXX_R9M:
|
||||
mask |= MASK_R9M;
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
case PULSES_PXX_DJT:
|
||||
case PULSES_PXX_R9M:
|
||||
mask |= MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
|
||||
if (protocol==PULSES_PXX_XJT_X16 || protocol==PULSES_PXX_XJT_LR12 || protocol==PULSES_PXX_R9M)
|
||||
mask |= MASK_RX_NUMBER;
|
||||
@@ -457,7 +459,17 @@ void ModulePanel::update()
|
||||
// Antenna slection on Horus
|
||||
ui->label_antenna->setVisible(mask & MASK_ANTENNA);
|
||||
ui->antennaMode->setVisible(mask & MASK_ANTENNA);
|
||||
ui->antennaMode->setCurrentIndex(module.ppm.pulsePol);
|
||||
ui->antennaMode->setCurrentIndex(module.pxx.external_antenna);
|
||||
|
||||
// R9M S.port output
|
||||
ui->sportOut->setVisible(mask & MASK_R9M);
|
||||
ui->label_sportOut->setVisible(mask & MASK_R9M);
|
||||
ui->sportOut->setCurrentIndex(module.pxx.sport_out);
|
||||
|
||||
ui->r9mPower->setVisible(mask & MASK_R9M);
|
||||
ui->label_r9mPower->setVisible(mask & MASK_R9M);
|
||||
ui->r9mPower->setCurrentIndex(module.pxx.power);
|
||||
|
||||
|
||||
// Multi settings fields
|
||||
ui->label_multiProtocol->setVisible(mask & MASK_MULTIMODULE);
|
||||
@@ -561,7 +573,19 @@ void ModulePanel::on_ppmPolarity_currentIndexChanged(int index)
|
||||
|
||||
void ModulePanel::on_antennaMode_currentIndexChanged(int index)
|
||||
{
|
||||
module.ppm.pulsePol = index;
|
||||
module.pxx.external_antenna = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void ModulePanel::on_sportOut_currentIndexChanged(int index)
|
||||
{
|
||||
module.pxx.sport_out = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void ModulePanel::on_r9mPower_currentIndexChanged(int index)
|
||||
{
|
||||
module.pxx.power = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@ class ModulePanel : public ModelPanel
|
||||
void on_multiSubType_currentIndexChanged(int index);
|
||||
void on_autoBind_stateChanged(int state);
|
||||
void on_lowPower_stateChanged(int state);
|
||||
void on_sportOut_currentIndexChanged(int index);
|
||||
void on_r9mPower_currentIndexChanged(int index);
|
||||
void setChannelFailsafeValue(const int channel, const int value, quint8 updtSb = 0);
|
||||
void onFailsafeComboIndexChanged(int index);
|
||||
void onFailsafeUsecChanged(int value);
|
||||
|
||||
@@ -667,6 +667,64 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_sportOut">
|
||||
<property name="text">
|
||||
<string>S.port output</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="sportOut">
|
||||
<property name="currentText">
|
||||
<string>Disable</string>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Disable</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_r9mPower">
|
||||
<property name="text">
|
||||
<string>RF Output Power</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="r9mPower">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10 mW</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>100 mW</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>500 mW</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1000 mW</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
|
||||
Reference in New Issue
Block a user