1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

Added Wizard option for flight timer.

This commit is contained in:
Kjell Kernen 2014-05-12 16:27:52 +02:00
parent 22697f9491
commit 9716fb04d2
7 changed files with 597 additions and 333 deletions

View file

@ -127,6 +127,15 @@ enum Switches {
SWITCH_SH1
};
enum TimerModes {
TMRMODE_NONE,
TMRMODE_ABS,
TMRMODE_THR,
TMRMODE_THR_REL,
TMRMODE_THR_TRG,
TMRMODE_FIRST_SWITCH
};
#define TRIM_LH_L 0
#define TRIM_LH_R 1
#define TRIM_LV_DN 2

File diff suppressed because it is too large Load diff

View file

@ -117,12 +117,20 @@ WizMix::operator ModelData()
model.funcSw[switchIndex].param = -100;
}
// Add the Throttle Timer option
if (options[THROTTLE_TIMER_OPTION] && throttleChannel >=0 ){
model.timers[timerIndex].mode.type = SWITCH_TYPE_SWITCH;
model.timers[timerIndex].mode.index = isTaranis ? -SWITCH_SF0 : -SWITCH_THR; // Taranis !SF-UP, 9X THR-DOWN
// Add the Flight Timer option
if (options[FLIGHT_TIMER_OPTION] ){
model.timers[timerIndex].mode.type = SWITCH_TYPE_TIMER_MODE;
model.timers[timerIndex].mode.index = TMRMODE_THR_TRG;
timerIndex++;
}
// Add the Throttle Timer option
if (options[THROTTLE_TIMER_OPTION] && throttleChannel >=0){
model.timers[timerIndex].mode.type = SWITCH_TYPE_TIMER_MODE;
model.timers[timerIndex].mode.index = TMRMODE_THR;
timerIndex++;
}
return model;
}

View file

@ -18,7 +18,6 @@
#include "eeprominterface.h"
#define WIZ_MAX_CHANNELS 8
#define WIZ_MAX_OPTIONS 2
// TODO use a constant common to the whole companion
// TODO when in the wizard use the getCapacity(...) to know how long the name can be
#define WIZ_MODEL_NAME_LENGTH 12
@ -40,7 +39,9 @@ enum Vehicle {
HELICOPTER
};
#define WIZ_MAX_OPTIONS 3
enum Options {
FLIGHT_TIMER_OPTION,
THROTTLE_CUT_OPTION,
THROTTLE_TIMER_OPTION
};

View file

@ -840,10 +840,12 @@ OptionsPage::OptionsPage(WizardDialog *dlg, QString image, QString title, QStrin
{
throttleCutRB = new QCheckBox(tr("Throttle Cut"));
throttleTimerRB = new QCheckBox(tr("Throttle Timer"));
flightTimerRB = new QCheckBox(tr("Flight Timer"));
QLayout *l = layout();
l->addWidget(throttleCutRB);
l->addWidget(throttleTimerRB);
l->addWidget(flightTimerRB);
}
void OptionsPage::initializePage(){
@ -853,6 +855,7 @@ void OptionsPage::initializePage(){
bool OptionsPage::validatePage(){
wizDlg->mix.options[THROTTLE_CUT_OPTION] = throttleCutRB->isChecked();
wizDlg->mix.options[THROTTLE_TIMER_OPTION] = throttleTimerRB->isChecked();
wizDlg->mix.options[FLIGHT_TIMER_OPTION] = flightTimerRB->isChecked();
return true;
}

View file

@ -342,6 +342,7 @@ public:
bool validatePage();
private:
QCheckBox *throttleCutRB;
QCheckBox *flightTimerRB;
QCheckBox *throttleTimerRB;
};

View file

@ -282,7 +282,7 @@
#if defined(CPUARM)
#define TR_TELEM_RESERVE "[--]"
#define TR_TELEM_TIME "Time"
#define TR_TELEM_TIME "Tid"
#define TR_SWR "SWR\0"
#define TR_RX_BATT "RxBt"
#define TR_A3_A4 "A3\0 ""A4\0 "