Merge pull request #2087 from opentx/bsongis/issue_2056_set_rtc_from_gps

Fixes #2056 - Needs tests!
This commit is contained in:
Bertrand Songis
2015-03-22 18:53:59 +01:00
23 changed files with 370 additions and 276 deletions
+2 -2
View File
@@ -1095,7 +1095,8 @@ class GeneralSettings {
bool enableTelemetryAlarm;
BeeperMode hapticMode;
unsigned int stickMode; // TODO enum
int timezone;
int timezone;
bool adjustRTC;
bool optrexDisplay;
unsigned int inactivityTimer;
bool minuteBeep;
@@ -1246,7 +1247,6 @@ enum Capability {
NoTelemetryProtocol,
TelemetryCustomScreens,
TelemetryCustomScreensFieldsPerLine,
TelemetryTimeshift,
TelemetryMaxMultiplier,
HasVario,
HasVarioSink,
@@ -3157,7 +3157,12 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
internalField.Append(new UnsignedField<2>(generalData.stickMode));
internalField.Append(new SignedField<5>(generalData.timezone));
internalField.Append(new SpareBitsField<1>());
if (version >= 217 && IS_TARANIS(board)) {
internalField.Append(new BoolField<1>(generalData.adjustRTC));
}
else {
internalField.Append(new SpareBitsField<1>());
}
internalField.Append(new UnsignedField<8>(generalData.inactivityTimer));
if (IS_9X(board) && version >= 215) {
@@ -689,8 +689,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
return IS_TARANIS(board) ? 1 : 0;
case TelemetryUnits:
return 0;
case TelemetryTimeshift:
return 1;
case TelemetryMaxMultiplier:
return (IS_ARM(board) ? 32 : 8);
case PPMCenter:
+14 -8
View File
@@ -123,17 +123,16 @@ GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & general
ui->units_CB->setCurrentIndex(generalSettings.imperial);
}
if (!firmware->getCapability(TelemetryTimeshift)) {
ui->label_timezone->hide();
ui->timezoneSB->hide();
ui->timezoneSB->setDisabled(true);
ui->gpsFormatCB->hide();
ui->gpsFormatLabel->hide();
}
ui->gpsFormatCB->setCurrentIndex(generalSettings.gpsFormat);
ui->timezoneSB->setValue(generalSettings.timezone);
if (IS_TARANIS(firmware->getBoard())) {
ui->adjustRTC->setChecked(generalSettings.adjustRTC);
}
else {
ui->adjustRTC->hide();
}
if (!firmware->getCapability(OptrexDisplay)) {
ui->label_displayType->hide();
ui->displayTypeCB->setDisabled(true);
@@ -533,6 +532,13 @@ void GeneralSetupPanel::on_timezoneSB_editingFinished()
emit modified();
}
void GeneralSetupPanel::on_adjustRTC_stateChanged(int)
{
generalSettings.adjustRTC = ui->adjustRTC->isChecked();
emit modified();
}
void GeneralSetupPanel::on_inactimerSB_editingFinished()
{
generalSettings.inactivityTimer = ui->inactimerSB->value();
+2 -1
View File
@@ -19,7 +19,7 @@ class GeneralSetupPanel : public GeneralPanel
private slots:
void on_splashScreenChkB_stateChanged(int);
void on_splashScreenDuration_currentIndexChanged(int index);
void on_alarmwarnChkB_stateChanged(int );
void on_alarmwarnChkB_stateChanged(int);
void on_gpsFormatCB_currentIndexChanged(int index);
void on_displayTypeCB_currentIndexChanged(int index);
void on_BLBright_SB_editingFinished();
@@ -29,6 +29,7 @@ class GeneralSetupPanel : public GeneralPanel
void on_faimode_CB_stateChanged(int );
void on_speakerPitchSB_editingFinished();
void on_timezoneSB_editingFinished();
void on_adjustRTC_stateChanged(int);
void on_hapticStrength_valueChanged();
void on_soundModeCB_currentIndexChanged(int index);
void on_beeperlenCB_currentIndexChanged(int index);
+272 -255
View File
@@ -6,101 +6,29 @@
<rect>
<x>0</x>
<y>0</y>
<width>689</width>
<height>606</height>
<width>758</width>
<height>635</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0,0,0">
<item row="34" column="3">
<item row="36" column="0">
<widget class="QLabel" name="gpsFormatLabel">
<property name="text">
<string>GPS Coordinates</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_speakerPitch">
<property name="text">
<string>Speaker Pitch (spkr only)</string>
</property>
</widget>
</item>
<item row="36" column="4">
<widget class="QComboBox" name="voiceLang_CB"/>
</item>
<item row="33" column="3">
<item row="35" column="0">
<widget class="QLabel" name="units_label">
<property name="text">
<string>Measurement Units</string>
</property>
</widget>
</item>
<item row="34" column="4">
<widget class="QComboBox" name="gpsFormatCB">
<item>
<property name="text">
<string>hh° (N/S) mm' ss''.dd</string>
</property>
</item>
<item>
<property name="text">
<string>NMEA</string>
</property>
</item>
</widget>
</item>
<item row="35" column="4">
<widget class="QSpinBox" name="timezoneSB">
<property name="minimum">
<number>-14</number>
</property>
<property name="maximum">
<number>12</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="36" column="3">
<widget class="QLabel" name="VoiceLang_label">
<property name="text">
<string>Voice Language</string>
</property>
</widget>
</item>
<item row="35" column="3">
<widget class="QLabel" name="label_timezone">
<property name="text">
<string>Timeshift from UTC</string>
</property>
</widget>
</item>
<item row="33" column="4">
<widget class="QComboBox" name="units_CB">
<item>
<property name="text">
<string>Metric</string>
</property>
</item>
<item>
<property name="text">
<string>Imperial</string>
</property>
</item>
</widget>
</item>
<item row="31" column="3">
<widget class="QLabel" name="countrycode_label">
<property name="text">
<string>Country Code</string>
</property>
</widget>
</item>
<item row="31" column="4">
<widget class="QComboBox" name="countrycode_CB">
<item>
<property name="text">
@@ -119,6 +47,144 @@
</item>
</widget>
</item>
<item row="34" column="3">
<widget class="QLabel" name="label_faimode">
<property name="text">
<string>FAI Mode</string>
</property>
</widget>
</item>
<item row="35" column="3">
<widget class="QLabel" name="countrycode_label">
<property name="text">
<string>Country Code</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>
<item row="36" column="1">
<widget class="QComboBox" name="gpsFormatCB">
<item>
<property name="text">
<string>hh° (N/S) mm' ss''.dd</string>
</property>
</item>
<item>
<property name="text">
<string>NMEA</string>
</property>
</item>
</widget>
</item>
<item row="35" column="1">
<widget class="QComboBox" name="units_CB">
<item>
<property name="text">
<string>Metric</string>
</property>
</item>
<item>
<property name="text">
<string>Imperial</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_speakerPitch">
<property name="text">
<string>Speaker Pitch (spkr only)</string>
</property>
</widget>
</item>
<item row="37" column="4">
<widget class="QComboBox" name="voiceLang_CB"/>
</item>
<item row="37" column="3">
<widget class="QLabel" name="VoiceLang_label">
<property name="text">
<string>Voice Language</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSlider" name="hapticStrength">
<property name="minimum">
@@ -195,6 +261,41 @@
</item>
</layout>
</item>
<item row="16" column="1">
<widget class="QCheckBox" name="memwarnChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</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; text-decoration: underline;&quot;&gt;Warnings&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&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;These will define startup warnings.&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;Throttle warning - will alert if the throttle is not at idle during startup&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;Switch warning - will alert if switches are not in their defaul position&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;Memory warning - will alert if there's not a lot of memory left&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;Silent mode warning - will alert you if the beeper is set to quiet (0)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_beeperlen">
<property name="text">
@@ -247,7 +348,7 @@
</property>
</widget>
</item>
<item row="38" column="0" colspan="2">
<item row="39" column="0" colspan="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -1278,41 +1379,6 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="16" column="1">
<widget class="QCheckBox" name="memwarnChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</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; text-decoration: underline;&quot;&gt;Warnings&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&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;These will define startup warnings.&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;Throttle warning - will alert if the throttle is not at idle during startup&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;Switch warning - will alert if switches are not in their defaul position&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;Memory warning - will alert if there's not a lot of memory left&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;Silent mode warning - will alert you if the beeper is set to quiet (0)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="17" column="0">
<widget class="QLabel" name="mavbaud_label">
<property name="text">
@@ -1404,85 +1470,6 @@ p, li { white-space: pre-wrap; }
</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>
<item row="14" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
@@ -1607,19 +1594,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="33" column="0">
<widget class="QLabel" name="stickReverseLB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Stick reverse (order as above)</string>
</property>
</widget>
</item>
<item row="34" column="0">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
@@ -1633,13 +1607,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="35" column="0">
<widget class="QLabel" name="label_faimode">
<property name="text">
<string>FAI Mode</string>
</property>
</widget>
</item>
<item row="31" column="1">
<widget class="QComboBox" name="stickmodeCB">
<property name="toolTip">
@@ -1694,38 +1661,6 @@ Mode 4:
</item>
</widget>
</item>
<item row="33" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="stickReverse1">
<property name="text">
<string notr="true">1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse2">
<property name="text">
<string notr="true">2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse3">
<property name="text">
<string notr="true">3</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse4">
<property name="text">
<string notr="true">4</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="34" column="1">
<widget class="QComboBox" name="channelorderCB">
<property name="toolTip">
@@ -1862,17 +1797,7 @@ Mode 4:
</item>
</widget>
</item>
<item row="35" column="1">
<widget class="QCheckBox" name="faimode_CB">
<property name="toolTip">
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="36" column="0">
<item row="37" column="0">
<widget class="QLabel" name="switchesDelayLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@@ -1885,7 +1810,7 @@ Mode 4:
</property>
</widget>
</item>
<item row="36" column="1">
<item row="37" column="1">
<widget class="QSpinBox" name="switchesDelay">
<property name="toolTip">
<string/>
@@ -1932,6 +1857,98 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="36" column="3">
<widget class="QLabel" name="label_timezone">
<property name="text">
<string>Timeshift from UTC</string>
</property>
</widget>
</item>
<item row="31" column="4">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="stickReverse1">
<property name="text">
<string notr="true">1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse2">
<property name="text">
<string notr="true">2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse3">
<property name="text">
<string notr="true">3</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stickReverse4">
<property name="text">
<string notr="true">4</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="31" column="3">
<widget class="QLabel" name="stickReverseLB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Stick reverse</string>
</property>
</widget>
</item>
<item row="36" column="4">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QSpinBox" name="timezoneSB">
<property name="minimum">
<number>-14</number>
</property>
<property name="maximum">
<number>12</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="adjustRTC">
<property name="toolTip">
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>Adjust RTC</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="34" column="4">
<widget class="QCheckBox" name="faimode_CB">
<property name="toolTip">
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
+11 -1
View File
@@ -90,7 +90,9 @@ enum menuGeneralSetupItems {
CASE_REVPLUS(ITEM_SETUP_BACKLIGHT_COLOR)
ITEM_SETUP_FLASH_BEEP,
CASE_SPLASH_PARAM(ITEM_SETUP_DISABLE_SPLASH)
CASE_GPS(ITEM_SETUP_LABEL_GPS)
CASE_GPS(ITEM_SETUP_TIMEZONE)
CASE_GPS(ITEM_SETUP_ADJUST_RTC)
CASE_GPS(ITEM_SETUP_GPSFORMAT)
CASE_PXX(ITEM_SETUP_COUNTRYCODE)
ITEM_SETUP_LANGUAGE,
@@ -126,7 +128,7 @@ void menuGeneralSetup(uint8_t event)
}
#endif
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
int sub = m_posVert;
@@ -412,12 +414,20 @@ void menuGeneralSetup(uint8_t event)
#endif
#if defined(FRSKY) && defined(FRSKY_HUB) && defined(GPS)
case ITEM_SETUP_LABEL_GPS:
lcd_putsLeft(y, STR_GPS);
break;
case ITEM_SETUP_TIMEZONE:
lcd_putsLeft(y, STR_TIMEZONE);
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
break;
case ITEM_SETUP_ADJUST_RTC:
g_eeGeneral.adjustRTC = onoffMenuItem(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, STR_ADJUST_RTC, attr, event);
break;
case ITEM_SETUP_GPSFORMAT:
g_eeGeneral.gpsFormat = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
break;
+1 -1
View File
@@ -742,7 +742,7 @@ PACK(typedef struct {
uint8_t disableAlarmWarning:1;
uint8_t stickMode:2;
int8_t timezone:5;
uint8_t spare1:1;
uint8_t adjustRTC:1;
uint8_t inactivityTimer;
uint8_t mavbaud:3;
SPLASH_MODE; /* 3bits */
+1 -1
View File
@@ -34,7 +34,7 @@
*
*/
#include "../opentx.h"
#include "../../opentx.h"
#if defined(REVX)
// TODO change this, not the right place
+5
View File
@@ -357,6 +357,11 @@ void telemetryWakeup()
uint8_t lastReceived = telemetryItems[i].lastReceived;
if (lastReceived < TELEMETRY_VALUE_TIMER_CYCLE && uint8_t(now - lastReceived) > TELEMETRY_VALUE_OLD_THRESHOLD) {
telemetryItems[i].lastReceived = TELEMETRY_VALUE_OLD;
TelemetrySensor * sensor = & g_model.telemetrySensors[i];
if (sensor->unit == UNIT_DATETIME) {
telemetryItems[i].datetime.datestate = 0;
telemetryItems[i].datetime.timestate = 0;
}
}
}
}
+30 -2
View File
@@ -52,13 +52,41 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t newVal, uin
datetime.year = (uint16_t) ((data & 0xff000000) >> 24);
datetime.month = (uint8_t) ((data & 0x00ff0000) >> 16);
datetime.day = (uint8_t) ((data & 0x0000ff00) >> 8);
datetime.datestate = 1;
if (datetime.year != 0) {
datetime.datestate = 1;
}
#if defined(RTCLOCK)
if (g_eeGeneral.adjustRTC && (datetime.datestate == 1)) {
struct gtm t;
gettime(&t);
t.tm_year = datetime.year+4;
t.tm_mon = datetime.month-1;
t.tm_mday = datetime.day;
rtcSetTime(&t);
}
#endif
}
else {
datetime.hour = ((uint8_t) ((data & 0xff000000) >> 24) + g_eeGeneral.timezone + 24) % 24;
datetime.min = (uint8_t) ((data & 0x00ff0000) >> 16);
datetime.sec = (uint16_t) ((data & 0x0000ff00) >> 8);
datetime.timestate = 1;
if (datetime.datestate == 1) {
datetime.timestate = 1;
}
#if defined(RTCLOCK)
if (g_eeGeneral.adjustRTC && (datetime.datestate == 1)) {
struct gtm t;
gettime(&t);
if (abs((t.tm_hour-datetime.hour)*3600 + (t.tm_min-datetime.min)*60 + (t.tm_sec-datetime.sec)) > 20) {
// we adjust RTC only if difference is > 20 seconds
t.tm_hour = datetime.hour;
t.tm_min = datetime.min;
t.tm_sec = datetime.sec;
g_rtcTime = gmktime(&t); // update local timestamp and get wday calculated
rtcSetTime(&t);
}
}
#endif
}
if (datetime.year == 0) {
return;
+2
View File
@@ -248,6 +248,8 @@ const pm_char STR_THROTTLEWARNING[] PROGMEM = TR_THROTTLEWARNING;
const pm_char STR_SWITCHWARNING[] PROGMEM = TR_SWITCHWARNING;
#ifdef FRSKY
const pm_char STR_TIMEZONE[] PROGMEM = TR_TIMEZONE;
const pm_char STR_ADJUST_RTC[] PROGMEM = TR_ADJUST_RTC;
const pm_char STR_GPS[] PROGMEM = TR_GPS;
const pm_char STR_GPSCOORD[] PROGMEM = TR_GPSCOORD;
const pm_char STR_VARIO[] PROGMEM = TR_VARIO;
const pm_char STR_PITCH_AT_ZERO[] PROGMEM = TR_PITCH_AT_ZERO;
+2
View File
@@ -427,6 +427,8 @@ extern const pm_char STR_SPLASHSCREEN[];
extern const pm_char STR_THROTTLEWARNING[];
extern const pm_char STR_SWITCHWARNING[];
extern const pm_char STR_TIMEZONE[];
extern const pm_char STR_ADJUST_RTC[];
extern const pm_char STR_GPS[];
extern const pm_char STR_GPSCOORD[];
extern const pm_char STR_VARIO[];
extern const pm_char STR_PITCH_AT_ZERO[];
+2
View File
@@ -670,6 +670,8 @@
#define TR_SWITCHWARNING TR("* Spínače", INDENT "Polohy spínačů")
#define TR_POTWARNING TR("* Potenc.", INDENT "Nastavení Pot.")
#define TR_TIMEZONE "časové pásmo"
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD TR("Pořadí kanálů", "Výchozí pořadí kanálů")
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"
+2
View File
@@ -669,6 +669,8 @@
#define TR_SWITCHWARNING TR("Sch. Alarm", INDENT "Schalter-Alarm")
#define TR_POTWARNING TR("Pot Warn.", INDENT "Poti-Warnung")
#define TR_TIMEZONE TR("Zeitzone", "GPS-Zeitzone +/-Std")
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD TR("Kanalanordnung", "Kanalvoreinstellung")
#define TR_STICKS "Knüppel"
#define TR_POTS "Potis"
+4 -2
View File
@@ -668,7 +668,9 @@
#define TR_THROTTLEWARNING TR(IF_CPUARM(INDENT) "T-Warning", INDENT "Throttle State")
#define TR_SWITCHWARNING TR(IF_CPUARM(INDENT) "S-Warning", INDENT "Switch Positions")
#define TR_POTWARNING TR(IF_CPUARM(INDENT) "Pot Warn.", INDENT "Pot Positions")
#define TR_TIMEZONE TR("Time Zone", "GPS Time zone")
#define TR_TIMEZONE TR("Time Zone", INDENT "Time zone")
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD TR("Rx Channel Ord", "Default channel order")
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"
@@ -771,7 +773,7 @@
#define TR_MINRSSI "Min Rssi"
#define TR_LATITUDE "Latitude"
#define TR_LONGITUDE "Longitude"
#define TR_GPSCOORD TR("GPS Coords", "GPS coordinate format")
#define TR_GPSCOORD TR("GPS Coords", INDENT "Coordinate format")
#define TR_VARIO TR("Vario", "Variometer")
#define TR_PITCH_AT_ZERO INDENT "Pitch at Zero"
#define TR_PITCH_AT_MAX INDENT "Pitch at Max"
+2
View File
@@ -618,6 +618,8 @@
#define TR_SWITCHWARNING TR("Aviso-I", INDENT "Aviso Intrptor")
#define TR_POTWARNING TR("Pot Warn.", INDENT "Pot Warning")
#define TR_TIMEZONE TR("Zona Hora", "GPS Zona Hora")
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD TR("Rx Orden canal", "Orden habitual canales")
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"
+2
View File
@@ -618,6 +618,8 @@
#define TR_SWITCHWARNING TR("S-Warning", INDENT "Switch Warning")
#define TR_POTWARNING TR("Pot Warn.", INDENT "Pot Warning")
#define TR_TIMEZONE TR("Time Zone","GPS Time zone")
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD TR("Rx Channel Ord","Default channel order")
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"
+2
View File
@@ -673,6 +673,8 @@
#define TR_SWITCHWARNING TR(IF_CPUARM(INDENT) "Alerte int", INDENT "Pos. interrupteurs")
#define TR_POTWARNING TR(IF_CPUARM(INDENT) "Alerte pot", INDENT "Pos. potentios")
#define TR_TIMEZONE "Fuseau horaire"
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD TR("Ordre voies RX","Ordre des voies préféré")
#define TR_STICKS "Manches"
#define TR_POTS "Potentios"
+2
View File
@@ -618,6 +618,8 @@
#define TR_SWITCHWARNING TR("Avv. Int.", INDENT "Avviso Interr.")
#define TR_POTWARNING TR("Avv. Pot.", INDENT "Avviso Pot.")
#define TR_TIMEZONE "Ora locale"
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD "Ordine ch RX"
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"
+2
View File
@@ -616,6 +616,8 @@
#define TR_SWITCHWARNING TR(IF_CPUARM(INDENT) "OstrzPrzeł", INDENT "PozycjaPrzeł")
#define TR_POTWARNING TR(IF_CPUARM(INDENT) "Ostrz.Poten.", INDENT "PozycjaPotencj.")
#define TR_TIMEZONE TR("Strefa czasowa" ,"Strefa czasowa GPS")
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD TR("KolejnKan.RX", "Bazowa kolejność kanałów")
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"
+2
View File
@@ -618,6 +618,8 @@
#define TR_SWITCHWARNING TR("Avisa Chav", INDENT "Avisa Chav")
#define TR_POTWARNING TR("Pot Warn.", INDENT "Pot Warning")
#define TR_TIMEZONE "Time Zone"
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD "Ordem Canal RX"
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"
+2
View File
@@ -618,6 +618,8 @@
#define TR_SWITCHWARNING TR("Bryt.varn.", INDENT "Brytarvarning")
#define TR_POTWARNING TR("Rattvarn.", INDENT "Rattvarning")
#define TR_TIMEZONE TR("Tidszon", "GPS Tidszon")
#define TR_ADJUST_RTC INDENT "Adjust RTC"
#define TR_GPS "GPS"
#define TR_RXCHANNELORD "Kanaler i RX"
#define TR_STICKS "Sticks"
#define TR_POTS "Pots"