@@ -50,15 +50,16 @@ ConfigPikoBLXHWWidget::ConfigPikoBLXHWWidget(QWidget *parent) : ConfigTaskWidget
5050 addWidgetBinding (" HwPikoBLXSettings" , " UARTPort" , m_ui->cbUART2 , 1 , 1 , true );
5151 addWidgetBinding (" HwPikoBLXSettings" , " UARTPort" , m_ui->cbUART3 , 2 , 1 , true );
5252 addWidgetBinding (" HwPikoBLXSettings" , " LEDPort" , m_ui->cbLEDPort );
53-
53+ addWidgetBinding (" HwPikoBLXSettings" , " PPMPort" , m_ui->cbPPMPort );
54+
5455 m_cbUART[0 ] = m_ui->cbUART1 ;
5556 m_cbUART[1 ] = m_ui->cbUART2 ;
5657 m_cbUART[2 ] = m_ui->cbUART3 ;
57-
58- for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
58+
59+ for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
5960 connect (m_cbUART[i], static_cast <void (QComboBox::*) (int )>(&QComboBox::currentIndexChanged), this , &ConfigPikoBLXHWWidget::UARTxChanged);
6061 }
61-
62+
6263 m_ui->commonHWSettings ->registerWidgets (*this );
6364
6465 connect (m_ui->commonHWSettings , &CommonHWSettingsWidget::USBVCPFunctionChanged, this , &ConfigPikoBLXHWWidget::USBVCPFunctionChanged);
@@ -74,10 +75,10 @@ ConfigPikoBLXHWWidget::~ConfigPikoBLXHWWidget()
7475void ConfigPikoBLXHWWidget::refreshWidgetsValuesImpl (UAVObject *obj)
7576{
7677// is this needed? This is to force sane state
77- // UART1Changed(0);
78- // UART2Changed(0);
79- // UART3Changed(0);
80-
78+ // UART1Changed(0);
79+ // UART2Changed(0);
80+ // UART3Changed(0);
81+
8182 m_ui->commonHWSettings ->refreshWidgetsValues (obj);
8283}
8384
@@ -88,9 +89,9 @@ void ConfigPikoBLXHWWidget::updateObjectsFromWidgetsImpl()
8889
8990void ConfigPikoBLXHWWidget::updateFeatures ()
9091{
91- quint32 features = CommonHWSettingsWidget::F_USB;
92+ quint32 features = CommonHWSettingsWidget::F_USB;
9293
93- for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
94+ for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
9495 switch (getComboboxSelectedOption (m_cbUART[i])) {
9596 case HwPikoBLXSettings::UARTPORT_TELEMETRY:
9697 features |= CommonHWSettingsWidget::F_TELEMETRY;
@@ -131,13 +132,13 @@ bool ConfigPikoBLXHWWidget::optionConflict(int uartOption, int vcpOption)
131132void ConfigPikoBLXHWWidget::UARTxChanged (int index)
132133{
133134 Q_UNUSED (index);
134-
135+
135136 QComboBox *cbUARTx = qobject_cast<QComboBox *>(sender ());
136-
137- if (!cbUARTx) {
137+
138+ if (!cbUARTx) {
138139 return ;
139140 }
140-
141+
141142 // Everything except HwPikoBLXSettings::UARTPORT_DISABLED and HwPikoBLXSettings::UARTPORT_DSM
142143 // is allowed on single port only.
143144 // HoTT SUMD & SUMH belong to the same receiver group, therefore cannot be configure at the same time
@@ -150,8 +151,7 @@ void ConfigPikoBLXHWWidget::UARTxChanged(int index)
150151 }
151152
152153 if (option != HwPikoBLXSettings::UARTPORT_DISABLED && option != HwPikoBLXSettings::UARTPORT_DSM) {
153-
154- for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
154+ for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
155155 if (m_cbUART[i] == cbUARTx) {
156156 continue ;
157157 }
@@ -180,12 +180,11 @@ void ConfigPikoBLXHWWidget::USBVCPFunctionChanged(int index)
180180
181181 int vcpOption = getComboboxSelectedOption (m_ui->commonHWSettings ->USBVCPComboBox ());
182182
183- for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
183+ for (quint32 i = 0 ; i < HwPikoBLXSettings::UARTPORT_NUMELEM; ++i) {
184184 if (optionConflict (getComboboxSelectedOption (m_cbUART[i]), vcpOption)) {
185185 setComboboxSelectedOption (m_cbUART[i], HwPikoBLXSettings::UARTPORT_DISABLED);
186186 }
187187 }
188188
189189 updateFeatures ();
190190}
191-
0 commit comments