1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00
This commit is contained in:
bsongis 2014-04-02 14:21:07 +02:00
parent 5a67212b20
commit a3344f399b
9 changed files with 123 additions and 32 deletions

View file

@ -451,6 +451,7 @@ class GeneralSettings {
bool frskyinternalalarm;
bool disableBG;
unsigned int splashMode;
int splashDuration;
uint8_t filterInput; // TODO enum
unsigned int backlightDelay;
bool blightinv;

View file

@ -2573,7 +2573,9 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new BoolField<1>(generalData.minuteBeep));
internalField.Append(new BoolField<1>(generalData.preBeep));
}
if (version >= 213 || (!IS_ARM(board) && version >= 212))
if (version >= 216 && IS_TARANIS(board))
internalField.Append(new SignedField<3>(generalData.splashDuration));
else if (version >= 213 || (!IS_ARM(board) && version >= 212))
internalField.Append(new UnsignedField<3>(generalData.splashMode)); // TODO
else
internalField.Append(new SpareBitsField<3>());

View file

@ -226,7 +226,14 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->memwarnChkB->setChecked(!g_eeGeneral.disableMemoryWarning); //Default is zero=checked
ui->alarmwarnChkB->setChecked(!g_eeGeneral.disableAlarmWarning);//Default is zero=checked
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
ui->splashScreenChkB->hide();
ui->splashScreenDuration->setCurrentIndex(3-g_eeGeneral.splashDuration);
}
else {
ui->splashScreenDuration->hide();
ui->splashScreenChkB->setChecked(!g_eeGeneral.splashMode);
}
ui->trnMode_1->setCurrentIndex(g_eeGeneral.trainer.mix[0].mode);
ui->trnChn_1->setCurrentIndex(g_eeGeneral.trainer.mix[0].src);
@ -853,6 +860,12 @@ void GeneralEdit::on_splashScreenChkB_stateChanged(int )
updateSettings();
}
void GeneralEdit::on_splashScreenDuration_currentIndexChanged(int index)
{
g_eeGeneral.splashDuration = 3-index;
updateSettings();
}
void GeneralEdit::on_PPM_MultiplierDSB_editingFinished()
{
g_eeGeneral.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;

View file

@ -44,6 +44,7 @@ private slots:
void on_hapticLengthCB_currentIndexChanged(int index);
void on_PPM_MultiplierDSB_editingFinished();
void on_splashScreenChkB_stateChanged(int);
void on_splashScreenDuration_currentIndexChanged(int index);
void on_alarmwarnChkB_stateChanged(int );
void on_gpsFormatCB_currentIndexChanged(int index);
void on_tabWidget_currentChanged(int index);

View file

@ -106,7 +106,7 @@
These will be relevant for all models in the same EEPROM.</string>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabSetup">
<attribute name="title">
@ -1582,31 +1582,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="splashScreenChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show splash screen on startup</string>
</property>
<property name="whatsThis">
<string>Show splash screen on startup</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_2">
<property name="toolTip">
@ -1850,6 +1825,85 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="12" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="splashScreenChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show splash screen on startup</string>
</property>
<property name="whatsThis">
<string>Show splash screen on startup</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="splashScreenDuration">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>---</string>
</property>
</item>
<item>
<property name="text">
<string>2s</string>
</property>
</item>
<item>
<property name="text">
<string>3s</string>
</property>
</item>
<item>
<property name="text">
<string>4s</string>
</property>
</item>
<item>
<property name="text">
<string>6s</string>
</property>
</item>
<item>
<property name="text">
<string>8s</string>
</property>
</item>
<item>
<property name="text">
<string>10s</string>
</property>
</item>
<item>
<property name="text">
<string>15s</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabTrainer">

View file

@ -546,8 +546,20 @@ void menuGeneralSetup(uint8_t event)
#if defined(SPLASH) && !defined(FSPLASH)
case ITEM_SETUP_DISABLE_SPLASH:
{
#if defined(PCBTARANIS)
lcd_putsLeft(y, STR_SPLASHSCREEN);
if (SPLASH_NEEDED()) {
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, SPLASH_TIMEOUT/100, attr|LEFT);
lcd_putc(lcdLastPos, y, 's');
}
else {
lcd_putsiAtt(RADIO_SETUP_2ND_COLUMN, y, STR_MMMINV, 0, attr);
}
if (attr) g_eeGeneral.splashMode = -checkIncDecGen(event, -g_eeGeneral.splashMode, -3, 4);
#else
uint8_t b = 1-g_eeGeneral.splashMode;
g_eeGeneral.splashMode = 1 - onoffMenuItem(b, RADIO_SETUP_2ND_COLUMN, y, STR_SPLASHSCREEN, attr, event);
#endif
break;
}
#endif

View file

@ -339,8 +339,10 @@ enum BacklightMode {
#if defined(FSPLASH)
#define SPLASH_MODE uint8_t splashMode:3
#elif defined(PCBTARANIS)
#define SPLASH_MODE int8_t splashMode:3
#else
#define SPLASH_MODE uint8_t splashMode:1; uint8_t spare4:2
#define SPLASH_MODE uint8_t splashMode:1; uint8_t splashSpare:2
#endif
#define XPOTS_MULTIPOS_COUNT 6

View file

@ -2238,8 +2238,6 @@ bool readonlyUnlocked()
#if defined(SPLASH)
#define SPLASH_NEEDED() (!IS_DSM2_PROTOCOL(g_model.protocol) && !g_eeGeneral.splashMode)
inline void Splash()
{
lcd_clear();

View file

@ -523,8 +523,16 @@ enum BaseCurves {
#define THRCHK_DEADBAND 16
#if defined(PCBTARANIS)
#define SPLASH_NEEDED() (g_eeGeneral.splashMode != 3)
#else
#define SPLASH_NEEDED() (!IS_DSM2_PROTOCOL(g_model.protocol) && !g_eeGeneral.splashMode)
#endif
#if defined(FSPLASH)
#define SPLASH_TIMEOUT (g_eeGeneral.splashMode == 0 ? 60000/*infinite=10mn*/ : ((4*100) * (g_eeGeneral.splashMode & 0x03)))
#elif defined(PCBTARANIS)
#define SPLASH_TIMEOUT (g_eeGeneral.splashMode==-4 ? 1500 : (g_eeGeneral.splashMode<=0 ? (400-g_eeGeneral.splashMode*200) : (400-g_eeGeneral.splashMode*100)))
#else
#define SPLASH_TIMEOUT (4*100) // 4 seconds
#endif