Fixes #1200 - Needs tests!

This commit is contained in:
bsongis
2014-06-07 11:07:00 +02:00
parent 5de9f6c4a4
commit 93d6788605
21 changed files with 122 additions and 22 deletions
+1
View File
@@ -517,6 +517,7 @@ class GeneralSettings {
unsigned int gpsFormat;
int speakerVolume;
unsigned int backlightBright;
unsigned int switchesDelay;
int currentCalib;
int temperatureCalib;
int temperatureWarn;
@@ -2703,7 +2703,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new SpareBitsField<3>());
internalField.Append(new SignedField<2>((int &)generalData.hapticMode));
internalField.Append(new SpareBitsField<8>());
if (IS_ARM(board))
internalField.Append(new UnsignedField<8>(generalData.switchesDelay));
else
internalField.Append(new SpareBitsField<8>());
internalField.Append(new UnsignedField<8>(generalData.backlightDelay));
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
@@ -2736,7 +2740,6 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
}
if (IS_ARM(board)) {
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
internalField.Append(new SignedField<8>(generalData.currentCalib));
if (version >= 213) {
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
+16 -1
View File
@@ -51,7 +51,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->chkSG->setValue(switchstate & 0x3);
switchstate >>= 2;
ui->chkSH->setValue(switchstate & 0x3);
} else {
}
else {
for (int i=0; pmsl[i]; i++) {
pmsl[i]->hide();
}
@@ -305,6 +306,14 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->backlightColor2_label->hide();
}
if (IS_ARM(eepromInterface->getBoard())) {
ui->switchesDelay->setValue(10*g_eeGeneral.switchesDelay);
}
else {
ui->switchesDelay->hide();
ui->switchesDelayLabel->hide();
}
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " GeneralEdit");
}
@@ -516,6 +525,12 @@ void GeneralEdit::on_backlightautoSB_editingFinished()
}
}
void GeneralEdit::on_switchesDelay_valueChanged()
{
g_eeGeneral.switchesDelay = ui->switchesDelay->value() / 10;
updateSettings();
}
void GeneralEdit::on_backlightColor_SL_valueChanged()
{
g_eeGeneral.backlightColor = ui->backlightColor_SL->value();
+3 -2
View File
@@ -29,10 +29,10 @@ private:
void setSwitchDefPos();
void updateVarioPitchRange();
signals:
signals:
void modelValuesChanged();
private slots:
private slots:
void on_faimode_CB_stateChanged(int );
void on_speakerPitchSB_editingFinished();
void on_timezoneSB_editingFinished();
@@ -132,6 +132,7 @@ private slots:
void setValues();
void shrink();
void stickReverseEdited();
void on_switchesDelay_valueChanged();
};
#endif // GENERALEDIT_H
+46
View File
@@ -1968,6 +1968,52 @@ Mode 4:
</property>
</widget>
</item>
<item row="34" column="0">
<widget class="QLabel" name="switchesDelayLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Switches Delay (mid position)</string>
</property>
</widget>
</item>
<item row="34" column="1">
<widget class="QSpinBox" name="switchesDelay">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;LCD Screen Contrast&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Values can be 20-45&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="suffix">
<string> ms</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>250</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabTrainer">