Merge branch 'origin/next'

This commit is contained in:
Dvogonen
2014-01-15 21:30:05 +01:00
183 changed files with 17546 additions and 44885 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ Bertrand Songis
Romolo Manfredini
André Bernet
Michael Blandford
Rob Thomson
Bryan J. Rentoul (aka Gruvin)
Cameron Weeks
Martin Hotař
@@ -17,4 +18,4 @@ Severino Anedda (splash screens)
Grootwitbaas - 9xforums.com (mac)
Adrian Amberg (splash screens)
Wallaguest1 - 9xforums.com (splash screens)
HC1969 - 9xforums.com (splash screens)
HC1969 - 9xforums.com (splash screens)
+17 -1
View File
@@ -166,7 +166,7 @@ Heiko Polig
Andrew Fernie
Marco Lange
Nick McMillan
Michel Baily (mensual)
Michel Baily (monthly)
Patrick Mullen
Scott Campbell
Erich Roeder
@@ -272,3 +272,19 @@ Kenneth Lilja (monthly)
R Wells
Uwe Jordt
Harald Wilczak
Bernhard Lohmann
Ferenc Koller
Robert Ferguson
Daniel Byers
Tyler Darby
Miguel Villalpando
Kim Dong Hoon
Terry McKinley
Walter Bell
wsTech - http://wstech.de
Clinton Linck
Gordon Stahl
Josep Clodas Sola
Thierry Martin
Peter Mauro
Mitchell Brenner
+58 -63
View File
@@ -1,4 +1,4 @@
PROJECT( companion9x )
PROJECT( companion )
SET( C9X_VERSION_MAJOR "1" )
SET( C9X_VERSION_MINOR "51" )
@@ -109,7 +109,9 @@ add_custom_command(
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
)
SET( companion9x_SRCS
add_subdirectory(modeledit)
SET( companion_SRCS
eeprominterface.cpp
hexinterface.cpp
flashinterface.cpp
@@ -124,28 +126,24 @@ SET( companion9x_SRCS
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
firmwares/gruvin9x/gruvin9xeeprom.cpp
firmwares/gruvin9x/gruvin9xinterface.cpp
firmwares/opentx/open9xeeprom.cpp
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xinterface.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
firmwares/opentx/open9xSky9xeeprom.cpp
firmwares/opentx/opentxinterface.cpp
firmwares/opentx/opentxTaranisSimulator.cpp
firmwares/opentx/open9xSky9xsimulator.cpp
firmwares/opentx/open9xGruvin9xsimulator.cpp
firmwares/opentx/open9xM128simulator.cpp
firmwares/opentx/open9xsimulator.cpp
firmwares/opentx/opentxSky9xsimulator.cpp
firmwares/opentx/opentxGruvin9xsimulator.cpp
firmwares/opentx/opentxM128simulator.cpp
firmwares/opentx/opentxsimulator.cpp
firmwares/ersky9x/ersky9xeeprom.cpp
firmwares/ersky9x/ersky9xinterface.cpp
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
node.cpp
edge.cpp
helpers.cpp
mdichild.cpp
generaledit.cpp
modeledit.cpp
modelslist.cpp
mountlist.cpp
mixerslist.cpp
avroutputdialog.cpp
preferencesdialog.cpp
burnconfigdialog.cpp
@@ -155,8 +153,6 @@ SET( companion9x_SRCS
burndialog.cpp
printdialog.cpp
fusesdialog.cpp
expodialog.cpp
mixerdialog.cpp
logsdialog.cpp
downloaddialog.cpp
simulatordialog.cpp
@@ -168,16 +164,14 @@ SET( companion9x_SRCS
qcustomplot.cpp
)
SET( companion9x_MOC_HDRS
SET( companion_MOC_HDRS
avroutputdialog.h
preferencesdialog.h
burnconfigdialog.h
comparedialog.h
printdialog.h
fusesdialog.h
mixerdialog.h
logsdialog.h
expodialog.h
contributorsdialog.h
customizesplashdialog.h
splashlibrary.h
@@ -191,31 +185,27 @@ SET( companion9x_MOC_HDRS
xmenuwidget.h
xsimulatordialog.h
generaledit.h
modeledit.h
modelslist.h
mixerslist.h
mdichild.h
mainwindow.h
myslider.h
modelconfigdialog.h
qcustomplot.h
helpers.h
)
SET( companion9x_UIS
SET( companion_UIS
mdichild.ui
avroutputdialog.ui
comparedialog.ui
fusesdialog.ui
expodialog.ui
logsdialog.ui
mixerdialog.ui
preferencesdialog.ui
simulatordialog.ui
xsimulatordialog.ui
burnconfigdialog.ui
downloaddialog.ui
generaledit.ui
modeledit.ui
printdialog.ui
contributorsdialog.ui
customizesplashdialog.ui
@@ -225,25 +215,25 @@ SET( companion9x_UIS
)
IF ( SDL_FOUND )
SET( companion9x_SRCS
${companion9x_SRCS}
SET( companion_SRCS
${companion_SRCS}
joystick.cpp
joystickdialog.cpp
)
SET( companion9x_MOC_HDRS
${companion9x_MOC_HDRS}
SET( companion_MOC_HDRS
${companion_MOC_HDRS}
joystick.h
joystickdialog.h
)
SET( companion9x_UIS
${companion9x_UIS}
SET( companion_UIS
${companion_UIS}
joystickdialog.ui
)
ENDIF( )
SET( companion9x_RCS
SET( companion_RCS
companion9x.qrc
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
)
@@ -286,7 +276,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${
SET( PATCH_FLAGS "--binary" )
IF( WIN32 )
SET( companion9x_SRCS ${companion9x_SRCS} icon.rc )
SET( companion_SRCS ${companion_SRCS} icon.rc )
IF ( NOT MSVC )
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
ENDIF( )
@@ -298,28 +288,33 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
SET( LANGUAGES he pt ru de fr it sv cs )
FOREACH( language ${LANGUAGES} )
SET( companion9x_TS ${companion9x_TS} translations/companion9x_${language}.ts )
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
ENDFOREACH( language )
QT4_WRAP_UI( companion9x_SRCS ${companion9x_UIS} )
QT4_WRAP_CPP( companion9x_SRCS ${companion9x_MOC_HDRS} )
QT4_ADD_TRANSLATION( companion9x_QM ${companion9x_TS} )
QT4_ADD_RESOURCES( companion9x_SRCS ${companion9x_RCS} )
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
IF( APPLE )
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion9x_SRCS} ${companion9x_QM} )
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
ELSE( )
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion9x_SRCS} ${companion9x_QM} )
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
ENDIF( )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
INSTALL( FILES companion9x.desktop DESTINATION share/applications )
INSTALL( FILES companion9x.png DESTINATION share/icons )
INSTALL( FILES companion.desktop DESTINATION share/applications )
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps )
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps )
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps )
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
INSTALL( FILES ../targets/linux/45-taranis.rules DESTINATION /etc/udev/rules.d/ )
# Linux specific code
SET(OperatingSystem "Linux")
@@ -329,13 +324,13 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF( WIN32 )
IF( MSVC )
SET( NSI_IN_FILE companion9x-vs.nsi.in )
SET( NSI_IN_FILE companion-vs.nsi.in )
ELSE( )
SET( NSI_IN_FILE companion9x-msys.nsi.in )
SET( NSI_IN_FILE companion-msys.nsi.in )
ENDIF( )
SET( SYSDIR "$ENV{windir}/system32" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion9x.nsi @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
"C:/Program Files/NSIS"
@@ -343,14 +338,14 @@ IF( WIN32 )
"C:/Programs/NSIS"
)
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companion9xInstall.exe
COMMAND "${NSIS_EXE}" ARGS companion9x.nsi
DEPENDS ${PROJECT_NAME} ${PROJECT_BINARY_DIR}/companion9x.nsi
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
COMMAND "${NSIS_EXE}" ARGS companion.nsi
DEPENDS ${PROJECT_NAME} ${PROJECT_BINARY_DIR}/companion.nsi
COMMENT "Windows NSIS Installer")
ADD_CUSTOM_TARGET( installer
DEPENDS ${PROJECT_BINARY_DIR}/companion9xInstall.exe
SOURCES ${PROJECT_BINARY_DIR}/companion9x.nsi)
DEPENDS ${PROJECT_BINARY_DIR}/companionInstall.exe
SOURCES ${PROJECT_BINARY_DIR}/companion.nsi)
ENDIF( )
IF( APPLE )
@@ -362,36 +357,36 @@ IF( APPLE )
ENDIF()
ADD_CUSTOM_TARGET( addframeworks ALL
COMMAND mkdir -p companion9x.app/Contents/Frameworks
COMMAND mkdir -p companion9x.app/Contents/Resources
COMMAND mkdir -p companion9x.app/Contents/translations
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion9x.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
COMMAND rsync ${PROJECT_SOURCE_DIR}/../macbuild/lib* companion9x.app/Contents/Frameworks
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../macbuild/libcrypto.1.0.0.dylib companion9x.app/Contents/Frameworks
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../macbuild/qt_menu.nib companion9x.app/Contents/Resources/
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion9x.app/Contents/translations
COMMAND ${QT_BINARY_DIR}/macdeployqt companion9x.app
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 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
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS ${PROJECT_NAME} )
ADD_CUSTOM_TARGET( makedmg
COMMAND ${QT_BINARY_DIR}/macdeployqt companion9x.app -dmg -no-plugins
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
WORKING_DIRECTORY ${WORK_DIR}
DEPENDS addframeworks )
ENDIF( )
ADD_CUSTOM_TARGET( stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion9x.stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion9x_TS} )
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
SET(CPACK_PACKAGE_NAME "COMPANION9X")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "EEPROM Editor for the openTx open source firmware")
SET(CPACK_PACKAGE_NAME "COMPANION")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
+8 -8
View File
@@ -58,7 +58,7 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
QFile exec;
winTitle=wTitle;
if (!(exec.exists(prog))) {
QMessageBox::critical(this, "companion9x", getProgrammer() + " " + tr("executable not found"));
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("executable not found"));
closeOpt = AVR_DIALOG_FORCE_CLOSE;
QTimer::singleShot(0, this, SLOT(forceClose()));
} else {
@@ -315,10 +315,10 @@ void avrOutputDialog::errorWizard()
}
}
if (fwexist==false) {
QMessageBox::warning(this, "companion9x - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr));
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr));
} else {
FirmwareInfo *firmware = GetCurrentFirmware();
QMessageBox::warning(this, "companion9x - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->name));
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->name));
}
}
}
@@ -416,24 +416,24 @@ void avrOutputDialog::doFinished(int code=0)
if (hasErrors || code) {
if (!cmdLine.isEmpty()) {
if (getProgrammer()!="AVRDUDE") {
QMessageBox::critical(this, "companion9x", getProgrammer() + " " + tr("did not finish correctly"));
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
} else {
int res = QMessageBox::question(this, "companion9x",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
int res = QMessageBox::question(this, "Companion",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
if (res != QMessageBox::No) {
errorWizard();
}
}
} else {
QMessageBox::critical(this, "companion9x", tr("Copy did not finish correctly"));
QMessageBox::critical(this, "Companion", tr("Copy did not finish correctly"));
}
// reject();
} else {
if (!cmdLine.isEmpty()) {
ui->progressBar->setValue(100);
QMessageBox::information(this, "companion9x", getProgrammer() + " " + tr("finished correctly"));
QMessageBox::information(this, "Companion", getProgrammer() + " " + tr("finished correctly"));
accept();
} else {
QMessageBox::information(this, "companion9x", tr("Copy finished correctly"));
QMessageBox::information(this, "Companion", tr("Copy finished correctly"));
accept();
}
}
+2 -2
View File
@@ -325,7 +325,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
QMessageBox::StandardButton ret = QMessageBox::No;
ret = QMessageBox::warning(this, tr("companion9x"),
ret = QMessageBox::warning(this, tr("Companion"),
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes)
@@ -394,7 +394,7 @@ void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
} else {
ui->label_av3->show();
ui->avrdude_mcu->show();
QMessageBox::warning(this, tr("companion9x"),
QMessageBox::warning(this, tr("Companion"),
tr("<b><u>WARNING!</u></b><br>Normally CPU type is automatically selected according to the chosen firmware.<br>If you change the CPU type the resulting eeprom could be inconsistent."),
QMessageBox::Ok);
}
+3 -3
View File
@@ -292,7 +292,7 @@ bool burnDialog::checkeEprom(QString fileName)
uint8_t eeprom[EESIZE_RLC_MAX];
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
if (!eeprom_size) {
int res = QMessageBox::question(this, "companion9x",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
@@ -302,7 +302,7 @@ bool burnDialog::checkeEprom(QString fileName)
}
file.close();
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "companion9x",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
@@ -325,7 +325,7 @@ bool burnDialog::checkeEprom(QString fileName)
return false;
}
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "companion9x",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) {
return false;
}
+1 -1
View File
@@ -273,7 +273,7 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Allows companion9x to write to older version of the firmware</string>
<string>Allows Companion to write to older version of the firmware</string>
</property>
<property name="text">
<string>Check Firmware compatibility</string>
+11
View File
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Companion
GenericName=Transmitter Companion App
Comment=The Ultimate Transmitter Companion
Icon=companion
Exec='companion'
Terminal=false
StartupNotify=false
Categories=Application
-11
View File
@@ -1,11 +0,0 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=companion9x
GenericName=COMPANION9X
Comment=9x EeProm Editor
Icon=/usr/share/icons/companion9x.png
Exec='companion9x'
Terminal=false
StartupNotify=false
Categories=Application
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

+1 -1
View File
@@ -48,7 +48,7 @@
<file>images/screenshot.png</file>
<file>images/splash.png</file>
<file>images/splasht.png</file>
<file>images/companion9x-title.png</file>
<file>images/companion-title.png</file>
<file>images/read_eeprom.png</file>
<file>images/write_eeprom.png</file>
<file>images/write_flash.png</file>
+15 -26
View File
@@ -21,7 +21,7 @@ public:
}
bool general_settings;
uint8_t models_count;
uint8_t models[C9XMAX_MODELS];
uint8_t models[C9X_MAX_MODELS];
};
compareDialog::compareDialog(QWidget *parent, GeneralSettings *gg) :
@@ -342,7 +342,7 @@ void compareDialog::printPhases()
gvars=1;
}
if (gvars==1) {
gvarnum=GetEepromInterface()->getCapability(GvarsNum);
gvarnum=GetEepromInterface()->getCapability(Gvars);
}
if ((gvars==1 && GetEepromInterface()->getCapability(GvarsFlightPhases)) || GetEepromInterface()->getCapability(RotaryEncoders)) {
str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
@@ -564,7 +564,7 @@ void compareDialog::printGvars()
int gvarnum=0;
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!GetEepromInterface()->getCapability(HasVariants) && GetEepromInterface()->getCapability(Gvars))) {
gvars=1;
gvarnum=GetEepromInterface()->getCapability(GvarsNum);
gvarnum=GetEepromInterface()->getCapability(Gvars);
}
if (!GetEepromInterface()->getCapability(GvarsFlightPhases) && (gvars==1 && GetEepromInterface()->getCapability(Gvars))) {
@@ -649,7 +649,8 @@ void compareDialog::printExpos()
};
str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' ');
str += " " + tr("Expo") + QString("%1").arg(getGVarString(ed->expo)).rightJustified(7, ' ');
str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (GetEepromInterface()->getCapability(FlightPhases)) {
if(ed->phases) {
if (ed->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) {
@@ -681,16 +682,14 @@ void compareDialog::printExpos()
mask <<=1;
}
str += QString(")");
} else {
}
else {
str += tr("DISABLED")+QString(" !!!");
}
}
}
if (ed->swtch.type)
str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString());
if (ed->curveMode)
if (ed->curveParam)
str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(ed->curveParam).replace("<", "&lt;").replace(">", "&gt;"));
str += "</font></td></tr>";
}
}
@@ -728,7 +727,8 @@ void compareDialog::printExpos()
}
str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' ');
str += " " + tr("Expo") + QString("%1").arg(getGVarString(ed->expo)).rightJustified(7, ' ');
str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (GetEepromInterface()->getCapability(FlightPhases)) {
if(ed->phases) {
if (ed->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) {
@@ -767,9 +767,7 @@ void compareDialog::printExpos()
}
if (ed->swtch.type)
str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString());
if (ed->curveMode)
if (ed->curveParam)
str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(ed->curveParam).replace("<", "&lt;").replace(">", "&gt;"));
str += "</font></td></tr>";
}
}
@@ -824,13 +822,8 @@ void compareDialog::printMixers()
str += md->srcRaw.toString();
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if(GetEepromInterface()->getCapability(MixFmTrim) && md->enableFmTrim==1){
if (md->sOffset) str += " "+ tr("FMTrim") + QString(" (%1%)").arg(md->sOffset);
} else {
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
}
if (md->differential) str += " "+ tr("Diff") + QString(" (%1%)").arg(getGVarString(md->differential));
if (md->curve) str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(md->curve).replace("<", "&lt;").replace(">", "&gt;"));
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
str += md->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
@@ -907,13 +900,9 @@ void compareDialog::printMixers()
str += md->srcRaw.toString();
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if(GetEepromInterface()->getCapability(MixFmTrim) && md->enableFmTrim==1){
if (md->sOffset) str += " "+ tr("FMTrim") + QString(" (%1%)").arg(getGVarString(md->sOffset));
} else {
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
}
if (md->differential) str += " "+ tr("Diff") + QString(" (%1%)").arg(getGVarString(md->differential));
if (md->curve) str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(md->curve).replace("<", "&lt;").replace(">", "&gt;"));
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
// TODO if (md->differential) str += " "+ tr("Diff") + QString(" (%1%)").arg(getGVarString(md->differential));
// TODO if (md->curve) str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(md->curve).replace("<", "&lt;").replace(">", "&gt;"));
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
+3 -2
View File
@@ -26,7 +26,8 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
ui->textBrowser->insertPlainText(file2.readAll());
}
ui->textBrowser->insertPlainText("\n\n\n");
ui->textBrowser->insertPlainText(tr("Honors go to Rafal Tomczak (RadioClone) and Thomas Husterer (th9x) \nof course. Also to Erez Raviv (er9x) and it's fantastic eePe, from which\ncompanion9x was forked out."));
ui->textBrowser->insertPlainText(tr(
"Honors go to Rafal Tomczak (RadioClone) and Thomas Husterer (th9x) \nof course. Also to Erez Raviv (er9x) and the fantastic eePe program \nwhich was the staring point for OpenTX Companion."));
ui->textBrowser->insertPlainText("\n\n");
ui->textBrowser->insertPlainText(tr("Thank you all !!!"));
ui->textBrowser->setReadOnly(true);
@@ -42,7 +43,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
}
ui->textBrowser->setReadOnly(true);
ui->textBrowser->verticalScrollBar()->setValue(0);
this->setWindowTitle(tr("Companion9x Release Notes"));
this->setWindowTitle(tr("Companion Release Notes"));
}
break;
case 2:{
+2 -2
View File
@@ -21,7 +21,7 @@ downloadDialog::downloadDialog(QWidget *parent, QString src, QString tgt) :
file = new QFile(tgt);
if (!file->open(QIODevice::WriteOnly)) {
QMessageBox::critical(this, "companion9x",
QMessageBox::critical(this, "Companion",
tr("Unable to save the file %1: %2.")
.arg(tgt).arg(file->errorString()));
QTimer::singleShot(0, this, SLOT(fileError()));
@@ -51,7 +51,7 @@ void downloadDialog::httpFinished()
if (reply->error())
{
file->remove();
QMessageBox::information(this, tr("companion9x"),
QMessageBox::information(this, tr("Companion"),
tr("Download failed: %1.")
.arg(reply->errorString()));
ok = false;
+28 -9
View File
@@ -74,7 +74,10 @@ class DataField {
QByteArray bytes = bitsToBytes(bits);
int result = (offset+bits.count()) % 8;
for (int i=0; i<level; i++) printf(" ");
printf("%s ", getName());
if (bits.count() % 8 == 0)
printf("%s (%dbytes) ", getName(), bytes.count());
else
printf("%s (%dbits) ", getName(), bits.count());
for (int i=0; i<bytes.count(); i++) {
unsigned char c = bytes[i];
if ((i==0 && offset) || (i==bytes.count()-1 && result!=0))
@@ -422,7 +425,7 @@ class StructField: public DataField {
virtual int Dump(int level=0, int offset=0)
{
for (int i=0; i<level; i++) printf(" ");
printf("%s\n", getName());
printf("%s (%d bytes)\n", getName(), size()/8);
foreach(DataField *field, fields) {
offset = field->Dump(level+1, offset);
}
@@ -547,6 +550,7 @@ class ConversionField: public TransformedField {
_field(0),
table(table),
shift(0),
scale(1),
min(INT_MIN),
max(INT_MAX),
exportFunc(NULL),
@@ -562,6 +566,7 @@ class ConversionField: public TransformedField {
_field(0),
table(table),
shift(0),
scale(0),
min(INT_MIN),
max(INT_MAX),
exportFunc(NULL),
@@ -577,6 +582,7 @@ class ConversionField: public TransformedField {
_field(0),
table(NULL),
shift(0),
scale(0),
min(INT_MIN),
max(INT_MAX),
exportFunc(exportFunc),
@@ -585,13 +591,14 @@ class ConversionField: public TransformedField {
{
}
ConversionField(int & field, int shift, int min=INT_MIN, int max=INT_MAX, const char *name = "Signed shifted"):
ConversionField(int & field, int shift, int scale=0, int min=INT_MIN, int max=INT_MAX, const char *name = "Signed shifted"):
TransformedField(internalField),
internalField(_field, name),
field(field),
_field(0),
table(NULL),
shift(shift),
scale(scale),
min(min),
max(max),
exportFunc(NULL),
@@ -600,13 +607,14 @@ class ConversionField: public TransformedField {
{
}
ConversionField(unsigned int & field, int shift):
ConversionField(unsigned int & field, int shift, int scale=0):
TransformedField(internalField),
internalField((unsigned int &)_field),
field((int &)field),
_field(0),
table(NULL),
shift(shift),
scale(scale),
min(INT_MIN),
max(INT_MAX),
exportFunc(NULL),
@@ -617,19 +625,25 @@ class ConversionField: public TransformedField {
virtual void beforeExport()
{
int val = field;
if (scale) {
val /= scale;
}
if (table) {
if (table->exportValue(field, _field))
if (table->exportValue(val, _field))
return;
if (!error.isEmpty())
EEPROMWarnings += error + "\n";
}
else if (shift) {
if (field < min) _field = min + shift;
else if (field > max) _field = max + shift;
else _field = field + shift;
if (val < min) _field = min + shift;
else if (val > max) _field = max + shift;
else _field = val + shift;
}
else {
_field = exportFunc(field);
_field = exportFunc(val);
}
}
@@ -645,6 +659,10 @@ class ConversionField: public TransformedField {
else {
field = importFunc(_field);
}
if (scale) {
field *= scale;
}
}
protected:
@@ -653,6 +671,7 @@ class ConversionField: public TransformedField {
int _field;
ConversionTable * table;
int shift;
int scale;
int min;
int max;
int (*exportFunc)(int);
+61 -34
View File
@@ -4,12 +4,16 @@
#include "firmwares/er9x/er9xinterface.h"
#include "firmwares/th9x/th9xinterface.h"
#include "firmwares/gruvin9x/gruvin9xinterface.h"
#include "firmwares/opentx/open9xinterface.h"
#include "firmwares/opentx/opentxinterface.h"
#include "firmwares/ersky9x/ersky9xinterface.h"
#include "qsettings.h"
#include "helpers.h"
QString EEPROMWarnings;
const char * switches9X[] = { "3POS", "THR", "RUD", "ELE", "AIL", "GEA", "TRN" };
const char * switchesX9D[] = { "SA", "SB", "SC", "SD", "SE", "SF", "SG", "SH" };
void setEEPROMString(char *dst, const char *src, int size)
{
memcpy(dst, src, size);
@@ -244,27 +248,28 @@ double RawSource::getStep(const ModelData & Model)
}
}
QString AnalogString(int index)
{
static const QString sticks[] = { QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail") };
static const QString pots9X[] = { QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3") };
static const QString potsX9D[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("LS"), QObject::tr("RS") };
if (index < 4)
return CHECK_IN_ARRAY(sticks, index);
else
return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(potsX9D, index-4) : CHECK_IN_ARRAY(pots9X, index-4));
}
QString RotaryEncoderString(int index)
{
static const QString rotary[] = { QObject::tr("REa"), QObject::tr("REb") };
return CHECK_IN_ARRAY(rotary, index);
}
QString RawSource::toString()
{
static const QString sticks[] = { QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail") };
static const QString trims[] = { QObject::tr("TrmR"), QObject::tr("TrmE"), QObject::tr("TrmT"), QObject::tr("TrmA")};
static const QString pots9X[] = { QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3") };
static const QString potsX9D[] = { QObject::tr("S1"), QObject::tr("S2"), QObject::tr("LS"), QObject::tr("RS") };
static const QString rotary[] = { QObject::tr("REa"), QObject::tr("REb") };
static const QString switches9X[] = { QObject::tr("3POS"),
QObject::tr("THR"), QObject::tr("RUD"), QObject::tr("ELE"),
QObject::tr("AIL"), QObject::tr("GEA"), QObject::tr("TRN"),
};
static const QString switchesX9D[] = { QObject::tr("SA"), QObject::tr("SB"), QObject::tr("SC"), QObject::tr("SD"),
QObject::tr("SE"), QObject::tr("SF"), QObject::tr("SG"), QObject::tr("SH"),
};
static const QString telemetry[] = { QObject::tr("Batt"), QObject::tr("Timer1"), QObject::tr("Timer2"),
(IS_TARANIS(GetEepromInterface()->getBoard()) ? QObject::tr("SWR") : QObject::tr("Tx")), (IS_TARANIS(GetEepromInterface()->getBoard()) ? QObject::tr("RSSI") : QObject::tr("Rx")), QObject::tr("A1"), QObject::tr("A2"), QObject::tr("Alt"), QObject::tr("Rpm"), QObject::tr("Fuel"), QObject::tr("T1"),
QObject::tr("T2"), QObject::tr("Speed"), QObject::tr("Dist"), QObject::tr("GPS Alt"), QObject::tr("Cell"), QObject::tr("Cels"), QObject::tr("Vfas"), QObject::tr("Curr"),
@@ -284,14 +289,11 @@ QString RawSource::toString()
}
switch(type) {
case SOURCE_TYPE_STICK:
if (index < 4)
return CHECK_IN_ARRAY(sticks, index);
else
return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(potsX9D, index-4) : CHECK_IN_ARRAY(pots9X, index-4));
return AnalogString(index);
case SOURCE_TYPE_TRIM:
return CHECK_IN_ARRAY(trims, index);
case SOURCE_TYPE_ROTARY_ENCODER:
return CHECK_IN_ARRAY(rotary, index);
return RotaryEncoderString(index);
case SOURCE_TYPE_MAX:
return QObject::tr("MAX");
case SOURCE_TYPE_SWITCH:
@@ -407,6 +409,25 @@ QString RawSwitch::toString()
return QObject::tr("----");
}
QString CurveReference::toString()
{
if (value == 0) {
return "----";
}
else {
switch(type) {
case CURVE_REF_DIFF:
return QObject::tr("Diff(%1)").arg(getGVarString(value));
case CURVE_REF_EXPO:
return QObject::tr("Expo(%1)").arg(getGVarString(value));
case CURVE_REF_FUNC:
return QObject::tr("Function(%1)").arg(QString("x>0" "x<0" "|x|" "f>0" "f<0" "|f|").mid(3*(value-1), 3));
default:
return QString(value > 0 ? QObject::tr("Curve(%1)") : QObject::tr("!Curve(%1)")).arg(abs(value));
}
}
}
GeneralSettings::GeneralSettings()
{
memset(this, 0, sizeof(GeneralSettings));
@@ -534,6 +555,18 @@ ModelData::ModelData()
clear();
}
void ModelData::clearInputs()
{
for (int i=0; i<C9X_MAX_EXPOS; i++)
expoData[i].clear();
}
void ModelData::clearMixes()
{
for (int i=0; i<C9X_MAX_MIXERS; i++)
mixData[i].clear();
}
void ModelData::clear()
{
memset(this, 0, sizeof(ModelData));
@@ -553,10 +586,8 @@ void ModelData::clear()
}
for (int i=0; i<C9X_MAX_PHASES; i++)
phaseData[i].clear();
for (int i=0; i<C9X_MAX_EXPOS; i++)
expoData[i].clear();
for (int i=0; i<C9X_MAX_MIXERS; i++)
mixData[i].clear();
clearInputs();
clearMixes();
for(int i=0; i<4; i++){
mixData[i].destCh = i+1;
mixData[i].srcRaw = RawSource(SOURCE_TYPE_STICK, i);
@@ -568,12 +599,8 @@ void ModelData::clear()
expoData[i].clear();
for (int i=0; i<C9X_NUM_CSW; i++)
customSw[i].clear();
bool custom = GetEepromInterface()->getCapability(CustomCurves);
for (int i=0; i<C9X_MAX_CURVES; i++) {
if (!custom && i>=8)
curves[i].clear(9);
else
curves[i].clear(5);
curves[i].clear(5);
}
swashRingData.clear();
@@ -617,13 +644,13 @@ ModelData ModelData::removeGlobalVars()
for (int i=0; i<C9X_MAX_MIXERS; i++) {
removeGlobalVar(mixData[i].weight);
removeGlobalVar(mixData[i].differential);
removeGlobalVar(mixData[i].curve.value);
removeGlobalVar(mixData[i].sOffset);
}
for (int i=0; i<C9X_MAX_EXPOS; i++) {
removeGlobalVar(expoData[i].weight);
removeGlobalVar(expoData[i].expo);
removeGlobalVar(expoData[i].curve.value);
}
return result;
+95 -52
View File
@@ -44,14 +44,17 @@ template<class t> t LIMIT(t mi, t x, t ma) { return std::min(std::max(mi, x), ma
enum BoardEnum {
BOARD_STOCK,
BOARD_M128,
BOARD_MEGA2560,
BOARD_GRUVIN9X,
BOARD_SKY9X,
BOARD_TARANIS,
BOARD_TARANIS_REV4a
};
#define IS_STOCK(board) (board==BOARD_STOCK || board==BOARD_M128)
#define IS_ARM(board) (board==BOARD_SKY9X || board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a)
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a)
#define IS_2560(board) (board==BOARD_GRUVIN9X || board==BOARD_MEGA2560)
#define IS_ARM(board) (board==BOARD_SKY9X || board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a)
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_REV4a)
const uint8_t modn12x3[4][4]= {
{1, 2, 3, 4},
@@ -59,13 +62,14 @@ const uint8_t modn12x3[4][4]= {
{4, 2, 3, 1},
{4, 3, 2, 1} };
#define C9XMAX_MODELS 60
#define C9X_MAX_MODELS 60
#define C9X_MAX_PHASES 9
#define C9X_MAX_MIXERS 64
#define C9X_MAX_EXPOS 32
#define C9X_MAX_CURVES 16
#define MAX_POINTS 17
#define C9X_MAX_GVARS 9
#define C9X_MAX_EXPOS 64
#define C9X_MAX_CURVES 32
#define C9X_MAX_POINTS 17
#define C9X_MAX_GVARS 9
#define C9X_MAX_ENCODERS 2
#define NUM_SAFETY_CHNOUT 16
#define C9X_NUM_CHNOUT 32 // number of real output channels
#define C9X_NUM_CSW 32 // number of custom switches
@@ -107,6 +111,18 @@ const uint8_t chout_ar[] = { //First number is 0..23 -> template setup, Second
3,1,2,4 , 3,1,4,2 , 3,2,1,4 , 3,2,4,1 , 3,4,1,2 , 3,4,2,1,
4,1,2,3 , 4,1,3,2 , 4,2,1,3 , 4,2,3,1 , 4,3,1,2 , 4,3,2,1 }; // TODO delete it?
// Beep center bits
#define BC_BIT_RUD (0x01)
#define BC_BIT_ELE (0x02)
#define BC_BIT_THR (0x04)
#define BC_BIT_AIL (0x08)
#define BC_BIT_P1 (0x10)
#define BC_BIT_P2 (0x20)
#define BC_BIT_P3 (0x40)
#define BC_BIT_P4 (0x80)
#define BC_BIT_REA (0x80)
#define BC_BIT_REB (0x100)
// TODO remove this enum!
enum EnumKeys {
KEY_MENU,
@@ -185,10 +201,13 @@ enum HeliSwashTypes {
#define NUM_CAL_PPM 4
#define NUM_PPM 8
#define NUM_CYC 3
#define C9X_NUM_SWITCHES 10
#define C9X_NUM_KEYS 6
#define C9X_NUM_SWITCHES 10
#define C9X_NUM_KEYS 6
#define C9X_MAX_TIMERS 2
extern const char * switches9X[];
extern const char * switchesX9D[];
enum TelemetrySource {
TELEMETRY_SOURCE_TX_BATT,
TELEMETRY_SOURCE_TIMER1,
@@ -241,6 +260,8 @@ enum TelemetrySource {
enum RawSourceType {
SOURCE_TYPE_NONE,
SOURCE_TYPE_VIRTUAL_INPUT,
SOURCE_TYPE_LUA_INPUT,
SOURCE_TYPE_STICK, // and POTS
SOURCE_TYPE_ROTARY_ENCODER,
SOURCE_TYPE_TRIM,
@@ -254,8 +275,12 @@ enum RawSourceType {
SOURCE_TYPE_TELEMETRY,
MAX_SOURCE_TYPE
};
class ModelData;
QString AnalogString(int index);
QString RotaryEncoderString(int index);
class RawSource {
public:
RawSource():
@@ -404,7 +429,6 @@ class GeneralSettings {
int timezone;
bool optrexDisplay;
unsigned int inactivityTimer;
bool throttleReversed;
bool minuteBeep;
bool preBeep;
bool flashBeep;
@@ -451,17 +475,44 @@ class GeneralSettings {
unsigned int switchUnlockStates;
};
class CurveReference {
public:
enum CurveRefType {
CURVE_REF_DIFF,
CURVE_REF_EXPO,
CURVE_REF_FUNC,
CURVE_REF_CUSTOM
};
CurveReference() { clear(); }
CurveReference(CurveRefType type, int value):
type(type),
value(value)
{
}
void clear() { memset(this, 0, sizeof(CurveReference)); }
CurveRefType type;
int value;
QString toString();
};
class ExpoData {
public:
ExpoData() { clear(); }
RawSource srcRaw;
unsigned int scale;
unsigned int mode; // 0=end, 1=pos, 2=neg, 3=both
unsigned int chn;
RawSwitch swtch;
unsigned int phases; // -5=!FP4, 0=normal, 5=FP4
int weight;
int expo;
unsigned int curveMode;
int curveParam;
int offset;
CurveReference curve;
int carryTrim;
char name[10+1];
void clear() { memset(this, 0, sizeof(ExpoData)); }
};
@@ -474,11 +525,19 @@ class CurvePoint {
class CurveData {
public:
enum CurveType {
CURVE_TYPE_STANDARD,
CURVE_TYPE_CUSTOM,
CURVE_TYPE_LAST = CURVE_TYPE_CUSTOM
};
CurveData() { clear(5); }
bool custom; // 0=end, 1=pos, 2=neg, 3=both
uint8_t count;
CurvePoint points[MAX_POINTS];
char name[6+1];
CurveType type;
bool smooth;
int count;
CurvePoint points[C9X_MAX_POINTS];
char name[6+1];
void clear(int count) { memset(this, 0, sizeof(CurveData)); this->count = count; }
};
@@ -492,6 +551,7 @@ class LimitData {
int ppmCenter;
bool symetrical;
char name[6+1];
CurveReference curve;
void clear() { memset(this, 0, sizeof(LimitData)); min = -100; max = +100; }
};
@@ -501,7 +561,6 @@ enum MltpxValue {
MLTPX_REP=2
};
class MixData {
public:
MixData() { clear(); }
@@ -509,9 +568,8 @@ class MixData {
RawSource srcRaw;
unsigned int srcVariant;
int weight;
int differential;
RawSwitch swtch;
int curve; //0=symmetrisch
CurveReference curve; //0=symmetrisch
unsigned int delayUp;
unsigned int delayDown;
unsigned int speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
@@ -520,9 +578,7 @@ class MixData {
bool noExpo;
MltpxValue mltpx; // multiplex method 0=+ 1=* 2=replace
unsigned int mixWarn; // mixer warning
unsigned int enableFmTrim;
unsigned int phases; // -5=!FP4, 0=normal, 5=FP4
unsigned int lateOffset;
int sOffset;
char name[10+1];
@@ -572,10 +628,7 @@ enum AssignFunc {
FuncBackgroundMusic,
FuncBackgroundMusicPause,
FuncAdjustGV1,
FuncAdjustGV2,
FuncAdjustGV3,
FuncAdjustGV4,
FuncAdjustGV5,
FuncAdjustGVLast = FuncAdjustGV1+C9X_MAX_GVARS-1,
FuncCount
};
@@ -602,7 +655,7 @@ class PhaseData {
unsigned int fadeIn;
unsigned int fadeOut;
int rotaryEncoders[2];
int gvars[5];
int gvars[C9X_MAX_GVARS];
void clear() { memset(this, 0, sizeof(PhaseData)); for (int i=0; i<NUM_STICKS; i++) trimRef[i] = -1; }
};
@@ -805,7 +858,9 @@ class ModelData {
int8_t t2throttle; // Start timer2 using throttle
unsigned int modelId;
unsigned int switchWarningStates;
// TODO structure
char gvars_names[C9X_MAX_GVARS][6+1];
bool gvars_popups[C9X_MAX_GVARS];
uint8_t gvsource[5];
uint8_t bt_telemetry;
uint8_t numVoice;
@@ -828,6 +883,9 @@ class ModelData {
ModelData removeGlobalVars();
void clearMixes();
void clearInputs();
protected:
void removeGlobalVar(int & var);
};
@@ -835,19 +893,19 @@ class ModelData {
class RadioData {
public:
GeneralSettings generalSettings;
ModelData models[C9XMAX_MODELS];
ModelData models[C9X_MAX_MODELS];
};
// TODO rename FlightPhase to FlightMode
enum Capability {
OwnerName,
FlightPhases,
FlightPhasesAreNamed,
FlightModesName,
FlightPhasesHaveFades,
SimulatorType,
Mixes,
MixesWithoutExpo,
Timers,
TimerTriggerB,
TimeDivisions,
minuteBeep,
countdownBeep,
@@ -857,7 +915,6 @@ enum Capability {
ModelVoice,
MultiLangVoice,
ModelImage,
InstantTrimSW,
Pots,
Switches,
SwitchesPositions,
@@ -867,20 +924,12 @@ enum Capability {
CustomSwitchesExt,
RotaryEncoders,
Outputs,
ChannelsName,
ExtraChannels,
ExtraInputs,
ExtraTrims,
ExtendedTrims,
HasNegCurves,
HasInputFilter,
HasExpoCurves,
ExpoIsCurve,
ExpoCurve5,
ExpoCurve9,
CustomCurves,
NumCurves3,
NumCurves5,
NumCurves9,
NumCurves,
NumCurvePoints,
OffsetWeight,
@@ -900,7 +949,6 @@ enum Capability {
TrainerSwitch,
ModelTrainerEnable,
Timer2ThrTrig,
HasTTrace,
HasExpoNames,
HasMixerNames,
HasChNames,
@@ -910,14 +958,10 @@ enum Capability {
HasPPMStart,
HasGeneralUnits,
HasFAIMode,
NoTimerDirs,
NoThrExpo,
OptrexDisplay,
PPMExtCtrl,
PPMFrameLength,
MixFmTrim,
gsSwitchMask,
pmSwitchMask,
BLonStickMove,
DSM2Indexes,
Telemetry,
@@ -930,9 +974,7 @@ enum Capability {
GvarsFlightPhases,
GvarsHaveSources,
GvarsAsSources,
GvarsAsWeight,
GvarsNum,
GvarsOfsNum,
GvarsName,
NoTelemetryProtocol,
TelemetryCSFields,
TelemetryColsCSFields,
@@ -949,11 +991,9 @@ enum Capability {
HasPPMSim,
HasCrossTrims,
HasStickScroll,
HasFixOffset,
HasSoundMixer,
NumModules,
FSSwitch,
DiffMixers,
PPMCenter,
SYMLimits,
HasCurrentCalibration,
@@ -961,8 +1001,6 @@ enum Capability {
HasBrightness,
HasContrast,
PerModelTimers,
PerModelThrottleWarning,
PerModelThrottleInvert,
SlowScale,
SlowRange,
PermTimers,
@@ -970,6 +1008,11 @@ enum Capability {
CSFunc,
LCDWidth,
GetThrSwitch,
VirtualInputs,
LuaInputs,
LimitsPer1000,
EnhancedCurves,
TelemetryInternalAlarms
};
enum UseContext {
-334
View File
@@ -1,334 +0,0 @@
#include "expodialog.h"
#include "ui_expodialog.h"
#include "eeprominterface.h"
#include "helpers.h"
ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
QDialog(parent),
ui(new Ui::ExpoDialog),
ed(expoData)
{
ui->setupUi(this);
QLabel * lb_fp[] = {ui->lb_FP0,ui->lb_FP1,ui->lb_FP2,ui->lb_FP3,ui->lb_FP4,ui->lb_FP5,ui->lb_FP6,ui->lb_FP7,ui->lb_FP8 };
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
setWindowTitle(tr("DEST -> %1").arg(getStickStr(ed->chn)));
QRegExp rx(CHAR_FOR_NAMES_REGEX);
if (GetEepromInterface()->getCapability(GvarsAsWeight)) {
int gvars=0;
if (GetEepromInterface()->getCapability(HasVariants)) {
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1;
}
} else {
gvars=1;
}
if (gvars==0) {
ui->expoGV->setDisabled(true);
ui->weightGV->setDisabled(true);
ui->expoCurveGV->setDisabled(true);
if (ed->expo>100) {
ed->expo=0;
}
if (ed->weight>100 || ed->weight<-100) {
ed->weight=100;
}
if (ed->curveParam>100 || ed->curveParam<-100) {
ed->curveParam=0;
}
}
populateGVCB(ui->expoCB,ed->expo);
populateGVCB(ui->weightCB,ed->weight);
populateGVCB(ui->expoCurveCB,ed->curveParam);
ui->weightSB->setMinimum(0);
ui->weightSB->setMaximum(100);
if (ed->weight>100 || ed->weight<0) {
ui->weightGV->setChecked(true);
ui->weightSB->hide();
ui->weightCB->show();
} else {
ui->weightGV->setChecked(false);
ui->weightSB->setValue(ed->weight);
ui->weightSB->show();
ui->weightCB->hide();
}
ui->expoSB->setMinimum(-100);
ui->expoSB->setMaximum(100);
if (ed->expo>100 || ed->expo<-100) {
ui->expoGV->setChecked(true);
ui->expoSB->hide();
ui->expoCB->show();
} else {
ui->expoGV->setChecked(false);
ui->expoSB->setValue(ed->expo);
ui->expoSB->show();
ui->expoCB->hide();
}
ui->expoCurveSB->setMinimum(-100);
ui->expoCurveSB->setMaximum(100);
if (ed->curveParam>100 || ed->curveParam<-100) {
ui->expoCurveGV->setChecked(true);
ui->expoCurveSB->hide();
ui->expoCurveCB->show();
} else {
ui->expoCurveGV->setChecked(false);
ui->expoCurveSB->setValue(ed->curveParam);
ui->expoCurveSB->show();
ui->expoCurveCB->hide();
}
} else {
ui->expoGV->hide();
ui->weightGV->hide();
ui->expoCurveGV->hide();
ui->expoSB->setMinimum(-100);
ui->expoSB->setMaximum(100);
ui->expoSB->setValue(ed->expo);
ui->expoCurveSB->setMinimum(-100);
ui->expoCurveSB->setMaximum(100);
ui->expoCurveSB->setValue(ed->curveParam);
ui->weightSB->setMinimum(0);
ui->weightSB->setMaximum(100);
ui->weightSB->setValue(ed->weight);
}
populateSwitchCB(ui->switchesCB,ed->swtch);
if (ed->curveMode==0) {
populateExpoCurvesCB(ui->curvesCB,0); // TODO capacity for er9x
} else {
populateExpoCurvesCB(ui->curvesCB,ed->curveParam); // TODO capacity for er9x
}
ui->modeCB->setCurrentIndex(ed->mode-1);
if (!GetEepromInterface()->getCapability(HasExpoCurves)) {
ui->label_curves->hide();
ui->curvesCB->hide();
ed->curveMode=1;
}
if (!GetEepromInterface()->getCapability(ExpoIsCurve)) {
ui->expoCurveCB->hide();
ui->expoCurveSB->hide();
ui->expoCurveGV->hide();
ui->label_curves->setText(tr("Curve"));
} else {
ui->label_expo->hide();
ui->expoCB->hide();
ui->expoGV->hide();
ui->expoSB->hide();
}
if (!GetEepromInterface()->getCapability(FlightPhases)) {
ui->label_phases->hide();
for (int i=0; i<9; i++) {
lb_fp[i]->hide();
cb_fp[i]->hide();
}
} else {
int mask=1;
for (int i=0; i<9 ; i++) {
if ((ed->phases & mask)==0) {
cb_fp[i]->setChecked(true);
}
mask <<= 1;
}
for (int i=GetEepromInterface()->getCapability(FlightPhases); i<9;i++) {
lb_fp[i]->hide();
cb_fp[i]->hide();
}
}
int expolength=GetEepromInterface()->getCapability(HasExpoNames);
if (!expolength) {
ui->label_name->hide();
ui->expoName->hide();
} else {
ui->expoName->setMaxLength(expolength);
}
ui->expoName->setValidator(new QRegExpValidator(rx, this));
ui->expoName->setText(ed->name);
valuesChanged();
connect(ui->expoName,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
connect(ui->expoCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
connect(ui->expoSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
connect(ui->expoCurveCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
connect(ui->expoCurveSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
connect(ui->weightCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
connect(ui->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
connect(ui->curvesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
connect(ui->modeCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
connect(ui->expoGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
connect(ui->expoCurveGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
connect(ui->weightGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
for (int i=0; i<9; i++) {
connect(cb_fp[i],SIGNAL(toggled(bool)),this,SLOT(valuesChanged()));
}
QTimer::singleShot(0, this, SLOT(shrink()));
}
ExpoDialog::~ExpoDialog()
{
delete ui;
}
void ExpoDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void ExpoDialog::widgetChanged()
{
if (GetEepromInterface()->getCapability(GvarsAsWeight)) {
int gvars=0;
if (GetEepromInterface()->getCapability(HasVariants)) {
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1;
}
} else {
gvars=1;
}
if (gvars==1) {
if (!GetEepromInterface()->getCapability(ExpoIsCurve)) {
if (ui->expoGV->isChecked()) {
ui->expoCB->show();
ui->expoSB->hide();
} else {
ui->expoCB->hide();
ui->expoSB->show();
}
} else {
if (ui->expoCurveGV->isChecked()) {
ui->expoCurveCB->show();
ui->expoCurveSB->hide();
} else {
ui->expoCurveCB->hide();
ui->expoCurveSB->show();
}
}
if (ui->weightGV->isChecked()) {
ui->weightCB->show();
ui->weightSB->hide();
} else {
ui->weightCB->hide();
ui->weightSB->show();
}
}
valuesChanged();
QTimer::singleShot(0, this, SLOT(shrink()));
}
}
void ExpoDialog::valuesChanged()
{
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
if (ui->curvesCB->currentIndex()==0) {
if (GetEepromInterface()->getCapability(ExpoIsCurve)) {
ed->curveMode = 0;
ui->expoCurveGV->show();
if (ui->expoCurveGV->isChecked()) {
ui->expoCurveCB->show();
ui->expoCurveSB->hide();
ed->curveParam = ui->expoCurveCB->itemData(ui->expoCurveCB->currentIndex()).toInt();
} else {
ui->expoCurveCB->hide();
ui->expoCurveSB->show();
ed->curveParam = ui->expoCurveSB->value();
}
ed->expo = ed->curveParam;
} else {
ui->expoCurveCB->hide();
ui->expoCurveSB->hide();
ui->expoCurveGV->hide();
ed->curveMode = 0;
if (ui->expoGV->isChecked()) {
ed->expo = ui->expoCB->itemData(ui->expoCB->currentIndex()).toInt();
} else {
ed->expo = ui->expoSB->value();
}
ed->curveParam = ed->expo;
}
} else {
if (!GetEepromInterface()->getCapability(ExpoIsCurve)) {
ed->curveMode = 1;
ed->curveParam = ui->curvesCB->currentIndex();
if (ui->expoGV->isChecked()) {
ed->expo = ui->expoCB->itemData(ui->expoCB->currentIndex()).toInt();
} else {
ed->expo = ui->expoSB->value();
}
} else {
ed->curveMode = 1;
ed->curveParam = ui->curvesCB->currentIndex();
ed->expo = 0;
}
ui->expoCurveCB->hide();
ui->expoCurveSB->hide();
ui->expoCurveGV->hide();
}
if (ui->weightGV->isChecked()) {
ed->weight = ui->weightCB->itemData(ui->weightCB->currentIndex()).toInt();
} else {
ed->weight = ui->weightSB->value();
}
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
ed->mode = ui->modeCB->currentIndex() + 1;
int i=0;
for (i=0; i<ui->expoName->text().toAscii().length(); i++) {
ed->name[i]=ui->expoName->text().toAscii().at(i);
}
ed->name[i]=0;
ed->phases=0;
for (int i=8; i>=0 ; i--) {
if (!cb_fp[i]->checkState()) {
ed->phases+=1;
}
ed->phases<<=1;
}
ed->phases>>=1;
if (GetEepromInterface()->getCapability(FlightPhases)) {
int zeros=0;
int ones=0;
int phtemp=ed->phases;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
if (phtemp & 1) {
ones++;
}
else {
zeros++;
}
phtemp >>=1;
}
if (zeros==1) {
phtemp=ed->phases;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
if ((phtemp & 1)==0) {
break;
}
phtemp >>=1;
}
}
else if (ones==1) {
phtemp=ed->phases;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
if (phtemp & 1) {
break;
}
phtemp >>=1;
}
}
} else {
ed->phases=0;
}
}
void ExpoDialog::shrink()
{
resize(0,0);
}
+4 -1
View File
@@ -323,7 +323,10 @@ unsigned int EFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
if (read(&m_bRlc, 1) !=1) break; //read how many bytes to read
assert(m_bRlc & 0x7f);
if (!(m_bRlc & 0x7f)) {
qDebug() << "RLC decoding error!";
return 0;
}
if (rlc2) {
if(m_bRlc&0x80){ // if contains high byte
+22 -492
View File
@@ -3,26 +3,6 @@
#include "helpers.h"
#include <QObject>
int8_t er9xFromSwitch(const RawSwitch & sw)
{
switch (sw.type) {
case SWITCH_TYPE_SWITCH:
return sw.index;
case SWITCH_TYPE_VIRTUAL:
return sw.index > 0 ? (9 + sw.index) : (-9 + sw.index);
case SWITCH_TYPE_ON:
return 22;
case SWITCH_TYPE_OFF:
return -22;
case SWITCH_TYPE_MOMENT_SWITCH:
return sw.index > 0 ? (22 + sw.index) : (-22 + sw.index);
case SWITCH_TYPE_MOMENT_VIRTUAL:
return sw.index > 0 ? (31 + sw.index) : (-31 + sw.index);
default:
return 0;
}
}
RawSwitch er9xToSwitch(int8_t sw)
{
uint8_t swa = abs(sw);
@@ -47,15 +27,6 @@ t_Er9xTrainerMix::t_Er9xTrainerMix()
memset(this, 0, sizeof(t_Er9xTrainerMix));
}
t_Er9xTrainerMix::t_Er9xTrainerMix(TrainerMix &c9x)
{
memset(this, 0, sizeof(t_Er9xTrainerMix));
srcChn = c9x.src;
swtch = er9xFromSwitch(c9x.swtch);
studWeight = (8 * c9x.weight) / 25;
mode = c9x.mode;
}
t_Er9xTrainerMix::operator TrainerMix()
{
TrainerMix c9x;
@@ -71,15 +42,6 @@ t_Er9xTrainerData::t_Er9xTrainerData()
memset(this, 0, sizeof(t_Er9xTrainerData));
}
t_Er9xTrainerData::t_Er9xTrainerData(TrainerData &c9x)
{
memset(this, 0, sizeof(t_Er9xTrainerData));
for (int i=0; i<NUM_STICKS; i++) {
calib[i] = c9x.calib[i];
mix[i] = c9x.mix[i];
}
}
t_Er9xTrainerData::operator TrainerData ()
{
TrainerData c9x;
@@ -95,76 +57,6 @@ t_Er9xGeneral::t_Er9xGeneral()
memset(this, 0, sizeof(t_Er9xGeneral));
}
t_Er9xGeneral::t_Er9xGeneral(GeneralSettings &c9x)
{
memset(this, 0, sizeof(t_Er9xGeneral));
myVers = MDVERS;
for (int i=0; i<NUM_STICKSnPOTS; i++) {
calibMid[i] = c9x.calibMid[i];
calibSpanNeg[i] = c9x.calibSpanNeg[i];
calibSpanPos[i] = c9x.calibSpanPos[i];
}
uint16_t sum = 0;
for (int i=0; i<12; i++)
sum += calibMid[i];
chkSum = sum;
currModel = c9x.currModel;
contrast = c9x.contrast;
vBatWarn = c9x.vBatWarn;
vBatCalib = c9x.vBatCalib;
trainer = c9x.trainer;
view = c9x.view;
disableThrottleWarning = c9x.disableThrottleWarning;
disableSwitchWarning = (c9x.switchWarning != -1);
disableMemoryWarning = c9x.disableMemoryWarning;
if (c9x.beeperMode == e_quiet)
beeperVal = 0;
else if (c9x.beeperMode < e_all)
beeperVal = 1;
else
beeperVal = c9x.beeperLength + 4;
disableAlarmWarning = c9x.disableAlarmWarning;
stickMode = c9x.stickMode;
inactivityTimer = c9x.inactivityTimer - 10;
throttleReversed = c9x.throttleReversed;
minuteBeep = c9x.minuteBeep;
preBeep = c9x.preBeep;
flashBeep = c9x.flashBeep;
disableSplashScreen = c9x.splashMode;
disablePotScroll=(c9x.disablePotScroll ? 1 : 0);
disableBG=(c9x.disableBG ? 1 :0);
frskyinternalalarm = c9x.frskyinternalalarm;
blightinv=(c9x.blightinv ? 1 : 0);
stickScroll=(c9x.stickScroll ? 1 : 0);
if (c9x.backlightMode == 4)
lightSw = 22;
if (c9x.backlightMode & 1)
lightAutoOff = c9x.backlightDelay;
if (c9x.backlightMode & 2)
lightOnStickMove = c9x.backlightDelay;
templateSetup = c9x.templateSetup;
PPM_Multiplier = c9x.PPM_Multiplier;
setEEPROMString(ownerName, c9x.ownerName, sizeof(ownerName));
speakerPitch = c9x.speakerPitch;
hapticStrength = c9x.hapticStrength;
hideNameOnSplash = (c9x.hideNameOnSplash ? 1 : 0);
enablePpmsim = (c9x.enablePpmsim ? 1 : 0);;
speakerMode = c9x.speakerMode;
switchWarningStates =c9x.switchWarningStates;
crosstrim=(c9x.crosstrim ? 1 : 0);
}
Er9xGeneral::operator GeneralSettings ()
{
GeneralSettings result;
@@ -207,7 +99,6 @@ Er9xGeneral::operator GeneralSettings ()
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = std::max((uint8_t)0, std::min(stickMode, (uint8_t)3));
result.inactivityTimer = inactivityTimer + 10;
result.throttleReversed = throttleReversed;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
@@ -244,15 +135,6 @@ t_Er9xLimitData::t_Er9xLimitData()
memset(this, 0, sizeof(t_Er9xLimitData));
}
t_Er9xLimitData::t_Er9xLimitData(LimitData &c9x)
{
memset(this, 0, sizeof(t_Er9xLimitData));
min = c9x.min+100;
max = c9x.max-100;
revert = c9x.revert;
offset = c9x.offset;
}
t_Er9xLimitData::operator LimitData ()
{
LimitData c9x;
@@ -268,107 +150,6 @@ t_Er9xMixData::t_Er9xMixData()
memset(this, 0, sizeof(t_Er9xMixData));
}
t_Er9xMixData::t_Er9xMixData(MixData &c9x)
{
memset(this, 0, sizeof(t_Er9xMixData));
destCh = c9x.destCh;
swtch = er9xFromSwitch(c9x.swtch);
if (c9x.srcRaw.type == SOURCE_TYPE_NONE) {
srcRaw = 0;
swtch = 0;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_STICK) {
srcRaw = 1 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_ROTARY_ENCODER) {
EEPROMWarnings += ::QObject::tr("er9x doesn't have Rotary Encoders") + "\n";
srcRaw = 5 + c9x.srcRaw.index; // use pots instead
}
else if (c9x.srcRaw.type == SOURCE_TYPE_MAX) {
srcRaw = 8; // MAX
}
else if (c9x.srcRaw.type == SOURCE_TYPE_SWITCH) {
srcRaw = 9; // FULL
swtch = er9xFromSwitch(RawSwitch(c9x.srcRaw.index));
}
else if (c9x.srcRaw.type == SOURCE_TYPE_CYC) {
srcRaw = 10 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_PPM) {
srcRaw = 13 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_CH) {
srcRaw = 21 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_GVAR) {
srcRaw = 38 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_TRIM) {
EEPROMWarnings += ::QObject::tr("er9x doesn't have trims as source") + "\n";
srcRaw = 0; // use pots instead
}
if (abs(c9x.weight)>125) {
if (c9x.weight>0) {
int index=abs(c9x.weight)-10000;
int gvar=125+index;
if (gvar>127) {
gvar-=256;
}
weight = gvar;
} else {
EEPROMWarnings += ::QObject::tr("er9x doesn't have negative gvars as weight") + "\n";
weight=0;
}
} else {
weight = c9x.weight;
}
if (abs(c9x.sOffset)>125) {
if (c9x.sOffset>0) {
int index=abs(c9x.sOffset)-10000;
int gvar=125+index;
if (gvar>127) {
gvar-=256;
}
sOffset = gvar;
} else {
EEPROMWarnings += ::QObject::tr("er9x doesn't have negative gvars as offset") + "\n";
sOffset=0;
}
} else {
sOffset = c9x.sOffset;
}
if (c9x.curve!=0) {
curve = c9x.curve;
differential=0;
} else {
if (c9x.differential!=0) {
curve=c9x.differential;
differential=1;
} else {
curve=0;
differential=0;
}
}
lateOffset=c9x.lateOffset;
delayUp = c9x.delayUp;
delayDown = c9x.delayDown;
speedUp = c9x.speedUp;
speedDown = c9x.speedDown;
if (c9x.carryTrim<0) {
EEPROMWarnings += ::QObject::tr("er9x doesn't have swappable trims") + "\n";
carryTrim=1;
} else {
carryTrim = c9x.carryTrim;
}
mltpx = (MltpxValue)c9x.mltpx;
mixWarn = c9x.mixWarn;
enableFmTrim=c9x.enableFmTrim;
}
t_Er9xMixData::operator MixData ()
{
MixData c9x;
@@ -434,14 +215,21 @@ t_Er9xMixData::operator MixData ()
else {
c9x.srcRaw = RawSource(SOURCE_TYPE_GVAR, srcRaw-38);
}
if (differential==1) {
c9x.differential=curve;
c9x.curve=0;
} else {
c9x.differential=0;
c9x.curve=curve;
c9x.curve.type = CurveReference::CURVE_REF_DIFF;
c9x.curve.value = differential;
}
c9x.lateOffset=lateOffset;
else if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
// c9x.lateOffset=lateOffset;
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
@@ -449,32 +237,10 @@ t_Er9xMixData::operator MixData ()
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
c9x.enableFmTrim=enableFmTrim;
// c9x.enableFmTrim=enableFmTrim;
return c9x;
}
int8_t er9xFromSource(RawSource source)
{
int v1 = 0;
if (source.type == SOURCE_TYPE_STICK)
v1 = 1+source.index;
else if (source.type == SOURCE_TYPE_ROTARY_ENCODER) {
EEPROMWarnings += ::QObject::tr("er9x on this board doesn't have Rotary Encoders") + "\n";
v1 = 5+source.index;
}
else if (source.type == SOURCE_TYPE_MAX)
v1 = 8;
else if (source.type == SOURCE_TYPE_CYC)
v1 = 10+source.index;
else if (source.type == SOURCE_TYPE_PPM)
v1 = 13+source.index;
else if (source.type == SOURCE_TYPE_CH)
v1 = 21+source.index;
else if (source.type == SOURCE_TYPE_TELEMETRY)
v1 = 36+source.index;
return v1;
}
RawSource er9xToSource(int8_t value)
{
if (value == 0) {
@@ -503,33 +269,6 @@ RawSource er9xToSource(int8_t value)
}
}
t_Er9xCustomSwData::t_Er9xCustomSwData(CustomSwData &c9x)
{
func = c9x.func;
v1 = c9x.val1;
v2 = c9x.val2;
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
v1 = er9xFromSource(RawSource(c9x.val1));
}
if (c9x.func >= CS_FN_EQUAL) {
v2 = er9xFromSource(RawSource(c9x.val2));
}
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
v1 = er9xFromSwitch(RawSwitch(c9x.val1));
v2 = er9xFromSwitch(RawSwitch(c9x.val2));
}
if (func>ER9X_MAX_CSFUNC ) {
EEPROMWarnings += ::QObject::tr("er9x does not support Custom Switch function %1").arg(getFuncName(func)) + "\n";
func=0;
v1=0;
v2=0;
}
}
Er9xCustomSwData::operator CustomSwData ()
{
CustomSwData c9x;
@@ -559,13 +298,6 @@ t_Er9xSafetySwData::t_Er9xSafetySwData()
memset(this, 0, sizeof(t_Er9xSafetySwData));
}
t_Er9xSafetySwData::t_Er9xSafetySwData(SafetySwData &c9x)
{
memset(this, 0, sizeof(t_Er9xSafetySwData));
swtch = er9xFromSwitch(c9x.swtch);
val = c9x.val;
}
t_Er9xSafetySwData::operator SafetySwData ()
{
SafetySwData c9x;
@@ -574,35 +306,11 @@ t_Er9xSafetySwData::operator SafetySwData ()
return c9x;
}
t_Er9xFrSkyChannelData::t_Er9xFrSkyChannelData()
{
memset(this, 0, sizeof(t_Er9xFrSkyChannelData));
}
t_Er9xFrSkyChannelData::t_Er9xFrSkyChannelData(FrSkyChannelData &c9x)
{
memset(this, 0, sizeof(t_Er9xFrSkyChannelData));
ratio = c9x.ratio;
alarms_value[0] = c9x.alarms[0].value;
alarms_value[1] = c9x.alarms[1].value;
alarms_level = (c9x.alarms[1].level << 2) + c9x.alarms[0].level;
alarms_greater = (c9x.alarms[1].greater << 1) + c9x.alarms[0].greater;
if (c9x.type==0) {
if (c9x.multiplier==0) {
type = 0;
} else if (c9x.multiplier==1) {
type = 2;
} else {
EEPROMWarnings += ::QObject::tr("er9x does not support this range for A1/A2") + "\n";
}
} else if (c9x.type==1 || c9x.type==3) {
type=c9x.type;
} else {
EEPROMWarnings += ::QObject::tr("er9x does not support this telemetry units") + "\n";
}
}
t_Er9xFrSkyChannelData::operator FrSkyChannelData ()
{
FrSkyChannelData c9x;
@@ -622,19 +330,11 @@ t_Er9xFrSkyChannelData::operator FrSkyChannelData ()
return c9x;
}
t_Er9xFrSkyData::t_Er9xFrSkyData()
{
memset(this, 0, sizeof(t_Er9xFrSkyData));
}
t_Er9xFrSkyData::t_Er9xFrSkyData(FrSkyData &c9x)
{
memset(this, 0, sizeof(t_Er9xFrSkyData));
channels[0] = c9x.channels[0];
channels[1] = c9x.channels[1];
}
t_Er9xFrSkyData::operator FrSkyData ()
{
FrSkyData c9x;
@@ -643,24 +343,6 @@ t_Er9xFrSkyData::operator FrSkyData ()
return c9x;
}
int setEr9xTimerMode(TimerMode mode)
{
if (mode == TMRMODE_OFF || mode == TMRMODE_ABS)
return mode;
else if (mode == TMRMODE_THs || mode == TMRMODE_THp)
return mode + 4;
else if (mode >= TMRMODE_FIRST_MOMENT_SWITCH)
return 37+mode-TMRMODE_FIRST_MOMENT_SWITCH;
else if (mode >= TMRMODE_FIRST_SWITCH)
return 16+mode-TMRMODE_FIRST_SWITCH;
else if (mode <= TMRMODE_FIRST_NEG_MOMENT_SWITCH)
return -37+mode-TMRMODE_FIRST_NEG_MOMENT_SWITCH;
else if (mode <= TMRMODE_FIRST_NEG_SWITCH)
return -16+mode-TMRMODE_FIRST_NEG_SWITCH;
else
return 0;
}
TimerMode getEr9xTimerMode(int mode)
{
if (mode <= -33)
@@ -675,162 +357,6 @@ TimerMode getEr9xTimerMode(int mode)
return TimerMode(TMRMODE_FIRST_MOMENT_SWITCH+(mode-16-21));
}
t_Er9xModelData::t_Er9xModelData(ModelData &c9x)
{
memset(this, 0, sizeof(t_Er9xModelData));
if (c9x.used) {
setEEPROMString(name, c9x.name, sizeof(name));
modelVoice=c9x.modelVoice;
tmrMode = setEr9xTimerMode(c9x.timers[0].mode);
tmrModeB = c9x.timers[0].modeB;
tmrDir = c9x.timers[0].dir;
tmrVal = c9x.timers[0].val;
switch(c9x.moduleData[0].protocol) {
case PPM:
protocol = 0;
break;
case PXX_DJT:
protocol = 1;
break;
case DSM2:
protocol = 2;
break;
case PPM16:
protocol = 3;
break;
default:
protocol = 0;
EEPROMWarnings += QObject::tr("Er9x doesn't accept this protocol") + "\n";
// TODO more explicit warning for each protocol
break;
}
traineron = c9x.traineron;
t2throttle = c9x.t2throttle;
ppmFrameLength = c9x.moduleData[0].ppmFrameLength;
ppmNCH = (c9x.moduleData[0].channelsCount - 8) / 2;
thrTrim = c9x.thrTrim;
thrExpo = c9x.thrExpo;
trimInc = c9x.trimInc;
ppmDelay = (c9x.moduleData[0].ppmDelay - 300) / 50;
for (unsigned int i=0; i<C9X_MAX_CUSTOM_FUNCTIONS; i++)
if (c9x.funcSw[i].func == FuncInstantTrim && c9x.funcSw[i].swtch.type != SWITCH_TYPE_NONE) {
trimSw = er9xFromSwitch(c9x.funcSw[i].swtch);
break;
}
beepANACenter = (uint8_t)(c9x.beepANACenter & 0x7F);
pulsePol = c9x.moduleData[0].ppmPulsePol;
extendedLimits = c9x.extendedLimits;
swashInvertELE = c9x.swashRingData.invertELE;
swashInvertAIL = c9x.swashRingData.invertAIL;
swashInvertCOL = c9x.swashRingData.invertCOL;
swashType = c9x.swashRingData.type;
swashCollectiveSource = er9xFromSource(c9x.swashRingData.collectiveSource);
swashRingValue = c9x.swashRingData.value;
for (int i=0; i<ER9X_MAX_MIXERS; i++)
mixData[i] = c9x.mixData[i];
for (int i=0; i<ER9X_NUM_CHNOUT; i++)
limitData[i] = c9x.limitData[i];
// expoData
for (unsigned int i=0; i<NUM_STICKS; i++) {
// first we find the switches
for (int e=0; e<C9X_MAX_EXPOS && c9x.expoData[e].mode; e++) {
if (c9x.expoData[e].chn == i) {
if (c9x.expoData[e].swtch.type!=SWITCH_TYPE_NONE) {
if (!expoData[i].drSw1)
expoData[i].drSw1 = -er9xFromSwitch(c9x.expoData[e].swtch);
else if (er9xFromSwitch(c9x.expoData[e].swtch) != -expoData[i].drSw1 && !expoData[i].drSw2) {
expoData[i].drSw2 = -er9xFromSwitch(c9x.expoData[e].swtch);
}
}
}
}
if (expoData[i].drSw1 && !expoData[i].drSw2) {
expoData[i].drSw1 = -expoData[i].drSw1;
}
for (int pos=0; pos<3; pos++) {
int swtch1=0, swtch2=0;
if (expoData[i].drSw1 && !expoData[i].drSw2) {
switch (pos) {
case 0:
swtch1 = -expoData[i].drSw1;
break;
case 1:
swtch1 = expoData[i].drSw1;
break;
default:
swtch1 = expoData[i].drSw1;
break;
}
}
else {
switch (pos) {
case 0:
swtch1 = -expoData[i].drSw1;
break;
case 1:
swtch1 = expoData[i].drSw1;
swtch2 = -expoData[i].drSw2;
break;
default:
swtch1 = expoData[i].drSw1;
swtch2 = expoData[i].drSw2;
break;
}
}
for (int mode=0; mode<2; mode++) {
for (int e=0; e<C9X_MAX_EXPOS && c9x.expoData[e].mode; e++) {
if (c9x.expoData[e].chn == i && !c9x.expoData[e].phases) {
if (c9x.expoData[e].swtch.type==SWITCH_TYPE_NONE || c9x.expoData[e].swtch == er9xToSwitch(swtch1) || c9x.expoData[e].swtch == er9xToSwitch(swtch2)) {
if (c9x.expoData[e].mode == 3 || (c9x.expoData[e].mode==2 && mode==0) || (c9x.expoData[e].mode==1 && mode==1)) {
expoData[i].expo[pos][0][mode] = c9x.expoData[e].expo;
expoData[i].expo[pos][1][mode] = c9x.expoData[e].weight - 100;
break;
}
}
}
}
}
}
}
for (int i=0; i<NUM_STICKS; i++)
trim[i] = std::max(-125, std::min(125, c9x.phaseData[0].trim[i]));
for (int i=0; i<ER9X_MAX_CURVE5; i++)
if (c9x.curves[i].count==5) {
if (c9x.curves[i].custom)
EEPROMWarnings += QObject::tr("Er9x doesn't support custom curves as curve%1, curve as been exported as fixed point ").arg(i+1) + "\n";
for (int j=0; j<5; j++)
curves5[i][j] = c9x.curves[i].points[j].y;
} else {
EEPROMWarnings += QObject::tr("Er9x doesn't support curve with %1 point as curve%2 ").arg(c9x.curves[i].count).arg(i+1) + "\n";
}
for (int i=0; i<ER9X_MAX_CURVE9; i++)
if (c9x.curves[i+ER9X_MAX_CURVE5].count==9) {
if (c9x.curves[i+ER9X_MAX_CURVE5].custom)
EEPROMWarnings += QObject::tr("Er9x doesn't support custom curves as curve%1, curve as been exported as fixed point ").arg(i+1+ER9X_MAX_CURVE5) + "\n";
for (int j=0; j<9; j++)
curves9[i][j] = c9x.curves[i+ER9X_MAX_CURVE5].points[j].y;
} else {
EEPROMWarnings += QObject::tr("Er9x doesn't support curve with %1 point as curve%2 ").arg(c9x.curves[i+ER9X_MAX_CURVE5].count).arg(i+1+ER9X_MAX_CURVE5) + "\n";
}
for (int i=0; i<ER9X_NUM_CSW; i++)
customSw[i] = c9x.customSw[i];
for (int i=0; i<ER9X_NUM_CHNOUT; i++)
safetySw[i] = c9x.safetySw[i];
frsky = c9x.frsky;
FrSkyUsrProto = c9x.frsky.usrProto;
FrSkyImperial = c9x.frsky.imperial;
FrSkyGpsAlt = c9x.frsky.FrSkyGpsAlt;
}
}
t_Er9xModelData::operator ModelData ()
{
ModelData c9x;
@@ -902,7 +428,10 @@ t_Er9xModelData::operator ModelData ()
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? -expoData[ch].drSw1 : (dr == 1 ? -expoData[ch].drSw2 : 0));
}
c9x.expoData[e].chn = ch;
c9x.expoData[e].expo = expoData[ch].expo[pos][0][0];
if (expoData[ch].expo[pos][0][0]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][0];
}
c9x.expoData[e].weight = 100 + expoData[ch].expo[pos][1][0];
if (expoData[ch].expo[pos][0][0] == expoData[ch].expo[pos][0][1] && expoData[ch].expo[pos][1][0] == expoData[ch].expo[pos][1][1]) {
c9x.expoData[e++].mode = 3;
@@ -913,7 +442,10 @@ t_Er9xModelData::operator ModelData ()
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
c9x.expoData[++e].chn = ch;
c9x.expoData[e].mode = 1;
c9x.expoData[e].expo = expoData[ch].expo[pos][0][1];
if (expoData[ch].expo[pos][0][1]) {
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][1];
}
c9x.expoData[e++].weight = 100 + expoData[ch].expo[pos][1][1];
}
}
@@ -924,7 +456,6 @@ t_Er9xModelData::operator ModelData ()
c9x.phaseData[0].trim[i] = trim[i];
for (int i=0; i<ER9X_MAX_CURVE5; i++) {
c9x.curves[i].custom = false;
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
@@ -932,7 +463,6 @@ t_Er9xModelData::operator ModelData ()
}
}
for (int i=0; i<ER9X_MAX_CURVE9; i++) {
c9x.curves[ER9X_MAX_CURVE5 + i].custom = false;
c9x.curves[ER9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[ER9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
-15
View File
@@ -42,8 +42,6 @@ PACK(typedef struct t_Er9xTrainerMix {
operator TrainerMix();
t_Er9xTrainerMix();
t_Er9xTrainerMix(TrainerMix&);
}) Er9xTrainerMix; //
PACK(typedef struct t_Er9xTrainerData {
@@ -52,8 +50,6 @@ PACK(typedef struct t_Er9xTrainerData {
operator TrainerData();
t_Er9xTrainerData();
t_Er9xTrainerData(TrainerData&);
}) Er9xTrainerData;
PACK(typedef struct t_Er9xGeneral {
@@ -109,8 +105,6 @@ PACK(typedef struct t_Er9xGeneral {
operator GeneralSettings();
t_Er9xGeneral();
t_Er9xGeneral(GeneralSettings&);
}) Er9xGeneral;
PACK(typedef struct t_Er9xExpoData {
@@ -130,7 +124,6 @@ PACK(typedef struct t_Er9xLimitData {
operator LimitData();
t_Er9xLimitData();
t_Er9xLimitData(LimitData&);
}) Er9xLimitData;
#define MLTPX_ADD 0
@@ -158,7 +151,6 @@ PACK(typedef struct t_Er9xMixData {
operator MixData();
t_Er9xMixData();
t_Er9xMixData(MixData&);
}) Er9xMixData;
@@ -170,7 +162,6 @@ PACK(typedef struct t_Er9xCustomSwData { // Custom Switches data
operator CustomSwData();
t_Er9xCustomSwData() { memset(this, 0, sizeof(t_Er9xCustomSwData)); }
t_Er9xCustomSwData(CustomSwData&);
}) Er9xCustomSwData;
PACK(typedef struct t_Er9xSafetySwData { // Custom Switches data
@@ -179,7 +170,6 @@ PACK(typedef struct t_Er9xSafetySwData { // Custom Switches data
operator SafetySwData();
t_Er9xSafetySwData();
t_Er9xSafetySwData(SafetySwData&);
}) Er9xSafetySwData;
PACK(typedef struct t_Er9xFrSkyChannelData {
@@ -191,7 +181,6 @@ PACK(typedef struct t_Er9xFrSkyChannelData {
operator FrSkyChannelData();
t_Er9xFrSkyChannelData();
t_Er9xFrSkyChannelData(FrSkyChannelData&);
}) Er9xFrSkyChannelData;
PACK(typedef struct t_Er9xFrSkyData {
@@ -199,7 +188,6 @@ PACK(typedef struct t_Er9xFrSkyData {
operator FrSkyData();
t_Er9xFrSkyData();
t_Er9xFrSkyData(FrSkyData&);
}) Er9xFrSkyData;
PACK(typedef struct t_gvar {
@@ -268,9 +256,6 @@ PACK(typedef struct t_Er9xModelData {
operator ModelData();
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
t_Er9xModelData(ModelData&);
}) Er9xModelData;
#endif
/*eof*/
+6 -59
View File
@@ -184,57 +184,20 @@ bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize,
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
EEPROMWarnings.clear();
std::cout << "NO!\n";
// TODO an error
efile->EeFsCreate(eeprom, getEEpromSize(), BOARD_STOCK);
Er9xGeneral er9xGeneral(radioData.generalSettings);
int sz = efile->writeRlc1(FILE_GENERAL, FILE_TYP_GENERAL, (uint8_t*)&er9xGeneral, sizeof(Er9xGeneral));
if(sz != sizeof(Er9xGeneral)) {
return 0;
}
for (int i=0; i<getMaxModels(); i++) {
if (!radioData.models[i].isempty()) {
Er9xModelData er9xModel(radioData.models[i]);
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
sz = efile->writeRlc1(FILE_MODEL(i), FILE_TYP_MODEL, (uint8_t*)&er9xModel, sizeof(Er9xModelData));
if(sz != sizeof(Er9xModelData)) {
return 0;
}
}
}
return getEEpromSize();
return 0;
}
int Er9xInterface::getSize(ModelData &model)
{
if (model.isempty())
return 0;
uint8_t tmp[2*EESIZE_STOCK];
efile->EeFsCreate(tmp, getEEpromSize(), BOARD_STOCK);
Er9xModelData er9xModel(model);
int sz = efile->writeRlc1(0, FILE_TYP_MODEL, (uint8_t*)&er9xModel, sizeof(Er9xModelData));
if(sz != sizeof(Er9xModelData)) {
return -1;
}
return efile->size(0);
return 0;
}
int Er9xInterface::getSize(GeneralSettings &settings)
{
uint8_t tmp[2*EESIZE_STOCK];
efile->EeFsCreate(tmp, getEEpromSize(), BOARD_STOCK);
Er9xGeneral er9xGeneral(settings);
int sz = efile->writeRlc1(0, FILE_TYP_GENERAL, (uint8_t*)&er9xGeneral, sizeof(Er9xGeneral));
if(sz != sizeof(Er9xGeneral)) {
return -1;
}
return efile->size(0);
return 0;
}
int Er9xInterface::getCapability(const Capability capability)
@@ -244,12 +207,6 @@ int Er9xInterface::getCapability(const Capability capability)
return 4;
case Mixes:
return ER9X_MAX_MIXERS;
case NumCurves5:
return ER9X_MAX_CURVE5;
case NumCurves9:
return ER9X_MAX_CURVE5;
case MixFmTrim:
return 1;
case PPMExtCtrl:
return 1;
case ModelTrainerEnable:
@@ -286,10 +243,6 @@ int Er9xInterface::getCapability(const Capability capability)
return 12;
case CustomAndSwitches:
return 5;
case GvarsNum:
return 7;
case GvarsOfsNum:
return 5;
case CSFunc:
return 13;
case Outputs:
@@ -306,8 +259,6 @@ int Er9xInterface::getCapability(const Capability capability)
return TM_HASTELEMETRY|TM_HASWSHH;
case TelemetryUnits:
return 1;
case TimerTriggerB:
return 1;
case TelemetryMaxMultiplier:
return 2;
case MaxVolume:
@@ -325,17 +276,13 @@ int Er9xInterface::getCapability(const Capability capability)
case HasStickScroll:
case HasAltitudeSel:
case HasContrast:
case InstantTrimSW:
case HasVolume:
case HasBlInvert:
case ModelVoice:
case DiffMixers:
case HasNegCurves:
case HasFixOffset:
case Gvars:
return 7;
case GvarsHaveSources:
case GvarsAsSources:
case GvarsAsWeight:
return 1;
case GetThrSwitch:
return DSW_THR;
File diff suppressed because it is too large Load Diff
@@ -51,8 +51,6 @@ PACK(typedef struct t_Ersky9xTrainerMix {
operator TrainerMix();
t_Ersky9xTrainerMix();
t_Ersky9xTrainerMix(TrainerMix&);
}) Ersky9xTrainerMix; //
PACK(typedef struct t_Ersky9xTrainerData {
@@ -61,8 +59,6 @@ PACK(typedef struct t_Ersky9xTrainerData {
operator TrainerData();
t_Ersky9xTrainerData();
t_Ersky9xTrainerData(TrainerData&);
}) Ersky9xTrainerData;
PACK(typedef struct t_Ersky9xGeneral {
@@ -122,8 +118,6 @@ PACK(typedef struct t_Ersky9xGeneral {
uint8_t rotaryDivisor ;
operator GeneralSettings();
t_Ersky9xGeneral();
t_Ersky9xGeneral(GeneralSettings&);
}) Ersky9xGeneral;
PACK(typedef struct t_Ersky9xExpoData {
@@ -143,7 +137,6 @@ PACK(typedef struct t_Ersky9xLimitData {
operator LimitData();
t_Ersky9xLimitData() ;
t_Ersky9xLimitData(LimitData&);
}) Ersky9xLimitData;
#define MLTPX_ADD 0
@@ -170,7 +163,6 @@ PACK(typedef struct t_Ersky9xMixData_v10 {
operator MixData();
t_Ersky9xMixData_v10();
t_Ersky9xMixData_v10(MixData&);
}) Ersky9xMixData_v10;
PACK(typedef struct t_Ersky9xMixData_v11 {
@@ -192,7 +184,6 @@ PACK(typedef struct t_Ersky9xMixData_v11 {
uint8_t res[4];
operator MixData();
t_Ersky9xMixData_v11();
t_Ersky9xMixData_v11(MixData&);
}) Ersky9xMixData_v11;
PACK(typedef struct t_Ersky9xCustomSwData_v10 { // Custom Switches data
@@ -202,8 +193,6 @@ PACK(typedef struct t_Ersky9xCustomSwData_v10 { // Custom Switches data
operator CustomSwData();
t_Ersky9xCustomSwData_v10() { memset(this, 0, sizeof(t_Ersky9xCustomSwData_v10)); }
t_Ersky9xCustomSwData_v10(CustomSwData&);
}) Ersky9xCustomSwData_v10;
PACK(typedef struct t_Ersky9xCustomSwData_v11 { // Custom Switches data
@@ -215,8 +204,6 @@ PACK(typedef struct t_Ersky9xCustomSwData_v11 { // Custom Switches data
operator CustomSwData();
t_Ersky9xCustomSwData_v11() { memset(this, 0, sizeof(t_Ersky9xCustomSwData_v11)); }
t_Ersky9xCustomSwData_v11(CustomSwData&);
}) Ersky9xCustomSwData_v11;
PACK(typedef struct t_Ersky9xSafetySwData_v10 { // Custom Switches data
@@ -225,7 +212,6 @@ PACK(typedef struct t_Ersky9xSafetySwData_v10 { // Custom Switches data
operator SafetySwData();
t_Ersky9xSafetySwData_v10();
t_Ersky9xSafetySwData_v10(SafetySwData&);
}) Ersky9xSafetySwData_v10;
PACK(typedef struct t_Ersky9xSafetySwData_v11 { // Custom Switches data
@@ -246,7 +232,6 @@ PACK(typedef struct t_Ersky9xSafetySwData_v11 { // Custom Switches data
operator SafetySwData();
t_Ersky9xSafetySwData_v11();
t_Ersky9xSafetySwData_v11(SafetySwData&);
}) Ersky9xSafetySwData_v11;
PACK(typedef struct t_Ersky9xgvar {
@@ -281,7 +266,6 @@ PACK(typedef struct t_Ersky9xFrSkyChannelData_v10 {
operator FrSkyChannelData();
t_Ersky9xFrSkyChannelData_v10();
t_Ersky9xFrSkyChannelData_v10(FrSkyChannelData&);
}) Ersky9xFrSkyChannelData_v10;
PACK(typedef struct t_Ersky9xFrSkyData_v10 {
@@ -289,7 +273,6 @@ PACK(typedef struct t_Ersky9xFrSkyData_v10 {
operator FrSkyData();
t_Ersky9xFrSkyData_v10();
t_Ersky9xFrSkyData_v10(FrSkyData&);
}) Ersky9xFrSkyData_v10;
PACK(typedef struct t_Ersky9xFrSkyChannelData_v11 {
@@ -303,7 +286,6 @@ PACK(typedef struct t_Ersky9xFrSkyChannelData_v11 {
operator FrSkyChannelData();
t_Ersky9xFrSkyChannelData_v11();
t_Ersky9xFrSkyChannelData_v11(FrSkyChannelData&);
}) Ersky9xFrSkyChannelData_v11;
PACK(typedef struct t_Ersky9xFrSkyData_v11 {
@@ -311,7 +293,6 @@ PACK(typedef struct t_Ersky9xFrSkyData_v11 {
operator FrSkyData();
t_Ersky9xFrSkyData_v11();
t_Ersky9xFrSkyData_v11(FrSkyData&);
}) Ersky9xFrSkyData_v11;
PACK(typedef struct t_Ersky9xFrSkyalarms_v11 {
@@ -390,7 +371,6 @@ PACK(typedef struct t_Ersky9xModelData_v10 {
Ersky9xTimerMode_v10 timer[2] ;
operator ModelData();
t_Ersky9xModelData_v10() { memset(this, 0, sizeof(t_Ersky9xModelData_v10)); }
t_Ersky9xModelData_v10(ModelData&);
}) Ersky9xModelData_v10;
PACK(typedef struct t_Ersky9xModelData_v11 {
@@ -449,8 +429,6 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
operator ModelData();
t_Ersky9xModelData_v11() { memset(this, 0, sizeof(t_Ersky9xModelData_v11)); }
t_Ersky9xModelData_v11(ModelData&);
}) Ersky9xModelData_v11;
#endif
/*eof*/
@@ -228,33 +228,10 @@ bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esi
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
EEPROMWarnings.clear();
std::cout << "NO!\n";
// TODO an error
efile->EeFsCreate(eeprom, EESIZE_SKY9X, BOARD_SKY9X);
Ersky9xGeneral ersky9xGeneral(radioData.generalSettings);
int sz = efile->writeRlc2(FILE_GENERAL, FILE_TYP_GENERAL, (uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral));
if(sz != sizeof(Ersky9xGeneral)) {
return 0;
}
for (int i=0; i<getMaxModels(); i++) {
if (!radioData.models[i].isempty()) {
Ersky9xModelData_v11 ersky9xModel(radioData.models[i]);
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
sz = efile->writeRlc2(FILE_MODEL(i), FILE_TYP_MODEL, (uint8_t*)&ersky9xModel, sizeof(Ersky9xModelData_v11));
if(sz != sizeof(Ersky9xModelData_v11)) {
return 0;
}
}
}
if (!EEPROMWarnings.isEmpty())
QMessageBox::warning(NULL,
QObject::tr("Warning"),
QObject::tr("EEPROM saved with these warnings:") + "\n- " + EEPROMWarnings.remove(EEPROMWarnings.length()-1, 1).replace("\n", "\n- "));
return EESIZE_SKY9X;
return 0;
}
int Ersky9xInterface::getSize(ModelData &model)
@@ -272,12 +249,6 @@ int Ersky9xInterface::getCapability(const Capability capability)
switch (capability) {
case Mixes:
return ERSKY9X_MAX_MIXERS_V11;
case NumCurves5:
return ERSKY9X_MAX_CURVE5;
case NumCurves9:
return ERSKY9X_MAX_CURVE9;
case MixFmTrim:
return 1;
case PPMExtCtrl:
return 1;
case ModelTrainerEnable:
@@ -306,10 +277,8 @@ int Ersky9xInterface::getCapability(const Capability capability)
return 2;
case Pots:
return 3;
case GvarsNum:
case Gvars:
return 7;
case GvarsOfsNum:
return 5;
case Switches:
return 7;
case SwitchesPositions:
@@ -338,8 +307,6 @@ int Ersky9xInterface::getCapability(const Capability capability)
return 1;
case OptrexDisplay:
return 1;
case TimerTriggerB:
return 2;
case HasAltitudeSel:
case HasCurrentCalibration:
case HasVolume:
@@ -350,12 +317,8 @@ int Ersky9xInterface::getCapability(const Capability capability)
return 125;
case MaxVolume:
return 23;
case Gvars:
case GvarsHaveSources:
case GvarsAsSources:
case GvarsAsWeight:
return 1;
case InstantTrimSW:
return 1;
case TelemetryMaxMultiplier:
return 2;
@@ -6,7 +6,6 @@
#define EEPROM_VER 106
extern void setEEPROMZString(char *dst, const char *src, int size);
extern void getEEPROMZString(char *dst, const char *src, int size);
RawSwitch gruvin9xToSwitch(int8_t sw)
@@ -19,18 +18,6 @@ RawSwitch gruvin9xToSwitch(int8_t sw)
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
}
int8_t gruvin9xFromSwitch(const RawSwitch & sw)
{
switch (sw.type) {
case SWITCH_TYPE_SWITCH:
return sw.index;
case SWITCH_TYPE_VIRTUAL:
return sw.index > 0 ? (9 + sw.index) : (-9 + sw.index);
default:
return 0;
}
}
t_Gruvin9xTrainerMix_v103::operator TrainerMix()
{
TrainerMix c9x;
@@ -50,14 +37,6 @@ t_Gruvin9xTrainerMix_v104::operator TrainerMix()
return c9x;
}
t_Gruvin9xTrainerMix_v104::t_Gruvin9xTrainerMix_v104(TrainerMix &c9x)
{
memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v104));
srcChn = c9x.src;
studWeight = c9x.weight;
mode = c9x.mode;
}
t_Gruvin9xTrainerData_v103::operator TrainerData ()
{
TrainerData c9x;
@@ -78,16 +57,6 @@ t_Gruvin9xTrainerData_v104::operator TrainerData ()
return c9x;
}
t_Gruvin9xTrainerData_v104::t_Gruvin9xTrainerData_v104(TrainerData &c9x)
{
memset(this, 0, sizeof(t_Gruvin9xTrainerData_v104));
for (int i=0; i<NUM_STICKS; i++) {
calib[i] = c9x.calib[i];
mix[i] = c9x.mix[i];
}
}
Gruvin9xGeneral_v103::operator GeneralSettings ()
{
GeneralSettings result;
@@ -134,7 +103,6 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
result.throttleReversed = throttleReversed;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
@@ -147,60 +115,6 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
return result;
}
t_Gruvin9xGeneral_v104::t_Gruvin9xGeneral_v104(GeneralSettings &c9x)
{
memset(this, 0, sizeof(t_Gruvin9xGeneral_v104));
myVers = EEPROM_VER;
for (int i=0; i<NUM_STICKS+BOARD_9X_NUM_POTS; i++) {
calibMid[i] = c9x.calibMid[i];
calibSpanNeg[i] = c9x.calibSpanNeg[i];
calibSpanPos[i] = c9x.calibSpanPos[i];
}
uint16_t sum = 0;
for (int i=0; i<12; i++)
sum += calibMid[i];
chkSum = sum;
currModel = c9x.currModel;
contrast = c9x.contrast;
vBatWarn = c9x.vBatWarn;
vBatCalib = c9x.vBatCalib;
if (c9x.backlightMode == 4)
lightSw = 22;
if (c9x.backlightMode & 1)
lightAutoOff = c9x.backlightDelay;
trainer = c9x.trainer;
view = c9x.view;
disableThrottleWarning = c9x.disableThrottleWarning;
if (c9x.beeperMode == e_quiet)
beeperVal = 0;
else if (c9x.beeperMode < e_all)
beeperVal = 1;
else
beeperVal = std::min(4, c9x.beeperLength + 4);
switchWarning = c9x.switchWarning;
disableMemoryWarning = c9x.disableMemoryWarning;
disableAlarmWarning = c9x.disableAlarmWarning;
stickMode = c9x.stickMode;
inactivityTimer = c9x.inactivityTimer;
throttleReversed = c9x.throttleReversed;
minuteBeep = c9x.minuteBeep;
preBeep = c9x.preBeep;
flashBeep = c9x.flashBeep;
disableSplashScreen = c9x.splashMode;
enableTelemetryAlarm = c9x.enableTelemetryAlarm;
spare = 0;
filterInput = c9x.filterInput;
templateSetup = c9x.templateSetup;
PPM_Multiplier = c9x.PPM_Multiplier;
// TODO frskyRssiAlarms[2];
}
Gruvin9xGeneral_v104::operator GeneralSettings ()
{
GeneralSettings result;
@@ -234,7 +148,6 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
result.throttleReversed = throttleReversed;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
@@ -252,69 +165,11 @@ t_Gruvin9xExpoData::t_Gruvin9xExpoData()
memset(this, 0, sizeof(t_Gruvin9xExpoData));
}
t_Gruvin9xExpoData::t_Gruvin9xExpoData(ExpoData &c9x)
{
mode = c9x.mode;
chn = c9x.chn;
if (c9x.curveMode==1) {
curve = c9x.curveParam;
} else {
curve=0;
}
swtch = gruvin9xFromSwitch(c9x.swtch);
int zeros=0;
int ones=0;
int phtemp=c9x.phases;
for (int i=0; i<G9X_MAX_PHASES; i++) {
if (phtemp & 1) {
ones++;
} else {
zeros++;
}
phtemp >>=1;
}
if (zeros==G9X_MAX_PHASES || zeros==0) {
phase=0;
negPhase=0;
} else if (zeros==1) {
int phtemp=c9x.phases;
int ph=0;
for (int i=0; i<G9X_MAX_PHASES; i++) {
if ((phtemp & 1)==0) {
ph=i;
break;
}
phtemp >>=1;
}
phase=ph+1;
negPhase=0;
} else if (ones==1) {
int phtemp=c9x.phases;
int ph=0;
for (int i=0; i<G9X_MAX_PHASES; i++) {
if (phtemp & 1) {
ph=i;
break;
}
phtemp >>=1;
}
phase=(ph+1);
negPhase=1;
} else {
phase=0;
EEPROMWarnings += ::QObject::tr("Flight modes settings on expos not exported") + "\n";
}
weight = c9x.weight;
expo = c9x.expo;
}
t_Gruvin9xExpoData::operator ExpoData ()
{
ExpoData c9x;
c9x.mode = mode;
c9x.chn = chn;
c9x.curveParam = curve;
c9x.curveMode=1;
c9x.swtch = gruvin9xToSwitch(swtch);
if (negPhase) {
c9x.phases= 1 << (phase -1);
@@ -325,7 +180,18 @@ t_Gruvin9xExpoData::operator ExpoData ()
c9x.phases &= ~(1 << (phase -1));
}
c9x.weight = weight;
c9x.expo = expo;
if (expo) {
c9x.curve.type = CurveReference::CURVE_REF_EXPO;
c9x.curve.value = expo;
}
else if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
return c9x;
}
@@ -334,14 +200,6 @@ t_Gruvin9xLimitData::t_Gruvin9xLimitData()
memset(this, 0, sizeof(t_Gruvin9xLimitData));
}
t_Gruvin9xLimitData::t_Gruvin9xLimitData(LimitData &c9x)
{
min = c9x.min+100;
max = c9x.max-100;
revert = c9x.revert;
offset = c9x.offset;
}
t_Gruvin9xLimitData::operator LimitData ()
{
LimitData c9x;
@@ -352,67 +210,11 @@ t_Gruvin9xLimitData::operator LimitData ()
return c9x;
}
t_Gruvin9xMixData::t_Gruvin9xMixData()
{
memset(this, 0, sizeof(t_Gruvin9xMixData));
}
t_Gruvin9xMixData::t_Gruvin9xMixData(MixData &c9x)
{
destCh = c9x.destCh;
mixWarn = c9x.mixWarn;
swtch = gruvin9xFromSwitch(c9x.swtch);
if (c9x.srcRaw.type == SOURCE_TYPE_NONE) {
srcRaw = 0;
swtch = 0;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_STICK) {
srcRaw = 1 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_ROTARY_ENCODER) {
EEPROMWarnings += ::QObject::tr("Open9x on this board doesn't have Rotary Encoders") + "\n";
srcRaw = 5 + c9x.srcRaw.index; // use pots instead
}
else if (c9x.srcRaw.type == SOURCE_TYPE_MAX) {
srcRaw = 8; // MAX
}
else if (c9x.srcRaw.type == SOURCE_TYPE_SWITCH) {
srcRaw = 9; // FULL
swtch = c9x.srcRaw.index+1;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_CYC) {
srcRaw = 10 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_PPM) {
srcRaw = 13 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_CH) {
srcRaw = 21 + c9x.srcRaw.index;
}
else if (c9x.srcRaw.type == SOURCE_TYPE_TRIM) {
EEPROMWarnings += ::QObject::tr("gruvin9x doesn't have trims as source") + "\n";
srcRaw = 0; // use pots instead
}
weight = c9x.weight;
curve = c9x.curve;
delayUp = c9x.delayUp;
delayDown = c9x.delayDown;
speedUp = c9x.speedUp;
speedDown = c9x.speedDown;
if (c9x.carryTrim<0) {
EEPROMWarnings += ::QObject::tr("gruvin9x doesn't have swappable trims") + "\n";
carryTrim=1;
} else {
carryTrim = c9x.carryTrim;
}
mltpx = (MltpxValue)c9x.mltpx;
// phase = c9x.phase;
sOffset = c9x.sOffset;
}
t_Gruvin9xMixData::operator MixData ()
{
MixData c9x;
@@ -450,7 +252,6 @@ t_Gruvin9xMixData::operator MixData ()
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
}
c9x.curve = curve;
c9x.delayUp = delayUp;
c9x.delayDown = delayDown;
c9x.speedUp = speedUp;
@@ -458,34 +259,18 @@ t_Gruvin9xMixData::operator MixData ()
c9x.carryTrim = carryTrim;
c9x.mltpx = (MltpxValue)mltpx;
c9x.mixWarn = mixWarn;
// c9x.phase = phase;
c9x.sOffset = sOffset;
return c9x;
}
int8_t gruvin9xFromSource(RawSource source)
{
int v1 = 0;
if (source.type == SOURCE_TYPE_STICK)
v1 = 1+source.index;
else if (source.type == SOURCE_TYPE_ROTARY_ENCODER) {
EEPROMWarnings += ::QObject::tr("gruvin9x on this board doesn't have Rotary Encoders") + "\n";
v1 = 5+source.index;
if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (source.type == SOURCE_TYPE_MAX)
v1 = 8;
/* else if (source.type == SOURCE_TYPE_3POS)
v1 = 0; */
else if (source.type == SOURCE_TYPE_CYC)
v1 = 10+source.index;
else if (source.type == SOURCE_TYPE_PPM)
v1 = 13+source.index;
else if (source.type == SOURCE_TYPE_CH)
v1 = 21+source.index;
else if (source.type == SOURCE_TYPE_TELEMETRY)
v1 = 36+source.index;
return v1;
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
return c9x;
}
RawSource gruvin9xToSource(int8_t value)
@@ -516,33 +301,6 @@ RawSource gruvin9xToSource(int8_t value)
}
}
t_Gruvin9xCustomSwData::t_Gruvin9xCustomSwData(CustomSwData &c9x)
{
func = c9x.func;
v1 = c9x.val1;
v2 = c9x.val2;
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
v1 = gruvin9xFromSource(RawSource(c9x.val1));
}
if (c9x.func >= CS_FN_EQUAL) {
v2 = gruvin9xFromSource(RawSource(c9x.val2));
}
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
v1 = gruvin9xFromSwitch(RawSwitch(c9x.val1));
v2 = gruvin9xFromSwitch(RawSwitch(c9x.val2));
}
if (func>GR9X_MAX_CSFUNC ) {
EEPROMWarnings += ::QObject::tr("gruvin9x does not support Custom Switch function %1").arg(getFuncName(func)) + "\n";
func=0;
v1=0;
v2=0;
}
}
Gruvin9xCustomSwData::operator CustomSwData ()
{
CustomSwData c9x;
@@ -566,12 +324,6 @@ Gruvin9xCustomSwData::operator CustomSwData ()
return c9x;
}
t_Gruvin9xFuncSwData::t_Gruvin9xFuncSwData(FuncSwData &c9x)
{
swtch = gruvin9xFromSwitch(c9x.swtch);
func = c9x.func - G9X_NUM_CHNOUT;
}
Gruvin9xFuncSwData::operator FuncSwData ()
{
FuncSwData c9x;
@@ -580,12 +332,6 @@ Gruvin9xFuncSwData::operator FuncSwData ()
return c9x;
}
t_Gruvin9xSafetySwData::t_Gruvin9xSafetySwData(SafetySwData &c9x)
{
swtch = gruvin9xFromSwitch(c9x.swtch);
val = c9x.val;
}
t_Gruvin9xSafetySwData::operator SafetySwData ()
{
SafetySwData c9x;
@@ -599,16 +345,6 @@ t_Gruvin9xSwashRingData::t_Gruvin9xSwashRingData()
memset(this, 0, sizeof(t_Gruvin9xSwashRingData));
}
t_Gruvin9xSwashRingData::t_Gruvin9xSwashRingData(SwashRingData &c9x)
{
invertELE = c9x.invertELE;
invertAIL = c9x.invertAIL;
invertCOL = c9x.invertCOL;
type = c9x.type;
collectiveSource = gruvin9xFromSource(c9x.collectiveSource);
value = c9x.value;
}
t_Gruvin9xSwashRingData::operator SwashRingData ()
{
SwashRingData c9x;
@@ -645,21 +381,7 @@ t_Gruvin9xPhaseData_v106::operator PhaseData ()
return c9x;
}
t_Gruvin9xPhaseData_v106::t_Gruvin9xPhaseData_v106(PhaseData &c9x)
{
trim_ext = 0;
for (int i=0; i<NUM_STICKS; i++) {
trim[i] = (int8_t)(c9x.trim[i] >> 2);
trim_ext = (trim_ext & ~(0x03 << (2*i))) + (((c9x.trim[i] & 0x03) << (2*i)));
}
swtch = gruvin9xFromSwitch(c9x.swtch);
setEEPROMZString(name, c9x.name, sizeof(name));
fadeIn = c9x.fadeIn;
fadeOut = c9x.fadeOut;
}
extern TimerMode getEr9xTimerMode(int mode);
extern int setEr9xTimerMode(TimerMode mode);
t_Gruvin9xTimerData::operator TimerData ()
{
@@ -670,29 +392,11 @@ t_Gruvin9xTimerData::operator TimerData ()
return c9x;
}
t_Gruvin9xTimerData::t_Gruvin9xTimerData(TimerData &c9x)
{
mode = setEr9xTimerMode(c9x.mode);
val = c9x.val;
dir = c9x.dir;
}
t_Gruvin9xFrSkyChannelData::t_Gruvin9xFrSkyChannelData()
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyChannelData));
}
t_Gruvin9xFrSkyChannelData::t_Gruvin9xFrSkyChannelData(FrSkyChannelData &c9x)
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyChannelData));
ratio = c9x.ratio;
alarms_value[0] = c9x.alarms[0].value;
alarms_value[1] = c9x.alarms[1].value;
alarms_level = (c9x.alarms[1].level << 2) + c9x.alarms[0].level;
alarms_greater = (c9x.alarms[1].greater << 1) + c9x.alarms[0].greater;
type = c9x.type;
}
t_Gruvin9xFrSkyChannelData::operator FrSkyChannelData ()
{
FrSkyChannelData c9x;
@@ -707,19 +411,11 @@ t_Gruvin9xFrSkyChannelData::operator FrSkyChannelData ()
return c9x;
}
t_Gruvin9xFrSkyData::t_Gruvin9xFrSkyData()
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyData));
}
t_Gruvin9xFrSkyData::t_Gruvin9xFrSkyData(FrSkyData &c9x)
{
memset(this, 0, sizeof(t_Gruvin9xFrSkyData));
channels[0] = c9x.channels[0];
channels[1] = c9x.channels[1];
}
t_Gruvin9xFrSkyData::operator FrSkyData ()
{
FrSkyData c9x;
@@ -728,7 +424,6 @@ t_Gruvin9xFrSkyData::operator FrSkyData ()
return c9x;
}
t_Gruvin9xModelData_v102::operator ModelData ()
{
ModelData c9x;
@@ -778,7 +473,6 @@ t_Gruvin9xModelData_v102::operator ModelData ()
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].custom = false;
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
@@ -786,7 +480,6 @@ t_Gruvin9xModelData_v102::operator ModelData ()
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].custom = false;
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
@@ -851,7 +544,6 @@ t_Gruvin9xModelData_v103::operator ModelData ()
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].custom = false;
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
@@ -859,7 +551,6 @@ t_Gruvin9xModelData_v103::operator ModelData ()
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].custom = false;
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
@@ -941,7 +632,6 @@ t_Gruvin9xModelData_v105::operator ModelData ()
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].custom = false;
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
@@ -949,7 +639,6 @@ t_Gruvin9xModelData_v105::operator ModelData ()
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].custom = false;
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
@@ -1027,7 +716,6 @@ t_Gruvin9xModelData_v106::operator ModelData ()
c9x.expoData[i] = expoData[i];
for (int i=0; i<G9X_MAX_CURVE5; i++) {
c9x.curves[i].custom = false;
c9x.curves[i].count = 5;
for (int j = 0; j < 5; j++) {
c9x.curves[i].points[j].x = -100 + 50 * i;
@@ -1035,7 +723,6 @@ t_Gruvin9xModelData_v106::operator ModelData ()
}
}
for (int i=0; i<G9X_MAX_CURVE9; i++) {
c9x.curves[G9X_MAX_CURVE5 + i].custom = false;
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
for (int j = 0; j < 9; j++) {
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
@@ -1055,99 +742,3 @@ t_Gruvin9xModelData_v106::operator ModelData ()
return c9x;
}
t_Gruvin9xModelData_v106::t_Gruvin9xModelData_v106(ModelData &c9x)
{
if (c9x.used) {
setEEPROMZString(name, c9x.name, sizeof(name));
timer1 = c9x.timers[0];
switch(c9x.moduleData[0].protocol) {
case PPM:
protocol = 0;
break;
case PXX_DJT:
protocol = 1;
break;
case DSM2:
protocol = 2;
break;
case SILV_A:
protocol = 3;
break;
case SILV_B:
protocol = 4;
break;
case SILV_C:
protocol = 5;
break;
case CTP1009:
protocol = 6;
break;
default:
protocol = 0;
EEPROMWarnings += QObject::tr("Er9x doesn't accept this protocol") + "\n";
// TODO more explicit warning for each protocol
break;
}
ppmNCH = (c9x.moduleData[0].channelsCount - 8) / 2;
thrTrim = c9x.thrTrim;
thrExpo = c9x.thrExpo;
trimInc = c9x.trimInc;
pulsePol = c9x.moduleData[0].ppmPulsePol;
extendedLimits = c9x.extendedLimits;
extendedTrims = c9x.extendedTrims;
spare2 = 0;
ppmDelay = (c9x.moduleData[0].ppmDelay - 300) / 50;
beepANACenter = c9x.beepANACenter;
timer2 = c9x.timers[1];
for (int i=0; i<G9X_MAX_MIXERS; i++)
mixData[i] = c9x.mixData[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
limitData[i] = c9x.limitData[i];
for (int i=0; i<G9X_MAX_EXPOS; i++)
expoData[i] = c9x.expoData[i];
if (c9x.expoData[G9X_MAX_EXPOS].mode)
EEPROMWarnings += QObject::tr("gruvin9x only accepts %1 expos").arg(G9X_MAX_EXPOS) + "\n";
for (int i=0; i<G9X_MAX_CURVE5; i++)
if (c9x.curves[i].count==5) {
if (c9x.curves[i].custom)
EEPROMWarnings += QObject::tr("gruvin9x doesn't support custom curves as curve%1, curve as been exported as fixed point ").arg(i+1) + "\n";
for (int j=0; j<5; j++)
curves5[i][j] = c9x.curves[i].points[j].y;
} else {
EEPROMWarnings += QObject::tr("gruvin9x doesn't support curve with %1 point as curve%2 ").arg(c9x.curves[i].count).arg(i+1) + "\n";
}
for (int i=0; i<G9X_MAX_CURVE9; i++)
if (c9x.curves[i+G9X_MAX_CURVE5].count==9) {
if (c9x.curves[i+G9X_MAX_CURVE5].custom)
EEPROMWarnings += QObject::tr("gruvin9x doesn't support custom curves as curve%1, curve as been exported as fixed point ").arg(i+1+G9X_MAX_CURVE5) + "\n";
for (int j=0; j<9; j++)
curves9[i][j] = c9x.curves[i+G9X_MAX_CURVE5].points[j].y;
} else {
EEPROMWarnings += QObject::tr("gruvin9x doesn't support curve with %1 point as curve%2 ").arg(c9x.curves[i+G9X_MAX_CURVE5].count).arg(i+1+G9X_MAX_CURVE5) + "\n";
}
for (int i=0; i<G9X_NUM_CSW; i++)
customSw[i] = c9x.customSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
funcSw[i] = c9x.funcSw[i];
for (int i=0; i<G9X_NUM_CHNOUT; i++)
safetySw[i] = c9x.safetySw[i];
swashR = c9x.swashRingData;
for (int i=0; i<G9X_MAX_PHASES; i++) {
PhaseData phase = c9x.phaseData[i];
for (int j=0; j<NUM_STICKS; j++) {
if (phase.trimRef[j] >= 0) {
phase.trim[j] = 501 + phase.trimRef[j] - (phase.trimRef[j] >= i ? 1 : 0);
}
else {
phase.trim[j] = std::max(-500, std::min(500, phase.trim[j]));
}
}
phaseData[i] = phase;
}
frsky = c9x.frsky;
}
else {
memset(this, 0, sizeof(t_Gruvin9xModelData_v106));
}
}
@@ -38,8 +38,6 @@ PACK(typedef struct t_Gruvin9xTrainerMix_v104 {
operator TrainerMix();
t_Gruvin9xTrainerMix_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v104)); }
t_Gruvin9xTrainerMix_v104(TrainerMix&);
}) Gruvin9xTrainerMix_v104; //
PACK(typedef struct t_Gruvin9xTrainerData_v103 {
@@ -55,8 +53,6 @@ PACK(typedef struct t_Gruvin9xTrainerData_v104 {
operator TrainerData();
t_Gruvin9xTrainerData_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerData_v104)); }
t_Gruvin9xTrainerData_v104(TrainerData&);
}) Gruvin9xTrainerData_v104;
PACK(typedef struct t_Gruvin9xFrSkyRSSIAlarm {
@@ -136,8 +132,6 @@ PACK(typedef struct t_Gruvin9xGeneral_v104 {
operator GeneralSettings();
t_Gruvin9xGeneral_v104() { memset(this, 0, sizeof(t_Gruvin9xGeneral_v104)); }
t_Gruvin9xGeneral_v104(GeneralSettings&);
}) Gruvin9xGeneral_v104;
typedef Gruvin9xGeneral_v104 Gruvin9xGeneral;
@@ -156,8 +150,6 @@ PACK(typedef struct t_Gruvin9xExpoData {
operator ExpoData();
t_Gruvin9xExpoData();
t_Gruvin9xExpoData(ExpoData&);
}) Gruvin9xExpoData;
PACK(typedef struct t_Gruvin9xLimitData {
@@ -168,8 +160,6 @@ PACK(typedef struct t_Gruvin9xLimitData {
operator LimitData();
t_Gruvin9xLimitData();
t_Gruvin9xLimitData(LimitData&);
}) Gruvin9xLimitData;
#define MLTPX_ADD 0
@@ -194,8 +184,6 @@ PACK(typedef struct t_Gruvin9xMixData {
operator MixData();
t_Gruvin9xMixData();
t_Gruvin9xMixData(MixData&);
}) Gruvin9xMixData;
PACK(typedef struct t_Gruvin9xCustomSwData { // Custom Switches data
@@ -205,8 +193,6 @@ PACK(typedef struct t_Gruvin9xCustomSwData { // Custom Switches data
operator CustomSwData();
t_Gruvin9xCustomSwData() { memset(this, 0, sizeof(t_Gruvin9xCustomSwData)); }
t_Gruvin9xCustomSwData(CustomSwData&);
}) Gruvin9xCustomSwData;
PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
@@ -215,8 +201,6 @@ PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
operator SafetySwData();
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
t_Gruvin9xSafetySwData(SafetySwData&);
}) Gruvin9xSafetySwData;
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
@@ -225,8 +209,6 @@ PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
operator FuncSwData();
t_Gruvin9xFuncSwData() { memset(this, 0, sizeof(t_Gruvin9xFuncSwData)); }
t_Gruvin9xFuncSwData(FuncSwData&);
}) Gruvin9xFuncSwData;
PACK(typedef struct t_Gruvin9xFrSkyChannelData {
@@ -242,17 +224,13 @@ PACK(typedef struct t_Gruvin9xFrSkyChannelData {
operator FrSkyChannelData();
t_Gruvin9xFrSkyChannelData();
t_Gruvin9xFrSkyChannelData(FrSkyChannelData&);
}) Gruvin9xFrSkyChannelData;
PACK(typedef struct t_Gruvin9xFrSkyData {
Gruvin9xFrSkyChannelData channels[2];
operator FrSkyData();
t_Gruvin9xFrSkyData();
t_Gruvin9xFrSkyData(FrSkyData&);
Gruvin9xFrSkyChannelData channels[2];
operator FrSkyData();
t_Gruvin9xFrSkyData();
}) Gruvin9xFrSkyData;
PACK(typedef struct t_Gruvin9xSwashRingData { // Swash Ring data
@@ -265,8 +243,6 @@ PACK(typedef struct t_Gruvin9xSwashRingData { // Swash Ring data
operator SwashRingData();
t_Gruvin9xSwashRingData();
t_Gruvin9xSwashRingData(SwashRingData&);
}) Gruvin9xSwashRingData;
PACK(typedef struct t_Gruvin9xPhaseData_v102 {
@@ -291,7 +267,6 @@ PACK(typedef struct t_Gruvin9xPhaseData_v106 {
operator PhaseData();
t_Gruvin9xPhaseData_v106() { memset(this, 0, sizeof(t_Gruvin9xPhaseData_v106)); }
t_Gruvin9xPhaseData_v106(PhaseData &eepe);
}) Gruvin9xPhaseData_v106;
PACK(typedef struct t_Gruvin9xTimerData {
@@ -301,7 +276,6 @@ PACK(typedef struct t_Gruvin9xTimerData {
operator TimerData();
t_Gruvin9xTimerData() { memset(this, 0, sizeof(t_Gruvin9xTimerData)); }
t_Gruvin9xTimerData(TimerData &eepe);
}) Gruvin9xTimerData;
#define G9X_MAX_PHASES 5
@@ -410,8 +384,6 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
operator ModelData();
t_Gruvin9xModelData_v105() { memset(this, 0, sizeof(t_Gruvin9xModelData_v105)); }
t_Gruvin9xModelData_v105(ModelData&);
}) Gruvin9xModelData_v105;
PACK(typedef struct t_Gruvin9xModelData_v106 {
@@ -443,11 +415,8 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
operator ModelData();
t_Gruvin9xModelData_v106() { memset(this, 0, sizeof(t_Gruvin9xModelData_v106)); }
t_Gruvin9xModelData_v106(ModelData&);
}) Gruvin9xModelData_v106;
typedef Gruvin9xModelData_v106 Gruvin9xModelData;
#endif
/*eof*/
@@ -200,62 +200,20 @@ bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int es
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
EEPROMWarnings.clear();
std::cout << "NO!\n";
// TODO an error
int size = getEEpromSize();
efile->EeFsCreate(eeprom, size, BOARD_STOCK);
Gruvin9xGeneral gruvin9xGeneral(radioData.generalSettings);
int sz = efile->writeRlc2(FILE_GENERAL, FILE_TYP_GENERAL, (uint8_t*)&gruvin9xGeneral, sizeof(Gruvin9xGeneral));
if(sz != sizeof(Gruvin9xGeneral)) {
return 0;
}
for (int i=0; i<getMaxModels(); i++) {
if (!radioData.models[i].isempty()) {
ModelData model = radioData.models[i];
if (1/*version < */) {
applyStickModeToModel(model, radioData.generalSettings.stickMode+1);
}
Gruvin9xModelData gruvin9xModel(model);
sz = efile->writeRlc2(FILE_MODEL(i), FILE_TYP_MODEL, (uint8_t*)&gruvin9xModel, sizeof(Gruvin9xModelData));
if(sz != sizeof(Gruvin9xModelData)) {
return 0;
}
}
}
return size;
return 0;
}
int Gruvin9xInterface::getSize(ModelData &model)
{
if (model.isempty())
return 0;
uint8_t tmp[EESIZE_GRUVIN9X];
efile->EeFsCreate(tmp, EESIZE_GRUVIN9X, BOARD_STOCK);
Gruvin9xModelData gruvin9xModel(model);
int sz = efile->writeRlc2(0, FILE_TYP_MODEL, (uint8_t*)&gruvin9xModel, sizeof(Gruvin9xModelData));
if(sz != sizeof(Gruvin9xModelData)) {
return -1;
}
return efile->size(0);
return 0;
}
int Gruvin9xInterface::getSize(GeneralSettings &settings)
{
uint8_t tmp[EESIZE_GRUVIN9X];
efile->EeFsCreate(tmp, EESIZE_GRUVIN9X, BOARD_STOCK);
Gruvin9xGeneral gruvin9xGeneral(settings);
int sz = efile->writeRlc1(0, FILE_TYP_GENERAL, (uint8_t*)&gruvin9xGeneral, sizeof(gruvin9xGeneral));
if(sz != sizeof(gruvin9xGeneral)) {
return -1;
}
return efile->size(0);
return 0;
}
int Gruvin9xInterface::getCapability(const Capability capability)
@@ -263,10 +221,6 @@ int Gruvin9xInterface::getCapability(const Capability capability)
switch (capability) {
case OwnerName:
return 0;
case NumCurves5:
return G9X_MAX_CURVE5;
case NumCurves9:
return G9X_MAX_CURVE9;
case Mixes:
return G9X_MAX_MIXERS;
case FlightPhases:
@@ -297,7 +251,6 @@ int Gruvin9xInterface::getCapability(const Capability capability)
return true;
case OffsetWeight:
return 125;
case HasExpoCurves:
case HasContrast:
return true;
case Telemetry:
File diff suppressed because it is too large Load Diff
@@ -32,7 +32,6 @@ PACK(typedef struct t_Open9xGruvin9xPhaseData_v207 {
int16_t rotaryEncoders[2];
operator PhaseData();
t_Open9xGruvin9xPhaseData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v207)); }
t_Open9xGruvin9xPhaseData_v207(PhaseData &eepe);
}) Open9xGruvin9xPhaseData_v207;
PACK(typedef struct t_Open9xGruvin9xPhaseData_v208 {
@@ -44,7 +43,6 @@ PACK(typedef struct t_Open9xGruvin9xPhaseData_v208 {
int16_t rotaryEncoders[2];
operator PhaseData();
t_Open9xGruvin9xPhaseData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v208)); }
t_Open9xGruvin9xPhaseData_v208(PhaseData &eepe);
}) Open9xGruvin9xPhaseData_v208;
PACK(typedef struct t_Open9xGruvin9xMixData_v207 {
@@ -66,8 +64,6 @@ PACK(typedef struct t_Open9xGruvin9xMixData_v207 {
operator MixData();
t_Open9xGruvin9xMixData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v207)); }
t_Open9xGruvin9xMixData_v207(MixData&);
}) Open9xGruvin9xMixData_v207;
PACK(typedef struct t_Open9xGruvin9xMixData_v209 {
@@ -89,8 +85,6 @@ PACK(typedef struct t_Open9xGruvin9xMixData_v209 {
operator MixData();
t_Open9xGruvin9xMixData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v209)); }
t_Open9xGruvin9xMixData_v209(MixData&);
}) Open9xGruvin9xMixData_v209;
PACK(typedef struct t_Open9xGruvin9xMixData_v211 {
@@ -114,8 +108,6 @@ PACK(typedef struct t_Open9xGruvin9xMixData_v211 {
operator MixData();
t_Open9xGruvin9xMixData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v211)); }
t_Open9xGruvin9xMixData_v211(MixData&);
}) Open9xGruvin9xMixData_v211;
PACK(typedef struct t_Open9xGruvin9xCustomSwData_v207 { // Custom Switches data
@@ -125,10 +117,8 @@ PACK(typedef struct t_Open9xGruvin9xCustomSwData_v207 { // Custom Switches data
operator CustomSwData();
t_Open9xGruvin9xCustomSwData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomSwData_v207)); }
t_Open9xGruvin9xCustomSwData_v207(CustomSwData&);
int8_t fromSource(RawSource source);
RawSource toSource(int8_t value);
}) Open9xGruvin9xCustomSwData_v207;
PACK(typedef struct t_Open9xGruvin9xCustomSwData_v209 { // Custom Switches data
@@ -138,10 +128,8 @@ PACK(typedef struct t_Open9xGruvin9xCustomSwData_v209 { // Custom Switches data
operator CustomSwData();
t_Open9xGruvin9xCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomSwData_v209)); }
t_Open9xGruvin9xCustomSwData_v209(CustomSwData&);
int8_t fromSource(RawSource source);
RawSource toSource(int8_t value);
}) Open9xGruvin9xCustomSwData_v209;
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
@@ -151,8 +139,6 @@ PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v203)); }
t_Open9xGruvin9xFuncSwData_v203(FuncSwData&);
}) Open9xGruvin9xFuncSwData_v203;
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v210 { // Function Switches data
@@ -163,8 +149,6 @@ PACK(typedef struct t_Open9xGruvin9xFuncSwData_v210 { // Function Switches data
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v210)); }
t_Open9xGruvin9xFuncSwData_v210(FuncSwData&);
}) Open9xGruvin9xFuncSwData_v210;
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v208 { // Swash Ring data
@@ -177,8 +161,6 @@ PACK(typedef struct t_Open9xGruvin9xSwashRingData_v208 { // Swash Ring data
operator SwashRingData();
t_Open9xGruvin9xSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xSwashRingData_v208)); }
t_Open9xGruvin9xSwashRingData_v208(SwashRingData&);
}) Open9xGruvin9xSwashRingData_v208;
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v209 { // Swash Ring data
@@ -191,8 +173,6 @@ PACK(typedef struct t_Open9xGruvin9xSwashRingData_v209 { // Swash Ring data
operator SwashRingData();
t_Open9xGruvin9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xSwashRingData_v209)); }
t_Open9xGruvin9xSwashRingData_v209(SwashRingData&);
}) Open9xGruvin9xSwashRingData_v209;
PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
@@ -227,8 +207,6 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
operator ModelData();
t_Open9xGruvin9xModelData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v207)); }
t_Open9xGruvin9xModelData_v207(ModelData&);
}) Open9xGruvin9xModelData_v207;
PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
@@ -268,8 +246,6 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
operator ModelData();
t_Open9xGruvin9xModelData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v208)); }
t_Open9xGruvin9xModelData_v208(ModelData&);
}) Open9xGruvin9xModelData_v208;
PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
@@ -310,8 +286,6 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
operator ModelData();
t_Open9xGruvin9xModelData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v209)); }
t_Open9xGruvin9xModelData_v209(ModelData&);
}) Open9xGruvin9xModelData_v209;
PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
@@ -350,8 +324,6 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
operator ModelData();
t_Open9xGruvin9xModelData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v210)); }
t_Open9xGruvin9xModelData_v210(ModelData&);
}) Open9xGruvin9xModelData_v210;
PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
@@ -388,8 +360,6 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
operator ModelData();
t_Open9xGruvin9xModelData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v211)); }
t_Open9xGruvin9xModelData_v211(ModelData&);
}) Open9xGruvin9xModelData_v211;
#endif
File diff suppressed because it is too large Load Diff
@@ -36,7 +36,6 @@ PACK(typedef struct t_Open9xArmTimerData_v202 {
operator TimerData();
t_Open9xArmTimerData_v202() { memset(this, 0, sizeof(t_Open9xArmTimerData_v202)); }
t_Open9xArmTimerData_v202(TimerData &eepe);
}) Open9xArmTimerData_v202;
PACK(typedef struct t_Open9xArmExpoData_v208 {
@@ -50,8 +49,6 @@ PACK(typedef struct t_Open9xArmExpoData_v208 {
operator ExpoData();
t_Open9xArmExpoData_v208() { memset(this, 0, sizeof(t_Open9xArmExpoData_v208)); }
t_Open9xArmExpoData_v208(ExpoData&);
}) Open9xArmExpoData_v208;
PACK(typedef struct t_Open9xArmExpoData_v210 {
@@ -67,8 +64,6 @@ PACK(typedef struct t_Open9xArmExpoData_v210 {
operator ExpoData();
t_Open9xArmExpoData_v210() { memset(this, 0, sizeof(t_Open9xArmExpoData_v210)); }
t_Open9xArmExpoData_v210(ExpoData&);
}) Open9xArmExpoData_v210;
PACK(typedef struct t_Open9xArmExpoData_v212 {
@@ -83,8 +78,6 @@ PACK(typedef struct t_Open9xArmExpoData_v212 {
operator ExpoData();
t_Open9xArmExpoData_v212() { memset(this, 0, sizeof(t_Open9xArmExpoData_v212)); }
t_Open9xArmExpoData_v212(ExpoData&);
}) Open9xArmExpoData_v212;
PACK(typedef struct t_Open9xArmMixData_v208 {
@@ -106,8 +99,6 @@ PACK(typedef struct t_Open9xArmMixData_v208 {
operator MixData();
t_Open9xArmMixData_v208() { memset(this, 0, sizeof(t_Open9xArmMixData_v208)); }
t_Open9xArmMixData_v208(MixData&);
}) Open9xArmMixData_v208;
PACK(typedef struct t_Open9xArmMixData_v209 {
@@ -129,8 +120,6 @@ PACK(typedef struct t_Open9xArmMixData_v209 {
operator MixData();
t_Open9xArmMixData_v209() { memset(this, 0, sizeof(t_Open9xArmMixData_v209)); }
t_Open9xArmMixData_v209(MixData&);
}) Open9xArmMixData_v209;
PACK(typedef struct t_Open9xArmMixData_v210 {
@@ -154,8 +143,6 @@ PACK(typedef struct t_Open9xArmMixData_v210 {
operator MixData();
t_Open9xArmMixData_v210() { memset(this, 0, sizeof(t_Open9xArmMixData_v210)); }
t_Open9xArmMixData_v210(MixData&);
}) Open9xArmMixData_v210;
PACK(typedef struct t_Open9xArmMixData_v212 {
@@ -180,8 +167,6 @@ PACK(typedef struct t_Open9xArmMixData_v212 {
operator MixData();
t_Open9xArmMixData_v212() { memset(this, 0, sizeof(t_Open9xArmMixData_v212)); }
t_Open9xArmMixData_v212(MixData&);
}) Open9xArmMixData_v212;
PACK(typedef struct t_Open9xArmPhaseData_v208 {
@@ -192,7 +177,6 @@ PACK(typedef struct t_Open9xArmPhaseData_v208 {
uint8_t fadeOut:4;
operator PhaseData();
t_Open9xArmPhaseData_v208() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v208)); }
t_Open9xArmPhaseData_v208(PhaseData &eepe);
}) Open9xArmPhaseData_v208;
PACK(typedef struct t_Open9xArmPhaseData_v212 {
@@ -204,7 +188,6 @@ PACK(typedef struct t_Open9xArmPhaseData_v212 {
int16_t rotaryEncoders[1];
operator PhaseData();
t_Open9xArmPhaseData_v212() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v212)); }
t_Open9xArmPhaseData_v212(PhaseData &eepe);
}) Open9xArmPhaseData_v212;
PACK(typedef struct t_Open9xArmCustomSwData_v208 { // Custom Switches data
@@ -214,7 +197,6 @@ PACK(typedef struct t_Open9xArmCustomSwData_v208 { // Custom Switches data
operator CustomSwData();
t_Open9xArmCustomSwData_v208() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v208)); }
t_Open9xArmCustomSwData_v208(CustomSwData&);
}) Open9xArmCustomSwData_v208;
PACK(typedef struct t_Open9xArmCustomSwData_v209 { // Custom Switches data
@@ -224,7 +206,6 @@ PACK(typedef struct t_Open9xArmCustomSwData_v209 { // Custom Switches data
operator CustomSwData();
t_Open9xArmCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v209)); }
t_Open9xArmCustomSwData_v209(CustomSwData&);
}) Open9xArmCustomSwData_v209;
PACK(typedef struct t_Open9xArmCustomSwData_v210 { // Custom Switches data
@@ -236,7 +217,6 @@ PACK(typedef struct t_Open9xArmCustomSwData_v210 { // Custom Switches data
operator CustomSwData();
t_Open9xArmCustomSwData_v210() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v210)); }
t_Open9xArmCustomSwData_v210(CustomSwData&);
}) Open9xArmCustomSwData_v210;
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
@@ -246,8 +226,6 @@ PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
operator FuncSwData();
t_Open9xArmFuncSwData_v208() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v208)); }
t_Open9xArmFuncSwData_v208(FuncSwData&);
}) Open9xArmFuncSwData_v208;
PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
@@ -257,8 +235,6 @@ PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
operator FuncSwData();
t_Open9xArmFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v210)); }
t_Open9xArmFuncSwData_v210(FuncSwData&);
}) Open9xArmFuncSwData_v210;
PACK(typedef struct t_Open9xArmFuncSwData_v211 { // Function Switches data
@@ -270,8 +246,6 @@ PACK(typedef struct t_Open9xArmFuncSwData_v211 { // Function Switches data
operator FuncSwData();
t_Open9xArmFuncSwData_v211() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v211)); }
t_Open9xArmFuncSwData_v211(FuncSwData&);
}) Open9xArmFuncSwData_v211;
PACK(typedef struct t_Open9xArmSwashRingData_v208 { // Swash Ring data
@@ -284,8 +258,6 @@ PACK(typedef struct t_Open9xArmSwashRingData_v208 { // Swash Ring data
operator SwashRingData();
t_Open9xArmSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v208)); }
t_Open9xArmSwashRingData_v208(SwashRingData&);
}) Open9xArmSwashRingData_v208;
PACK(typedef struct t_Open9xArmSwashRingData_v209 { // Swash Ring data
@@ -298,8 +270,6 @@ PACK(typedef struct t_Open9xArmSwashRingData_v209 { // Swash Ring data
operator SwashRingData();
t_Open9xArmSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v209)); }
t_Open9xArmSwashRingData_v209(SwashRingData&);
}) Open9xArmSwashRingData_v209;
PACK(typedef struct t_Open9xArmSwashRingData_v210 { // Swash Ring data
@@ -312,8 +282,6 @@ PACK(typedef struct t_Open9xArmSwashRingData_v210 { // Swash Ring data
operator SwashRingData();
t_Open9xArmSwashRingData_v210() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v210)); }
t_Open9xArmSwashRingData_v210(SwashRingData&);
}) Open9xArmSwashRingData_v210;
@@ -336,7 +304,6 @@ PACK(typedef struct t_Open9xArmFrSkyData_v210 {
operator FrSkyData();
t_Open9xArmFrSkyData_v210() { memset(this, 0, sizeof(t_Open9xArmFrSkyData_v210)); }
t_Open9xArmFrSkyData_v210(FrSkyData&);
}) Open9xArmFrSkyData_v210;
PACK(typedef struct t_Open9xArmFrSkyData_v211 {
@@ -355,7 +322,6 @@ PACK(typedef struct t_Open9xArmFrSkyData_v211 {
operator FrSkyData();
t_Open9xArmFrSkyData_v211() { memset(this, 0, sizeof(t_Open9xArmFrSkyData_v211)); }
t_Open9xArmFrSkyData_v211(FrSkyData&);
}) Open9xArmFrSkyData_v211;
PACK(typedef struct t_Open9xArmModelData_v208 {
@@ -395,8 +361,6 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
operator ModelData();
t_Open9xArmModelData_v208() { memset(this, 0, sizeof(t_Open9xArmModelData_v208)); }
t_Open9xArmModelData_v208(ModelData&);
}) Open9xArmModelData_v208;
PACK(typedef struct t_Open9xArmModelData_v209 {
@@ -437,8 +401,6 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
operator ModelData();
t_Open9xArmModelData_v209() { memset(this, 0, sizeof(t_Open9xArmModelData_v209)); }
t_Open9xArmModelData_v209(ModelData&);
}) Open9xArmModelData_v209;
PACK(typedef struct t_Open9xArmModelData_v210 {
@@ -477,7 +439,6 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
operator ModelData();
t_Open9xArmModelData_v210() { memset(this, 0, sizeof(t_Open9xArmModelData_v210)); }
t_Open9xArmModelData_v210(ModelData&);
}) Open9xArmModelData_v210;
@@ -517,8 +478,6 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
operator ModelData();
t_Open9xArmModelData_v211() { memset(this, 0, sizeof(t_Open9xArmModelData_v211)); }
t_Open9xArmModelData_v211(ModelData&);
}) Open9xArmModelData_v211;
PACK(typedef struct t_Open9xArmModelData_v212 {
@@ -555,8 +514,6 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
operator ModelData();
t_Open9xArmModelData_v212() { memset(this, 0, sizeof(t_Open9xArmModelData_v212)); }
t_Open9xArmModelData_v212(ModelData&);
}) Open9xArmModelData_v212;
#endif
File diff suppressed because it is too large Load Diff
@@ -65,7 +65,6 @@ PACK(typedef struct t_Open9xFrSkyRSSIAlarm {
int8_t value:6;
FrSkyRSSIAlarm get(int index);
t_Open9xFrSkyRSSIAlarm() { memset(this, 0, sizeof(t_Open9xFrSkyRSSIAlarm)); }
t_Open9xFrSkyRSSIAlarm(int index, FrSkyRSSIAlarm&);
}) Open9xFrSkyRSSIAlarm;
PACK(typedef struct t_Open9xExpoData_v201 {
@@ -80,8 +79,6 @@ PACK(typedef struct t_Open9xExpoData_v201 {
operator ExpoData();
t_Open9xExpoData_v201() { memset(this, 0, sizeof(t_Open9xExpoData_v201)); }
t_Open9xExpoData_v201(ExpoData&);
}) Open9xExpoData_v201;
PACK(typedef struct t_Open9xExpoData_v211 {
@@ -95,8 +92,6 @@ PACK(typedef struct t_Open9xExpoData_v211 {
operator ExpoData();
t_Open9xExpoData_v211() { memset(this, 0, sizeof(t_Open9xExpoData_v211)); }
t_Open9xExpoData_v211(ExpoData&);
}) Open9xExpoData_v211;
PACK(typedef struct t_Open9xLimitData_v201 {
@@ -107,8 +102,6 @@ PACK(typedef struct t_Open9xLimitData_v201 {
operator LimitData();
t_Open9xLimitData_v201() { memset(this, 0, sizeof(t_Open9xLimitData_v201)); }
t_Open9xLimitData_v201(LimitData&);
}) Open9xLimitData_v201;
PACK(typedef struct t_Open9xLimitData_v211 {
@@ -121,8 +114,6 @@ PACK(typedef struct t_Open9xLimitData_v211 {
operator LimitData();
t_Open9xLimitData_v211() { memset(this, 0, sizeof(t_Open9xLimitData_v211)); }
t_Open9xLimitData_v211(LimitData&);
}) Open9xLimitData_v211;
PACK(typedef struct t_Open9xMixData_v201 {
@@ -143,8 +134,6 @@ PACK(typedef struct t_Open9xMixData_v201 {
operator MixData();
t_Open9xMixData_v201() { memset(this, 0, sizeof(t_Open9xMixData_v201)); }
t_Open9xMixData_v201(MixData&);
}) Open9xMixData_v201;
PACK(typedef struct t_Open9xMixData_v203 {
@@ -165,8 +154,6 @@ PACK(typedef struct t_Open9xMixData_v203 {
operator MixData();
t_Open9xMixData_v203() { memset(this, 0, sizeof(t_Open9xMixData_v203)); }
t_Open9xMixData_v203(MixData&);
}) Open9xMixData_v203;
PACK(typedef struct t_Open9xMixData_v205 {
@@ -188,8 +175,6 @@ PACK(typedef struct t_Open9xMixData_v205 {
operator MixData();
t_Open9xMixData_v205() { memset(this, 0, sizeof(t_Open9xMixData_v205)); }
t_Open9xMixData_v205(MixData&);
}) Open9xMixData_v205;
PACK(typedef struct t_Open9xMixData_v209 {
@@ -211,8 +196,6 @@ PACK(typedef struct t_Open9xMixData_v209 {
operator MixData();
t_Open9xMixData_v209() { memset(this, 0, sizeof(t_Open9xMixData_v209)); }
t_Open9xMixData_v209(MixData&);
}) Open9xMixData_v209;
PACK(typedef struct t_Open9xMixData_v211 {
@@ -236,8 +219,6 @@ PACK(typedef struct t_Open9xMixData_v211 {
operator MixData();
t_Open9xMixData_v211() { memset(this, 0, sizeof(t_Open9xMixData_v211)); }
t_Open9xMixData_v211(MixData&);
}) Open9xMixData_v211;
PACK(typedef struct t_Open9xCustomSwData_v208 { // Custom Switches data
@@ -257,7 +238,6 @@ PACK(typedef struct t_Open9xCustomSwData_v209 { // Custom Switches data
operator CustomSwData();
t_Open9xCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xCustomSwData_v209)); }
t_Open9xCustomSwData_v209(CustomSwData&);
}) Open9xCustomSwData_v209;
PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
@@ -266,8 +246,6 @@ PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
operator SafetySwData();
t_Open9xSafetySwData() { memset(this, 0, sizeof(t_Open9xSafetySwData)); }
t_Open9xSafetySwData(SafetySwData&);
}) Open9xSafetySwData;
PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
@@ -276,8 +254,6 @@ PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
operator FuncSwData();
t_Open9xFuncSwData_v201() { memset(this, 0, sizeof(t_Open9xFuncSwData_v201)); }
t_Open9xFuncSwData_v201(FuncSwData&);
}) Open9xFuncSwData_v201;
PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
@@ -287,8 +263,6 @@ PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
operator FuncSwData();
t_Open9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xFuncSwData_v203)); }
t_Open9xFuncSwData_v203(FuncSwData&);
}) Open9xFuncSwData_v203;
PACK(typedef struct t_Open9xFuncSwData_v210 { // Function Switches data
@@ -299,8 +273,6 @@ PACK(typedef struct t_Open9xFuncSwData_v210 { // Function Switches data
operator FuncSwData();
t_Open9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xFuncSwData_v210)); }
t_Open9xFuncSwData_v210(FuncSwData&);
}) Open9xFuncSwData_v210;
PACK(typedef struct t_Open9xFrSkyChannelData_v201 {
@@ -316,8 +288,6 @@ PACK(typedef struct t_Open9xFrSkyChannelData_v201 {
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v201() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v201)); }
t_Open9xFrSkyChannelData_v201(FrSkyChannelData&);
}) Open9xFrSkyChannelData_v201;
PACK(typedef struct t_Open9xFrSkyChannelData_v203 {
@@ -333,8 +303,6 @@ PACK(typedef struct t_Open9xFrSkyChannelData_v203 {
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v203() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v203)); }
t_Open9xFrSkyChannelData_v203(FrSkyChannelData&);
}) Open9xFrSkyChannelData_v203;
PACK(typedef struct t_Open9xFrSkyChannelData_v204 {
@@ -348,8 +316,6 @@ PACK(typedef struct t_Open9xFrSkyChannelData_v204 {
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v204)); }
t_Open9xFrSkyChannelData_v204(FrSkyChannelData&);
}) Open9xFrSkyChannelData_v204;
PACK(typedef struct t_Open9xFrSkyChannelData_v208 {
@@ -363,37 +329,30 @@ PACK(typedef struct t_Open9xFrSkyChannelData_v208 {
operator FrSkyChannelData();
t_Open9xFrSkyChannelData_v208() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v208)); }
t_Open9xFrSkyChannelData_v208(FrSkyChannelData&);
}) Open9xFrSkyChannelData_v208;
PACK(typedef struct t_Open9xFrSkyData_v201 {
Open9xFrSkyChannelData_v201 channels[2];
operator FrSkyData();
t_Open9xFrSkyData_v201() { memset(this, 0, sizeof(t_Open9xFrSkyData_v201)); }
Open9xFrSkyChannelData_v201 channels[2];
operator FrSkyData();
t_Open9xFrSkyData_v201() { memset(this, 0, sizeof(t_Open9xFrSkyData_v201)); }
}) Open9xFrSkyData_v201;
PACK(typedef struct t_Open9xFrSkyData_v202 {
Open9xFrSkyChannelData_v201 channels[2];
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t spare:6;
operator FrSkyData();
t_Open9xFrSkyData_v202() { memset(this, 0, sizeof(t_Open9xFrSkyData_v202)); }
t_Open9xFrSkyData_v202(FrSkyData&);
Open9xFrSkyChannelData_v201 channels[2];
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint8_t spare:6;
operator FrSkyData();
t_Open9xFrSkyData_v202() { memset(this, 0, sizeof(t_Open9xFrSkyData_v202)); }
}) Open9xFrSkyData_v202;
PACK(typedef struct t_Open9xFrSkyData_v203 {
Open9xFrSkyChannelData_v203 channels[2];
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
operator FrSkyData();
t_Open9xFrSkyData_v203() { memset(this, 0, sizeof(t_Open9xFrSkyData_v203)); }
t_Open9xFrSkyData_v203(FrSkyData&);
Open9xFrSkyChannelData_v203 channels[2];
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
operator FrSkyData();
t_Open9xFrSkyData_v203() { memset(this, 0, sizeof(t_Open9xFrSkyData_v203)); }
}) Open9xFrSkyData_v203;
PACK(typedef struct t_Open9xFrSkyBarData_v204 {
@@ -403,8 +362,6 @@ PACK(typedef struct t_Open9xFrSkyBarData_v204 {
operator FrSkyBarData();
t_Open9xFrSkyBarData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyBarData_v204)); }
t_Open9xFrSkyBarData_v204(FrSkyBarData&);
}) Open9xFrSkyBarData_v204;
PACK(typedef struct t_Open9xFrSkyData_v204 {
@@ -417,7 +374,6 @@ PACK(typedef struct t_Open9xFrSkyData_v204 {
operator FrSkyData();
t_Open9xFrSkyData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyData_v204)); }
t_Open9xFrSkyData_v204(FrSkyData&);
}) Open9xFrSkyData_v204;
PACK(typedef struct t_Open9xFrSkyData_v205 {
@@ -431,7 +387,6 @@ PACK(typedef struct t_Open9xFrSkyData_v205 {
operator FrSkyData();
t_Open9xFrSkyData_v205() { memset(this, 0, sizeof(t_Open9xFrSkyData_v205)); }
t_Open9xFrSkyData_v205(FrSkyData&);
}) Open9xFrSkyData_v205;
PACK(typedef struct t_Open9xFrSkyData_v208 {
@@ -445,7 +400,6 @@ PACK(typedef struct t_Open9xFrSkyData_v208 {
operator FrSkyData();
t_Open9xFrSkyData_v208() { memset(this, 0, sizeof(t_Open9xFrSkyData_v208)); }
t_Open9xFrSkyData_v208(FrSkyData&);
}) Open9xFrSkyData_v208;
PACK(typedef struct t_Open9xFrSkyData_v210 {
@@ -466,7 +420,6 @@ PACK(typedef struct t_Open9xFrSkyData_v210 {
operator FrSkyData();
t_Open9xFrSkyData_v210() { memset(this, 0, sizeof(t_Open9xFrSkyData_v210)); }
t_Open9xFrSkyData_v210(FrSkyData&);
}) Open9xFrSkyData_v210;
PACK(typedef struct t_Open9xSwashRingData_v208 { // Swash Ring data
@@ -479,8 +432,6 @@ PACK(typedef struct t_Open9xSwashRingData_v208 { // Swash Ring data
operator SwashRingData();
t_Open9xSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xSwashRingData_v208)); }
t_Open9xSwashRingData_v208(SwashRingData&);
}) Open9xSwashRingData_v208;
PACK(typedef struct t_Open9xSwashRingData_v209 { // Swash Ring data
@@ -493,8 +444,6 @@ PACK(typedef struct t_Open9xSwashRingData_v209 { // Swash Ring data
operator SwashRingData();
t_Open9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xSwashRingData_v209)); }
t_Open9xSwashRingData_v209(SwashRingData&);
}) Open9xSwashRingData_v209;
PACK(typedef struct t_Open9xPhaseData_v201 {
@@ -507,7 +456,6 @@ PACK(typedef struct t_Open9xPhaseData_v201 {
operator PhaseData();
t_Open9xPhaseData_v201() { memset(this, 0, sizeof(t_Open9xPhaseData_v201)); }
t_Open9xPhaseData_v201(PhaseData &eepe);
}) Open9xPhaseData_v201;
PACK(typedef struct t_Open9xTimerData_v201 {
@@ -526,7 +474,6 @@ PACK(typedef struct t_Open9xTimerData_v202 {
operator TimerData();
t_Open9xTimerData_v202() { memset(this, 0, sizeof(t_Open9xTimerData_v202)); }
t_Open9xTimerData_v202(TimerData &eepe);
}) Open9xTimerData_v202;
PACK(typedef struct t_Open9xTimerDataExtra {
@@ -579,8 +526,6 @@ PACK(typedef struct t_Open9xModelData_v201 {
operator ModelData();
t_Open9xModelData_v201() { memset(this, 0, sizeof(t_Open9xModelData_v201)); }
t_Open9xModelData_v201(ModelData&);
}) Open9xModelData_v201;
PACK(typedef struct t_Open9xModelData_v202 {
@@ -615,8 +560,6 @@ PACK(typedef struct t_Open9xModelData_v202 {
operator ModelData();
t_Open9xModelData_v202() { memset(this, 0, sizeof(t_Open9xModelData_v202)); }
t_Open9xModelData_v202(ModelData&);
}) Open9xModelData_v202;
PACK(typedef struct t_Open9xModelData_v203 {
@@ -650,8 +593,6 @@ PACK(typedef struct t_Open9xModelData_v203 {
operator ModelData();
t_Open9xModelData_v203() { memset(this, 0, sizeof(t_Open9xModelData_v203)); }
t_Open9xModelData_v203(ModelData&);
}) Open9xModelData_v203;
PACK(typedef struct t_Open9xModelData_v204 {
@@ -686,8 +627,6 @@ PACK(typedef struct t_Open9xModelData_v204 {
operator ModelData();
t_Open9xModelData_v204() { memset(this, 0, sizeof(t_Open9xModelData_v204)); }
t_Open9xModelData_v204(ModelData&);
}) Open9xModelData_v204;
PACK(typedef struct t_Open9xModelData_v205 {
@@ -723,8 +662,6 @@ PACK(typedef struct t_Open9xModelData_v205 {
operator ModelData();
t_Open9xModelData_v205() { memset(this, 0, sizeof(t_Open9xModelData_v205)); }
t_Open9xModelData_v205(ModelData&);
}) Open9xModelData_v205;
PACK(typedef struct t_Open9xModelData_v208 {
@@ -764,8 +701,6 @@ PACK(typedef struct t_Open9xModelData_v208 {
operator ModelData();
t_Open9xModelData_v208() { memset(this, 0, sizeof(t_Open9xModelData_v208)); }
t_Open9xModelData_v208(ModelData&);
}) Open9xModelData_v208;
PACK(typedef struct t_Open9xModelData_v209 {
@@ -806,8 +741,6 @@ PACK(typedef struct t_Open9xModelData_v209 {
operator ModelData();
t_Open9xModelData_v209() { memset(this, 0, sizeof(t_Open9xModelData_v209)); }
t_Open9xModelData_v209(ModelData&);
}) Open9xModelData_v209;
PACK(typedef struct t_Open9xModelData_v210 {
@@ -846,8 +779,6 @@ PACK(typedef struct t_Open9xModelData_v210 {
operator ModelData();
t_Open9xModelData_v210() { memset(this, 0, sizeof(t_Open9xModelData_v210)); }
t_Open9xModelData_v210(ModelData&);
}) Open9xModelData_v210;
PACK(typedef struct t_Open9xModelData_v211 {
@@ -884,8 +815,6 @@ PACK(typedef struct t_Open9xModelData_v211 {
operator ModelData();
t_Open9xModelData_v211() { memset(this, 0, sizeof(t_Open9xModelData_v211)); }
t_Open9xModelData_v211(ModelData&);
}) Open9xModelData_v211;
#endif
@@ -14,9 +14,9 @@
*
*/
#include "open9xGruvin9xsimulator.h"
#include "open9xinterface.h"
#include "open9xeeprom.h"
#include "opentxGruvin9xsimulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define SIMU
#define SIMU_EXCEPTIONS
@@ -98,7 +98,7 @@ bool hasExtendedTrims()
uint8_t getStickMode()
{
return g_eeGeneral.stickMode;
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
@@ -160,7 +160,7 @@ void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx] - 1;
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
@@ -174,7 +174,7 @@ void Open9xGruvin9xSimulator::getTrims(Trims & trims)
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xGruvin9x::modn12x3[4*getStickMode() + i] - 1;
uint8_t idx = Open9xGruvin9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
@@ -14,9 +14,9 @@
*
*/
#include "open9xM128simulator.h"
#include "open9xinterface.h"
#include "open9xeeprom.h"
#include "opentxM128simulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define SIMU
#define SIMU_EXCEPTIONS
@@ -96,7 +96,7 @@ bool hasExtendedTrims()
uint8_t getStickMode()
{
return g_eeGeneral.stickMode;
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
@@ -154,7 +154,7 @@ void Open9xM128Simulator::setValues(TxInputs &inputs)
void Open9xM128Simulator::setTrim(unsigned int idx, int value)
{
idx = Open9xM128::modn12x3[4*getStickMode() + idx] - 1;
idx = Open9xM128::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
@@ -168,7 +168,7 @@ void Open9xM128Simulator::getTrims(Trims & trims)
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xM128::modn12x3[4*getStickMode() + i] - 1;
uint8_t idx = Open9xM128::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
@@ -14,8 +14,8 @@
*
*/
#include "open9xSky9xsimulator.h"
#include "open9xinterface.h"
#include "opentxSky9xsimulator.h"
#include "opentxinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
@@ -125,7 +125,7 @@ bool hasExtendedTrims()
uint8_t getStickMode()
{
return g_eeGeneral.stickMode;
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
@@ -193,7 +193,7 @@ void Open9xSky9xSimulator::setValues(TxInputs &inputs)
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx] - 1;
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
@@ -207,7 +207,7 @@ void Open9xSky9xSimulator::getTrims(Trims & trims)
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i] - 1;
uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
@@ -15,7 +15,7 @@
*/
#include "opentxTaranisSimulator.h"
#include "open9xinterface.h"
#include "opentxinterface.h"
#define SIMU
#define SIMU_EXCEPTIONS
@@ -128,7 +128,7 @@ bool hasExtendedTrims()
uint8_t getStickMode()
{
return g_eeGeneral.stickMode;
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
void resetTrims()
@@ -200,7 +200,7 @@ void OpentxTaranisSimulator::setValues(TxInputs &inputs)
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xX9D::modn12x3[4*getStickMode() + idx] - 1;
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
@@ -214,7 +214,7 @@ void OpentxTaranisSimulator::getTrims(Trims & trims)
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i] - 1;
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <algorithm>
#include "helpers.h"
#include "open9xeeprom.h"
#include "opentxeeprom.h"
#include <QObject>
#define IS_DBLEEPROM(board, version) ((board==BOARD_GRUVIN9X || board==BOARD_M128) && version >= 213)
@@ -18,10 +18,11 @@
#define MAX_PHASES(board, version) (IS_ARM(board) ? 9 : (IS_DBLRAM(board, version) ? 6 : 5))
#define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32)
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
#define MAX_EXPOS(board, version) (IS_ARM(board) ? 32 : (IS_DBLRAM(board, version) ? 16 : 14))
#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_CURVES(board) (IS_ARM(board) ? O9X_ARM_MAX_CURVES : O9X_MAX_CURVES)
#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)
#define IS_RELEASE_21_MARCH_2013(board, version) (version >= 214 || (!IS_ARM(board) && version >= 213))
#define IS_RELEASE_23_MARCH_2013(board, version) (version >= 214 || (board==BOARD_STOCK && version >= 213))
@@ -134,6 +135,16 @@ class SourcesConversionTable: public ConversionTable {
addConversion(RawSource(SOURCE_TYPE_NONE), val++);
}
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 j=0; j<6; j++) {
addConversion(RawSource(SOURCE_TYPE_LUA_INPUT, i*16+j), val++);
}
}
}
for (int i=0; i<4+MAX_POTS(board); i++)
addConversion(RawSource(SOURCE_TYPE_STICK, i), val++);
@@ -352,6 +363,36 @@ class SourceField: public ConversionField< UnsignedField<N> > {
unsigned int _source;
};
class CurveReferenceField: public TransformedField {
public:
CurveReferenceField(CurveReference & curve, BoardEnum board, unsigned int version):
TransformedField(internalField),
curve(curve),
_curve_type(0)
{
internalField.Append(new UnsignedField<8>(_curve_type));
internalField.Append(new SignedField<8>(curve.value));
}
virtual void beforeExport()
{
if (curve.value != 0)
_curve_type = (unsigned int)curve.type;
else
_curve_type = 0;
}
virtual void afterImport()
{
curve.type = (CurveReference::CurveRefType)_curve_type;
}
protected:
StructField internalField;
CurveReference & curve;
unsigned int _curve_type;
};
class HeliField: public StructField {
public:
HeliField(SwashRingData & heli, BoardEnum board, unsigned int version, unsigned int variant)
@@ -409,7 +450,7 @@ class PhaseField: public TransformedField {
}
if (board != BOARD_STOCK && (board != BOARD_M128 || version < 215)) {
for (int i=0; i<O9X_MAX_GVARS; i++) {
for (int i=0; i<MAX_GVARS(board, version); i++) {
internalField.Append(new SignedField<16>(phase.gvars[i]));
}
}
@@ -595,7 +636,25 @@ class MixField: public TransformedField {
board(board),
version(version)
{
if (IS_ARM(board)) {
if (IS_TARANIS(board) && version >= 216) {
internalField.Append(new UnsignedField<8>(_destCh));
internalField.Append(new UnsignedField<16>(mix.phases));
internalField.Append(new UnsignedField<8>((unsigned int &)mix.mltpx));
internalField.Append(new SignedField<16>(_weight));
internalField.Append(new SwitchField<8>(mix.swtch, board, version));
internalField.Append(new CurveReferenceField(mix.curve, board, version));
internalField.Append(new UnsignedField<4>(mix.mixWarn));
internalField.Append(new UnsignedField<4>(mix.srcVariant));
internalField.Append(new UnsignedField<8>(mix.delayUp));
internalField.Append(new UnsignedField<8>(mix.delayDown));
internalField.Append(new UnsignedField<8>(mix.speedUp));
internalField.Append(new UnsignedField<8>(mix.speedDown));
internalField.Append(new SourceField<8>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
internalField.Append(new SignedField<16>(_offset));
internalField.Append(new ZCharField<8>(mix.name));
internalField.Append(new SpareBitsField<8>());
}
else if (IS_ARM(board)) {
internalField.Append(new UnsignedField<8>(_destCh));
internalField.Append(new UnsignedField<16>(mix.phases));
internalField.Append(new BoolField<1>(_curveMode));
@@ -680,8 +739,18 @@ class MixField: public TransformedField {
{
if (mix.destCh && mix.srcRaw.type != SOURCE_TYPE_NONE) {
_destCh = mix.destCh - 1;
_curveMode = mix.curve;
_curveParam = (mix.curve ? mix.curve : smallGvarToEEPROM(mix.differential));
if (mix.curve.type == CurveReference::CURVE_REF_CUSTOM) {
_curveMode = true;
_curveParam = 6 + mix.curve.value;
}
else if (mix.curve.type == CurveReference::CURVE_REF_FUNC) {
_curveMode = true;
_curveParam = mix.curve.value;
}
else if (mix.curve.type == CurveReference::CURVE_REF_DIFF) {
_curveMode = 0;
_curveParam = smallGvarToEEPROM(mix.curve.value);
}
}
else {
mix.clear();
@@ -707,12 +776,14 @@ class MixField: public TransformedField {
{
if (mix.srcRaw.type != SOURCE_TYPE_NONE) {
mix.destCh = _destCh + 1;
mix.curve = 0;
mix.differential = 0;
if (_curveMode)
mix.curve = _curveParam;
else
mix.differential = smallGvarToC9x(_curveParam);
if (!IS_ARM(board) || version < 216) {
if (!_curveMode)
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
else if (_curveParam > 6)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
else
mix.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
}
}
if (IS_ARM(board)) {
@@ -748,9 +819,23 @@ class ExpoField: public TransformedField {
TransformedField(internalField),
internalField("Expo"),
expo(expo),
board(board)
board(board),
version(version)
{
if (IS_ARM(board)) {
if (IS_TARANIS(board) && version >= 216) {
internalField.Append(new SourceField<8>(expo.srcRaw, board, version, 0));
internalField.Append(new UnsignedField<16>(expo.scale));
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
internalField.Append(new UnsignedField<16>(expo.phases));
internalField.Append(new SignedField<8>(_weight, "Weight"));
internalField.Append(new SignedField<8>(expo.carryTrim));
internalField.Append(new ZCharField<8>(expo.name));
internalField.Append(new SignedField<8>(expo.offset, "Offset"));
internalField.Append(new CurveReferenceField(expo.curve, board, version));
internalField.Append(new SpareBitsField<8>());
}
else if (IS_ARM(board)) {
internalField.Append(new UnsignedField<8>(expo.mode));
internalField.Append(new UnsignedField<8>(expo.chn));
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
@@ -789,22 +874,41 @@ class ExpoField: public TransformedField {
virtual void beforeExport()
{
_curveMode = (expo.curveMode && expo.curveParam);
_weight = smallGvarToEEPROM(expo.weight);
_curveParam = smallGvarToEEPROM(expo.curveParam);
if (!IS_TARANIS(board) || version < 216) {
if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) {
_curveMode = true;
_curveParam = expo.curve.value;
}
else if (expo.curve.type==CurveReference::CURVE_REF_CUSTOM && expo.curve.value) {
_curveMode = true;
_curveParam = expo.curve.value+6;
}
else {
_curveMode = false;
_curveParam = smallGvarToEEPROM(expo.curve.value);
}
}
}
virtual void afterImport()
{
expo.curveMode = _curveMode;
expo.weight = smallGvarToC9x(_weight);
expo.curveParam = smallGvarToC9x(_curveParam);
if (!IS_TARANIS(board) || version < 216) {
if (!_curveMode)
expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam));
else if (_curveParam > 6)
expo.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
else
expo.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
}
}
protected:
StructField internalField;
ExpoData & expo;
BoardEnum board;
unsigned int version;
bool _curveMode;
int _weight;
int _curveParam;
@@ -812,36 +916,56 @@ class ExpoField: public TransformedField {
class LimitField: public StructField {
public:
LimitField(LimitData & limit, BoardEnum board):
LimitField(LimitData & limit, BoardEnum board, unsigned int version):
StructField("Limit")
{
Append(new ConversionField< SignedField<8> >(limit.min, +100));
Append(new ConversionField< SignedField<8> >(limit.max, -100));
if (IS_ARM(board) && version >= 216) {
Append(new ConversionField< SignedField<16> >(limit.min, +1000));
Append(new ConversionField< SignedField<16> >(limit.max, -1000));
}
else {
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
Append(new ConversionField< SignedField<8> >(limit.max, -100, 10));
}
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
Append(new BoolField<1>(limit.symetrical));
Append(new BoolField<1>(limit.revert));
if (HAS_LARGE_LCD(board))
if (HAS_LARGE_LCD(board)) {
Append(new ZCharField<6>(limit.name));
}
if (IS_TARANIS(board) && version >= 216) {
Append(new SignedField<8>(limit.curve.value));
}
}
};
class CurvesField: public TransformedField {
public:
CurvesField(CurveData * curves, BoardEnum board):
CurvesField(CurveData * curves, BoardEnum board, unsigned int version):
TransformedField(internalField),
internalField("Curves"),
curves(curves),
board(board),
maxCurves(MAX_CURVES(board)),
version(version),
maxCurves(MAX_CURVES(board, version)),
maxPoints(IS_ARM(board) ? O9X_ARM_NUM_POINTS : O9X_NUM_POINTS)
{
for (int i=0; i<maxCurves; i++) {
if (IS_ARM(board))
if (IS_TARANIS(board) && version >= 216) {
internalField.Append(new UnsignedField<3>((unsigned int &)curves[i].type));
internalField.Append(new BoolField<1>(curves[i].smooth));
internalField.Append(new SpareBitsField<4>());
internalField.Append(new ConversionField< SignedField<8> >(curves[i].count, -5));
}
else if (IS_ARM(board)) {
internalField.Append(new SignedField<16>(_curves[i]));
else
}
else {
internalField.Append(new SignedField<8>(_curves[i]));
}
}
for (int i=0; i<maxPoints; i++) {
internalField.Append(new SignedField<8>(_points[i]));
}
@@ -853,46 +977,56 @@ class CurvesField: public TransformedField {
int * cur = &_points[0];
int offset = 0;
for (int i=0; i<maxCurves; i++) {
CurveData *curve = &curves[i];
offset += (curve->custom ? curve->count * 2 - 2 : curve->count) - 5;
if (offset > maxPoints - 5 * maxCurves) {
int size = (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
if (offset+size > maxPoints) {
EEPROMWarnings += ::QObject::tr("openTx only accepts %1 points in all curves").arg(maxPoints) + "\n";
break;
}
_curves[i] = offset;
if (!IS_TARANIS(board) || version < 216) {
_curves[i] = offset - (5*i);
}
for (int j=0; j<curve->count; j++) {
*cur++ = curve->points[j].y;
}
if (curve->custom) {
if (curve->type == CurveData::CURVE_TYPE_CUSTOM) {
for (int j=1; j<curve->count-1; j++) {
*cur++ = curve->points[j].x;
}
}
offset += size;
}
}
virtual void afterImport()
{
int * cur = &_points[0];
for (int i=0; i<maxCurves; i++) {
CurveData *curve = &curves[i];
int * cur = &_points[i==0 ? 0 : 5*i + _curves[i-1]];
int * next = &_points[5*(i+1) + _curves[i]];
int size = next - cur;
if (size % 2 == 0) {
curve->count = (size / 2) + 1;
curve->custom = true;
if (!IS_TARANIS(board) || version < 216) {
int * next = &_points[5*(i+1) + _curves[i]];
int size = next - cur;
if (size % 2 == 0) {
curve->count = (size / 2) + 1;
curve->type = CurveData::CURVE_TYPE_CUSTOM;
}
else {
curve->count = size;
curve->type = CurveData::CURVE_TYPE_STANDARD;
}
}
else {
curve->count = size;
curve->custom = false;
for (int j=0; j<curve->count; j++) {
curve->points[j].y = *cur++;
}
for (int j=0; j<curve->count; j++)
curve->points[j].y = cur[j];
if (curve->custom) {
if (curve->type == CurveData::CURVE_TYPE_CUSTOM) {
curve->points[0].x = -100;
for (int j=1; j<curve->count-1; j++)
curve->points[j].x = cur[curve->count+j-1];
curve->points[j].x = *cur++;
curve->points[curve->count-1].x = +100;
}
else {
@@ -906,10 +1040,11 @@ class CurvesField: public TransformedField {
StructField internalField;
CurveData *curves;
BoardEnum board;
unsigned int version;
int maxCurves;
int maxPoints;
int _curves[O9X_ARM_MAX_CURVES];
int _points[O9X_ARM_NUM_POINTS];
int _curves[C9X_MAX_CURVES];
int _points[C9X_MAX_CURVES*C9X_MAX_POINTS*2];
};
class CustomSwitchesFunctionsTable: public ConversionTable {
@@ -1238,7 +1373,7 @@ class CustomFunctionField: public TransformedField {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
memcpy(_arm_param, fn.paramarm, sizeof(_arm_param));
}
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGV5) {
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
unsigned int value;
if (version >= 214) {
_mode = fn.adjustMode;
@@ -1268,7 +1403,7 @@ class CustomFunctionField: public TransformedField {
/* the default behavior */
_param = fn.param;
_union_param = (fn.enabled ? 1 : 0);
if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGV5) {
if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
if (version >= 213) {
_union_param += (fn.adjustMode << 1);
if (fn.adjustMode == 1)
@@ -1321,7 +1456,7 @@ class CustomFunctionField: public TransformedField {
else if (fn.func == FuncVolume) {
sourcesConversionTable->importValue(value, (int &)fn.param);
}
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGV5) {
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
if (version >= 214) {
fn.adjustMode = _mode;
if (fn.adjustMode == 1)
@@ -1350,7 +1485,7 @@ class CustomFunctionField: public TransformedField {
if (version >= 213) {
fn.enabled = (_union_param & 0x01);
}
if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGV5) {
if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
if (version >= 213) {
fn.adjustMode = ((_union_param >> 1) & 0x03);
if (fn.adjustMode == 1)
@@ -1551,7 +1686,14 @@ class FrskyField: public StructField {
Append(new UnsignedField<8>(frsky.channels[i].multiplier, 0, 5, "Multiplier"));
}
Append(new UnsignedField<8>(frsky.usrProto));
Append(new UnsignedField<8>(frsky.voltsSource));
if (version >= 216) {
Append(new UnsignedField<7>(frsky.voltsSource));
// TODO altitude displayed
Append(new SpareBitsField<1>());
}
else {
Append(new UnsignedField<8>(frsky.voltsSource));
}
Append(new UnsignedField<8>(frsky.blades));
Append(new UnsignedField<8>(frsky.currentSource));
@@ -1575,6 +1717,12 @@ class FrskyField: public StructField {
Append(new ConversionField< UnsignedField<2> >(frsky.rssiAlarms[i].level, &rssiConversionTable[i], "RSSI"));
Append(new ConversionField< SignedField<6> >(frsky.rssiAlarms[i].value, -45+i*3));
}
if (version >= 216) {
// TODO uint16_t mAhPersistent:1;
// uint16_t storedMah:15;
// int8_t fasOffset;
Append(new SpareBitsField<24>());
}
}
else {
for (int i=0; i<2; i++) {
@@ -1598,7 +1746,7 @@ class FrskyField: public StructField {
Append(new SignedField<4>(frsky.varioMax));
for (int i=0; i<2; i++) {
Append(new ConversionField< UnsignedField<2> >(frsky.rssiAlarms[i].level, &rssiConversionTable[i], "RSSI level"));
Append(new ConversionField< SignedField<6> >(frsky.rssiAlarms[i].value, -45+i*3, 0, 100, "RSSI value"));
Append(new ConversionField< SignedField<6> >(frsky.rssiAlarms[i].value, -45+i*3, 0, 0, 100, "RSSI value"));
}
for (int i=0; i<2; i++) {
Append(new FrskyScreenField(frsky.screens[i], board, version));
@@ -1607,6 +1755,10 @@ class FrskyField: public StructField {
Append(new SignedField<5>(frsky.varioCenterMin));
Append(new UnsignedField<3>(frsky.currentSource));
Append(new SignedField<8>(frsky.varioCenterMax));
if (version >= 216) {
// TODO int8_t fasOffset;
Append(new SpareBitsField<8>());
}
}
}
@@ -1658,9 +1810,16 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
for (int i=0; i<O9X_MAX_TIMERS; i++) {
internalField.Append(new TimerModeField(modelData.timers[i].mode, board, version));
if (release21March2013) {
if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
internalField.Append(new BoolField<2>(modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
internalField.Append(new SpareBitsField<4>());
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
}
else if (release21March2013) {
internalField.Append(new UnsignedField<12>(modelData.timers[i].val));
internalField.Append(new BoolField<1>(modelData.timers[i].countdownBeep));
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
if (HAS_PERSISTENT_TIMERS(board)) {
@@ -1688,7 +1847,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
internalField.Append(new BoolField<1>(modelData.thrTrim));
if (IS_TARANIS(board))
if (IS_TARANIS(board) || (IS_ARM(board) && version >= 216))
internalField.Append(new SpareBitsField<4>());
else
internalField.Append(new ConversionField< SignedField<4> >(modelData.moduleData[0].channelsCount, &channelsConversionTable, "Channels number", ::QObject::tr("OpenTX doesn't allow this number of channels")));
@@ -1696,7 +1855,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
internalField.Append(new UnsignedField<3>(modelData.trimInc));
internalField.Append(new BoolField<1>(modelData.disableThrottleWarning));
if (IS_TARANIS(board))
if (IS_TARANIS(board) || (IS_ARM(board) && version >= 216))
internalField.Append(new SpareBitsField<1>());
else
internalField.Append(new BoolField<1>(modelData.moduleData[0].ppmPulsePol));
@@ -1704,7 +1863,10 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
internalField.Append(new BoolField<1>(modelData.extendedLimits));
internalField.Append(new BoolField<1>(modelData.extendedTrims));
internalField.Append(new BoolField<1>(modelData.throttleReversed));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].ppmDelay, exportPpmDelay, importPpmDelay));
if (!IS_ARM(board) || version < 216) {
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].ppmDelay, exportPpmDelay, importPpmDelay));
}
if (IS_ARM(board) || board==BOARD_GRUVIN9X)
internalField.Append(new UnsignedField<16>(modelData.beepANACenter));
@@ -1714,10 +1876,10 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
for (int i=0; i<MAX_MIXERS(board, version); i++)
internalField.Append(new MixField(modelData.mixData[i], board, version));
for (int i=0; i<MAX_CHANNELS(board, version); i++)
internalField.Append(new LimitField(modelData.limitData[i], board));
internalField.Append(new LimitField(modelData.limitData[i], board, version));
for (int i=0; i<MAX_EXPOS(board, version); i++)
internalField.Append(new ExpoField(modelData.expoData[i], board, version));
internalField.Append(new CurvesField(modelData.curves, board));
internalField.Append(new CurvesField(modelData.curves, board, version));
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
internalField.Append(new CustomSwitchField(modelData.customSw[i], board, version, variant));
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++)
@@ -1725,11 +1887,16 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
for (int i=0; i<MAX_PHASES(board, version); i++)
internalField.Append(new PhaseField(modelData.phaseData[i], i, board, version));
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
if (!IS_ARM(board) || version < 216) {
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
}
internalField.Append(new UnsignedField<8>(modelData.thrTraceSrc));
if (!release21March2013)
if (!release21March2013) {
internalField.Append(new UnsignedField<8>(modelData.modelId));
}
if (IS_TARANIS(board))
internalField.Append(new UnsignedField<16>(modelData.switchWarningStates));
@@ -1737,15 +1904,19 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
internalField.Append(new SwitchesWarningField<8>(modelData.switchWarningStates, board, version));
if ((board == BOARD_STOCK || (board == BOARD_M128 && version >= 215)) && (variant & GVARS_VARIANT)) {
for (int i=0; i<O9X_MAX_GVARS; i++) {
for (int i=0; i<MAX_GVARS(board, version); i++) {
// on M64 GVARS are common to all phases, and there is no name
internalField.Append(new SignedField<16>(modelData.phaseData[0].gvars[i]));
}
}
if (board != BOARD_STOCK && (board != BOARD_M128 || version < 215)) {
for (int i=0; i<O9X_MAX_GVARS; i++) {
for (int i=0; i<MAX_GVARS(board, version); i++) {
internalField.Append(new ZCharField<6>(modelData.gvars_names[i]));
if (version >= 216) {
internalField.Append(new BoolField<1>(modelData.gvars_popups[i]));
internalField.Append(new SpareBitsField<7>());
}
}
}
@@ -1783,15 +1954,23 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
}
if (IS_TARANIS(board)) {
for (int i=0; i<MAX_CURVES(board); i++) {
for (int i=0; i<MAX_CURVES(board, version); i++) {
internalField.Append(new ZCharField<6>(modelData.curves[i].name));
}
}
if (IS_TARANIS(board) && version >= 216) {
// TODO ScriptData scriptsData[MAX_SCRIPTS];
internalField.Append(new SpareBitsField<720>());
// TODO char inputNames[MAX_INPUTS][4];
internalField.Append(new SpareBitsField<1024>());
}
}
void Open9xModelDataNew::beforeExport()
{
// qDebug() << QString("before export model") << modelData.name;
for (int module=0; module<3; module++) {
if (modelData.moduleData[module].protocol >= PXX_XJT_X16 && modelData.moduleData[module].protocol <= PXX_XJT_LR12)
subprotocols[module] = modelData.moduleData[module].protocol - PXX_XJT_X16;
@@ -1802,7 +1981,7 @@ void Open9xModelDataNew::beforeExport()
void Open9xModelDataNew::afterImport()
{
// qDebug() << QString("after import model") << modelData.name;
// qDebug() << QString("after import model") << modelData.name ;
for (int module=0; module<3; module++) {
if (modelData.moduleData[module].protocol == PXX_XJT_X16) {
@@ -1866,8 +2045,9 @@ Open9xGeneralDataNew::Open9xGeneralDataNew(GeneralSettings & generalData, BoardE
internalField.Append(new UnsignedField<8>(generalData.inactivityTimer));
if (IS_STOCK(board) && version >= 215) {
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
} else {
internalField.Append(new BoolField<1>(generalData.throttleReversed));
}
else {
internalField.Append(new SpareBitsField<1>());
internalField.Append(new BoolField<1>(generalData.minuteBeep));
internalField.Append(new BoolField<1>(generalData.preBeep));
}
@@ -1892,9 +2072,9 @@ Open9xGeneralDataNew::Open9xGeneralDataNew(GeneralSettings & generalData, BoardE
internalField.Append(new UnsignedField<8>(generalData.speakerPitch));
if (IS_ARM(board))
internalField.Append(new ConversionField< SignedField<8> >(generalData.speakerVolume, -12, 0, 23, "Volume"));
internalField.Append(new ConversionField< SignedField<8> >(generalData.speakerVolume, -12, 0, 0, 23, "Volume"));
else
internalField.Append(new ConversionField< SignedField<8> >(generalData.speakerVolume, -7, 0, 7, "Volume"));
internalField.Append(new ConversionField< SignedField<8> >(generalData.speakerVolume, -7, 0, 0, 7, "Volume"));
if (version >= 214 || (!IS_ARM(board) && version >= 213)) {
internalField.Append(new SignedField<8>(generalData.vBatMin));
@@ -42,7 +42,6 @@
#define O9X_NUM_FSW 16 // number of functions assigned to switches
#define O9X_MAX_CURVES 8
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
#define O9X_MAX_GVARS 5
#define O9X_ARM_MAX_PHASES 9
#define O9X_ARM_MAX_MIXERS 64
@@ -50,7 +49,6 @@
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
#define O9X_ARM_NUM_CSW 32 // number of custom switches
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
#define O9X_ARM_MAX_CURVES 16
#define O9X_ARM_NUM_POINTS 512
#define O9X_ARM_MAX_CSFUNCOLD 13
#define O9X_ARM_MAX_CSFUNC 15
@@ -16,14 +16,14 @@
#include <iostream>
#include <QMessageBox>
#include "open9xinterface.h"
#include "open9xeeprom.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#include "open9xGruvin9xeeprom.h"
#include "open9xSky9xeeprom.h"
#include "open9xsimulator.h"
#include "open9xM128simulator.h"
#include "open9xGruvin9xsimulator.h"
#include "open9xSky9xsimulator.h"
#include "opentxsimulator.h"
#include "opentxM128simulator.h"
#include "opentxGruvin9xsimulator.h"
#include "opentxSky9xsimulator.h"
#include "opentxTaranisSimulator.h"
#include "file.h"
@@ -278,15 +278,7 @@ bool Open9xInterface::saveGeneral(GeneralSettings &settings, BoardEnum board, ui
}
template <class T>
bool Open9xInterface::saveModel(unsigned int index, ModelData &model)
{
T open9xModel(model);
int sz = efile->writeRlc2(FILE_MODEL(index), FILE_TYP_MODEL, (uint8_t*)&open9xModel, sizeof(T));
return (sz == sizeof(T));
}
template <class T>
bool Open9xInterface::saveModelVariant(unsigned int index, ModelData &model, unsigned int version, unsigned int variant)
bool Open9xInterface::saveModel(unsigned int index, ModelData &model, unsigned int version, unsigned int variant)
{
T open9xModel(model, board, version, variant);
// open9xModel.Dump();
@@ -371,16 +363,16 @@ int Open9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varian
case BOARD_TARANIS:
case BOARD_TARANIS_REV4a:
case BOARD_SKY9X:
version = 215;
version = 216;
break;
case BOARD_GRUVIN9X:
version = 214;
version = 216;
break;
case BOARD_M128:
version = 215;
version = 216;
break;
case BOARD_STOCK:
version = 213;
version = 216;
break;
}
}
@@ -389,81 +381,21 @@ int Open9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varian
efile->EeFsCreate(eeprom, size, board);
int result = 0;
if (board == BOARD_M128) {
variant |= M128_VARIANT;
}
result = saveGeneral<Open9xGeneralDataNew>(radioData.generalSettings, board, version, variant);
if (!result)
int result = saveGeneral<Open9xGeneralDataNew>(radioData.generalSettings, board, version, variant);
if (!result) {
return 0;
}
for (int i=0; i<getMaxModels(); i++) {
if (!radioData.models[i].isempty()) {
result = 0;
switch(version) {
case 202:
result = saveModel<Open9xModelData_v202>(i, radioData.models[i]);
break;
case 203:
result = saveModel<Open9xModelData_v203>(i, radioData.models[i]);
break;
case 204:
result = saveModel<Open9xModelData_v204>(i, radioData.models[i]);
break;
case 205:
result = saveModel<Open9xModelData_v205>(i, radioData.models[i]);
break;
case 207:
if (board == BOARD_GRUVIN9X)
result = saveModel<Open9xGruvin9xModelData_v207>(i, radioData.models[i]);
break;
case 208:
if (board == BOARD_GRUVIN9X)
result = saveModel<Open9xGruvin9xModelData_v208>(i, radioData.models[i]);
else if (board == BOARD_SKY9X)
result = saveModel<Open9xArmModelData_v208>(i, radioData.models[i]);
else
result = saveModel<Open9xModelData_v208>(i, radioData.models[i]);
break;
case 209:
if (board == BOARD_GRUVIN9X)
result = saveModel<Open9xGruvin9xModelData_v209>(i, radioData.models[i]);
else if (board == BOARD_SKY9X)
result = saveModel<Open9xArmModelData_v209>(i, radioData.models[i]);
else
result = saveModel<Open9xModelData_v209>(i, radioData.models[i]);
break;
case 210:
if (board == BOARD_GRUVIN9X)
result = saveModel<Open9xGruvin9xModelData_v210>(i, radioData.models[i]);
else if (board == BOARD_SKY9X)
result = saveModel<Open9xArmModelData_v210>(i, radioData.models[i]);
else
result = saveModel<Open9xModelData_v210>(i, radioData.models[i]);
break;
case 211:
if (board == BOARD_GRUVIN9X)
result = saveModel<Open9xGruvin9xModelData_v211>(i, radioData.models[i]);
else if (board == BOARD_SKY9X)
result = saveModel<Open9xArmModelData_v211>(i, radioData.models[i]);
else
result = saveModel<Open9xModelData_v211>(i, radioData.models[i]);
break;
case 212:
if (board == BOARD_SKY9X)
result = saveModel<Open9xArmModelData_v212>(i, radioData.models[i]);
else
result = saveModelVariant<Open9xModelDataNew>(i, radioData.models[i], version, variant);
break;
default:
result = saveModelVariant<Open9xModelDataNew>(i, radioData.models[i], version, variant);
break;
result = saveModel<Open9xModelDataNew>(i, radioData.models[i], version, variant);
if (!result) {
return 0;
}
if (!result)
return false;
}
}
@@ -488,7 +420,6 @@ int Open9xInterface::getSize(ModelData &model)
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board);
Open9xModelDataNew open9xModel(model, board, 255, GetCurrentFirmwareVariant());
// open9xModel.Dump();
QByteArray eeprom;
open9xModel.Export(eeprom);
@@ -562,12 +493,14 @@ int Open9xInterface::getCapability(const Capability capability)
return 6;
else
return 5;
case FlightPhasesAreNamed:
case FlightPhasesHaveFades:
return 1;
case Gvars:
return IS_ARM(board) ? 9 : 5;
case FlightModesName:
case GvarsName:
return (IS_TARANIS(board) ? 10 : 6);
case GvarsInCS:
case GvarsAsWeight:
case ExpoIsCurve:
case HasFAIMode:
return 1;
case GvarsAreNamed:
@@ -663,13 +596,6 @@ int Open9xInterface::getCapability(const Capability capability)
return 0;
case ExtraInputs:
return 1;
case HasNegCurves:
return 1;
case HasExpoCurves:
return true;
case ExpoCurve5:
case ExpoCurve9:
return 4;
case ExtendedTrims:
return 500;
case ExtraTrims:
@@ -680,10 +606,6 @@ int Open9xInterface::getCapability(const Capability capability)
return 1;
case FSSwitch:
return 1;
case HasTTrace:
return 1;
case CustomCurves:
return 1;
case MixesWithoutExpo:
return 1;
case NumCurves:
@@ -692,14 +614,10 @@ int Open9xInterface::getCapability(const Capability capability)
return (IS_ARM(board) ? (IS_TARANIS(board) ? 8 : 6) : false);
case HasExpoNames:
return (IS_ARM(board) ? (IS_TARANIS(board) ? 8 : 6) : false);
case HasChNames:
return (IS_TARANIS(board) ? 1 : 0);
case ChannelsName:
return (IS_TARANIS(board) ? 6 : 0);
case HasCvNames:
return (IS_TARANIS(board) ? 1 : 0);
case NoTimerDirs:
return 1;
case NoThrExpo:
return 1;
case Telemetry:
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
case TelemetryBars:
@@ -734,8 +652,6 @@ int Open9xInterface::getCapability(const Capability capability)
return 1;
case TelemetryMaxMultiplier:
return (IS_ARM(board) ? 32 : 8);
case DiffMixers:
return 1;
case PPMCenter:
return 1;
case SYMLimits:
@@ -766,10 +682,6 @@ int Open9xInterface::getCapability(const Capability capability)
case HasBrightness:
return (IS_ARM(board) ? true : false);
case PerModelTimers:
case PerModelThrottleWarning:
case PerModelThrottleInvert:
return 1;
case pmSwitchMask:
return 1;
case SlowScale:
return (IS_ARM(board) ? 10 : 2);
@@ -777,15 +689,18 @@ int Open9xInterface::getCapability(const Capability capability)
return (IS_ARM(board) ? 250 : 15);
case CSFunc:
return 18;
case GvarsNum:
case GvarsOfsNum:
return 5;
case HasSDLogs:
return ((board == BOARD_GRUVIN9X || IS_ARM(board)) ? true : false);
case LCDWidth:
return (IS_TARANIS(board) ? 212 : 128) ;
case GetThrSwitch:
return (IS_TARANIS(board) ?DSW_SF1 : DSW_THR) ;
return (IS_TARANIS(board) ? DSW_SF1 : DSW_THR) ;
case VirtualInputs:
case LuaInputs:
case LimitsPer1000:
case EnhancedCurves:
case TelemetryInternalAlarms:
return IS_TARANIS(board);
default:
return 0;
}
@@ -814,12 +729,15 @@ int Open9xInterface::isAvailable(Protocol proto, int port)
case PXX_XJT_D8:
case PXX_XJT_LR12:
case PXX_DJT:
case LP45:
case DSM2:
case DSMX:
return 1;
default:
return 0;
}
break;
case 2:
case -1:
switch (proto) {
case PPM:
return 1;
@@ -954,6 +872,9 @@ bool Open9xInterface::checkVersion(unsigned int version)
case 215:
// M128 revert because too much RAM used!
break;
case 216:
// A lot of things (first github release)
break;
default:
return false;
}
@@ -67,10 +67,7 @@ class Open9xInterface : public EEPROMInterface
bool loadModel(uint8_t version, ModelData &model, uint8_t *data, int index, unsigned int variant, unsigned int stickMode=0);
template <class T>
bool saveModel(unsigned int index, ModelData &model);
template <class T>
bool saveModelVariant(unsigned int index, ModelData &model, unsigned int version, unsigned int variant);
bool saveModel(unsigned int index, ModelData &model, unsigned int version, unsigned int variant);
template <class T>
bool loadGeneral(GeneralSettings &settings, unsigned int version);
@@ -14,9 +14,9 @@
*
*/
#include "open9xsimulator.h"
#include "open9xinterface.h"
#include "open9xeeprom.h"
#include "opentxsimulator.h"
#include "opentxinterface.h"
#include "opentxeeprom.h"
#define HELI
#define SIMU
@@ -100,7 +100,7 @@ bool hasExtendedTrims()
uint8_t getStickMode()
{
return g_eeGeneral.stickMode;
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
}
@@ -162,7 +162,7 @@ void Open9xSimulator::setValues(TxInputs &inputs)
void Open9xSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9x::modn12x3[4*getStickMode() + idx] - 1;
idx = Open9x::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
@@ -176,7 +176,7 @@ void Open9xSimulator::getTrims(Trims & trims)
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9x::modn12x3[4*getStickMode() + i] - 1;
uint8_t idx = Open9x::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;
+20 -222
View File
@@ -29,15 +29,6 @@ t_Th9xTrainerMix::t_Th9xTrainerMix()
memset(this, 0, sizeof(t_Th9xTrainerMix));
}
t_Th9xTrainerMix::t_Th9xTrainerMix(TrainerMix &c9x)
{
memset(this, 0, sizeof(t_Th9xTrainerMix));
srcChn = c9x.src;
swtch = th9xFromSwitch(c9x.swtch);
studWeight = (8 * c9x.weight) / 25;
mode = c9x.mode;
}
t_Th9xTrainerMix::operator TrainerMix()
{
TrainerMix c9x;
@@ -53,15 +44,6 @@ t_Th9xTrainerData::t_Th9xTrainerData()
memset(this, 0, sizeof(t_Th9xTrainerData));
}
t_Th9xTrainerData::t_Th9xTrainerData(TrainerData &c9x)
{
memset(this, 0, sizeof(t_Th9xTrainerData));
for (int i=0; i<NUM_STICKS; i++) {
calib[i] = c9x.calib[i];
mix[i] = c9x.mix[i];
}
}
t_Th9xTrainerData::operator TrainerData ()
{
TrainerData c9x;
@@ -77,49 +59,6 @@ t_Th9xGeneral::t_Th9xGeneral()
memset(this, 0, sizeof(t_Th9xGeneral));
}
t_Th9xGeneral::t_Th9xGeneral(GeneralSettings &c9x)
{
memset(this, 0, sizeof(t_Th9xGeneral));
myVers = MDVERS;
for (int i=0; i<NUM_STICKSnPOTS; i++) {
calibMid[i] = c9x.calibMid[i];
calibSpanNeg[i] = c9x.calibSpanNeg[i];
calibSpanPos[i] = c9x.calibSpanPos[i];
}
inactivityMin = c9x.inactivityTimer;
// iTrimSwitch =
// iTrimTme1
// iTrimTme2
currModel = c9x.currModel;
contrast = c9x.contrast;
vBatWarn = c9x.vBatWarn;
vBatCalib = c9x.vBatCalib;
// lightSw = th9xFromSwitch(c9x.lightSw);
trainer = c9x.trainer;
adcFilt = c9x.filterInput;
// keySpeed
thr0pos = c9x.throttleReversed;
disableThrottleWarning = c9x.disableThrottleWarning;
disableSwitchWarning = (c9x.switchWarning != -1);
disableMemoryWarning = c9x.disableMemoryWarning;
if (c9x.beeperMode == e_quiet)
beeperVal = 0;
else if (c9x.beeperMode < e_all)
beeperVal = 1;
else if (c9x.beeperLength < 2)
beeperVal = 2;
else
beeperVal = 3;
view = c9x.view;
stickMode = c9x.stickMode;
// naviMode
}
Th9xGeneral::operator GeneralSettings ()
{
GeneralSettings result;
@@ -158,7 +97,6 @@ Th9xGeneral::operator GeneralSettings ()
}
result.stickMode = stickMode;
result.inactivityTimer = inactivityMin;
result.throttleReversed = thr0pos;
result.filterInput = adcFilt;
return result;
}
@@ -169,35 +107,25 @@ t_Th9xExpoData::t_Th9xExpoData()
memset(this, 0, sizeof(t_Th9xExpoData));
}
t_Th9xExpoData::t_Th9xExpoData(ExpoData &c9x)
{
memset(this, 0, sizeof(t_Th9xLimitData));
exp5 = c9x.expo;
mode3 = c9x.mode;
weight6 = c9x.weight;
chn = c9x.chn;
drSw = th9xFromSwitch(c9x.swtch);
if (c9x.curveMode==1)
curve = c9x.curveParam;
else
curve = 0;
}
t_Th9xExpoData::operator ExpoData ()
{
ExpoData c9x;
c9x.expo = exp5;
if (exp5) {
c9x.curve.type = CurveReference::CURVE_REF_EXPO;
c9x.curve.value = exp5;
}
else if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
c9x.mode = mode3;
c9x.weight = weight6;
c9x.chn = chn;
c9x.swtch = th9xToSwitch(drSw);
if (curve) {
c9x.curveMode=1;
c9x.curveParam = curve;
} else {
c9x.curveMode = 0;
c9x.curveParam = exp5;
}
return c9x;
}
@@ -206,15 +134,6 @@ t_Th9xLimitData::t_Th9xLimitData()
memset(this, 0, sizeof(t_Th9xLimitData));
}
t_Th9xLimitData::t_Th9xLimitData(LimitData &c9x)
{
memset(this, 0, sizeof(t_Th9xLimitData));
min = c9x.min+100;
max = c9x.max-100;
revert = c9x.revert;
offset = c9x.offset;
}
t_Th9xLimitData::operator LimitData ()
{
LimitData c9x;
@@ -225,36 +144,11 @@ t_Th9xLimitData::operator LimitData ()
return c9x;
}
t_Th9xMixData::t_Th9xMixData()
{
memset(this, 0, sizeof(t_Th9xMixData));
}
t_Th9xMixData::t_Th9xMixData(MixData &c9x)
{
memset(this, 0, sizeof(t_Th9xMixData));
destCh = c9x.destCh;
mixMode = c9x.mltpx;
if (c9x.srcRaw.type == SOURCE_TYPE_STICK)
srcRaw = c9x.srcRaw.index;
else if (c9x.srcRaw.type == SOURCE_TYPE_MAX)
srcRaw = 10;
else if (c9x.srcRaw.type == SOURCE_TYPE_PPM)
srcRaw = 24 + c9x.srcRaw.index;
else if (c9x.srcRaw.type == SOURCE_TYPE_CH)
srcRaw = 12 + c9x.srcRaw.index;
else
srcRaw = 0; // TODO
switchMode = 1;
curveNeg = 0;
weight = c9x.weight;
swtch = th9xFromSwitch(c9x.swtch);
curve = c9x.curve;
speedUp = c9x.speedUp;
speedDown = c9x.speedDown;
}
t_Th9xMixData::operator MixData ()
{
MixData c9x;
@@ -273,41 +167,20 @@ t_Th9xMixData::operator MixData ()
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-24);
c9x.weight = weight;
c9x.swtch = th9xToSwitch(swtch);
c9x.curve = curve;
if (curve > 6) {
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
c9x.curve.value = curve - 6;
}
else if (curve > 0) {
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
c9x.curve.value = curve;
}
c9x.speedUp = speedUp;
c9x.speedDown = speedDown;
c9x.mltpx = (MltpxValue)mixMode;
return c9x;
}
t_Th9xCustomSwData::t_Th9xCustomSwData(CustomSwData &c9x)
{
opCmp = c9x.func;
val1 = c9x.val1;
val2 = c9x.val2;
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
val1 = fromSource(RawSource(c9x.val1));
}
if (c9x.func >= CS_FN_EQUAL) {
val2 = fromSource(RawSource(c9x.val2));
}
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
val1 = th9xFromSwitch(RawSwitch(c9x.val1));
val2 = th9xFromSwitch(RawSwitch(c9x.val2));
}
if (opCmp>TH9X_MAX_CSFUNC ) {
EEPROMWarnings += ::QObject::tr("th9x does not support Custom Switch function %1").arg(getFuncName(opCmp)) + "\n";
opCmp=0;
val1=0;
val2=0;
}
}
t_Th9xCustomSwData::operator CustomSwData ()
{
CustomSwData c9x;
@@ -388,76 +261,6 @@ t_Th9xModelData::t_Th9xModelData()
memset(this, 0, sizeof(t_Th9xModelData));
}
t_Th9xModelData::t_Th9xModelData(ModelData &c9x)
{
memset(this, 0, sizeof(t_Th9xModelData));
if (c9x.used) {
setEEPROMString(name, c9x.name, sizeof(name));
mdVers = MDVERS;
if (c9x.timers[0].mode == TMRMODE_ABS)
tmrMode = 1;
if (c9x.timers[0].mode == TMRMODE_THs)
tmrMode = 2;
if (c9x.timers[0].mode == TMRMODE_THp)
tmrMode = 3;
else
tmrMode = 0;
// TODO tmrDir = c9x.timers[0].dir;
tmrVal = c9x.timers[0].val;
//protocol = c9x.protocol;
/*
ppmNCH = (c9x.moduleData[0].channelsCount - 8) / 2;
thrTrim = c9x.thrTrim;
thrExpo = c9x.thrExpo;
trimInc = c9x.trimInc;
ppmDelay = (c9x.moduleData[0].ppmDelay - 300) / 50;
for (unsigned int i=0; i<C9X_MAX_CUSTOM_FUNCTIONS; i++)
if (c9x.funcSw[i].func == FuncTrims2Offsets && c9x.funcSw[i].swtch) trimSw = c9x.funcSw[i].swtch;
beepANACenter = c9x.beepANACenter;
pulsePol = c9x.pulsePol;*/
for (int i=0; i<TH9X_NUM_CHNOUT; i++)
limitData[i] = c9x.limitData[i];
for (int i=0; i<TH9X_MAX_EXPOS; i++)
expoTab[i] = c9x.expoData[i];
for (int i=0; i<TH9X_MAX_MIXERS; i++)
mixData[i] = c9x.mixData[i];
for (int i=0; i<NUM_STICKS; i++)
trimData[i].itrim = std::max(-30, std::min(30, c9x.phaseData[0].trim[i]));
for (int i=0; i<TH9X_MAX_CURVES3; i++)
if (c9x.curves[i].count==3) {
if (c9x.curves[i].custom)
EEPROMWarnings += QObject::tr("th9x doesn't support custom curves as curve%1, curve as been exported as fixed point ").arg(i+1) + "\n";
for (int j=0; j<3; j++)
curves3[i][j] = c9x.curves[i].points[j].y;
} else {
EEPROMWarnings += QObject::tr("th9x doesn't support curve with %1 point as curve%2 ").arg(c9x.curves[i].count).arg(i+1) + "\n";
}
for (int i=0; i<TH9X_MAX_CURVES5; i++)
if (c9x.curves[i+TH9X_MAX_CURVES3].count==5) {
if (c9x.curves[i+TH9X_MAX_CURVES3].custom)
EEPROMWarnings += QObject::tr("th9x doesn't support custom curves as curve%1, curve as been exported as fixed point ").arg(i+1+TH9X_MAX_CURVES3) + "\n";
for (int j=0; j<5; j++)
curves5[i][j] = c9x.curves[i+TH9X_MAX_CURVES3].points[j].y;
} else {
EEPROMWarnings += QObject::tr("th9x doesn't support curve with %1 point as curve%2 ").arg(c9x.curves[i+TH9X_MAX_CURVES3].count).arg(i+1+TH9X_MAX_CURVES3) + "\n";
}
for (int i=0; i<TH9X_MAX_CURVES9; i++)
if (c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].count==9) {
if (c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].custom)
EEPROMWarnings += QObject::tr("th9x doesn't support custom curves as curve%1, curve as been exported as fixed point ").arg(i+1+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5) + "\n";
for (int j=0; j<9; j++)
curves5[i][j] = c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].points[j].y;
} else {
EEPROMWarnings += QObject::tr("th9x doesn't support curve with %1 point as curve%2 ").arg(c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].count).arg(i+1+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5) + "\n";
}
/*for (int i=0; i<TH9X_NUM_CSW; i++)
customSw[i] = c9x.customSw[i];*/
}
}
t_Th9xModelData::operator ModelData ()
{
ModelData c9x;
@@ -507,7 +310,6 @@ t_Th9xModelData::operator ModelData ()
for (int i=0; i<NUM_STICKS; i++)
c9x.phaseData[0].trim[i] = trimData[i].itrim;
for (int i=0; i<TH9X_MAX_CURVES3; i++) {
c9x.curves[i].custom = false;
c9x.curves[i].count = 3;
for (int j=0; j<3; j++) {
c9x.curves[i].points[j].x = -100 + 100*i;
@@ -515,7 +317,6 @@ t_Th9xModelData::operator ModelData ()
}
}
for (int i=0; i<TH9X_MAX_CURVES5; i++) {
c9x.curves[i+TH9X_MAX_CURVES3].custom = false;
c9x.curves[i+TH9X_MAX_CURVES3].count = 5;
for (int j=0; j<5; j++) {
c9x.curves[i+TH9X_MAX_CURVES3].points[j].x = -100 + 50*i;
@@ -523,15 +324,12 @@ t_Th9xModelData::operator ModelData ()
}
}
for (int i=0; i<TH9X_MAX_CURVES9; i++) {
c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].custom = false;
c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].count = 5;
for (int j=0; j<9; j++) {
c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].points[j].x = -100 + 50*i;
c9x.curves[i+TH9X_MAX_CURVES3+TH9X_MAX_CURVES5].points[j].y = curves9[i][j];
}
}
/*for (int i=0; i<TH9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];*/
return c9x;
}
-13
View File
@@ -42,8 +42,6 @@ PACK(typedef struct t_Th9xTrainerMix {
operator TrainerMix();
t_Th9xTrainerMix();
t_Th9xTrainerMix(TrainerMix&);
}) Th9xTrainerMix; //
PACK(typedef struct t_Th9xTrainerData {
@@ -52,8 +50,6 @@ PACK(typedef struct t_Th9xTrainerData {
operator TrainerData();
t_Th9xTrainerData();
t_Th9xTrainerData(TrainerData&);
}) Th9xTrainerData;
PACK(typedef struct t_Th9xGeneral {
@@ -84,8 +80,6 @@ PACK(typedef struct t_Th9xGeneral {
operator GeneralSettings();
t_Th9xGeneral();
t_Th9xGeneral(GeneralSettings&);
}) Th9xGeneral;
/*
@@ -104,7 +98,6 @@ PACK(typedef struct t_Th9xExpoData {
operator ExpoData();
t_Th9xExpoData();
t_Th9xExpoData(ExpoData&);
}) Th9xExpoData;
@@ -118,7 +111,6 @@ PACK(typedef struct t_Th9xLimitData {
operator LimitData();
t_Th9xLimitData();
t_Th9xLimitData(LimitData&);
}) Th9xLimitData;
#define MLTPX_ADD 0
@@ -144,7 +136,6 @@ PACK(typedef struct t_Th9xMixData {
operator MixData();
t_Th9xMixData();
t_Th9xMixData(MixData&);
}) Th9xMixData;
PACK(typedef struct t_Th9xCustomSwData {
@@ -156,7 +147,6 @@ PACK(typedef struct t_Th9xCustomSwData {
operator CustomSwData();
t_Th9xCustomSwData() { memset(this, 0, sizeof(t_Th9xCustomSwData)); }
t_Th9xCustomSwData(CustomSwData &);
int8_t fromSource(RawSource source);
RawSource toSource(int8_t value);
}) Th9xCustomSwData;
@@ -187,9 +177,6 @@ PACK(typedef struct t_Th9xModelData {
Th9xTrimData trimData[NUM_STICKS]; // 3*4 -> 1*4
operator ModelData();
t_Th9xModelData();
t_Th9xModelData(ModelData&);
}) Th9xModelData;
#endif
/*eof*/
+5 -47
View File
@@ -124,56 +124,20 @@ bool Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize,
int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{
EEPROMWarnings.clear();
std::cout << "NO!\n";
// TODO a warning
efile->EeFsCreate(eeprom, getEEpromSize(), BOARD_STOCK);
Th9xGeneral th9xGeneral(radioData.generalSettings);
int sz = efile->writeRlc2(FILE_GENERAL, FILE_TYP_GENERAL, (uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
if(sz != sizeof(Th9xGeneral)) {
return 0;
}
for (int i=0; i<getMaxModels(); i++) {
if (!radioData.models[i].isempty()) {
Th9xModelData th9xModel(radioData.models[i]);
sz = efile->writeRlc2(FILE_MODEL(i), FILE_TYP_MODEL, (uint8_t*)&th9xModel, sizeof(Th9xModelData));
if(sz != sizeof(Th9xModelData)) {
return 0;
}
}
}
return getEEpromSize();
return 0;
}
int Th9xInterface::getSize(ModelData &model)
{
if (model.isempty())
return 0;
uint8_t tmp[2*EESIZE_STOCK];
efile->EeFsCreate(tmp, getEEpromSize(), BOARD_STOCK);
Th9xModelData th9xModel(model);
int sz = efile->writeRlc2(0, FILE_TYP_MODEL, (uint8_t*)&th9xModel, sizeof(Th9xModelData));
if(sz != sizeof(Th9xModelData)) {
return -1;
}
return efile->size(0);
return 0;
}
int Th9xInterface::getSize(GeneralSettings &settings)
{
uint8_t tmp[2*EESIZE_STOCK];
efile->EeFsCreate(tmp, getEEpromSize(), BOARD_STOCK);
Th9xGeneral th9xGeneral(settings);
int sz = efile->writeRlc2(0, FILE_TYP_GENERAL, (uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
if(sz != sizeof(th9xGeneral)) {
return -1;
}
return efile->size(0);
return 0;
}
int Th9xInterface::getCapability(const Capability capability)
@@ -181,12 +145,6 @@ int Th9xInterface::getCapability(const Capability capability)
switch (capability) {
case Mixes:
return TH9X_MAX_MIXERS;
case NumCurves3:
return TH9X_MAX_CURVES3;
case NumCurves5:
return TH9X_MAX_CURVES5;
case NumCurves9:
return TH9X_MAX_CURVES9;
case OwnerName:
return 0;
case Timers:
+4 -52
View File
@@ -170,22 +170,10 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->crosstrimChkB->hide();
ui->crosstrimLB->hide();
}
if (!GetEepromInterface()->getCapability(HasPPMSim)) {
if (!GetEepromInterface()->getCapability(HasPPMSim)) {
ui->PPMSimLB->hide();
ui->PPMSimChkB->hide();
}
if (GetEepromInterface()->getCapability(PerModelThrottleWarning)) {
ui->thrwarnChkB->setDisabled(true);
ui->thrwarnChkB->hide();
ui->thrwarnLabel->hide();
}
if (GetEepromInterface()->getCapability(pmSwitchMask)) {
ui->swwarn_label->hide();
ui->swtchWarnCB->hide();
ui->swtchWarnChkB->hide();
layout()->removeItem(ui->swwarn_layout);
}
if (!GetEepromInterface()->getCapability( HasPxxCountry)) {
ui->countrycode_label->hide();
ui->countrycode_CB->hide();
@@ -322,11 +310,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->swID0ChkB->hide();
ui->swID1ChkB->hide();
ui->swID2ChkB->hide();
ui->swtchWarnChkB->hide();
this->layout()->removeItem(ui->switchMaskLayout);
} else {
ui->swtchWarnCB->setDisabled(true);
ui->swtchWarnCB->hide();
setSwitchDefPos();
}
if (!GetEepromInterface()->getCapability(TelemetryAlarm)) {
@@ -340,12 +325,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
} else {
populateRotEncCB(ui->re_CB, g_eeGeneral.reNavigation, renumber);
}
if (GetEepromInterface()->getCapability(PerModelThrottleInvert)) {
ui->label_thrrev->hide();
ui->thrrevChkB->hide();
} else {
ui->thrrevChkB->setChecked(g_eeGeneral.throttleReversed);
}
ui->telalarmsChkB->setChecked(g_eeGeneral.enableTelemetryAlarm);
ui->PotScrollEnableChkB->setChecked(!g_eeGeneral.disablePotScroll);
ui->BandGapEnableChkB->setChecked(!g_eeGeneral.disableBG);
@@ -359,9 +338,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->StickScrollChkB->setChecked(g_eeGeneral.stickScroll);
ui->PPMSimChkB->setChecked(g_eeGeneral.enablePpmsim);
ui->inputfilterCB->setCurrentIndex(g_eeGeneral.filterInput);
ui->thrwarnChkB->setChecked(!g_eeGeneral.disableThrottleWarning); //Default is zero=checked
ui->swtchWarnChkB->setChecked(g_eeGeneral.switchWarning == -1);
ui->swtchWarnCB->setCurrentIndex(g_eeGeneral.switchWarning == -1 ? 2 : g_eeGeneral.switchWarning);
ui->memwarnChkB->setChecked(!g_eeGeneral.disableMemoryWarning); //Default is zero=checked
ui->alarmwarnChkB->setChecked(!g_eeGeneral.disableAlarmWarning);//Default is zero=checked
ui->enableTelemetryAlarmChkB->setChecked(g_eeGeneral.enableTelemetryAlarm);
@@ -622,36 +598,12 @@ void GeneralEdit::on_inactimerSB_editingFinished()
updateSettings();
}
void GeneralEdit::on_thrrevChkB_stateChanged(int )
{
g_eeGeneral.throttleReversed = ui->thrrevChkB->isChecked() ? 1 : 0;
updateSettings();
}
void GeneralEdit::on_inputfilterCB_currentIndexChanged(int index)
{
g_eeGeneral.filterInput = index;
updateSettings();
}
void GeneralEdit::on_thrwarnChkB_stateChanged(int )
{
g_eeGeneral.disableThrottleWarning = ui->thrwarnChkB->isChecked() ? 0 : 1;
updateSettings();
}
void GeneralEdit::on_swtchWarnCB_currentIndexChanged(int index)
{
g_eeGeneral.switchWarning = (index == 2 ? -1 : index);
updateSettings();
}
void GeneralEdit::on_swtchWarnChkB_stateChanged(int )
{
g_eeGeneral.switchWarning = ui->swtchWarnChkB->isChecked() ? -1 : 0;
updateSettings();
}
void GeneralEdit::on_memwarnChkB_stateChanged(int )
{
g_eeGeneral.disableMemoryWarning = ui->memwarnChkB->isChecked() ? 0 : 1;
@@ -1074,7 +1026,7 @@ void GeneralEdit::on_blinvert_cb_stateChanged(int )
void GeneralEdit::on_faimode_CB_stateChanged(int )
{
if (ui->faimode_CB->isChecked()) {
int ret = QMessageBox::question(this, "companion9x",
int ret = QMessageBox::question(this, "Companion",
tr("If you enable FAI, you loose the vario, the play functions, the telemetry screen.\nThis function cannot be disabled by the radio.\nAre you sure ?") ,
QMessageBox::Yes | QMessageBox::No);
if (ret==QMessageBox::Yes) {
@@ -1375,7 +1327,7 @@ void GeneralEdit::on_calstore_PB_clicked()
} else {
QString calib=settings.value("StickPotCalib","").toString();
if (!(calib.isEmpty())) {
int ret = QMessageBox::question(this, "companion9x",
int ret = QMessageBox::question(this, "Companion",
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::No) {
@@ -1408,7 +1360,7 @@ void GeneralEdit::on_calstore_PB_clicked()
settings.setValue("countryCode",QString("%1%2%3").arg((uint8_t)g_eeGeneral.countryCode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.imperial, 2, 16, QChar('0')).arg(g_eeGeneral.ttsLanguage));
settings.endGroup();
settings.endGroup();
QMessageBox::information(this, "companion9x", tr("Calibration and HW parameters saved."));
QMessageBox::information(this, "Companion", tr("Calibration and HW parameters saved."));
}
}
-4
View File
@@ -123,12 +123,8 @@ private slots:
void on_channelorderCB_currentIndexChanged(int index);
void on_beeperCB_currentIndexChanged(int index);
void on_memwarnChkB_stateChanged(int );
void on_swtchWarnCB_currentIndexChanged(int index);
void on_swtchWarnChkB_stateChanged(int );
void on_telalarmsChkB_stateChanged(int );
void on_thrwarnChkB_stateChanged(int );
void on_inputfilterCB_currentIndexChanged(int index);
void on_thrrevChkB_stateChanged(int );
void on_inactimerSB_editingFinished();
void on_backlightautoSB_editingFinished();
void on_backlightswCB_currentIndexChanged(int index);
+157 -261
View File
@@ -117,6 +117,13 @@ These will be relevant for all models in the same EEPROM.</string>
<string>Setup</string>
</attribute>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0,0,0">
<item row="19" column="4">
<widget class="QCheckBox" name="PPMSimChkB">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="volume_SB">
<property name="sizePolicy">
@@ -130,7 +137,7 @@ These will be relevant for all models in the same EEPROM.</string>
</property>
</widget>
</item>
<item row="29" column="3" colspan="2">
<item row="28" column="3" colspan="2">
<layout class="QHBoxLayout" name="pxxCountry">
<item>
<widget class="QLabel" name="countrycode_label">
@@ -160,13 +167,6 @@ These will be relevant for all models in the same EEPROM.</string>
</item>
</layout>
</item>
<item row="19" column="4">
<widget class="QCheckBox" name="PPMSimChkB">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="24" column="0">
<widget class="QLabel" name="mavbaud_label">
<property name="text">
@@ -174,7 +174,7 @@ These will be relevant for all models in the same EEPROM.</string>
</property>
</widget>
</item>
<item row="30" column="3" colspan="2">
<item row="29" column="3" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="VoiceLang_label">
@@ -188,49 +188,7 @@ These will be relevant for all models in the same EEPROM.</string>
</item>
</layout>
</item>
<item row="25" column="1">
<layout class="QHBoxLayout" name="swwarn_layout">
<item>
<widget class="QComboBox" name="swtchWarnCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>Off</string>
</property>
</item>
<item>
<property name="text">
<string>Switches Up</string>
</property>
</item>
<item>
<property name="text">
<string>Switches Down</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QCheckBox" name="swtchWarnChkB">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="30" column="0">
<item row="29" column="0">
<widget class="QLabel" name="units_label">
<property name="text">
<string>Measurement Units</string>
@@ -476,13 +434,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="19" column="0">
<widget class="QLabel" name="label_thrrev">
<property name="text">
<string>Reverse Throttle Operation</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_HL">
<property name="text">
@@ -490,7 +441,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="32" column="1">
<item row="31" column="1">
<widget class="QComboBox" name="stickmodeCB">
<property name="toolTip">
<string/>
@@ -551,26 +502,40 @@ Mode 4:
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<item row="18" column="4">
<widget class="QCheckBox" name="crosstrimChkB">
<property name="text">
<string>Beeper Mode</string>
<string/>
</property>
</widget>
</item>
<item row="13" column="4">
<widget class="QSpinBox" name="blOnStickMoveSB">
<property name="suffix">
<string> sec</string>
<item row="12" column="0">
<widget class="QLabel" name="label_displayType">
<property name="text">
<string>LCD Display Type</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="hapticStrengthSB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>600</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
<item row="13" column="3">
<widget class="QLabel" name="label_blOnStickMove">
<property name="text">
<string>BackLight On Stick Move</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QSpinBox" name="speakerPitchSB">
<property name="toolTip">
@@ -598,23 +563,37 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="19" column="1">
<widget class="QCheckBox" name="thrrevChkB">
<property name="whatsThis">
<string>Reverse throttle operation.
If this is checked the throttle will be reversed. Idle will be forward, trim will also be reversed and the throttle warning will be reversed as well.
</string>
<item row="13" column="4">
<widget class="QSpinBox" name="blOnStickMoveSB">
<property name="suffix">
<string> sec</string>
</property>
<property name="text">
<string/>
<property name="maximum">
<number>600</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
<item row="13" column="3">
<widget class="QLabel" name="label_blOnStickMove">
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>BackLight On Stick Move</string>
<string>Beeper Mode</string>
</property>
</widget>
</item>
<item row="30" column="0">
<widget class="QLabel" name="label_timezone">
<property name="text">
<string>Timeshift from UTC</string>
</property>
</widget>
</item>
<item row="17" column="3">
<widget class="QLabel" name="re_label">
<property name="text">
<string>RotEnc Navigation</string>
</property>
</widget>
</item>
@@ -637,47 +616,6 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</property>
</widget>
</item>
<item row="17" column="3">
<widget class="QLabel" name="re_label">
<property name="text">
<string>RotEnc Navigation</string>
</property>
</widget>
</item>
<item row="31" column="0">
<widget class="QLabel" name="label_timezone">
<property name="text">
<string>Timeshift from UTC</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="hapticStrengthSB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>5</number>
</property>
</widget>
</item>
<item row="18" column="4">
<widget class="QCheckBox" name="crosstrimChkB">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_displayType">
<property name="text">
<string>LCD Display Type</string>
</property>
</widget>
</item>
<item row="22" column="0">
<widget class="QLabel" name="label_frskyintalarm">
<property name="text">
@@ -685,14 +623,7 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</property>
</widget>
</item>
<item row="21" column="0">
<widget class="QLabel" name="thrwarnLabel">
<property name="text">
<string>Throttle Startup Warning</string>
</property>
</widget>
</item>
<item row="26" column="0" colspan="5">
<item row="25" column="0" colspan="5">
<layout class="QHBoxLayout" name="switchMaskLayout">
<item>
<widget class="QCheckBox" name="swTHRChkB">
@@ -775,7 +706,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="31" column="3" colspan="2">
<item row="30" column="3" colspan="2">
<layout class="QHBoxLayout" name="gpsFormatLayout">
<item>
<widget class="QLabel" name="gpsFormatLabel">
@@ -800,7 +731,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="29" column="1">
<item row="28" 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>
@@ -810,7 +741,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="32" column="4">
<item row="31" column="4">
<widget class="QComboBox" name="channelorderCB">
<property name="toolTip">
<string/>
@@ -948,48 +879,6 @@ This is used by the templated to determine which channel goes to what number out
</item>
</widget>
</item>
<item row="20" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Alarm Warning</string>
</property>
</widget>
</item>
<item row="20" column="1">
<widget class="QCheckBox" name="alarmwarnChkB">
<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="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="16" column="3">
<widget class="QLabel" name="label_hideOwnerName">
<property name="text">
@@ -1046,7 +935,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="29" column="0">
<item row="28" column="0">
<widget class="QLabel" name="label_faimode">
<property name="text">
<string>FAI Mode</string>
@@ -1163,7 +1052,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="31" column="1">
<item row="30" column="1">
<widget class="QSpinBox" name="timezoneSB">
<property name="minimum">
<number>-14</number>
@@ -1176,7 +1065,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="30" column="1">
<item row="29" column="1">
<widget class="QComboBox" name="units_CB">
<item>
<property name="text">
@@ -1190,7 +1079,7 @@ p, li { white-space: pre-wrap; }
</item>
</widget>
</item>
<item row="32" column="3">
<item row="31" column="3">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@@ -1203,7 +1092,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="32" column="0">
<item row="31" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Stick Mode</string>
@@ -1247,41 +1136,6 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="20" column="4">
<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="12" column="1">
<widget class="QComboBox" name="displayTypeCB">
<item>
@@ -1345,13 +1199,6 @@ p, li { white-space: pre-wrap; }
</item>
</widget>
</item>
<item row="20" column="3">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Memory Startup Warning</string>
</property>
</widget>
</item>
<item row="11" column="4">
<widget class="QSpinBox" name="BLBright_SB">
<property name="maximum">
@@ -1532,32 +1379,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="21" column="1">
<widget class="QCheckBox" name="thrwarnChkB">
<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>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_soundMode">
<property name="text">
@@ -1565,7 +1386,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="33" column="0" colspan="2">
<item row="32" column="0" colspan="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -1684,7 +1505,7 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="27" column="0">
<item row="26" column="0">
<widget class="QLabel" name="ro_label">
<property name="text">
<string>Readonly Unlock</string>
@@ -1726,13 +1547,6 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="25" column="0">
<widget class="QLabel" name="swwarn_label">
<property name="text">
<string>Switch Startup Warning</string>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
@@ -1740,7 +1554,7 @@ Acceptable values are 5v..10v</string>
</property>
</widget>
</item>
<item row="27" column="1" colspan="3">
<item row="26" column="1" colspan="3">
<layout class="QGridLayout" name="TaranisReadOnlyUnlock" rowstretch="0,0" columnstretch="0,0,0,0,0,0,0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
@@ -2268,6 +2082,90 @@ Acceptable values are 5v..10v</string>
</item>
</layout>
</item>
<item row="19" column="1">
<widget class="QCheckBox" name="alarmwarnChkB">
<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="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="19" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Alarm Warning</string>
</property>
</widget>
</item>
<item row="21" 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="21" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Memory Startup Warning</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabTrainer">
@@ -3607,8 +3505,6 @@ p, li { white-space: pre-wrap; }
<tabstop>beepMinuteChkB</tabstop>
<tabstop>beepCountDownChkB</tabstop>
<tabstop>beepFlashChkB</tabstop>
<tabstop>swtchWarnCB</tabstop>
<tabstop>swtchWarnChkB</tabstop>
<tabstop>swTHRChkB</tabstop>
<tabstop>swRUDChkB</tabstop>
<tabstop>swELEChkB</tabstop>
+171 -136
View File
@@ -155,16 +155,8 @@ QString getFuncName(unsigned int val)
return QObject::tr("Background Music");
else if (val == FuncBackgroundMusicPause)
return QObject::tr("Background Music Pause");
else if (val == FuncAdjustGV1)
return QObject::tr("Adjust GV1");
else if (val == FuncAdjustGV2)
return QObject::tr("Adjust GV2");
else if (val == FuncAdjustGV3)
return QObject::tr("Adjust GV3");
else if (val == FuncAdjustGV4)
return QObject::tr("Adjust GV4");
else if (val == FuncAdjustGV5)
return QObject::tr("Adjust GV5");
else if (val >= FuncAdjustGV1 && val <= FuncAdjustGVLast)
return QObject::tr("Adjust GV%1").arg(val-FuncAdjustGV1+1);
else {
return QString("???"); // Highlight unknown functions with output of question marks.(BTW should not happen that we do not know what a function is)
}
@@ -424,7 +416,7 @@ void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsign
else if (function==FuncPlayValue) {
populateSourceCB(b, RawSource(value), POPULATE_SOURCES|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRYEXT);
}
else if (function>=FuncAdjustGV1 && function<=FuncAdjustGV5 ) {
else if (function>=FuncAdjustGV1 && function<=FuncAdjustGVLast) {
switch (adjustmode) {
case 1:
populateSourceCB(b, RawSource(value), POPULATE_SOURCES|POPULATE_TRIMS|POPULATE_SWITCHES);
@@ -440,7 +432,6 @@ void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsign
break;
}
}
else {
b->hide();
}
@@ -480,68 +471,133 @@ void populatePhasesCB(QComboBox *b, int value)
b->setCurrentIndex(value + GetEepromInterface()->getCapability(FlightPhases));
}
void populateCurvesCB(QComboBox *b, int value)
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
QObject(),
curveTypeCB(curveTypeCB),
curveGVarCB(curveGVarCB),
curveValueCB(curveValueCB),
curveValueSB(curveValueSB),
curve(curve),
flags(flags),
lock(false),
lastType(-1)
{
b->clear();
int numcurves=GetEepromInterface()->getCapability(NumCurves);
if (numcurves==0) {
numcurves=16;
}
for (int i = -(numcurves)*GetEepromInterface()->getCapability(HasNegCurves); i < CURVE_BASE + numcurves; i++) {
if ((i==0) && GetEepromInterface()->getCapability(DiffMixers)) {
b->addItem(QObject::tr("Diff"));
} else {
b->addItem(getCurveStr(i));
}
}
b->setCurrentIndex(value+numcurves*GetEepromInterface()->getCapability(HasNegCurves));
b->setMaxVisibleItems(10);
curveTypeCB->addItem(tr("Diff"));
curveTypeCB->addItem(tr("Expo"));
curveTypeCB->addItem(tr("Func"));
curveTypeCB->addItem(tr("Curve"));
curveValueCB->setMaxVisibleItems(10);
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveGVarCB, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(curveValueCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveValueSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
update();
}
void populateExpoCurvesCB(QComboBox *b, int value)
void CurveGroup::update()
{
b->clear();
int numcurves=GetEepromInterface()->getCapability(NumCurves);
if (numcurves==0) {
numcurves=16;
}
if (GetEepromInterface()->getCapability(ExpoIsCurve)) {
b->addItem(QObject::tr("Expo"));
} else {
b->addItem(getCurveStr(0));
}
for (int i = 1; i < CURVE_BASE + numcurves; i++)
b->addItem(getCurveStr(i));
b->setCurrentIndex(value);
b->setMaxVisibleItems(10);
/* TODO
if (GetEepromInterface()->getCapability(ExpoCurve5)) {
int curve5=GetEepromInterface()->getCapability(ExpoCurve5);
for (int i=CURVE_BASE+curve5; i < CURVE_BASE + MAX_CURVE5; i++) {
// Get the index of the value to disable
QModelIndex index = b->model()->index(i, 0);
lock = true;
// This is the effective 'disable' flag
QVariant v(0);
curveTypeCB->setCurrentIndex(curve.type);
//the magic
b->model()->setData(index, v, Qt::UserRole - 1);
if (curve.type == CurveReference::CURVE_REF_DIFF || curve.type == CurveReference::CURVE_REF_EXPO) {
curveGVarCB->show();
if (curve.value > 100 || curve.value < -100) {
curveGVarCB->setChecked(true);
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
lastType = curve.type;
populateGVCB(curveValueCB, curve.value);
}
curveValueCB->show();
curveValueSB->hide();
}
else {
curveGVarCB->setChecked(false);
curveValueSB->setMinimum(-100);
curveValueSB->setMaximum(100);
curveValueSB->setValue(curve.value);
curveValueSB->show();
curveValueCB->hide();
}
}
if (GetEepromInterface()->getCapability(ExpoCurve9)) {
int curve9=GetEepromInterface()->getCapability(ExpoCurve9);
for (int i=CURVE_BASE+MAX_CURVE5+curve9; i < CURVE_BASE + MAX_CURVE5+ MAX_CURVE9; i++) {
// Get the index of the value to disable
QModelIndex index = b->model()->index(i, 0);
// This is the effective 'disable' flag
QVariant v(0);
//the magic
b->model()->setData(index, v, Qt::UserRole - 1);
else {
curveGVarCB->hide();
curveValueSB->hide();
curveValueCB->show();
switch (curve.type) {
case CurveReference::CURVE_REF_FUNC:
if (lastType != curve.type) {
lastType = curve.type;
curveValueCB->clear();
for (int i=0; i<=6/*TODO constant*/; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_FUNC, i).toString());
}
}
curveValueCB->setCurrentIndex(curve.value);
break;
case CurveReference::CURVE_REF_CUSTOM:
{
int numcurves = GetEepromInterface()->getCapability(NumCurves);
if (lastType != curve.type) {
lastType = curve.type;
curveValueCB->clear();
for (int i=-numcurves; i<numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
}
}
curveValueCB->setCurrentIndex(curve.value+numcurves);
break;
}
default:
break;
}
}
*/
lock = false;
}
void CurveGroup::gvarCBChanged(int state)
{
if (!lock) {
if (state) {
curve.value = 10000; // TODO constant in EEpromInterface ...
}
else {
curve.value = 0; // TODO could be better
}
update();
}
}
void CurveGroup::valuesChanged()
{
if (!lock) {
switch (curveTypeCB->currentIndex()) {
case 0:
case 1:
{
int value;
if (curveGVarCB->isChecked())
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
else
value = curveValueSB->value();
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
break;
}
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex());
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetEepromInterface()->getCapability(NumCurves));
break;
}
update();
}
}
void populateTrimUseCB(QComboBox *b, unsigned int phase)
@@ -560,73 +616,29 @@ void populateTrimUseCB(QComboBox *b, unsigned int phase)
void populateGvarUseCB(QComboBox *b, unsigned int phase)
{
b->addItem(QObject::tr("Own value"));
unsigned int num_phases = GetEepromInterface()->getCapability(FlightPhases);
if (num_phases>0) {
for (unsigned int i = 0; i < num_phases; i++) {
if (i != phase) {
b->addItem(QObject::tr("Flight mode %1 value").arg(i));
}
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
if (i != (int)phase) {
b->addItem(QObject::tr("Flight mode %1 value").arg(i));
}
}
}
void populateTimerSwitchCB(QComboBox *b, int value, int extrafields)
void populateTimerSwitchCB(QComboBox *b, int value)
{
b->clear();
uint8_t endvalue=128;
uint8_t count=0;
if (extrafields==2)
endvalue=192;
for (int i=-128; i<endvalue; i++) {
for (int i=-128; i<128; i++) {
QString timerMode = getTimerMode(i);
if (!timerMode.isEmpty()) {
b->addItem(getTimerMode(i), i);
if (i==value)
b->setCurrentIndex(b->count()-1);
if (extrafields==2 && (i<0 || (i>3 && i <TMRMODE_FIRST_CHPERC))) {
QModelIndex index = b->model()->index(count, 0);
// This is the effective 'disable' flag
QVariant v(0);
//the magic
b->model()->setData(index, v, Qt::UserRole - 1);
}
count++;
}
}
b->setMaxVisibleItems(10);
}
void populateTimerSwitchBCB(QComboBox *b, int value, int extrafields)
{
b->clear();
if (extrafields!=2) {
int startvalue=-128;
int endvalue=128;
if (extrafields==1) {
startvalue=-25;
endvalue=26;
}
for (int i=startvalue; i<endvalue; i++) {
QString timerMode = getTimerMode(i);
if (!timerMode.isEmpty()) {
b->addItem(getTimerMode(i), i);
if (i==value)
b->setCurrentIndex(b->count()-1);
}
}
} else {
for (int i=-33; i<66; i++) {
QString timerMode = getTimerModeB(i);
if (!timerMode.isEmpty()) {
b->addItem(timerMode, i);
if (i==value)
b->setCurrentIndex(b->count()-1);
}
}
}
b->setMaxVisibleItems(10);
}
QString getTimerMode(int tm) {
QString stt = "OFFABSTHsTH%THt";
@@ -868,8 +880,10 @@ void populateGVCB(QComboBox *b, int value)
{
int selected=0;
int nullitem;
b->clear();
int pgvars=GetEepromInterface()->getCapability(GvarsOfsNum);
int pgvars = GetEepromInterface()->getCapability(Gvars);
for (int i=-pgvars; i<=-1; i++) {
int16_t gval = (int16_t)(-10000+i);
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
@@ -878,12 +892,15 @@ void populateGVCB(QComboBox *b, int value)
selected=1;
}
}
b->addItem("---", 0);
nullitem=b->count()-1;
if (value == 0) {
b->setCurrentIndex(b->count()-1);
selected=1;
}
for (int i=1; i<=pgvars; i++) {
int16_t gval = (int16_t)(10000+i);
b->addItem(QObject::tr("GV%1").arg(i), gval);
@@ -892,6 +909,7 @@ void populateGVCB(QComboBox *b, int value)
selected=1;
}
}
if (selected==0)
b->setCurrentIndex(nullitem);
}
@@ -983,7 +1001,7 @@ void populateSourceCB(QComboBox *b, const RawSource &source, unsigned int flags)
}
if (flags & POPULATE_GVARS) {
for (int i=0; i<GetEepromInterface()->getCapability(GvarsNum); i++) {
for (int i=0; i<GetEepromInterface()->getCapability(Gvars); i++) {
item = RawSource(SOURCE_TYPE_GVAR, i);
b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
@@ -1061,25 +1079,20 @@ QString getSignedStr(int value)
return value > 0 ? QString("+%1").arg(value) : QString("%1").arg(value);
}
QString getCurveStr(int curve)
{
QString crvStr = "!c16!c15!c14!c13!c12!c11!c10!c9 !c8 !c7 !c6 !c5 !c4 !c3 !c2 !c1 ----x>0 x<0 |x| f>0 f<0 |f| c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 ";
return crvStr.mid((curve+C9X_MAX_CURVES) * 4, 4).remove(' ').replace("c", QObject::tr("Curve") + " ");
}
QString getGVarString(int16_t val, bool sign)
{
if (val >= -10000 && val <= 10000)
if (val >= -10000 && val <= 10000) {
if (sign)
return QString("(%1%)").arg(getSignedStr(val));
return QString("%1%").arg(getSignedStr(val));
else
return QString("(%1%)").arg(val);
else
if (val<0) {
return QObject::tr("(-GV%1)").arg(-val-10000);
} else {
return QObject::tr("(GV%1)").arg(val-10000);
}
return QString("%1%").arg(val);
}
else {
if (val<0)
return QObject::tr("-GV%1").arg(-val-10000);
else
return QObject::tr("GV%1").arg(val-10000);
}
}
QString image2qstring(QImage image)
@@ -1141,12 +1154,6 @@ int findmult(float value, float base)
return mult;
}
bool checkbit(int value, int bit)
{
return ((value & (1<<bit))==(1<<bit));
}
QString getFrSkyAlarmType(int alarm)
{
switch (alarm) {
@@ -1344,6 +1351,34 @@ QString getProtocol(ModelData * g_model)
return str;
}
QString getPhasesStr(unsigned int phases, ModelData & model)
{
int numphases = GetEepromInterface()->getCapability(FlightPhases);
if (numphases && phases) {
QString str;
int count = 0;
if (phases == (unsigned int)(1<<numphases) - 1) {
str = QObject::tr("None");
}
if (phases) {
for (int i=0; i<numphases;i++) {
if (!(phases & (1<<i))) {
if (count++ > 0) str += QString(", ");
str += getPhaseName(i+1, model.phaseData[i].name);
}
}
}
if (count > 1)
return QObject::tr("Flight modes(%1)").arg(str);
else
return QObject::tr("Flight mode(%1)").arg(str);
}
else {
return "";
}
}
float c9xexpou(float point, float coeff)
{
float x=point*1024.0/100.0;
+29 -9
View File
@@ -6,10 +6,10 @@
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(CustomSwitches)-1)
//convert from mode 1 to mode g_eeGeneral.stickMode
//convert from mode 1 to mode generalSettings.stickMode
//NOTICE! => 1..4 -> 1..4
#define CONVERT_MODE(x) (((x)<=4) ? modn12x3[g_eeGeneral.stickMode][((x)-1)] : (x))
#define CHANNEL_ORDER(x) (chout_ar[g_eeGeneral.templateSetup*4 + (x)-1])
#define CONVERT_MODE(x) (((x)<=4) ? modn12x3[generalSettings.stickMode][((x)-1)] : (x))
#define CHANNEL_ORDER(x) (chout_ar[generalSettings.templateSetup*4 + (x)-1])
#define CURVE_BASE 7
#define CH(x) (SRC_CH1+(x)-1-(SRC_SWC-SRC_3POS))
@@ -29,6 +29,29 @@ void populateTTraceCB(QComboBox *b, int value);
void populateRotEncCB(QComboBox *b, int value, int renumber);
void populateBacklightCB(QComboBox *b, const uint8_t value);
class CurveGroup : public QObject {
Q_OBJECT
public:
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags=0);
void update();
protected slots:
void gvarCBChanged(int);
void valuesChanged();
protected:
QComboBox *curveTypeCB;
QCheckBox *curveGVarCB;
QComboBox *curveValueCB;
QSpinBox *curveValueSB;
CurveReference & curve;
unsigned int flags;
bool lock;
int lastType;
};
#define POPULATE_ONOFF 0x01
#define POPULATE_MSWITCHES 0x02
#define POPULATE_AND_SWITCHES 0x04
@@ -42,13 +65,11 @@ void populateFuncParamArmTCB(QComboBox *b, ModelData * g_model, char * value, QS
void populatePhasesCB(QComboBox *b, int value);
void populateTrimUseCB(QComboBox *b, unsigned int phase);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
void populateCurvesCB(QComboBox *b, int value);
void populateCustomScreenFieldCB(QComboBox *b, unsigned int value, bool last, int hubproto);
void populateExpoCurvesCB(QComboBox *b, int value);
void populateTimerSwitchCB(QComboBox *b, int value, int extrafields=0);
void populateTimerSwitchBCB(QComboBox *b, int value, int extrafields=0);
void populateTimerSwitchCB(QComboBox *b, int value);
QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model);
QString getProtocolStr(const int proto);
QString getPhasesStr(unsigned int phases, ModelData & model);
#define POPULATE_SOURCES 1
#define POPULATE_TRIMS 2
@@ -72,12 +93,10 @@ QString getCSWFunc(int val);
QString getFuncName(unsigned int val);
QString getRepeatString(unsigned int val);
QString getSignedStr(int value);
QString getCurveStr(int curve);
QString getGVarString(int16_t val, bool sign=false);
QString image2qstring(QImage image);
QImage qstring2image(QString imagestr);
int findmult(float value, float base);
bool checkbit(int value, int bit);
QString getTrimInc(ModelData * g_model);
QString getTimerStr(TimerData & timer);
@@ -95,4 +114,5 @@ float getBarValue(int barId, int value, FrSkyData *fd);
float c9xexpou(float point, float coeff);
float ValToTim(int value);
int TimToVal(float value);
#endif // HELPERS_H
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

-157
View File
@@ -1,157 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48px"
height="48px"
id="svg3050"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="New document 6">
<defs
id="defs3052" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7"
inkscape:cx="24"
inkscape:cy="24"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="479"
inkscape:window-height="590"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata3055">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<image
y="6.811959e-08"
x="4.108463e-07"
id="image3120"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAFFRJREFU
aIHtmWlwXcd15//dd3337QseHoCHlVi5gaJIcBMp0hJTlGzLiV2UPXGUipOKKiqXVGUrrnJ5UoNi
pFQcO1PxSJM4jD2eOHHkWHQiWxpJZkQtpERS3ESQFAiC2LcH4D28/b279r09H+hw7JGrxhzHyRef
7919fn26T5/+H+BX9iv7hYz8W07GOafPPPOMBEBxHEe2LEvw+/1wHIczxpxYLGb19vbaBw4cYP9W
a/7CABycfP5zn1dDoVC0rOupWrXY7Fp2g8d4mDFPJYQQTjgTBKEmy3JeVdXleDy+pGlaTtf1+pEj
R7z/MIBHjx6VErm5RG4111+p1u4CYwOSqrb4g8FwIOhXFFkWZUjEcz3X1C27WqnU6/V6lrt8MhAN
XArHw1f7Ovoyn/nMZ8x/d4DP/dfP+UiFtK8sZfeZlrUv2hTrbuvriLV1d/qaEyklooVFURapShRE
XD9nhuOWSyV7bmHeHLl+pTI+fXPOL2pvk5j8+ql3X5+4fvJ67d8N4PH/9rgilIXuzNzKh4kgHOzf
ubF1y9Bd0c0tA/5UIKnUBIsuYo0skRwpo4YYD/EQNMS9oBc0FSeXzdXPXTpfeunEK5lL7116Y3U2
8wNozg3M4Y4jId7pgOefPyycG5ebFxdW7qeSeGjHg/e079yxK7El1uefE9eEPzOfw6uX3sDU2CTq
hQpc6kGIKUTtjSDW3Sg0a0kh1hCUjcGycuPsnFBYzO4H4xUYSgWw5gC4v1SA00vrg+XVubscZh/Y
fv/u1j179jRsifT7n6en6B+N/AVmv3seeL8OGJSDUg8u54wTasUztLxrATPb/IAiUHGc+dXpCty4
wLDi7IXNphDDGgqo/NIAhoeHxWy+1FSsVXem+zs6BndujW4Mdfu/TY/Tx999Guaz48AKODTVhsJ1
VJkJ0/NAiShyT5NGXI25juCWa+ALNjFkz+c1iGHkaStsbxBcuQpYNQA/d2a6I4AcoNYqlXVUpP3r
tvaF18e7A1fEGfrFxf8O8x9mQPKU8xi1UGFrmDPyqLgFuLAgkaAXRlwOIIH39LArMskVwUE8DzYn
EIkMwhMgXhAA/aUBaKgHluu1rkAylGxrb/OHlID0X9y/Q/70JMicCx4SXHBexKyRQcm9AI5zIKQC
oJ1a3j5n1eizK47jacQHxj1UXAtlVofllUHICkRiAuB34tPPDTA8PEwXrVzAcZyWcFPcn4w0KIvC
GnmrcAEYswFCOEKChUmjgqo3DpW+gIByGaGQoYa8RMLV1laWVj/s5sxuEKqCwYHjVcF4DhTvQ+Bn
oNk53MHu3xEAAMqYHfAojwbjQTmk+KVRMkcyaytAjgE+yiERCzVWg4gxyHQc1ytFoMLNw4cz+eyZ
U4FoqKwTut41WYCLbsXzhBVIPAPOl2DYq5hHFb+sCFzHdSq7mkop9UkBVVREmUwhA1YzQWwAGgVE
wsC4AZGswifXAeOWM8eOuQawbHRFq/FU6HKdMNHUPBN1ZqCUt3AdDHe483cMsH7DekycmRU8QKKi
QDhAi7wKWAwgBPBTDpVwUMIgEBP0Azvp8keeqD5TiJmz4ix9KBRyDhw58gsXdT//EWqAx0XP4/A8
j3swYfO6ZwCuB4gECAiACkDkBIJAINKfAhgeHpaf8BnJun+01TEd/99WqrXHn3o8J7JYkcUK9Wef
eMYGIXd0fP6fAMPDw7QZUKvVqub8sByKUF9jndcUR7dozi3CIg6giIBKgZhEECQUiiBB9fwBnyI/
OTysAjG5VrPV1epyS6VQ2V2vV3dCIBGXObWVQnaRSgs3W83m8S8/82fTlw4fzh47dsx+9NFHpaam
JgUIydUqp//qD+fEy2ZFNjQE64knnrAJIfxnAjz//PPCyJkzSS+f75qs1fpqut7BLCvhqGITAeuv
ZkthwzRogz8M+ERwlUCwQeTWiOQ013x8XG9pNtMdc3OGZJoT7aZda/Ko281gb9PigXQoFZFVv8Rk
eFUna2aL2cLEd9/9/okbNybe+c3HHitLNJ6emMj22PZcA+DKrgtYFqAost3VFc8tLIjTHR37ZwGU
PwDwhS98ITh69uxArVS6v1os7vUcp0cVxahfVWVBFATueaKeKQhO0SCtsQaIARUsrcC7XCPpzT2K
1yEEpk5e3tg0mDRss5YyTGuTpsWShAoNEMWQ5vdLAcqFhCZwfyAanuBzoZNnXg0tvT/JQslUVmGw
cuXMfQDZ5vfHI5yrEqUEiQTnoujao6MzuQsXxt5ZWVl8FUD9pwC++tWv+kvz87tWc7lPG/X6gdZU
KjmwaZPUNjBAEqkUqKlj9PIFcmZ5GmbFQNppQDgYRr6jDDJpYvnklELzLNK9pW9dS0OqoVatxlrb
Nid6enYFYrGQ2pxWSDwh0KDfwT+/9h75i299Q13I3xC4WTOkqJZMNaXbKpVaOuSP39fff19TY2NX
oLvbJ6TTCjKZunf06Mv1EydeDhjGQg5InAaG6G2Ao0ePSpmpqcF8ofDbruMc2r93b2T3Aw/Q9o0b
iZLPo3T5MrKzM4jnCkiaLgozS2jsbEZaaUQ+tgy+NQAzw6jWEYx+asvvIDWixU+cP6sJsqS1tbXI
Q0PNlEJEuUzx5hs2vvX1dzB/IwcSl6iQCAohTqwmLdkkUnFbX9+HGjdvvqdhaCioLS1R8txzC/jO
d15h16//yAOMoiDEa8Fge71UCrLbAMVMpimfy33EMowD9+3bFz74yU/SZCpFCt/8Jr7xta/hzOgo
8gB8mopAbycii91oCPrQsEUFdQiUzjBaDrVhfm1RrLULsQ+1fMjWQmGMvD8l2l6WvH8tgf/xDQEX
LzEsLs7B86YgBzdDVbOetTJK1g10WZrkW9eWXt/S2joYHRoKaMeOCXR4+AxWV78PYN4lRNQDgUg2
GlUvO45vuVQ65oq3L+3p0xsqpdL+vs7O+J5Dh4RkKkVyf/zHGB4exjkAFsA1gPtdjpnVNdIiKWT8
xTfhFKsILVgw7CrmR8qwQ8C3yYtCuaXuG9rbxxVTIuNLI9jYFUWl1oKZGRvAKkQxAMHt5sYyhV+b
Iw3BWEMsnPR1du6MDm5p8I+Pi/SLX7yGUuk5AMRtaRmshMNX12xbvEAIvTg/7yveTqOjo6PBWqUy
KABdW7dtE1I9PYS/8gq+/dRTuAiAAJwCDlTVnqXU0yt15dc7e8VCrS5YX3sPGnVg9MpwfAAqDMXX
1vA/02P4p1iCpMoNaM6E0JwU8JGHDuLmeAIzMyl4Xjdc6zwhxMZA7/1886ZEMhYZVDs7e6Itzar0
R/+5hlLpfwGQ+PbtO/V16y4Wr12bv8mYeMowlHngmHsbQGQsrOv6ukgwGGzt7aUqY1j8q7/Cu4xB
AOABLiitOory7mSlsrZt67advl07O/piQbo8nyPlzAiIvx0YCKHumajlapzlDF5ZWOGerBOPpMib
750lDx/q4A98NEj+9puN0PUueF4Bopige/cc8B+8L8Dz+bg2NBTVXnqJ0JdfPgVgDun0Xvuuuwql
CxcuZmo1/rbnae+vrr5W/6mHjJpm0LGseLihQQwmEgSzs5i7eBFV3CrOBQCiqq6UdP2fN2zadHPD
nl18amys6aFDD0j/6bOPkfSfDOOdkybMSR+U9iByySAvd1h6XTR1jxBu6K44Nr/ou3z1tHTwYKMw
PtpJX3+9Fa5rgjGFVqsDgcFBQZMkUZiakuhTT83Ccd6AJHW4W7eq1bGxl/LZbOU9TQu+K0mZtZ/M
nCIASIRQ7nmSJElEkGVgagq1SgUgBALnCIoiX+LcXnGc4m8/+GC2UK/nWaHoBjwPffccQEvoKLJX
RjBSqCE8q6EeDnBLcmqe6s6Y1K5btC7WqRs6V7qS2pDu037rkYR/aSki3riRJvG4Sl5/XRHjcQnR
KMFzz+mYmHgJgMN7e/uNev1ccWZmepJz5S3XlWYmJq7bHwBwOGcUsEzL4o7jAJaFACFQATBC0CgI
5IJhxPu7u7dzVY1UZ2f7UooihXw+BAMhtLoeWqt1TNgMfSBciMU9XXdXOMNLBthNR3Q9OSJG63W+
48zZ93Y8+rsbmj7/+VDsS19Kin6/jVLJxNNPO7cOK94BMI5I5G4WjxfK4+MXV2ybnxYE/9Xp6T1V
4AQ+AOCpalWSpGypVnPKlYroKgpplGW06TomRBFZ16XtDQ3xvrvuenh6crKi2HbL3QMDUmJggJK1
NbiZDEQAgmUjrJukkYtYYNSIBgJX5AR92yybTmNDlz9sBVcmbmSjo6OT/k99qjV47VpA/Mu/dEBp
BUARQB3AOIAWHg63W5nMD6uVSnFCUbTzsuxkgQ+qeBQA5FCopGnazWqtVpqenvZ0ShHQNGwCsFkU
MeTz0S///u+rD3zyk213t7Zu/Ni+fbE9n/60HOnsBL7/fRQWFnBLleKQOYfsuiC2Q+Wa46bKKWPu
5Jx5T1dXNaQFSszx9OvXdbdc5t7u3QSKIoKxMgAJgAxAAKUeVlbybi5XZZ7nlnVdLM/NJZ3/2/nb
EdB1vR4JhUbKtj12cWQk3hWN0jrnNCuKGFAUxGwb20slQdm0ibJkEkIwSATTBPvKV1D88z/HnOfB
uZVuIQLwGANsm0MQbi9ULMrRSmVlQNMCLara4VtbkyVdp/A8D4AOQIKmdcG2F8H5W8S2RyTG4qok
qW2UOp2xWHWh8DMkFxEAjhw54v3JE0+MJZqaji9NT7f/3dhYx7JpIiuKtLdeh8k5Xvubv0HqX/6F
uIEAqroOvrKCe2s1bFMUCLj1D+QAOOdgpslh24wBTADw5JNf9ReL2fWmWdvX17e/uadnXbi1VZG+
/GXAsm4AuAxARDAoIRK5G+Pji1CUUYUxX9i2WzoEYW6v42AeOHwDOPbBSwwAdjSaC4XDr+r5fOPx
yclPrBaLTSFAjADCkM9HCpxjZXIStiTxNcfxcgAOPvywkPL7wY4dg1urgdwC4Ea9zsGYTinVN2/2
CZZVa83ns/cmEh0Dvb17Yjt2RPxvvimQF1+8CuCHIKQKQvzI5z3Y9kEQsgGuqwuyPBWy7WSCsfw2
zo0poLgGYBk/8W++HeOTJ0/yhw4dcoii2P5o1AcgVjdNZdqyvDHGuEeIGw0EvJVAgF3UdXvfxz7m
/cZXviKEtm8n1okTeCWXgw6gSxAwBdgVxxnRBOH15KYH3bW13L0AfWDjxgdb77lnQ8Ln88l/8Adr
ZGnp7wFUeTT6Ibe1dZ1bLs+iXm+gQASACErXqCAYguvKBMjKgLMMtGeBhdtRuB2BJ5980p9bXu43
Gbtbjccbe7Zv5x0bNzLJtvnl06edV1dXueI4VQ8oDWzaFGrbty/uzM2BNjejJAjIAQgAcF3XKxuG
JRCSCaZSlmGwfsPQ9/f03NPa378p1t/vU770JU6uXTsOYBXA3U61misbxoilqrFAKtURXFmRBdu2
wFg/leULfkkKRG070Qcs7Qd8GeDw2E+VEgDgo7S5Xi5/tFwuf9wfCLSsa2sTm7q6aKK5Gft/7de8
b/7pnzrLul7btH37WrixMRi3LDFICIFh4MriIkoANgDIMcZrnleUZXk6uX4wVK5k700k0ht6eu6J
7doV9b/xhkC/9a3LAM4DaHeBtTJjx5cZG7e2bfu90Cc+4dLvfU8NvvtuinheDYzlBEG4GaI0lfC8
te1AbRoYy/2Y/v8AeITEq/X6Rk2WWz+6a5cysG2bEOzuJqIkoRiN8tgjjwjnTLOlVK83tCuKbyid
Fht27yaFp5/Gy4UCBAAhwBvnnDmuO51MNi0zRdnIDbqzu3tfw549bWHGZOHIkRJ0/VUAKgcUA3it
AEzPAXYmnV7s27lz0ieKm9SFhai8tNQI1+0FpSVFkpyobdfTnF+9F/BmgLurwCX9NoAkiiYIsURV
5YnBQdLc2Ejo8eMwz52D//Rpsm/fPrn/s58VSzduaClKSfuBA9Q8fhzPPvssbgLoAHgW8OaAgs/n
u9Bw9zZSqjp7enp2tH3kI1ujTU1+9bHHKuTy5WMgZAWcr3OAkTIwvgp4b2labMzz9IPvvHMmsnt3
s7ZlS1NsacmmnOdh261EUdo1SuWo6872A2v7AZ4BDt+8DRCQpEwgHL5Yse1t53/0o9aZU6f4+KlT
JGfe6jlsn57GnliMpgYH4do2LgwP47lnn8XpWg0xABTwrgGGQ8j5dEfHlaqgdUaC0f6Pf3x3mDFF
e+SRt8nLL78FYBWcd7jAQhW4XACMq4DydmOjPJ9IxOWzZ8c7NG3ED1RVUXzZ73lF0tLy6zCMtJDP
XwkAzVGgsBWwrgKXMrcB2jdsyFszM2/o16/3fefrX39oNZOJUEBIE0J2+P34wdoafvCHf4i4pqFs
25hlDCaA8K2U5r0PGHXgfEgR/ymxfmvGEun25uawduLETf7Xf/09c2FhnAEaAdIuMG8CF/LA2jQg
ngScqba2eEWSGq6oaub0iRMnEufPvyh5nsEikQ/LlDJSKr3COc/Yt1Q0IQKwNOD4bwM8/PDD7tGj
R6+fPnv2H95fWoIN3O8HGv2AVCeEbG5rI3XGwLJZzDPGPQASwMsAKwF5BpxVgeelePJ0cl1nOJfL
rr3wwpvF0dHvioCnAxEK+AFMeEDeAOqLAHkNwCVgsXzy5KK7detDq8mkc/If//F4LJdb2E3p5kSl
ckIuFFYIYAJwXaBqAGYOEEoA5z+rRxYIAespcD+AvRzoIUAkAqgRUaSEc5iu61qAZQMlD5gWgdMU
eJMDV4cOH66mUt2xF154a2BxcWwLILYCsgpwAjj8lhNSERDHAbwHSPPAnIlbjyDZseO3gufP/6gX
iGwFxA6gGAAovVWoEBdAHaDTgHAJMG/+zCbfvYA4BsQZ0MGBLgBpD4g4gEIBIgGmCBQJsCQB0zIw
OwPkAfyr1ikA8APpIKCqgEEB68drqR7ATUCsAXO1nxjzE9auAh0BYCVwS/qRfqzO2RwQGCDogFkF
lv+/27O/sl/Zj+1/A3SW42Q2L0q5AAAAAElFTkSuQmCC
"
height="48"
width="48" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="190mm" height="190mm" viewBox="0 0 19000 19000" preserveAspectRatio="xMidYMid" fill-rule="evenodd" clip-path="url(#presentation_clip_path)" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="19000" height="19000"/>
</clipPath>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8 id9 id10"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template(57356)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template(57354)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template(10146)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template(10132)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template(10007)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template(10004)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template(9679)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template(8226)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template(8211)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
</defs>
<defs class="TextEmbeddedBitmaps"/>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id3">
<path fill="rgb(0,0,0)" stroke="none" d="M 9500,19000 L 0,19000 0,0 19000,0 19000,19000 9500,19000 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 9500,19000 L 0,19000 0,0 19000,0 19000,19000 9500,19000 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.PolyPolygonShape">
<g id="id4">
<path fill="rgb(255,255,255)" stroke="none" d="M 1500,4800 L 7800,4800 7800,6800 5800,6800 5800,14800 3500,14800 3500,6800 1500,6800 1500,6000 1500,4800 Z"/>
<path fill="none" stroke="rgb(255,255,255)" d="M 1500,4800 L 7800,4800 7800,6800 5800,6800 5800,14800 3500,14800 3500,6800 1500,6800 1500,6000 1500,4800 Z"/>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3228" y="10021"><tspan fill="rgb(0,0,0)" stroke="none"> </tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.PolyPolygonShape">
<g id="id5">
<path fill="rgb(51,102,51)" stroke="none" d="M 17400,4800 L 14800,4800 13000,7900 11100,4800 8500,4800 11500,9800 8400,14800 10900,14800 13000,11500 15000,14800 17600,14800 14400,9800 17400,4800 Z"/>
<path fill="none" stroke="rgb(51,102,51)" d="M 17400,4800 L 14800,4800 13000,7900 11100,4800 8500,4800 11500,9800 8400,14800 10900,14800 13000,11500 15000,14800 17600,14800 14400,9800 17400,4800 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id6">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="2540px" font-weight="700"><tspan class="TextPosition" x="1201" y="17891"><tspan fill="rgb(255,255,255)" stroke="none">COMPANION</tspan></tspan></tspan></text>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.TextShape">
<g id="id7">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="1391" y="3521"><tspan fill="rgb(255,255,255)" stroke="none">O</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id8">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="6282" y="3521"><tspan fill="rgb(255,255,255)" stroke="none">P</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id9">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="10696" y="3586"><tspan fill="rgb(255,255,255)" stroke="none">E</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id10">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="14950" y="3586"><tspan fill="rgb(255,255,255)" stroke="none">N</tspan></tspan></tspan></text>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="190mm" height="190mm" viewBox="0 0 19000 19000" preserveAspectRatio="xMidYMid" fill-rule="evenodd" clip-path="url(#presentation_clip_path)" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="19000" height="19000"/>
</clipPath>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8 id9 id10"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template(57356)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template(57354)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template(10146)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template(10132)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template(10007)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template(10004)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template(9679)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template(8226)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template(8211)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
</defs>
<defs class="TextEmbeddedBitmaps"/>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id3">
<path fill="rgb(0,0,0)" stroke="none" d="M 9500,19000 L 0,19000 0,0 19000,0 19000,19000 9500,19000 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 9500,19000 L 0,19000 0,0 19000,0 19000,19000 9500,19000 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.PolyPolygonShape">
<g id="id4">
<path fill="rgb(255,255,255)" stroke="none" d="M 1500,4800 L 7800,4800 7800,6800 5800,6800 5800,14800 3500,14800 3500,6800 1500,6800 1500,6000 1500,4800 Z"/>
<path fill="none" stroke="rgb(255,255,255)" d="M 1500,4800 L 7800,4800 7800,6800 5800,6800 5800,14800 3500,14800 3500,6800 1500,6800 1500,6000 1500,4800 Z"/>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3228" y="10021"><tspan fill="rgb(0,0,0)" stroke="none"> </tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.PolyPolygonShape">
<g id="id5">
<path fill="rgb(51,102,51)" stroke="none" d="M 17400,4800 L 14800,4800 13000,7900 11100,4800 8500,4800 11500,9800 8400,14800 10900,14800 13000,11500 15000,14800 17600,14800 14400,9800 17400,4800 Z"/>
<path fill="none" stroke="rgb(51,102,51)" d="M 17400,4800 L 14800,4800 13000,7900 11100,4800 8500,4800 11500,9800 8400,14800 10900,14800 13000,11500 15000,14800 17600,14800 14400,9800 17400,4800 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id6">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="2540px" font-weight="700"><tspan class="TextPosition" x="1201" y="17891"><tspan fill="rgb(255,255,255)" stroke="none">COMPANION</tspan></tspan></tspan></text>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.TextShape">
<g id="id7">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="1391" y="3521"><tspan fill="rgb(255,255,255)" stroke="none">O</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id8">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="6282" y="3521"><tspan fill="rgb(255,255,255)" stroke="none">P</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id9">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="10696" y="3586"><tspan fill="rgb(255,255,255)" stroke="none">E</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.TextShape">
<g id="id10">
<text class="TextShape"><tspan class="TextParagraph" font-family="Ubuntu Medium" font-size="3104px" font-weight="700"><tspan class="TextPosition" x="14950" y="3586"><tspan fill="rgb(255,255,255)" stroke="none">N</tspan></tspan></tspan></text>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 102 KiB

+1 -1
View File
@@ -687,7 +687,7 @@ bool logsDialog::cvsFileParse()
file.close();
if (errors>1) {
QMessageBox::warning(this, "companion9x", tr("The selected logfile contains %1 invalid lines out of %2 total lines").arg(errors).arg(lines));
QMessageBox::warning(this, "Companion", tr("The selected logfile contains %1 invalid lines out of %2 total lines").arg(errors).arg(lines));
}
plotLock=true;
int n=csvlog.count();
+1 -1
View File
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Companion9x log viewer</string>
<string>Companion Log Viewer</string>
</property>
<property name="windowIcon">
<iconset resource="companion9x.qrc">
+4 -4
View File
@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(companion9x);
QApplication app(argc, argv);
app.setApplicationName("Companion9x");
app.setApplicationName("OpenTX Companion");
#ifdef __APPLE__
app.setStyle(new MyProxyStyle);
#endif
@@ -100,13 +100,13 @@ int main(int argc, char *argv[])
QString locale = settings.value("locale",QLocale::system().name()).toString();
bool showSplash = settings.value("show_splash", true).toBool();
QTranslator companion9xTranslator;
companion9xTranslator.load(":/companion9x_" + locale);
QTranslator companionTranslator;
companionTranslator.load(":/companion_" + locale);
QTranslator qtTranslator;
qtTranslator.load((QString)"qt_" + locale.left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
// qDebug() << locale;
// qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&companion9xTranslator);
app.installTranslator(&companionTranslator);
app.installTranslator(&qtTranslator);
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+43 -41
View File
@@ -59,7 +59,7 @@
#include "burndialog.h"
#include "hexinterface.h"
#include "warnings.h"
#include "firmwares/opentx/open9xinterface.h" // TODO get rid of this include
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
#ifdef __APPLE__
@@ -103,9 +103,9 @@ downloadDialog_forWait(NULL)
readSettings();
FirmwareInfo *firmware = GetCurrentFirmware();
if (ActiveProfile) {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
} else {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
}
setUnifiedTitleAndToolBarOnMac(true);
this->setWindowIcon(QIcon(":/icon.png"));
@@ -172,11 +172,11 @@ void MainWindow::displayWarnings()
if (warnId<WARNING_ID && warnId!=0) {
int res=0;
if (WARNING_LEVEL>0) {
QMessageBox::warning(this, "companion9x", WARNING);
res = QMessageBox::question(this, "companion9x",tr("Display previous warning again at startup ?"),QMessageBox::Yes | QMessageBox::No);
QMessageBox::warning(this, "Companion", WARNING);
res = QMessageBox::question(this, "Companion",tr("Display previous warning again at startup ?"),QMessageBox::Yes | QMessageBox::No);
} else {
QMessageBox::about(this, "companion9x", WARNING);
res = QMessageBox::question(this, "companion9x",tr("Display previous message again at startup ?"),QMessageBox::Yes | QMessageBox::No);
QMessageBox::about(this, "Companion", WARNING);
res = QMessageBox::question(this, "Companion",tr("Display previous message again at startup ?"),QMessageBox::Yes | QMessageBox::No);
}
if (res == QMessageBox::No) {
settings.setValue("warningId", WARNING_ID);
@@ -249,7 +249,7 @@ void MainWindow::checkForUpdateFinished(QNetworkReply * reply)
QString version = qba.mid(i+14, 4);
if (version.isNull()) {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
return;
}
double vnum=version.toDouble();
@@ -263,7 +263,7 @@ void MainWindow::checkForUpdateFinished(QNetworkReply * reply)
if (c9xver< vnum) {
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
showcheckForUpdatesResult = false; // update is available - do not show dialog
int ret = QMessageBox::question(this, "companion9x", tr("A new version of companion9x is available (version %1)<br>"
int ret = QMessageBox::question(this, "Companion", tr("A new version of Companion is available (version %1)<br>"
"Would you like to download it?").arg(version) ,
QMessageBox::Yes | QMessageBox::No);
@@ -284,21 +284,21 @@ void MainWindow::checkForUpdateFinished(QNetworkReply * reply)
}
}
#else
QMessageBox::warning(this, tr("New release available"), tr("A new release of companion is available please check the repository"));
QMessageBox::warning(this, tr("New release available"), tr("A new release of Companion is available please check the repository"));
#endif
} else {
if (showcheckForUpdatesResult && check1done && check2done)
QMessageBox::information(this, "companion9x", tr("No updates available at this time."));
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
}
} else {
if(check1done && check2done)
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
}
}
void MainWindow::updateDownloaded()
{
int ret = QMessageBox::question(this, "companion9x", tr("Would you like to launch the installer?") ,
int ret = QMessageBox::question(this, "Companion", tr("Would you like to launch the installer?") ,
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
if(QDesktopServices::openUrl(QUrl::fromLocalFile(installer_fileName)))
@@ -362,7 +362,7 @@ void MainWindow::reply1Accepted()
errormsg=tr("Compilation server too busy, try later");
break;
case 4:
errormsg=tr("Compilation server requires registration, please check opentx web site");
errormsg=tr("Compilation server requires registration, please check OpenTX web site");
break;
default:
errormsg=tr("Unknown server failure, try later");
@@ -402,7 +402,7 @@ void MainWindow::reply1Accepted()
errormsg=tr("Compilation server too busy, try later");
break;
case 4:
errormsg=tr("Compilation server requires registration, please check opentx web site");
errormsg=tr("Compilation server requires registration, please check OpenTX web site");
break;
default:
errormsg=tr("Unknown server failure, try later");
@@ -433,7 +433,7 @@ void MainWindow::reply1Accepted()
}
settings.setValue(downloadedFW, currentFWrev);
if (autoflash) {
int ret = QMessageBox::question(this, "companion9x", tr("Do you want to write the firmware to the transmitter now ?"), QMessageBox::Yes | QMessageBox::No);
int ret = QMessageBox::question(this, "Companion", tr("Do you want to write the firmware to the transmitter now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
burnToFlash(downloadedFWFilename);
}
@@ -470,7 +470,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
QString newrev=qba.mid(k).replace('"', "").trimmed();
if(!cres) {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
int server = settings.value("fwserver",0).toInt();
server++;
settings.setValue("fwserver",server);
@@ -490,6 +490,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
showcheckForUpdatesResult = false; // update is available - do not show dialog
QString rn = GetFirmware(fwToUpdate)->rnurl;
QAbstractButton *rnButton;
msgBox.setWindowTitle("Companion");
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nVersion %2 is available.\nDo you want to download it now ?").arg(fwToUpdate).arg(NewFwRev));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
@@ -502,7 +503,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
if( msgBox.clickedButton() == rnButton ) {
contributorsDialog *cd = new contributorsDialog(this,2,rn);
cd->exec();
int ret2 = QMessageBox::question(this, "companion9x", tr("Do you want to download release %1 now ?").arg(NewFwRev),
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(NewFwRev),
QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) {
download = true;
@@ -518,7 +519,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
showcheckForUpdatesResult = false; // update is available - do not show dialog
QString rn = GetFirmware(fwToUpdate)->rnurl;
QAbstractButton *rnButton;
msgBox.setText("companion9x");
msgBox.setText("Companion");
msgBox.setInformativeText(tr("A new version of %1 firmware is available (current %2 - newer %3).\nDo you want to download it now ?").arg(fwToUpdate).arg(OldFwRev).arg(NewFwRev));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
@@ -532,7 +533,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
warning=0;
contributorsDialog *cd = new contributorsDialog(this,2,rn);
cd->exec();
int ret2 = QMessageBox::question(this, "companion9x", tr("Do you want to download release %1 now ?").arg(NewFwRev),
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(NewFwRev),
QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) {
download = true;
@@ -546,10 +547,10 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
}
} else {
if(showcheckForUpdatesResult && check1done && check2done)
QMessageBox::information(this, "companion9x", tr("No updates available at this time."));
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
}
if (ignore) {
int res = QMessageBox::question(this, "companion9x",tr("Ignore this version (r%1)?").arg(rev), QMessageBox::Yes | QMessageBox::No);
int res = QMessageBox::question(this, "Companion",tr("Ignore this version (r%1)?").arg(rev), QMessageBox::Yes | QMessageBox::No);
if (res==QMessageBox::Yes) {
settings.beginGroup("FwRevisions");
settings.setValue(fwToUpdate, NewFwRev);
@@ -559,7 +560,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
if (warning>0) {
QString rn = GetFirmware(fwToUpdate)->rnurl;
if (!rn.isEmpty()) {
int ret2 = QMessageBox::warning(this, "companion9x", tr("Release notes contain very important informations. Do you want to see them now ?"), QMessageBox::Yes | QMessageBox::No);
int ret2 = QMessageBox::warning(this, "Companion", tr("Release notes contain very important informations. Do you want to see them now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) {
contributorsDialog *cd = new contributorsDialog(this,2,rn);
cd->exec();
@@ -592,11 +593,11 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
}
}
} else {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
}
} else {
if(check1done && check2done) {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
int server = settings.value("fwserver",0).toInt();
server++;
settings.setValue("fwserver",server);
@@ -718,13 +719,13 @@ void MainWindow::loadProfile()
settings.setValue("profileId", profnum);
current_firmware_variant = GetFirmwareVariant(firmware_id);
FirmwareInfo *firmware = GetCurrentFirmware();
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
// settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
mdiChild->eepromInterfaceChanged();
}
setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
}
}
@@ -735,7 +736,7 @@ void MainWindow::unloadProfile()
QSettings settings("companion9x", "companion9x");
settings.setValue("ActiveProfile",0);
FirmwareInfo *firmware = GetCurrentFirmware();
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
}
void MainWindow::preferences()
@@ -744,9 +745,9 @@ void MainWindow::preferences()
pd->exec();
FirmwareInfo *firmware = GetCurrentFirmware();
if (ActiveProfile) {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
} else {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
}
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
@@ -1082,10 +1083,10 @@ void MainWindow::burnExtenalToEEPROM()
cd->exec();
if (!fileName.isEmpty()) {
settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
int ret = QMessageBox::question(this, "companion9x", tr("Write Models and settings from %1 to the Tx?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
int ret = QMessageBox::question(this, "Companion", tr("Write Models and settings from %1 to the Tx?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return;
if (!isValidEEPROM(fileName))
ret = QMessageBox::question(this, "companion9x", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
ret = QMessageBox::question(this, "Companion", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return;
bool backupEnable = settings.value("backupEnable", true).toBool();
QString backupPath = settings.value("backupPath", "").toString();
@@ -1489,15 +1490,16 @@ void MainWindow::logFile()
void MainWindow::about()
{
QString aboutStr = "<center><img src=\":/images/companion9x-title.png\"><br>";
aboutStr.append(tr("Copyright") +" Bertrand Songis & Romolo Manfredini &copy; 2011- 2013<br>");
aboutStr.append(QString("<a href='http://code.google.com/p/companion9x/'>http://code.google.com/p/companion9x/</a><br>")+tr("Version %1 (revision %2), %3").arg(C9X_VERSION).arg(C9X_REVISION).arg(__DATE__)+QString("<br/><br/>"));
aboutStr.append(tr("The companion9x project was originally forked from eePe")+QString(" <a href='http://code.google.com/p/eepe'>http://code.google.com/p/eepe</a><br/><br/>"));
QString aboutStr = "<center><img src=\":/images/companion-title.png\"></center><br>";
aboutStr.append("OpenTX Home Page: <a href='http://opentx.github.io'>http://open-tx.org</a><br><br>");
aboutStr.append(tr("The Companion project was originally forked from eePe")+QString(" <a href='http://code.google.com/p/eepe'>http://code.google.com/p/eepe</a><br/><br/>"));
aboutStr.append(tr("If you've found this program useful, please support by"));
aboutStr.append(" <a href='" DONATE_STR "'>");
aboutStr.append(tr("donating") + "</a></center>");
aboutStr.append(tr("donating") + "</a><br><br>");
aboutStr.append(tr("Version %1 (revision %2), %3").arg(C9X_VERSION).arg(C9X_REVISION).arg(__DATE__)+QString("<br/><br/>"));
aboutStr.append(tr("Copyright") +" Bertrand Songis & Romolo Manfredini &copy; 2011- 2014<br>");
QMessageBox::about(this, tr("About companion9x"),aboutStr);
QMessageBox::about(this, tr("About Companion"),aboutStr);
}
void MainWindow::updateMenus()
@@ -1624,15 +1626,15 @@ void MainWindow::createActions()
connect(preferencesAct, SIGNAL(triggered()), this, SLOT(preferences()));
checkForUpdatesAct = new QAction(QIcon(":/images/update.png"), tr("&Check for updates..."), this);
checkForUpdatesAct->setStatusTip(tr("Check for new version of companion9x/er9x"));
checkForUpdatesAct->setStatusTip(tr("Check for new version of Companion"));
connect(checkForUpdatesAct, SIGNAL(triggered()), this, SLOT(doUpdates()));
contributorsAct = new QAction(QIcon(":/images/contributors.png"), tr("Contributors &List..."), this);
contributorsAct->setStatusTip(tr("Show companion9x contributors list"));
contributorsAct->setStatusTip(tr("Show Companion contributors list"));
connect(contributorsAct, SIGNAL(triggered()), this, SLOT(contributors()));
changelogAct = new QAction(QIcon(":/images/changelog.png"), tr("ChangeLog..."), this);
changelogAct->setStatusTip(tr("Show companion9x changelog"));
changelogAct->setStatusTip(tr("Show Companion changelog"));
connect(changelogAct, SIGNAL(triggered()), this, SLOT(changelog()));
fwchangelogAct = new QAction(QIcon(":/images/changelog.png"), tr("Firmware ChangeLog..."), this);

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