[Companion] Horus fixes

This commit is contained in:
Bertrand Songis
2016-12-02 20:41:49 +01:00
parent 440ca771df
commit 8cd581f770
2 changed files with 14 additions and 37 deletions
@@ -562,7 +562,7 @@ int OpenTxFirmware::getCapability(Capability capability)
else if (IS_TARANIS_X9E(board))
return 4;
else if (IS_TARANIS(board))
return 3; //Taranis has only 2 pots but still has a placeholder in settings for 3 pots
return 3; // Taranis has only 2 pots but still has a placeholder in settings for 3 pots
else
return 3;
case Sliders:
@@ -908,7 +908,7 @@ bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
{
if (IS_TARANIS(board)) {
if (IS_TARANIS(board) || IS_HORUS(board)) {
switch (port) {
case 0:
switch (proto) {
+12 -35
View File
@@ -148,7 +148,7 @@ void TimerPanel::on_name_editingFinished()
#define FAILSAFE_CHANNEL_HOLD 2000
#define FAILSAFE_CHANNEL_NOPULSE 2001
ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, Firmware * firmware, int moduleIdx):
ModulePanel::ModulePanel(QWidget * parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, Firmware * firmware, int moduleIdx):
ModelPanel(parent, model, generalSettings, firmware),
module(module),
moduleIdx(moduleIdx),
@@ -174,7 +174,7 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
ui->label_trainerMode->hide();
ui->trainerMode->hide();
if (firmware->getCapability(NumModules) > 1) {
if (IS_TARANIS(firmware->getBoard())) {
if (IS_TARANIS(firmware->getBoard()) || IS_HORUS(firmware->getBoard())) {
if (moduleIdx == 0)
label = tr("Internal Radio System");
else
@@ -294,7 +294,7 @@ void ModulePanel::update()
break;
}
}
else if (IS_TARANIS(firmware->getBoard())) {
else if (IS_TARANIS(firmware->getBoard()) || IS_HORUS(firmware->getBoard())) {
if (model->trainerMode == TRAINER_SLAVE_JACK) {
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
}
@@ -851,40 +851,16 @@ void SetupPanel::on_image_currentIndexChanged(int index)
void SetupPanel::populateThrottleSourceCB()
{
const QString pots9x[] = { QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
const QString potsTaranis[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS")};
const QString potsTaranisX9E[] = { QObject::tr("F1"), QObject::tr("F2"), QObject::tr("F3"), QObject::tr("F4"), QObject::tr("S1"), QObject::tr("S2"), QObject::tr("LS"), QObject::tr("RS")};
unsigned int i;
lock = true;
ui->throttleSource->clear();
ui->throttleSource->addItem(QObject::tr("THR"));
if (IS_TARANIS_X9E(GetEepromInterface()->getBoard())) {
for (i=0; i<8; i++) {
ui->throttleSource->addItem(potsTaranisX9E[i], i);
}
for (int i=0; i<firmware->getCapability(Pots)+firmware->getCapability(Sliders); i++) {
ui->throttleSource->addItem(firmware->getAnalogInputName(4+i), i);
}
else if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (i=0; i<5; i++) {
ui->throttleSource->addItem(potsTaranis[i], i);
}
}
else {
for (i=0; i<3; i++) {
ui->throttleSource->addItem(pots9x[i], i);
}
}
int channels = (IS_ARM(GetEepromInterface()->getBoard()) ? 32 : 16);
for (int i=0; i<channels; i++) {
for (int i=0; i<firmware->getCapability(Outputs); i++) {
ui->throttleSource->addItem(ModelPrinter::printChannelName(i));
}
ui->throttleSource->setCurrentIndex(model->thrTraceSrc);
lock = false;
}
@@ -895,8 +871,6 @@ void SetupPanel::update()
ui->throttleReverse->setChecked(model->throttleReversed);
populateThrottleSourceCB();
ui->throttleWarning->setChecked(!model->disableThrottleWarning);
//trim inc, thro trim, thro expo, instatrim
ui->trimIncrement->setCurrentIndex(model->trimInc+2);
ui->throttleTrim->setChecked(model->thrTrim);
ui->extendedLimits->setChecked(model->extendedLimits);
@@ -911,12 +885,15 @@ void SetupPanel::update()
updatePotWarnings();
}
for (int i=0; i<firmware->getCapability(Timers); i++)
for (int i=0; i<firmware->getCapability(Timers); i++) {
timers[i]->update();
}
for (int i=0; i<CPN_MAX_MODULES+1; i++)
if (modules[i])
for (int i=0; i<CPN_MAX_MODULES+1; i++) {
if (modules[i]) {
modules[i]->update();
}
}
}
void SetupPanel::updateBeepCenter()