mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-28 17:54:15 +01:00
Uncrustify
This commit is contained in:
parent
9e6d71120b
commit
14d4156d1f
@ -636,7 +636,7 @@ void ConfigInputWidget::wizardSetUpStep(enum wizardSteps step)
|
|||||||
case wizardChooseMode:
|
case wizardChooseMode:
|
||||||
{
|
{
|
||||||
wizardUi->wzBack->setEnabled(true);
|
wizardUi->wzBack->setEnabled(true);
|
||||||
QRadioButton* modeButtons[] = {
|
QRadioButton *modeButtons[] = {
|
||||||
wizardUi->mode1Button,
|
wizardUi->mode1Button,
|
||||||
wizardUi->mode2Button,
|
wizardUi->mode2Button,
|
||||||
wizardUi->mode3Button,
|
wizardUi->mode3Button,
|
||||||
@ -755,20 +755,20 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case wizardChooseMode:
|
case wizardChooseMode:
|
||||||
{
|
{
|
||||||
QRadioButton* modeButtons[] = {
|
QRadioButton *modeButtons[] = {
|
||||||
wizardUi->mode1Button,
|
wizardUi->mode1Button,
|
||||||
wizardUi->mode2Button,
|
wizardUi->mode2Button,
|
||||||
wizardUi->mode3Button,
|
wizardUi->mode3Button,
|
||||||
wizardUi->mode4Button
|
wizardUi->mode4Button
|
||||||
};
|
};
|
||||||
for (int i = mode1; i <= mode4; ++i) {
|
for (int i = mode1; i <= mode4; ++i) {
|
||||||
if (modeButtons[i]->isChecked()) {
|
if (modeButtons[i]->isChecked()) {
|
||||||
transmitterMode = static_cast<txMode>(i);
|
transmitterMode = static_cast<txMode>(i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
case wizardIdentifySticks:
|
case wizardIdentifySticks:
|
||||||
disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(identifyControls()));
|
disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(identifyControls()));
|
||||||
wizardUi->wzNext->setEnabled(true);
|
wizardUi->wzNext->setEnabled(true);
|
||||||
@ -861,7 +861,7 @@ void ConfigInputWidget::setChannel(int newChan)
|
|||||||
wizardUi->identifyStickInstructions->setText(QString(tr("Please disable throttle hold mode.\n\nMove the Throttle stick.")));
|
wizardUi->identifyStickInstructions->setText(QString(tr("Please disable throttle hold mode.\n\nMove the Throttle stick.")));
|
||||||
} else {
|
} else {
|
||||||
wizardUi->identifyStickInstructions->setText(QString(tr("Please move each control one at a time according to the instructions and picture below.\n\n"
|
wizardUi->identifyStickInstructions->setText(QString(tr("Please move each control one at a time according to the instructions and picture below.\n\n"
|
||||||
"Move the %1 stick.")).arg(manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan)));
|
"Move the %1 stick.")).arg(manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan).contains("Accessory")) {
|
if (manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan).contains("Accessory")) {
|
||||||
|
@ -93,7 +93,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
|
|||||||
|
|
||||||
// Associate the buttons with their UAVO fields
|
// Associate the buttons with their UAVO fields
|
||||||
addWidget(m_ui->spinningArmed);
|
addWidget(m_ui->spinningArmed);
|
||||||
MixerSettings* mixer = MixerSettings::GetInstance(getObjectManager());
|
MixerSettings *mixer = MixerSettings::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(mixer);
|
Q_ASSERT(mixer);
|
||||||
m_banks << OutputBankControls(mixer, m_ui->chBank1, QColor("#C6ECAE"), m_ui->cb_outputRate1, m_ui->cb_outputMode1);
|
m_banks << OutputBankControls(mixer, m_ui->chBank1, QColor("#C6ECAE"), m_ui->cb_outputRate1, m_ui->cb_outputMode1);
|
||||||
m_banks << OutputBankControls(mixer, m_ui->chBank2, QColor("#91E5D3"), m_ui->cb_outputRate2, m_ui->cb_outputMode2);
|
m_banks << OutputBankControls(mixer, m_ui->chBank2, QColor("#91E5D3"), m_ui->cb_outputRate2, m_ui->cb_outputMode2);
|
||||||
@ -110,7 +110,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
|
|||||||
|
|
||||||
controls.rateCombo()->addItem(tr("-"), QVariant(0));
|
controls.rateCombo()->addItem(tr("-"), QVariant(0));
|
||||||
controls.rateCombo()->model()->setData(controls.rateCombo()->model()->index(0, 0), QVariant(0), Qt::UserRole - 1);
|
controls.rateCombo()->model()->setData(controls.rateCombo()->model()->index(0, 0), QVariant(0), Qt::UserRole - 1);
|
||||||
foreach (int rate, rates) {
|
foreach(int rate, rates) {
|
||||||
controls.rateCombo()->addItem(tr("%1 Hz").arg(rate), rate);
|
controls.rateCombo()->addItem(tr("%1 Hz").arg(rate), rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +132,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
|
|||||||
ConfigOutputWidget::~ConfigOutputWidget()
|
ConfigOutputWidget::~ConfigOutputWidget()
|
||||||
{
|
{
|
||||||
SystemAlarms *systemAlarmsObj = SystemAlarms::GetInstance(getObjectManager());
|
SystemAlarms *systemAlarmsObj = SystemAlarms::GetInstance(getObjectManager());
|
||||||
|
|
||||||
disconnect(systemAlarmsObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateWarnings(UAVObject *)));
|
disconnect(systemAlarmsObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateWarnings(UAVObject *)));
|
||||||
foreach(OutputBankControls controls, m_banks) {
|
foreach(OutputBankControls controls, m_banks) {
|
||||||
disconnect(controls.modeCombo(), SIGNAL(currentIndexChanged(int)), this, SLOT(onBankTypeChange(int)));
|
disconnect(controls.modeCombo(), SIGNAL(currentIndexChanged(int)), this, SLOT(onBankTypeChange(int)));
|
||||||
@ -367,9 +368,10 @@ void ConfigOutputWidget::refreshWidgetsValues(UAVObject *obj)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(QString banklabel, bankLabels) {
|
foreach(QString banklabel, bankLabels) {
|
||||||
OutputBankControls controls = m_banks.at(i);
|
OutputBankControls controls = m_banks.at(i);
|
||||||
|
|
||||||
controls.label()->setText(banklabel);
|
controls.label()->setText(banklabel);
|
||||||
int index = controls.rateCombo()->findData(actuatorSettingsData.BankUpdateFreq[i]);
|
int index = controls.rateCombo()->findData(actuatorSettingsData.BankUpdateFreq[i]);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
controls.rateCombo()->addItem(tr("%1 Hz").arg(actuatorSettingsData.BankUpdateFreq[i]), actuatorSettingsData.BankUpdateFreq[i]);
|
controls.rateCombo()->addItem(tr("%1 Hz").arg(actuatorSettingsData.BankUpdateFreq[i]), actuatorSettingsData.BankUpdateFreq[i]);
|
||||||
}
|
}
|
||||||
controls.rateCombo()->setCurrentIndex(index);
|
controls.rateCombo()->setCurrentIndex(index);
|
||||||
@ -443,7 +445,8 @@ void ConfigOutputWidget::openHelp()
|
|||||||
|
|
||||||
void ConfigOutputWidget::onBankTypeChange()
|
void ConfigOutputWidget::onBankTypeChange()
|
||||||
{
|
{
|
||||||
QComboBox* bankModeCombo = qobject_cast<QComboBox*>(sender());
|
QComboBox *bankModeCombo = qobject_cast<QComboBox *>(sender());
|
||||||
|
|
||||||
if (bankModeCombo != NULL) {
|
if (bankModeCombo != NULL) {
|
||||||
foreach(OutputBankControls controls, m_banks) {
|
foreach(OutputBankControls controls, m_banks) {
|
||||||
if (controls.modeCombo() == bankModeCombo) {
|
if (controls.modeCombo() == bankModeCombo) {
|
||||||
@ -487,11 +490,9 @@ void ConfigOutputWidget::setWarning(QString message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OutputBankControls::OutputBankControls(MixerSettings* mixer, QLabel *label, QColor color, QComboBox *rateCombo, QComboBox *modeCombo) :
|
OutputBankControls::OutputBankControls(MixerSettings *mixer, QLabel *label, QColor color, QComboBox *rateCombo, QComboBox *modeCombo) :
|
||||||
m_mixer(mixer), m_label(label), m_color(color), m_rateCombo(rateCombo), m_modeCombo(modeCombo)
|
m_mixer(mixer), m_label(label), m_color(color), m_rateCombo(rateCombo), m_modeCombo(modeCombo)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
OutputBankControls::~OutputBankControls()
|
OutputBankControls::~OutputBankControls()
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
@ -46,20 +46,32 @@ class MixerSettings;
|
|||||||
|
|
||||||
class OutputBankControls {
|
class OutputBankControls {
|
||||||
public:
|
public:
|
||||||
OutputBankControls(MixerSettings *mixer, QLabel* label, QColor color, QComboBox* rateCombo, QComboBox* modeCombo);
|
OutputBankControls(MixerSettings *mixer, QLabel *label, QColor color, QComboBox *rateCombo, QComboBox *modeCombo);
|
||||||
virtual ~OutputBankControls();
|
virtual ~OutputBankControls();
|
||||||
|
|
||||||
QLabel *label() const { return m_label; }
|
QLabel *label() const
|
||||||
QColor color() const { return m_color; }
|
{
|
||||||
QComboBox *rateCombo() const { return m_rateCombo; }
|
return m_label;
|
||||||
QComboBox *modeCombo() const { return m_modeCombo; }
|
}
|
||||||
|
QColor color() const
|
||||||
|
{
|
||||||
|
return m_color;
|
||||||
|
}
|
||||||
|
QComboBox *rateCombo() const
|
||||||
|
{
|
||||||
|
return m_rateCombo;
|
||||||
|
}
|
||||||
|
QComboBox *modeCombo() const
|
||||||
|
{
|
||||||
|
return m_modeCombo;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MixerSettings* m_mixer;
|
MixerSettings *m_mixer;
|
||||||
QLabel* m_label;
|
QLabel *m_label;
|
||||||
QColor m_color;
|
QColor m_color;
|
||||||
QComboBox* m_rateCombo;
|
QComboBox *m_rateCombo;
|
||||||
QComboBox* m_modeCombo;
|
QComboBox *m_modeCombo;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConfigOutputWidget : public ConfigTaskWidget {
|
class ConfigOutputWidget : public ConfigTaskWidget {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user