1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

LP-525 Uncrustify

This commit is contained in:
Vladimir Zidar 2017-10-23 22:56:27 +02:00
parent f5c10ca611
commit 4bd3df43aa
5 changed files with 24 additions and 26 deletions

View File

@ -47,7 +47,7 @@ public:
void registerWidgets(ConfigTaskWidget &ct);
void refreshWidgetsValues(UAVObject *obj);
void setFeatures(quint32 features);
QComboBox *USBVCPComboBox();

View File

@ -52,7 +52,7 @@ private:
Ui_PikoBLXHWWidget *m_ui;
QComboBox *m_cbUART[HwPikoBLXSettings::UARTPORT_NUMELEM];
void updateFeatures();
bool optionConflict(int uartOption, int vcpOption);

View File

@ -51,15 +51,15 @@ ConfigSPRacingF3EVOHWWidget::ConfigSPRacingF3EVOHWWidget(QWidget *parent) : Conf
addWidgetBinding("HwSPRacingF3EVOSettings", "UARTPort", m_ui->cbUART3, 2, 1, true);
addWidgetBinding("HwSPRacingF3EVOSettings", "LEDPort", m_ui->cbLEDPort);
addWidgetBinding("HwSPRacingF3EVOSettings", "I2CPort", m_ui->cbI2C1);
m_cbUART[0] = m_ui->cbUART1;
m_cbUART[1] = m_ui->cbUART2;
m_cbUART[2] = m_ui->cbUART3;
for(quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
for (quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
connect(m_cbUART[i], static_cast<void(QComboBox::*) (int)>(&QComboBox::currentIndexChanged), this, &ConfigSPRacingF3EVOHWWidget::UARTxChanged);
}
m_ui->commonHWSettings->registerWidgets(*this);
connect(m_ui->commonHWSettings, &CommonHWSettingsWidget::USBVCPFunctionChanged, this, &ConfigSPRacingF3EVOHWWidget::USBVCPFunctionChanged);
@ -75,10 +75,10 @@ ConfigSPRacingF3EVOHWWidget::~ConfigSPRacingF3EVOHWWidget()
void ConfigSPRacingF3EVOHWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
{
// is this needed? This is to force sane state
// UART1Changed(0);
// UART2Changed(0);
// UART3Changed(0);
// UART1Changed(0);
// UART2Changed(0);
// UART3Changed(0);
m_ui->commonHWSettings->refreshWidgetsValues(obj);
}
@ -89,9 +89,9 @@ void ConfigSPRacingF3EVOHWWidget::updateObjectsFromWidgetsImpl()
void ConfigSPRacingF3EVOHWWidget::updateFeatures()
{
quint32 features = CommonHWSettingsWidget::F_USB;
quint32 features = CommonHWSettingsWidget::F_USB;
for(quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
for (quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
switch (getComboboxSelectedOption(m_cbUART[i])) {
case HwSPRacingF3EVOSettings::UARTPORT_TELEMETRY:
features |= CommonHWSettingsWidget::F_TELEMETRY;
@ -132,13 +132,13 @@ bool ConfigSPRacingF3EVOHWWidget::optionConflict(int uartOption, int vcpOption)
void ConfigSPRacingF3EVOHWWidget::UARTxChanged(int index)
{
Q_UNUSED(index);
QComboBox *cbUARTx = qobject_cast<QComboBox *>(sender());
if(!cbUARTx) {
if (!cbUARTx) {
return;
}
// Everything except HwSPRacingF3EVOSettings::UARTPORT_DISABLED and HwSPRacingF3EVOSettings::UARTPORT_DSM
// is allowed on single port only.
// HoTT SUMD & SUMH belong to the same receiver group, therefore cannot be configure at the same time
@ -151,8 +151,7 @@ void ConfigSPRacingF3EVOHWWidget::UARTxChanged(int index)
}
if (option != HwSPRacingF3EVOSettings::UARTPORT_DISABLED && option != HwSPRacingF3EVOSettings::UARTPORT_DSM) {
for(quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
for (quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
if (m_cbUART[i] == cbUARTx) {
continue;
}
@ -181,7 +180,7 @@ void ConfigSPRacingF3EVOHWWidget::USBVCPFunctionChanged(int index)
int vcpOption = getComboboxSelectedOption(m_ui->commonHWSettings->USBVCPComboBox());
for(quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
for (quint32 i = 0; i < HwSPRacingF3EVOSettings::UARTPORT_NUMELEM; ++i) {
if (optionConflict(getComboboxSelectedOption(m_cbUART[i]), vcpOption)) {
setComboboxSelectedOption(m_cbUART[i], HwSPRacingF3EVOSettings::UARTPORT_DISABLED);
}
@ -189,4 +188,3 @@ void ConfigSPRacingF3EVOHWWidget::USBVCPFunctionChanged(int index)
updateFeatures();
}

View File

@ -53,7 +53,7 @@ private:
Ui_SPRacingF3EVOHWWidget *m_ui;
QComboBox *m_cbUART[HwSPRacingF3EVOSettings::UARTPORT_NUMELEM];
void updateFeatures();
bool optionConflict(int uartOption, int vcpOption);

View File

@ -65,8 +65,8 @@ ConfigTinyFISHHWWidget::~ConfigTinyFISHHWWidget()
void ConfigTinyFISHHWWidget::refreshWidgetsValuesImpl(UAVObject *obj)
{
// UART3Changed(0);
// UART3Changed(0);
m_ui->commonHWSettings->refreshWidgetsValues(obj);
}
@ -118,10 +118,10 @@ bool ConfigTinyFISHHWWidget::optionConflict(int uartOption, int vcpOption)
void ConfigTinyFISHHWWidget::UARTxChanged(int index)
{
Q_UNUSED(index);
QComboBox *cbUARTx = qobject_cast<QComboBox *>(sender());
if(!cbUARTx) {
if (!cbUARTx) {
return;
}