Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Side_back_in_expos_is_it_useful

This commit is contained in:
Andre Bernet
2014-03-20 21:37:29 +01:00
93 changed files with 6181 additions and 1893 deletions
+38 -3
View File
@@ -500,8 +500,10 @@ void Setup::on_trimIncrement_currentIndexChanged(int index)
void Setup::on_throttleSource_currentIndexChanged(int index)
{
model.thrTraceSrc = index;
emit modified();
if (!lock) {
model.thrTraceSrc = ui->throttleSource->itemData(index).toInt();
emit modified();
}
}
void Setup::on_name_editingFinished()
@@ -543,12 +545,45 @@ void Setup::on_image_currentIndexChanged(int index)
}
}
void Setup::populateThrottleSourceCB()
{
const QString sources9x[] = { QObject::tr("THR"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
const QString sourcesTaranis[] = { QObject::tr("THR"), QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS")};
unsigned int i;
lock = true;
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (i=0; i<6; i++) {
ui->throttleSource->addItem(sourcesTaranis[i], i);
}
}
else {
for (i=0; i<4; i++) {
ui->throttleSource->addItem(sources9x[i], i);
}
}
if (model.thrTraceSrc < i)
ui->throttleSource->setCurrentIndex(model.thrTraceSrc);
int channels = (IS_ARM(GetEepromInterface()->getBoard()) ? 32 : 16);
for (int i=0; i<channels; i++) {
ui->throttleSource->addItem(QObject::tr("CH%1").arg(i+1, 2, 10, QChar('0')), THROTTLE_SOURCE_FIRST_CHANNEL+i);
if (model.thrTraceSrc == unsigned(THROTTLE_SOURCE_FIRST_CHANNEL+i))
ui->throttleSource->setCurrentIndex(ui->throttleSource->count()-1);
}
lock = false;
}
void Setup::update()
{
ui->name->setText(model.name);
ui->throttleReverse->setChecked(model.throttleReversed);
populateTTraceCB(ui->throttleSource, model.thrTraceSrc);
populateThrottleSourceCB();
ui->throttleWarning->setChecked(!model.disableThrottleWarning);
//trim inc, thro trim, thro expo, instatrim
+2
View File
@@ -6,6 +6,7 @@
#include <QCheckBox>
#include <QSlider>
#include <QSpinBox>
#include <QComboBox>
#include <QLabel>
namespace Ui {
@@ -104,6 +105,7 @@ class Setup : public ModelPanel
void updateStartupSwitches();
void updatePotWarnings();
void updateBeepCenter();
void populateThrottleSourceCB();
};
#endif // SETUP_H