Merge branch 'next' of https://github.com/opentx/opentx into bsongis/Issue524_SPORT_GPS

Conflicts:
	radio/src/translations.h
This commit is contained in:
Andre Bernet
2014-02-27 22:45:12 +01:00
262 changed files with 4040 additions and 2950 deletions
+5
View File
@@ -325,3 +325,8 @@ Reginald H Millsom
Emanuel Stassar
Pierluigi Sommaruga
Rafael Eric Suarez Nordlow
A Harris
Stefan Grunenberg
Francisco Gutierrez Muñoz
Steve Coley
+3 -3
View File
@@ -398,13 +398,13 @@ IF( APPLE )
ADD_CUSTOM_TARGET( addframeworks ALL
COMMAND mkdir -p companion.app/Contents/Frameworks
COMMAND mkdir -p companion.app/Contents/Resources
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND mkdir -p companion.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${PROJECT_NAME} )
+1 -1
View File
@@ -166,7 +166,7 @@ class Profile: protected CompStoreObj
void vBatWarn (const int);
Profile();
Profile& operator=(const Profile&);
Profile& operator=(const Profile&);
void remove();
bool existsOnDisk();
void init(int newIndex);
+19 -24
View File
@@ -60,13 +60,22 @@ void appPreferencesDialog::writeValues()
g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex());
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
g.profile[g.id()].name(ui->profileNameLE->text());
g.profile[g.id()].sdPath(ui->sdPath->text());
g.profile[g.id()].splashFile(ui->SplashFileName->text());
g.profile[g.id()].fwName(ui->fwNameLE->text());
g.profile[g.id()].fwType(ui->fwTypeLE->text());
saveProfile();
// The profile name may NEVER be empty
if (ui->profileNameLE->text().isEmpty())
g.profile[g.id()].name(tr("My Radio"));
else
g.profile[g.id()].name(ui->profileNameLE->text());
// If a new radio type has been choosen, several things need to change
if ( initialRadioType != ui->radioCB->currentIndex())
{
g.profile[g.id()].fwName("");
g.profile[g.id()].fwType(getDefaultFwType(ui->radioCB->currentIndex()));
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
}
}
void appPreferencesDialog::on_snapshotPathButton_clicked()
@@ -146,10 +155,11 @@ void appPreferencesDialog::initSettings()
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
ui->sdPath->setText(g.profile[g.id()].sdPath());
ui->profileNameLE->setText(g.profile[g.id()].name());
ui->fwNameLE->setText(g.profile[g.id()].fwName());
ui->fwTypeLE->setText(g.profile[g.id()].fwType());
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
initialRadioType = getRadioType(g.profile[g.id()].fwType());
ui->radioCB->setCurrentIndex(initialRadioType);
displayImage( g.profile[g.id()].splashFile() );
}
@@ -237,23 +247,6 @@ void appPreferencesDialog::on_sdPathButton_clicked()
}
}
void appPreferencesDialog::saveProfile()
{
// The profile name may NEVER be empty
if (ui->profileNameLE->text().isEmpty())
ui->profileNameLE->setText("----");
g.profile[g.id()].name( ui->profileNameLE->text() );
g.profile[g.id()].channelOrder( ui->channelorderCB->currentIndex());
g.profile[g.id()].defaultMode( ui->stickmodeCB->currentIndex());
g.profile[g.id()].burnFirmware( ui->burnFirmware->isChecked());
g.profile[g.id()].renameFwFiles( ui->renameFirmware->isChecked());
g.profile[g.id()].sdPath( ui->sdPath->text());
g.profile[g.id()].splashFile( ui->SplashFileName->text());
g.profile[g.id()].fwName( ui->fwNameLE->text());
g.profile[g.id()].fwType( ui->fwTypeLE->text());
}
void appPreferencesDialog::on_removeProfileButton_clicked()
{
if ( g.id() == 0 )
@@ -266,6 +259,7 @@ void appPreferencesDialog::on_removeProfileButton_clicked()
}
}
bool appPreferencesDialog::displayImage( QString fileName )
{
// Start by clearing the pixmap
@@ -310,3 +304,4 @@ void appPreferencesDialog::on_clearImageButton_clicked() {
+1 -1
View File
@@ -21,10 +21,10 @@ public:
Joystick *joystick;
private:
int initialRadioType;
Ui::appPreferencesDialog *ui;
void initSettings();
bool displayImage( QString fileName );
void saveProfile();
void loadProfileString(QString profile, QString label);
void loadFromProfile();
+73 -88
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>685</width>
<height>442</height>
<height>462</height>
</rect>
</property>
<property name="sizePolicy">
@@ -26,21 +26,12 @@
<string>Edit Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item row="2" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@@ -502,7 +493,7 @@
<string>Radio Settings Profile</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="11" column="1" colspan="4">
<item row="10" column="1" colspan="3">
<widget class="QComboBox" name="stickmodeCB">
<property name="maximumSize">
<size>
@@ -556,7 +547,7 @@ Mode 4:
</item>
</widget>
</item>
<item row="13" column="1" colspan="4">
<item row="12" column="1" colspan="3">
<widget class="QComboBox" name="channelorderCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -706,7 +697,7 @@ This is used by the templated to determine which channel goes to what number out
</item>
</widget>
</item>
<item row="11" column="0">
<item row="10" column="0">
<widget class="QLabel" name="label_14">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@@ -726,7 +717,7 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="16" column="1">
<item row="15" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -739,7 +730,7 @@ This is used by the templated to determine which channel goes to what number out
</property>
</spacer>
</item>
<item row="5" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@@ -752,7 +743,7 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="13" column="0">
<item row="12" column="0">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
@@ -768,14 +759,14 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="14" column="1" colspan="4">
<item row="13" column="1" colspan="3">
<widget class="QCheckBox" name="renameFirmware">
<property name="text">
<string>Append version number to FW file name</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="sdPathLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@@ -791,7 +782,7 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="sdPath">
<property name="enabled">
<bool>true</bool>
@@ -813,7 +804,7 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="3" column="5">
<item row="2" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -826,35 +817,35 @@ This is used by the templated to determine which channel goes to what number out
</property>
</spacer>
</item>
<item row="15" column="1" colspan="4">
<item row="14" column="1" colspan="3">
<widget class="QCheckBox" name="burnFirmware">
<property name="text">
<string>Offer to write FW to Tx after download</string>
</property>
</widget>
</item>
<item row="15" column="6">
<item row="14" column="5">
<widget class="QPushButton" name="removeProfileButton">
<property name="text">
<string>Remove Profile</string>
</property>
</widget>
</item>
<item row="3" column="6">
<item row="2" column="5">
<widget class="QPushButton" name="sdPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="10" column="1" colspan="6">
<item row="9" column="1" colspan="5">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="1" colspan="3">
<item row="4" column="1" colspan="2">
<widget class="QLineEdit" name="SplashFileName">
<property name="enabled">
<bool>true</bool>
@@ -876,46 +867,34 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Firmware Variant</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="fwTypeLE">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="5" column="6">
<item row="4" column="5">
<widget class="QPushButton" name="SplashSelect">
<property name="text">
<string>Select Image</string>
</property>
</widget>
</item>
<item row="8" column="6">
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Radio Type</string>
</property>
</widget>
</item>
<item row="7" column="5">
<widget class="QPushButton" name="clearImageButton">
<property name="text">
<string>Clear Image</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="5">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="profileNameLE">
<property name="minimumSize">
@@ -932,7 +911,7 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="8" column="1">
<item row="7" column="1">
<widget class="QLabel" name="imageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@@ -969,37 +948,43 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="4" column="1" colspan="6">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Firmware File</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="fwNameLE">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
<item row="1" column="1">
<widget class="QComboBox" name="radioCB">
<item>
<property name="text">
<string>9X</string>
</property>
</item>
<item>
<property name="text">
<string>9X with m128</string>
</property>
</item>
<item>
<property name="text">
<string>9XR</string>
</property>
</item>
<item>
<property name="text">
<string>9XR with m128</string>
</property>
</item>
<item>
<property name="text">
<string>Gruvin9x Board</string>
</property>
</item>
<item>
<property name="text">
<string>Sky9x Board</string>
</property>
</item>
<item>
<property name="text">
<string>Taranis</string>
</property>
</item>
</widget>
</item>
</layout>
+53 -114
View File
@@ -173,126 +173,65 @@
<file>images/library/00014.png</file>
<file>images/library/00015.png</file>
<file>images/library/00016.png</file>
<file>images/library/01001.png</file>
<file>images/library/01002.png</file>
<file>images/library/01003.png</file>
<file>images/library/01004.png</file>
<file>images/library/01005.png</file>
<file>images/library/01006.png</file>
<file>images/library/01007.png</file>
<file>images/library/01008.png</file>
<file>images/library/00017.png</file>
<file>images/library/00018.png</file>
<file>images/library/00019.png</file>
<file>images/library/00020.png</file>
<file>images/library/00050.png</file>
<file>images/library/00051.png</file>
<file>images/library/00052.png</file>
<file>images/library/00053.png</file>
<file>images/library/00054.png</file>
<file>images/library/00055.png</file>
<file>images/library/00056.png</file>
<file>images/library/00057.png</file>
<file>images/library/00058.png</file>
<file>images/library/00059.png</file>
<file>images/library/00060.png</file>
<file>images/library/00061.png</file>
<file>images/library/00062.png</file>
<file>images/library/00063.png</file>
<file>images/library/00064.png</file>
<file>images/library/00065.png</file>
<file>images/library/00066.png</file>
<file>images/library/00100.png</file>
<file>images/library/00101.png</file>
<file>images/library/00102.png</file>
<file>images/library/00103.png</file>
<file>images/library/00104.png</file>
<file>images/library/00105.png</file>
<file>images/library/00106.png</file>
<file>images/library/00201.png</file>
<file>images/library/00202.png</file>
<file>images/library/00203.png</file>
<file>images/library/00204.png</file>
<file>images/library/00301.png</file>
<file>images/library/00302.png</file>
<file>images/library/00303.png</file>
<file>images/library/00304.png</file>
<file>images/library/00401.png</file>
<file>images/library/00402.png</file>
<file>images/library/00403.png</file>
<file>images/library/00404.png</file>
<file>images/library/00501.png</file>
<file>images/library/10001.png</file>
<file>images/library/10002.png</file>
<file>images/library/10003.png</file>
<file>images/library/10004.png</file>
<file>images/library/10005.png</file>
<file>images/library/10006.png</file>
<file>images/library/10007.png</file>
<file>images/library/10008.png</file>
<file>images/library/10009.png</file>
<file>images/library/10010.png</file>
<file>images/library/10011.png</file>
<file>images/library/10012.png</file>
<file>images/library/10013.png</file>
<file>images/library/10014.png</file>
<file>images/library/10015.png</file>
<file>images/library/10016.png</file>
<file>images/library/10017.png</file>
<file>images/library/10018.png</file>
<file>images/library/10019.png</file>
<file>images/library/10020.png</file>
<file>images/library/10021.png</file>
<file>images/library/10022.png</file>
<file>images/library/10023.png</file>
<file>images/library/10024.png</file>
<file>images/library/10033.png</file>
<file>images/library/10034.png</file>
<file>images/library/10035.png</file>
<file>images/library/10036.png</file>
<file>images/library/10049.png</file>
<file>images/library/10050.png</file>
<file>images/library/10051.png</file>
<file>images/library/10052.png</file>
<file>images/library/10037.png</file>
<file>images/library/10038.png</file>
<file>images/library/10039.png</file>
<file>images/library/10040.png</file>
<file>images/library/10053.png</file>
<file>images/library/10054.png</file>
<file>images/library/10055.png</file>
<file>images/library/10056.png</file>
<file>images/library/10025.png</file>
<file>images/library/10026.png</file>
<file>images/library/10027.png</file>
<file>images/library/10028.png</file>
<file>images/library/10029.png</file>
<file>images/library/10030.png</file>
<file>images/library/10031.png</file>
<file>images/library/10032.png</file>
<file>images/library/10041.png</file>
<file>images/library/10042.png</file>
<file>images/library/10043.png</file>
<file>images/library/10044.png</file>
<file>images/library/10057.png</file>
<file>images/library/10058.png</file>
<file>images/library/10059.png</file>
<file>images/library/10060.png</file>
<file>images/library/10045.png</file>
<file>images/library/10046.png</file>
<file>images/library/10047.png</file>
<file>images/library/10048.png</file>
<file>images/library/10061.png</file>
<file>images/library/10062.png</file>
<file>images/library/10063.png</file>
<file>images/library/10064.png</file>
<file>images/library/10065.png</file>
<file>images/library/10066.png</file>
<file>images/library/10067.png</file>
<file>images/library/10068.png</file>
<file>images/library/10081.png</file>
<file>images/library/10082.png</file>
<file>images/library/10083.png</file>
<file>images/library/10084.png</file>
<file>images/library/10069.png</file>
<file>images/library/10070.png</file>
<file>images/library/10071.png</file>
<file>images/library/10072.png</file>
<file>images/library/10085.png</file>
<file>images/library/10086.png</file>
<file>images/library/10087.png</file>
<file>images/library/10088.png</file>
<file>images/library/10073.png</file>
<file>images/library/10074.png</file>
<file>images/library/10075.png</file>
<file>images/library/10076.png</file>
<file>images/library/10089.png</file>
<file>images/library/10090.png</file>
<file>images/library/10091.png</file>
<file>images/library/10092.png</file>
<file>images/library/10077.png</file>
<file>images/library/10078.png</file>
<file>images/library/10079.png</file>
<file>images/library/10080.png</file>
<file>images/library/10093.png</file>
<file>images/library/10094.png</file>
<file>images/library/10095.png</file>
<file>images/library/10096.png</file>
<file>images/library/10097.png</file>
<file>images/library/10098.png</file>
<file>images/library/10099.png</file>
<file>images/library/10100.png</file>
<file>images/library/10101.png</file>
<file>images/library/10102.png</file>
<file>images/library/10103.png</file>
<file>images/library/10104.png</file>
<file>images/library/20001.png</file>
<file>images/library/20002.png</file>
<file>images/library/20003.png</file>
<file>images/library/20004.png</file>
<file>images/library/30001.png</file>
<file>images/library/30002.png</file>
<file>images/library/30003.png</file>
<file>images/library/30004.png</file>
<file>images/library/10501.png</file>
<file>images/library/10502.png</file>
<file>images/library/10503.png</file>
<file>images/library/10504.png</file>
<file>images/library/10505.png</file>
<file>images/library/10506.png</file>
<file>images/library/10508.png</file>
<file>images/library/10601.png</file>
<file>images/library/10701.png</file>
<file>images/library/10702.png</file>
<file>images/library/10801.png</file>
<file>images/library/10802.png</file>
<file>themes/monochrome/16/paintbrush.png</file>
<file>themes/monochrome/16/open.png</file>
<file>themes/monochrome/16/edit.png</file>
+8 -6
View File
@@ -650,12 +650,14 @@ class ConversionField: public TransformedField {
if (!error.isEmpty())
EEPROMWarnings += error + "\n";
}
else if (shift) {
if (shift) {
if (val < min) _field = min + shift;
else if (val > max) _field = max + shift;
else _field = val + shift;
}
else {
if (exportFunc) {
_field = exportFunc(val);
}
}
@@ -666,10 +668,10 @@ class ConversionField: public TransformedField {
if (table->importValue(_field, field))
return;
}
else if (shift) {
field = _field - shift;
}
else {
field = _field - shift;
if (importFunc) {
field = importFunc(_field);
}
+6 -3
View File
@@ -428,6 +428,8 @@ QString LogicalSwitchData::funcToString()
case LS_FN_DAPOS:
return QObject::tr("|d|>=x");
case LS_FN_VEQUAL:
return QObject::tr("a=x");
case LS_FN_VALMOSTEQUAL:
return QObject::tr("a~x");
case LS_FN_TIMER:
return QObject::tr("Timer");
@@ -539,9 +541,9 @@ QString LogicalSwitchData::toString(const ModelData & model)
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) {
if (delay)
result += QObject::tr(" Delay %1 sec").arg(delay/2.0);
result += QObject::tr(" Delay %1 sec").arg(delay/10.0);
if (duration)
result += QObject::tr(" Duration %1 sec").arg(duration/2.0);
result += QObject::tr(" Duration %1 sec").arg(duration/10.0);
}
return result;
@@ -940,6 +942,7 @@ void ModelData::setDefault(uint8_t id)
clear();
used = true;
sprintf(name, "MODEL%02d", id+1);
modelId = id+1;
}
int ModelData::getTrimValue(int phaseIdx, int trimIdx)
@@ -1048,7 +1051,7 @@ void RegisterFirmwares()
RegisterEepromInterfaces();
}
bool LoadEeprom(RadioData &radioData, uint8_t *eeprom, int size)
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
{
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
if (eepromInterface->load(radioData, eeprom, size))
+8 -4
View File
@@ -74,7 +74,7 @@ const uint8_t modn12x3[4][4]= {
#define C9X_MAX_ENCODERS 2
#define C9X_NUM_CHNOUT 32 // number of real output channels
#define C9X_NUM_CSW 32 // number of custom switches
#define C9X_MAX_CUSTOM_FUNCTIONS 32 // number of functions assigned to switches
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
#define C9X_NUM_MODULES 2
#define STK_RUD 1
@@ -462,6 +462,9 @@ class GeneralSettings {
int beepVolume;
int wavVolume;
int varioVolume;
int varioPitch;
int varioRange;
int varioRepeat;
int backgroundVolume;
unsigned int mavbaud;
unsigned int switchUnlockStates;
@@ -597,6 +600,7 @@ enum CSFunction {
LS_FN_DPOS,
LS_FN_DAPOS,
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
LS_FN_VALMOSTEQUAL,
LS_FN_TIMER,
LS_FN_STICKY,
LS_FN_STAY,
@@ -856,7 +860,7 @@ class ModuleData {
void clear() { memset(this, 0, sizeof(ModuleData)); }
};
#define C9X_MAX_SCRIPTS 3
#define C9X_MAX_SCRIPTS 7
#define C9X_MAX_SCRIPT_INPUTS 10
class ScriptData {
public:
@@ -1078,7 +1082,7 @@ class EEPROMInterface
inline BoardEnum getBoard() { return board; }
virtual bool load(RadioData &radioData, uint8_t *eeprom, int size) = 0;
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
@@ -1207,7 +1211,7 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
void RegisterFirmwares();
bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
bool LoadEeprom(RadioData &radioData, uint8_t *eeprom, int size);
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
bool LoadEepromXml(RadioData &radioData, QDomDocument &doc);
struct Option {
@@ -114,7 +114,7 @@ bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
return true;
}
bool Er9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying er9x import... ";
@@ -123,7 +123,7 @@ bool Er9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
return false;
}
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
}
+1 -1
View File
@@ -34,7 +34,7 @@ class Er9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, uint8_t * eeprom, int size);
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
@@ -151,7 +151,7 @@ bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
return true;
}
bool Ersky9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying ersky9x import... ";
@@ -160,7 +160,7 @@ bool Ersky9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
return false;
}
if (!efile->EeFsOpen(eeprom, size, BOARD_SKY9X)) {
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
std::cout << "wrong file system\n";
return false;
}
@@ -34,7 +34,7 @@ class Ersky9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, uint8_t * eeprom, int size);
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
@@ -99,7 +99,7 @@ bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
}
bool Gruvin9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying " << getName() << " import... ";
@@ -108,7 +108,7 @@ bool Gruvin9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
return false;
}
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
}
@@ -35,7 +35,7 @@ class Gruvin9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, uint8_t *eeprom, int size);
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
@@ -20,7 +20,7 @@
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
#define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14))
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : (IS_DBLEEPROM(board, version) ? 15 : 12))
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? 32 : (IS_DBLEEPROM(board, version) ? 24 : 16))
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : O9X_MAX_CURVES)
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
@@ -164,7 +164,7 @@ class SourcesConversionTable: public ConversionTable {
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<32; i++)
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
for (int i=0; i<3; i++) {
for (int i=0; i<7; i++) {
for (int j=0; j<6; j++) {
addConversion(RawSource(SOURCE_TYPE_LUA_INPUT, i*16+j), val++);
}
@@ -1063,8 +1063,10 @@ class LogicalSwitchesFunctionsTable: public ConversionTable {
int val=0;
bool afterrelease21March2013 = IS_AFTER_RELEASE_21_MARCH_2013(board, version);
addConversion(LS_FN_OFF, val++);
if (afterrelease21March2013)
if (IS_ARM(board) && version >= 216)
addConversion(LS_FN_VEQUAL, val++);
if (afterrelease21March2013)
addConversion(LS_FN_VALMOSTEQUAL, val++);
addConversion(LS_FN_VPOS, val++);
addConversion(LS_FN_VNEG, val++);
if (IS_ARM(board) && version >= 216) val++; // later RANGE
@@ -1196,8 +1198,9 @@ class LogicalSwitchField: public TransformedField {
if (IS_ARM(board)) {
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
internalField.Append(new UnsignedField<8>(csw.delay));
internalField.Append(new UnsignedField<8>(csw.duration));
int scale = (version >= 216 ? 0 : 5);
internalField.Append(new ConversionField< UnsignedField<8> >(csw.delay, 0, scale));
internalField.Append(new ConversionField< UnsignedField<8> >(csw.duration, 0, scale));
if (version >= 214) {
internalField.Append(new ConversionField< SignedField<8> >((int &)csw.andsw, andswitchesConversionTable, "AND switch"));
}
@@ -1260,6 +1263,49 @@ class LogicalSwitchField: public TransformedField {
else if (csw.func != LS_FN_OFF) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
csw.val2 = v2;
RawSource val1(csw.val1);
if (IS_ARM(board) && version < 216 && val1.type == SOURCE_TYPE_TELEMETRY) {
switch (val1.index) {
case TELEMETRY_SOURCE_TIMER1:
case TELEMETRY_SOURCE_TIMER2:
csw.val2 = (csw.val2 + 128) * 3;
break;
case TELEMETRY_SOURCE_ALT:
case TELEMETRY_SOURCE_GPS_ALT:
case TELEMETRY_SOURCE_ALT_MIN:
case TELEMETRY_SOURCE_ALT_MAX:
csw.val2 = (csw.val2 + 128) * 8 - 500;
break;
case TELEMETRY_SOURCE_RPM:
case TELEMETRY_SOURCE_RPM_MAX:
csw.val2 = (csw.val2 + 128) * 50;
break;
case TELEMETRY_SOURCE_T1:
case TELEMETRY_SOURCE_T2:
case TELEMETRY_SOURCE_T1_MAX:
case TELEMETRY_SOURCE_T2_MAX:
csw.val2 = (csw.val2 + 128) + 30;
break;
case TELEMETRY_SOURCE_CELL:
case TELEMETRY_SOURCE_HDG:
csw.val2 = (csw.val2 + 128) * 2;
break;
case TELEMETRY_SOURCE_DIST:
case TELEMETRY_SOURCE_DIST_MAX:
csw.val2 = (csw.val2 + 128) * 8;
break;
case TELEMETRY_SOURCE_CURRENT:
case TELEMETRY_SOURCE_POWER:
csw.val2 = (csw.val2 + 128) * 5;
break;
case TELEMETRY_SOURCE_CONSUMPTION:
csw.val2 = (csw.val2 + 128) * 20;
break;
default:
csw.val2 += 128;
break;
}
}
}
}
@@ -1429,7 +1475,9 @@ class ArmCustomFunctionField: public TransformedField {
internalField.Append(new SwitchField<8>(fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<8> >((unsigned int &)fn.func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
if (IS_TARANIS(board))
if (IS_TARANIS(board) && version >= 216)
internalField.Append(new CharField<8>(_param, false));
else if (IS_TARANIS(board))
internalField.Append(new CharField<10>(_param, false));
else
internalField.Append(new CharField<6>(_param, false));
@@ -2208,7 +2256,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
}
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<3; i++) {
for (int i=0; i<7; i++) {
ScriptData & script = modelData.scriptData[i];
internalField.Append(new ZCharField<10>(script.filename));
internalField.Append(new ZCharField<10>(script.name));
@@ -2375,6 +2423,11 @@ Open9xGeneralDataNew::Open9xGeneralDataNew(GeneralSettings & generalData, BoardE
internalField.Append(new SignedField<8>(generalData.beepVolume));
internalField.Append(new SignedField<8>(generalData.wavVolume));
internalField.Append(new SignedField<8>(generalData.varioVolume));
if (version >= 216) {
internalField.Append(new SignedField<8>(generalData.varioPitch));
internalField.Append(new SignedField<8>(generalData.varioRange));
internalField.Append(new SignedField<8>(generalData.varioRepeat));
}
internalField.Append(new SignedField<8>(generalData.backgroundVolume));
}
if (IS_TARANIS(board) && version >= 216) {
@@ -290,7 +290,7 @@ bool OpenTxInterface::loadxml(RadioData &radioData, QDomDocument &doc)
return false;
}
bool OpenTxInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
bool OpenTxInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying " << getName() << " import...";
@@ -305,7 +305,8 @@ bool OpenTxInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
if (notnull) {
std::cout << " wrong size (" << size << ")\n";
return false;
} else {
}
else {
QMessageBox::warning(NULL, "companion", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
size=2048;
}
@@ -315,7 +316,7 @@ bool OpenTxInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
}
}
if (!efile->EeFsOpen(eeprom, size, board)) {
if (!efile->EeFsOpen((uint8_t *)eeprom, size, board)) {
std::cout << " wrong file system\n";
return false;
}
@@ -517,7 +518,7 @@ int OpenTxInterface::getCapability(const Capability capability)
return (IS_TARANIS(board) ? 22 : 9);
case CustomFunctions:
if (IS_ARM(board))
return 32;
return 64;
else if (board==BOARD_GRUVIN9X||board==BOARD_M128)
return 24;
else
@@ -550,7 +551,7 @@ int OpenTxInterface::getCapability(const Capability capability)
case VoicesAsNumbers:
return (IS_ARM(board) ? 0 : 1);
case VoicesMaxLength:
return (IS_ARM(board) ? (IS_TARANIS(board) ? 10 : 6) : 0);
return (IS_ARM(board) ? (IS_TARANIS(board) ? 8 : 6) : 0);
case MultiLangVoice:
return (IS_ARM(board) ? 1 : 0);
case SoundPitch:
@@ -37,7 +37,7 @@ class OpenTxInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, uint8_t *eeprom, int size);
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
@@ -62,7 +62,7 @@ bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
return false;
}
bool Th9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{
std::cout << "trying th9x import... ";
@@ -71,7 +71,7 @@ bool Th9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
return false;
}
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
std::cout << "wrong file system\n";
return false;
}
+1 -1
View File
@@ -34,7 +34,7 @@ class Th9xInterface : public EEPROMInterface
virtual const int getMaxModels();
virtual bool load(RadioData &, uint8_t *eeprom, int size);
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
+1 -1
View File
@@ -52,7 +52,7 @@ FlashInterface::FlashInterface(QString fileName)
char * bin_flash = (char *)malloc(MAX_FSIZE);
flash_size = file.read(bin_flash, MAX_FSIZE);
flash = QByteArray(bin_flash, flash_size);
free(bin_flash);
free(bin_flash);
}
else {
flash = QByteArray(temp, flash_size);
+1 -1
View File
@@ -92,5 +92,5 @@ private:
protected:
bool isValidFlag;
};
#endif /* FLASHINTERFACE_H */
#endif /* FLASHINTERFACE_H */
+5 -1
View File
@@ -157,7 +157,11 @@
</widget>
</item>
<item row="3" column="2" colspan="3">
<widget class="QComboBox" name="downloadVerCB"/>
<widget class="QComboBox" name="downloadVerCB">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QComboBox" name="langCombo">
+1 -1
View File
@@ -74,7 +74,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
if (!name.isEmpty()) {
ui->profile_CB->addItem(name, i);
if (i==g.id()) {
ui->profile_CB->setCurrentIndex(ui->profile_CB->count());
ui->profile_CB->setCurrentIndex(ui->profile_CB->count()-1);
}
}
}
+25
View File
@@ -643,6 +643,7 @@ void populateCSWCB(QComboBox *b, int value)
int order[] = {
LS_FN_OFF,
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
LS_FN_VALMOSTEQUAL, // added at the end to avoid everything renumbered
LS_FN_VPOS,
LS_FN_VNEG,
// LS_FN_RANGE,
@@ -968,3 +969,27 @@ QPixmap makePixMap( QImage image, QString firmwareType )
}
return(QPixmap::fromImage(image));
}
int getRadioType(QString firmwareType)
{
if (firmwareType.contains( "taranis" )) return 6;
if (firmwareType.contains( "sky9x" )) return 5;
if (firmwareType.contains( "gruvin9x")) return 4;
if (firmwareType.contains( "9xr128" )) return 3;
if (firmwareType.contains( "9xr" )) return 2;
if (firmwareType.contains( "9x128" )) return 1;
return 0; // 9x
}
QString getDefaultFwType( int radioType )
{
switch (radioType){
case 6: return "opentx-taranis-en";
case 5: return "opentx-sky9x-en";
case 4: return "opentx-gruvin9x-en";
case 3: return "opentx-9xr128-en";
case 2: return "opentx-9xr-en";
case 1: return "opentx-9x128-en";
default: return "opentx-9x-en";
}
}
+7
View File
@@ -128,6 +128,13 @@ QString getFrSkySrc(int index);
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx);
// Format a pixmap to fit on the radio using a specific firmware
QPixmap makePixMap( QImage image, QString firmwareType );
// Return a radio type derived from a firmware type string
int getRadioType(QString firmwareType);
// Return the default firmware string for a specified radio
QString getDefaultFwType( int radioType );
#endif // HELPERS_H
Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 B

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 546 B

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 535 B

Before

Width:  |  Height:  |  Size: 872 B

After

Width:  |  Height:  |  Size: 872 B

Before

Width:  |  Height:  |  Size: 929 B

After

Width:  |  Height:  |  Size: 929 B

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

Some files were not shown because too many files have changed in this diff Show More