Merge branch 'next' of https://github.com/opentx/opentx into kilrah/158_12_cells_in_telemetry_view
Conflicts: radio/src/logs.cpp radio/src/telemetry/frsky.h radio/src/telemetry/frsky_sport.h
@@ -0,0 +1,6 @@
|
||||
/.*project
|
||||
/.settings
|
||||
/.autotools
|
||||
radio/src/bootloader/.dep/
|
||||
radio/src/bootloader/bootloader_ramBoot*
|
||||
*.lbm
|
||||
@@ -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,5 @@ 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)
|
||||
|
||||
|
||||
@@ -95,8 +95,7 @@ Heinrich Illig
|
||||
Michael Collins
|
||||
Michael Manning
|
||||
Craig Lorentz
|
||||
Jonathan Modellismo - http://jonathan.it
|
||||
Aviomotive - http://www.aviomotive.com
|
||||
Jonathan Modellismo - jonathan.it
|
||||
André Lasseret
|
||||
Felipe Alexandre de Oliveira
|
||||
Brian Harris
|
||||
@@ -126,7 +125,7 @@ Larisa Filocamo
|
||||
Alex Calderhead
|
||||
Hartmut Sahm
|
||||
Åke Brodin
|
||||
Aloft Hobbies - http://www.alofthobbies.com
|
||||
Aloft Hobbies - www.alofthobbies.com
|
||||
Ted Moss
|
||||
Filippos Tigarakis
|
||||
Chewytm
|
||||
@@ -166,7 +165,7 @@ Heiko Polig
|
||||
Andrew Fernie
|
||||
Marco Lange
|
||||
Nick McMillan
|
||||
Michel Baily (mensual)
|
||||
Michel Baily (monthly)
|
||||
Patrick Mullen
|
||||
Scott Campbell
|
||||
Erich Roeder
|
||||
@@ -271,3 +270,95 @@ Henrik Hammarström
|
||||
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
|
||||
Ulach Green
|
||||
Lluis Bullich Rañe
|
||||
Steffen Rohr
|
||||
Eric Jacquin
|
||||
Harvest Lane
|
||||
Ville Kuvaja
|
||||
DK-System
|
||||
Heinz Vogel
|
||||
Heung Jin Choi
|
||||
MMJS van der Helm
|
||||
Dan Neelands
|
||||
Yashiro Masayuki
|
||||
Isaac Sloan
|
||||
Harold Baird
|
||||
Roy Bender
|
||||
Bradley Murchie
|
||||
Maximilian Süß
|
||||
Dean Jansa
|
||||
Ronald Donker
|
||||
Paul Oldenkamp
|
||||
Dietmar Drees
|
||||
Bradley Murchie
|
||||
Richard Fahie
|
||||
James Kaufman
|
||||
Henry Deucker
|
||||
Christian Fuchs
|
||||
Arold Reinders
|
||||
Robert Miller
|
||||
Aviomotive - www.aviomotive.com
|
||||
Mark Gaskievicz
|
||||
Roland Müller
|
||||
Frank Gewalt
|
||||
Remi Viard
|
||||
Leonard MacKey
|
||||
Reginald H Millsom
|
||||
Emanuel Stassar
|
||||
Pierluigi Sommaruga
|
||||
Rafael Eric Suarez Nordlow
|
||||
A Harris
|
||||
Stefan Grunenberg
|
||||
Francisco Gutierrez Muñoz
|
||||
Steve Coley
|
||||
Sean Cull
|
||||
Roberto Orsello
|
||||
David Finger
|
||||
FrSky - www.frsky-rc.com
|
||||
Jean-Marie Oddo
|
||||
Mike Matheny
|
||||
Glen Roe (Showmaster)
|
||||
Arron Bates
|
||||
Tim Spurr
|
||||
Daniel Morgan
|
||||
Trent Ready
|
||||
Mark Maskiell
|
||||
Robert Crockford
|
||||
Mark Illum
|
||||
David McGuire
|
||||
Martyn Coles
|
||||
Jose Sobral
|
||||
Heung Jin Choi
|
||||
Tomasz Janiak
|
||||
Fabien Gagné
|
||||
Joe Street
|
||||
Micha Ronen
|
||||
Albert Blondin
|
||||
Klaus Schuebel
|
||||
Evening Shade Pottery
|
||||
Thomas Kilduff
|
||||
Sven Assmus
|
||||
Markus Eberl
|
||||
Dietmar Drees
|
||||
Nicholas Field
|
||||
Harald Wilczak
|
||||
Michel Baily
|
||||
John Grepps
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
##OpenTX Next Branch
|
||||
|
||||
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
|
||||
|
||||
The stable release code is not here, it is in the master branch.
|
||||
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
|
||||
|
||||
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
@@ -1 +0,0 @@
|
||||
[to be written]
|
||||
@@ -1,3 +1,10 @@
|
||||
<h2>Version 1.52</h2>
|
||||
<ul>
|
||||
<li>Fix crash when writing certain EEPROMS</li>
|
||||
<li>Google Earth export of logs containing GPS positions</li>
|
||||
<li>DSM2 added for Taranis</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.51</h2>
|
||||
<ul>
|
||||
<li>Wrong DFU-Util default path (MAC)</li>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
PROJECT( companion9x )
|
||||
PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "1" )
|
||||
SET( C9X_VERSION_MINOR "51" )
|
||||
SET( C9X_VERSION_MINOR "99" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
@@ -36,7 +36,7 @@ ELSE()
|
||||
MESSAGE( "SDL not found! Joysticks support will be disabled" )
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE( Qt4 REQUIRED )
|
||||
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
|
||||
SET( QT_USE_QTNETWORK True )
|
||||
SET( QT_USE_QTXML True )
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
@@ -72,180 +72,146 @@ ELSE( )
|
||||
LINK_DIRECTORIES( /usr/local/lib )
|
||||
ENDIF( )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} )
|
||||
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
|
||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
FIND_PACKAGE( Subversion )
|
||||
SET( C9X_WC_REVISION 0 )
|
||||
IF( Subversion_FOUND )
|
||||
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} C9X )
|
||||
ENDIF( )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/../.. ${PROJECT_SOURCE_DIR}/../../radio/src/fonts/std )
|
||||
|
||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
COMMAND make lbm
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/sticks_4x1.xbm
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
COMMAND make tra
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/translations/en.h.txt
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/stamp-opentx.h
|
||||
COMMAND make stamp_header
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/Makefile
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
SET( companion9x_SRCS
|
||||
eeprominterface.cpp
|
||||
hexinterface.cpp
|
||||
flashinterface.cpp
|
||||
file.cpp
|
||||
xmlinterface.cpp
|
||||
${PROJECT_BINARY_DIR}/radio.cxx
|
||||
firmwares/th9x/th9xeeprom.cpp
|
||||
firmwares/th9x/th9xinterface.cpp
|
||||
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
firmwares/er9x/er9xeeprom.cpp
|
||||
firmwares/er9x/er9xinterface.cpp
|
||||
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
firmwares/gruvin9x/gruvin9xeeprom.cpp
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/opentx/open9xeeprom.cpp
|
||||
firmwares/opentx/open9xStockeeprom.cpp
|
||||
firmwares/opentx/open9xinterface.cpp
|
||||
firmwares/opentx/open9xGruvin9xeeprom.cpp
|
||||
firmwares/opentx/open9xSky9xeeprom.cpp
|
||||
firmwares/opentx/opentxTaranisSimulator.cpp
|
||||
firmwares/opentx/open9xSky9xsimulator.cpp
|
||||
firmwares/opentx/open9xGruvin9xsimulator.cpp
|
||||
firmwares/opentx/open9xM128simulator.cpp
|
||||
firmwares/opentx/open9xsimulator.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
|
||||
comparedialog.cpp
|
||||
contributorsdialog.cpp
|
||||
customizesplashdialog.cpp
|
||||
burndialog.cpp
|
||||
printdialog.cpp
|
||||
fusesdialog.cpp
|
||||
expodialog.cpp
|
||||
mixerdialog.cpp
|
||||
logsdialog.cpp
|
||||
downloaddialog.cpp
|
||||
simulatordialog.cpp
|
||||
xsimulatordialog.cpp
|
||||
splashlibrary.cpp
|
||||
mainwindow.cpp
|
||||
main.cpp
|
||||
modelconfigdialog.cpp
|
||||
qcustomplot.cpp
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/../..
|
||||
${SIMU_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
${RADIO_SRC_DIRECTORY}/lua/src
|
||||
${XSD_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
SET( companion9x_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
|
||||
splashlabel.h
|
||||
burndialog.h
|
||||
downloaddialog.h
|
||||
cursorwidget.h
|
||||
menuwidget.h
|
||||
simulatordialog.h
|
||||
xcursorwidget.h
|
||||
xmenuwidget.h
|
||||
xsimulatordialog.h
|
||||
generaledit.h
|
||||
modeledit.h
|
||||
modelslist.h
|
||||
mixerslist.h
|
||||
mdichild.h
|
||||
mainwindow.h
|
||||
myslider.h
|
||||
modelconfigdialog.h
|
||||
qcustomplot.h
|
||||
add_subdirectory(modeledit)
|
||||
add_subdirectory(simulation)
|
||||
|
||||
set(companion_SRCS
|
||||
eeprominterface.cpp
|
||||
hexinterface.cpp
|
||||
flashinterface.cpp
|
||||
file.cpp
|
||||
xmlinterface.cpp
|
||||
${PROJECT_BINARY_DIR}/radio.cxx
|
||||
firmwares/th9x/th9xeeprom.cpp
|
||||
firmwares/th9x/th9xinterface.cpp
|
||||
firmwares/er9x/er9xeeprom.cpp
|
||||
firmwares/er9x/er9xinterface.cpp
|
||||
firmwares/gruvin9x/gruvin9xeeprom.cpp
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/opentx/opentxeeprom.cpp
|
||||
firmwares/opentx/open9xStockeeprom.cpp
|
||||
firmwares/opentx/open9xGruvin9xeeprom.cpp
|
||||
firmwares/opentx/open9xSky9xeeprom.cpp
|
||||
firmwares/opentx/opentxinterface.cpp
|
||||
firmwares/opentx/opentxTaranisSimulator.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
|
||||
${RADIO_SRC_DIRECTORY}/stamp-opentx.h
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
appdata.cpp
|
||||
helpers.cpp
|
||||
mdichild.cpp
|
||||
generaledit.cpp
|
||||
modelslist.cpp
|
||||
mountlist.cpp
|
||||
avroutputdialog.cpp
|
||||
apppreferencesdialog.cpp
|
||||
fwpreferencesdialog.cpp
|
||||
burnconfigdialog.cpp
|
||||
comparedialog.cpp
|
||||
contributorsdialog.cpp
|
||||
customizesplashdialog.cpp
|
||||
burndialog.cpp
|
||||
printdialog.cpp
|
||||
fusesdialog.cpp
|
||||
logsdialog.cpp
|
||||
downloaddialog.cpp
|
||||
splashlibrary.cpp
|
||||
mainwindow.cpp
|
||||
companion.cpp
|
||||
taranisnotfound.cpp
|
||||
qcustomplot.cpp
|
||||
wizarddata.cpp
|
||||
wizarddialog.cpp
|
||||
)
|
||||
|
||||
set(companion_MOC_HDRS
|
||||
avroutputdialog.h
|
||||
apppreferencesdialog.h
|
||||
fwpreferencesdialog.h
|
||||
burnconfigdialog.h
|
||||
comparedialog.h
|
||||
printdialog.h
|
||||
fusesdialog.h
|
||||
logsdialog.h
|
||||
contributorsdialog.h
|
||||
customizesplashdialog.h
|
||||
splashlibrary.h
|
||||
splashlabel.h
|
||||
burndialog.h
|
||||
downloaddialog.h
|
||||
generaledit.h
|
||||
modelslist.h
|
||||
mdichild.h
|
||||
mainwindow.h
|
||||
taranisnotfound.h
|
||||
qcustomplot.h
|
||||
helpers.h
|
||||
wizarddialog.h
|
||||
)
|
||||
|
||||
SET( companion9x_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
|
||||
splashlibrary.ui
|
||||
burndialog.ui
|
||||
modelconfigdialog.ui
|
||||
set(companion_UIS
|
||||
mdichild.ui
|
||||
avroutputdialog.ui
|
||||
comparedialog.ui
|
||||
fusesdialog.ui
|
||||
logsdialog.ui
|
||||
apppreferencesdialog.ui
|
||||
fwpreferencesdialog.ui
|
||||
burnconfigdialog.ui
|
||||
downloaddialog.ui
|
||||
generaledit.ui
|
||||
printdialog.ui
|
||||
contributorsdialog.ui
|
||||
customizesplashdialog.ui
|
||||
splashlibrary.ui
|
||||
burndialog.ui
|
||||
taranisnotfound.ui
|
||||
)
|
||||
|
||||
IF ( SDL_FOUND )
|
||||
SET( companion9x_SRCS
|
||||
${companion9x_SRCS}
|
||||
joystick.cpp
|
||||
joystickdialog.cpp
|
||||
)
|
||||
|
||||
SET( companion9x_MOC_HDRS
|
||||
${companion9x_MOC_HDRS}
|
||||
joystick.h
|
||||
joystickdialog.h
|
||||
)
|
||||
|
||||
SET( companion9x_UIS
|
||||
${companion9x_UIS}
|
||||
joystickdialog.ui
|
||||
)
|
||||
ENDIF( )
|
||||
|
||||
SET( companion9x_RCS
|
||||
companion9x.qrc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
||||
set(companion_RCS
|
||||
companion.qrc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
||||
)
|
||||
|
||||
MACRO (TODAY RESULT)
|
||||
@@ -283,10 +249,8 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_B
|
||||
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR}/../${FIRMWARE} G9X )
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
|
||||
|
||||
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( )
|
||||
@@ -295,31 +259,120 @@ ENDIF( )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
|
||||
|
||||
|
||||
SET( LANGUAGES he pt ru de fr it sv cs )
|
||||
SET( LANGUAGES he pl pt ru de fr it sv cs fi nl)
|
||||
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 simulation ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(simu_SRCS
|
||||
eeprominterface.cpp
|
||||
firmwares/th9x/th9xeeprom.cpp # TODO not needed
|
||||
firmwares/th9x/th9xinterface.cpp
|
||||
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
firmwares/er9x/er9xeeprom.cpp # TODO not needed
|
||||
firmwares/er9x/er9xinterface.cpp
|
||||
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
firmwares/gruvin9x/gruvin9xeeprom.cpp # TODO not needed
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/opentx/opentxeeprom.cpp # TODO not needed
|
||||
firmwares/opentx/open9xStockeeprom.cpp # TODO not needed
|
||||
firmwares/opentx/open9xGruvin9xeeprom.cpp # TODO not needed
|
||||
firmwares/opentx/open9xSky9xeeprom.cpp # TODO not needed
|
||||
firmwares/opentx/opentxinterface.cpp
|
||||
firmwares/opentx/opentxTaranisSimulator.cpp
|
||||
firmwares/opentx/opentxSky9xsimulator.cpp
|
||||
firmwares/opentx/opentxGruvin9xsimulator.cpp
|
||||
firmwares/opentx/opentxM128simulator.cpp
|
||||
firmwares/opentx/opentxsimulator.cpp
|
||||
firmwares/ersky9x/ersky9xeeprom.cpp # TODO not needed
|
||||
firmwares/ersky9x/ersky9xinterface.cpp
|
||||
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
file.cpp # TODO not needed
|
||||
modeledit/node.cpp
|
||||
modeledit/edge.cpp # TODO not needed
|
||||
appdata.cpp
|
||||
simulator.cpp
|
||||
)
|
||||
|
||||
set(simu_HDRS
|
||||
modeledit/node.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_HDRS} )
|
||||
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
|
||||
|
||||
if(WIN32)
|
||||
set(simu_SRCS ${simu_SRCS} icon.rc)
|
||||
endif()
|
||||
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
|
||||
if(SDL_FOUND)
|
||||
target_link_libraries(simulator simulation ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
else()
|
||||
target_link_libraries(simulator simulation ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
endif()
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
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/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps )
|
||||
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps )
|
||||
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps )
|
||||
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 +382,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 +396,15 @@ 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} simulator ${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 +416,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)
|
||||
|
||||
@@ -0,0 +1,698 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "appdata.h"
|
||||
|
||||
// Global data and storage object
|
||||
AppData g;
|
||||
|
||||
// ** CompStoreObj class********************
|
||||
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (tag2.isEmpty())
|
||||
{
|
||||
settings.remove(tag1);
|
||||
}
|
||||
else if (tag3.isEmpty())
|
||||
{
|
||||
settings.beginGroup(tag1);
|
||||
settings.remove(tag2);
|
||||
settings.endGroup();
|
||||
}
|
||||
else
|
||||
{
|
||||
settings.beginGroup(tag1);
|
||||
settings.beginGroup(tag2);
|
||||
settings.remove(tag3);
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
}
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newArray);
|
||||
array = newArray;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newSList);
|
||||
stringList = newSList;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newString);
|
||||
string = newString;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newTruth);
|
||||
truth = newTruth;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newNumber);
|
||||
number = newNumber;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
// Retrieval functions
|
||||
void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
array = settings.value(tag, def).toByteArray();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
stringList = settings.value(tag, def).toStringList();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
string = settings.value(tag, def).toString();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
truth = settings.value(tag, def).toBool();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
number = settings.value(tag, def).toInt();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
// Retrieve and Store functions
|
||||
void CompStoreObj::getset( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( array, tag, def, group1, group2);
|
||||
store(array, array, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( stringList, tag, def, group1, group2);
|
||||
store(stringList, stringList, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( string, tag, def, group1, group2);
|
||||
store(string, string, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( truth, tag, def, group1, group2);
|
||||
store(truth, truth, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( int &number, const QString tag, const int def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( number, tag, def, group1, group2);
|
||||
store(number, number, tag, group1, group2);
|
||||
}
|
||||
|
||||
// ** FwRevision class********************
|
||||
int FwRevision::get( const QString fwType )
|
||||
{
|
||||
QString result;
|
||||
retrieve( result, fwType, "", "FwRevisions" );
|
||||
return result.toInt();
|
||||
}
|
||||
|
||||
void FwRevision::set( const QString fwType, const int fwRevision )
|
||||
{
|
||||
QString tempString= QString("%1").arg(fwRevision);
|
||||
store( tempString, tempString, fwType, "FwRevisions" );
|
||||
}
|
||||
|
||||
void FwRevision::remove( const QString tag )
|
||||
{
|
||||
clear( "FwRevisions", tag );
|
||||
}
|
||||
|
||||
// ** JStickData class********************
|
||||
// Get declarations
|
||||
int JStickData::stick_axe() { return _stickAxe; }
|
||||
int JStickData::stick_min() { return _stickMin; }
|
||||
int JStickData::stick_med() { return _stickMed; }
|
||||
int JStickData::stick_max() { return _stickMax; }
|
||||
int JStickData::stick_inv() { return _stickInv; }
|
||||
|
||||
// Set declarations
|
||||
void JStickData::stick_axe(const int it) { store( it, _stickAxe, QString("stick%1_axe").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_min(const int it) { store( it, _stickMin, QString("stick%1_min").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_med(const int it) { store( it, _stickMed, QString("stick%1_med").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_max(const int it) { store( it, _stickMax, QString("stick%1_max").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_inv(const int it) { store( it, _stickInv, QString("stick%1_inv").arg(index), "JsCalibration" );}
|
||||
|
||||
// Constructor
|
||||
JStickData::JStickData()
|
||||
{
|
||||
index = -1;
|
||||
}
|
||||
|
||||
void JStickData::remove()
|
||||
{
|
||||
// Remove all JStickData values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup( "JsCalibration" );
|
||||
settings.remove( QString( "stick%1_axe").arg(index) );
|
||||
settings.remove( QString( "stick%1_min").arg(index) );
|
||||
settings.remove( QString( "stick%1_med").arg(index) );
|
||||
settings.remove( QString( "stick%1_max").arg(index) );
|
||||
settings.remove( QString( "stick%1_inv").arg(index) );
|
||||
settings.endGroup();
|
||||
|
||||
// Reset all JStickData variables to initial values
|
||||
init(index);
|
||||
}
|
||||
|
||||
bool JStickData::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup("JsCalibration");
|
||||
int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt();
|
||||
settings.endGroup();
|
||||
|
||||
return (axe > -1);
|
||||
}
|
||||
|
||||
void JStickData::init(int newIndex)
|
||||
{
|
||||
index = newIndex;
|
||||
_stickAxe = -1;
|
||||
_stickMin = -32767;
|
||||
_stickMed = 0;
|
||||
_stickMax = 0;
|
||||
_stickInv = 0;
|
||||
|
||||
// Do not write empty joystick calibrations to disk.
|
||||
if ( !existsOnDisk() )
|
||||
return;
|
||||
|
||||
flush();
|
||||
}
|
||||
|
||||
void JStickData::flush()
|
||||
{
|
||||
getset( _stickAxe, QString("stick%1_axe").arg(index), -1, "JsCalibration" );
|
||||
getset( _stickMin, QString("stick%1_min").arg(index), -32767, "JsCalibration" );
|
||||
getset( _stickMed, QString("stick%1_med").arg(index), 0, "JsCalibration" );
|
||||
getset( _stickMax, QString("stick%1_max").arg(index), 0, "JsCalibration" );
|
||||
getset( _stickInv, QString("stick%1_inv").arg(index), 0, "JsCalibration" );
|
||||
}
|
||||
|
||||
// ** Profile class********************
|
||||
// Get declarations
|
||||
QString Profile::fwName() const { return _fwName; }
|
||||
QString Profile::fwType() const { return _fwType; }
|
||||
QString Profile::name() const { return _name; }
|
||||
QString Profile::sdPath() const { return _sdPath; }
|
||||
QString Profile::splashFile() const { return _splashFile; }
|
||||
bool Profile::burnFirmware() const { return _burnFirmware; }
|
||||
bool Profile::renameFwFiles() const { return _renameFwFiles; }
|
||||
int Profile::channelOrder() const { return _channelOrder; }
|
||||
int Profile::defaultMode() const { return _defaultMode; }
|
||||
|
||||
QString Profile::beeper() const { return _beeper; }
|
||||
QString Profile::countryCode() const { return _countryCode; }
|
||||
QString Profile::display() const { return _display; }
|
||||
QString Profile::haptic() const { return _haptic; }
|
||||
QString Profile::speaker() const { return _speaker; }
|
||||
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||
QString Profile::timeStamp() const { return _timeStamp; }
|
||||
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||
int Profile::currentCalib() const { return _currentCalib; }
|
||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||
|
||||
// Set declarations
|
||||
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
void Profile::beeper (const QString x) { store(x, _beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::countryCode (const QString x) { store(x, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::display (const QString x) { store(x, _display, "Display" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::haptic (const QString x) { store(x, _haptic, "Haptic" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::speaker (const QString x) { store(x, _speaker, "Speaker" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
// Constructor
|
||||
Profile::Profile()
|
||||
{
|
||||
index = -1;
|
||||
}
|
||||
|
||||
// The default copy operator can not be used since the index variable would be destroyed
|
||||
Profile& Profile::operator=(const Profile& rhs)
|
||||
{
|
||||
name ( rhs.name() );
|
||||
fwName ( rhs.fwName() );
|
||||
fwType ( rhs.fwType() );
|
||||
sdPath ( rhs.sdPath() );
|
||||
splashFile ( rhs.splashFile() );
|
||||
burnFirmware ( rhs.burnFirmware() );
|
||||
renameFwFiles( rhs.renameFwFiles() );
|
||||
channelOrder ( rhs.channelOrder() );
|
||||
defaultMode ( rhs.defaultMode() );
|
||||
beeper ( rhs.beeper() );
|
||||
countryCode ( rhs.countryCode() );
|
||||
display ( rhs.display() );
|
||||
haptic ( rhs.haptic() );
|
||||
speaker ( rhs.speaker() );
|
||||
stickPotCalib( rhs.stickPotCalib() );
|
||||
trainerCalib ( rhs.trainerCalib() );
|
||||
currentCalib ( rhs.currentCalib() );
|
||||
gsStickMode ( rhs.gsStickMode() );
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
vBatCalib ( rhs.vBatCalib() );
|
||||
vBatWarn ( rhs.vBatWarn() );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Profile::remove()
|
||||
{
|
||||
// Remove all profile values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.remove(QString("profile%1").arg(index));
|
||||
settings.endGroup();
|
||||
|
||||
// Reset all profile variables to initial values
|
||||
init(index);
|
||||
}
|
||||
|
||||
bool Profile::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.beginGroup(QString("profile%1").arg(index));
|
||||
QStringList keyList = settings.allKeys();
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
|
||||
return (keyList.length() > 0);
|
||||
}
|
||||
|
||||
void Profile::initFwVariables()
|
||||
{
|
||||
_beeper = "";
|
||||
_countryCode = "";
|
||||
_display = "";
|
||||
_haptic = "";
|
||||
_speaker = "";
|
||||
_stickPotCalib = "";
|
||||
_timeStamp = "";
|
||||
_trainerCalib = "";
|
||||
|
||||
_currentCalib = 0;
|
||||
_gsStickMode = 0;
|
||||
_ppmMultiplier = 0;
|
||||
_vBatCalib = 0;
|
||||
_vBatWarn = 0;
|
||||
}
|
||||
|
||||
void Profile::init(int newIndex)
|
||||
{
|
||||
index = newIndex;
|
||||
|
||||
_fwName = "";
|
||||
_fwType = "";
|
||||
_name = "";
|
||||
_sdPath = "";
|
||||
_splashFile = "";
|
||||
_burnFirmware = false;
|
||||
_renameFwFiles = false;
|
||||
_channelOrder = 0;
|
||||
_defaultMode = 1;
|
||||
|
||||
initFwVariables();
|
||||
|
||||
// Do not write empty profiles to disk except the default (0) profile.
|
||||
if ( index > 0 && !existsOnDisk())
|
||||
return;
|
||||
|
||||
flush();
|
||||
}
|
||||
|
||||
void Profile::flush()
|
||||
{
|
||||
// Load and store all variables. Use default values if setting values are missing
|
||||
getset( _fwName, "fwName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _fwType, "fwType" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
|
||||
|
||||
getset( _beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _countryCode, "countryCode" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _haptic, "Haptic" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _speaker, "Speaker" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
}
|
||||
|
||||
|
||||
// ** AppData class********************
|
||||
|
||||
// Get declarations
|
||||
QStringList AppData::recentFiles() { return _recentFiles; }
|
||||
QByteArray AppData::mainWinGeo() { return _mainWinGeo; }
|
||||
QByteArray AppData::mainWinState() { return _mainWinState; }
|
||||
QByteArray AppData::modelEditGeo() { return _modelEditGeo; }
|
||||
|
||||
QString AppData::armMcu() { return _armMcu; }
|
||||
QString AppData::avrArguments() { return _avrArguments; }
|
||||
QString AppData::avrPort() { return _avrPort; }
|
||||
QString AppData::avrdudeLocation() { return _avrdudeLocation; }
|
||||
QString AppData::compileServer() { return _compileServer; }
|
||||
QString AppData::cpuId() { return _cpuId; }
|
||||
QString AppData::dfuArguments() { return _dfuArguments; }
|
||||
QString AppData::dfuLocation() { return _dfuLocation; }
|
||||
QString AppData::locale() { return _locale; }
|
||||
QString AppData::mcu() { return _mcu; }
|
||||
QString AppData::programmer() { return _programmer; }
|
||||
QString AppData::sambaLocation() { return _sambaLocation; }
|
||||
QString AppData::sambaPort() { return _sambaPort; }
|
||||
|
||||
QString AppData::backupDir() { return _backupDir; }
|
||||
QString AppData::gePath() { return _gePath; }
|
||||
QString AppData::eepromDir() { return _eepromDir; }
|
||||
QString AppData::flashDir() { return _flashDir; }
|
||||
QString AppData::imagesDir() { return _imagesDir; }
|
||||
QString AppData::logDir() { return _logDir; }
|
||||
QString AppData::libDir() { return _libDir; }
|
||||
QString AppData::snapshotDir() { return _snapshotDir; }
|
||||
QString AppData::updatesDir() { return _updatesDir; }
|
||||
|
||||
bool AppData::enableBackup() { return _enableBackup; }
|
||||
bool AppData::backupOnFlash() { return _backupOnFlash; }
|
||||
bool AppData::jsSupport() { return _jsSupport; }
|
||||
bool AppData::rev4aSupport() { return _rev4aSupport; }
|
||||
bool AppData::maximized() { return _maximized; }
|
||||
bool AppData::showSplash() { return _showSplash; }
|
||||
bool AppData::snapToClpbrd() { return _snapToClpbrd; }
|
||||
bool AppData::autoCheckApp() { return _autoCheckApp; }
|
||||
bool AppData::autoCheckFw() { return _autoCheckFw; }
|
||||
bool AppData::simuSW() { return _simuSW; }
|
||||
bool AppData::useWizard() { return _useWizard; }
|
||||
|
||||
int AppData::backLight() { return _backLight; }
|
||||
int AppData::embedSplashes() { return _embedSplashes; }
|
||||
int AppData::fwServerFails() { return _fwServerFails; }
|
||||
int AppData::generalEditTab() { return _generalEditTab; }
|
||||
int AppData::iconSize() { return _iconSize; }
|
||||
int AppData::historySize() { return _historySize; }
|
||||
int AppData::jsCtrl() { return _jsCtrl; }
|
||||
int AppData::id() { return _id; }
|
||||
int AppData::theme() { return _theme; }
|
||||
int AppData::warningId() { return _warningId; }
|
||||
|
||||
// Set declarations
|
||||
void AppData::recentFiles (const QStringList x) { store(x, _recentFiles, "recentFileList" );}
|
||||
void AppData::mainWinGeo (const QByteArray x) { store(x, _mainWinGeo, "mainWindowGeometry" );}
|
||||
void AppData::mainWinState (const QByteArray x) { store(x, _mainWinState, "mainWindowState" );}
|
||||
void AppData::modelEditGeo (const QByteArray x) { store(x, _modelEditGeo, "modelEditGeometry" );}
|
||||
|
||||
void AppData::armMcu (const QString x) { store(x, _armMcu, "arm_mcu" );}
|
||||
void AppData::avrArguments (const QString x) { store(x, _avrArguments, "avr_arguments" );}
|
||||
void AppData::avrPort (const QString x) { store(x, _avrPort, "avr_port" );}
|
||||
void AppData::avrdudeLocation (const QString x) { store(x, _avrdudeLocation, "avrdudeLocation" );}
|
||||
void AppData::compileServer (const QString x) { store(x, _compileServer, "compilation-server" );}
|
||||
void AppData::cpuId (const QString x) { store(x, _cpuId, "cpu_id" );}
|
||||
void AppData::dfuArguments (const QString x) { store(x, _dfuArguments, "dfu_arguments" );}
|
||||
void AppData::dfuLocation (const QString x) { store(x, _dfuLocation, "dfu_location" );}
|
||||
void AppData::locale (const QString x) { store(x, _locale, "locale" );}
|
||||
void AppData::mcu (const QString x) { store(x, _mcu, "mcu" );}
|
||||
void AppData::programmer (const QString x) { store(x, _programmer, "programmer" );}
|
||||
void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
|
||||
void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
|
||||
|
||||
void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
|
||||
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
|
||||
void AppData::eepromDir (const QString x) { store(x, _eepromDir, "lastDir" );}
|
||||
void AppData::flashDir (const QString x) { store(x, _flashDir, "lastFlashDir" );}
|
||||
void AppData::imagesDir (const QString x) { store(x, _imagesDir, "lastImagesDir" );}
|
||||
void AppData::logDir (const QString x) { store(x, _logDir, "lastLogDir" );}
|
||||
void AppData::libDir (const QString x) { store(x, _libDir, "libraryPath" );}
|
||||
void AppData::snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );}
|
||||
void AppData::updatesDir (const QString x) { store(x, _updatesDir, "lastUpdatesDir" );}
|
||||
|
||||
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
|
||||
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
|
||||
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
|
||||
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
|
||||
void AppData::rev4aSupport (const bool x) { store(x, _rev4aSupport, "rev4asupport" );}
|
||||
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
|
||||
void AppData::snapToClpbrd (const bool x) { store(x, _snapToClpbrd, "snapshot_to_clipboard" );}
|
||||
void AppData::autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );}
|
||||
void AppData::autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );}
|
||||
void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );}
|
||||
void AppData::useWizard (const bool x) { store(x, _useWizard, "useWizard" );}
|
||||
|
||||
void AppData::backLight (const int x) { store(x, _backLight, "backLight" );}
|
||||
void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );}
|
||||
void AppData::fwServerFails (const int x) { store(x, _fwServerFails, "fwserver" );}
|
||||
void AppData::generalEditTab (const int x) { store(x, _generalEditTab, "generalEditTab" );}
|
||||
void AppData::iconSize (const int x) { store(x, _iconSize, "icon_size" );}
|
||||
void AppData::historySize (const int x) { store(x, _historySize, "history_size" );}
|
||||
void AppData::jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );}
|
||||
void AppData::id (const int x) { store(x, _id, "profileId" );}
|
||||
void AppData::theme (const int x) { store(x, _theme, "theme" );}
|
||||
void AppData::warningId (const int x) { store(x, _warningId, "warningId" );}
|
||||
|
||||
// Constructor
|
||||
AppData::AppData()
|
||||
{
|
||||
//Initialize the profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
profile[i].init( i );
|
||||
|
||||
//Initialize the joysticks
|
||||
for (int i=0; i<MAX_JOYSTICKS; i++)
|
||||
joystick[i].init( i );
|
||||
|
||||
// Import settings from companion9x, but only do it one time.
|
||||
QSettings c9x_settings("companion9x", "companion9x");
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (profile[0].name().isEmpty() )
|
||||
{
|
||||
// Copy all settings from companion9x to companion
|
||||
QStringList keys = c9x_settings.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
settings.setValue(*i, c9x_settings.value(*i));
|
||||
}
|
||||
|
||||
// Store old values in new locations
|
||||
autoCheckApp(settings.value("startup_check_companion9x", true).toBool());
|
||||
useWizard(settings.value("wizardEnable", true).toBool());
|
||||
|
||||
// Convert and store the firmware type
|
||||
QString fwType = settings.value("firmware", "").toString();
|
||||
fwType.replace("open9x","opentx");
|
||||
fwType.replace("x9da","taranis");
|
||||
profile[0].fwType( fwType );
|
||||
|
||||
// Move the Companion9x profile settings to profile0, the new default profile
|
||||
profile[0].name( settings.value( "Name", "" ).toString());
|
||||
profile[0].sdPath( settings.value( "sdPath", "" ).toString());
|
||||
profile[0].splashFile( settings.value( "SplashFileName", "" ).toString());
|
||||
profile[0].burnFirmware( settings.value( "burnFirmware", false ).toBool());
|
||||
profile[0].renameFwFiles( settings.value( "rename_firmware_files", false ).toBool());
|
||||
profile[0].channelOrder( settings.value( "default_channel_order", "0" ).toInt());
|
||||
profile[0].defaultMode( settings.value( "default_mode", "1" ).toInt());
|
||||
|
||||
// Ensure that the default profile has a name
|
||||
if ( profile[0].name().isEmpty() )
|
||||
profile[0].name("My Radio");
|
||||
|
||||
// Delete obsolete settings fields
|
||||
settings.remove("ActiveProfile");
|
||||
settings.remove("burnFirmware");
|
||||
settings.remove("custom_id");
|
||||
settings.remove("default_channel_order");
|
||||
settings.remove("default_mode");
|
||||
settings.remove("firmware");
|
||||
settings.remove("lastFw");
|
||||
settings.remove("modelEditTab");
|
||||
settings.remove("Name");
|
||||
settings.remove("patchImage");
|
||||
settings.remove("rename_firmware_files");
|
||||
settings.remove("sdPath");
|
||||
settings.remove("SplashFileName");
|
||||
settings.remove("startup_check_companion9x");
|
||||
settings.remove("wizardEnable");
|
||||
|
||||
// Select the new default profile as current profile
|
||||
id( 0 );
|
||||
}
|
||||
|
||||
// Load and store all variables. Use default values if setting values are missing
|
||||
getset( _recentFiles, "recentFileList" ,"" );
|
||||
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
|
||||
getset( _mainWinState, "mainWindowState" ,"" );
|
||||
getset( _modelEditGeo, "modelEditGeometry" ,"" );
|
||||
|
||||
getset( _armMcu, "arm_mcu" ,"at91sam3s4-9x" );
|
||||
getset( _avrArguments, "avr_arguments" ,"" );
|
||||
getset( _avrPort, "avr_port" ,"" );
|
||||
getset( _avrdudeLocation, "avrdudeLocation" ,"" );
|
||||
getset( _compileServer, "compilation-server" ,"" );
|
||||
getset( _cpuId, "cpu_id" ,"" );
|
||||
getset( _dfuArguments, "dfu_arguments" ,"-a 0" );
|
||||
getset( _dfuLocation, "dfu_location" ,"" );
|
||||
getset( _locale, "locale" ,"" );
|
||||
getset( _mcu, "mcu" ,"m64" );
|
||||
getset( _programmer, "programmer" ,"usbasp" );
|
||||
getset( _sambaLocation, "samba_location" ,"" );
|
||||
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
|
||||
|
||||
getset( _backupDir, "backupPath" ,"" );
|
||||
getset( _gePath, "gePath" ,"" );
|
||||
getset( _eepromDir, "lastDir" ,"" );
|
||||
getset( _flashDir, "lastFlashDir" ,"" );
|
||||
getset( _imagesDir, "lastImagesDir" ,"" );
|
||||
getset( _logDir, "lastLogDir" ,"" );
|
||||
getset( _libDir, "libraryPath" ,"" );
|
||||
getset( _snapshotDir, "snapshotpath" ,"" );
|
||||
getset( _updatesDir, "lastUpdatesDir" ,"" );
|
||||
|
||||
getset( _enableBackup, "backupEnable" ,false );
|
||||
getset( _backupOnFlash, "backupOnFlash" ,true );
|
||||
getset( _jsSupport, "js_support" ,false );
|
||||
getset( _rev4aSupport, "rev4asupport" ,false );
|
||||
getset( _maximized, "maximized" ,false );
|
||||
getset( _showSplash, "show_splash" ,true );
|
||||
getset( _snapToClpbrd, "snapshot_to_clipboard" ,false );
|
||||
getset( _autoCheckApp, "startup_check_companion" ,true );
|
||||
getset( _autoCheckFw, "startup_check_fw" ,true );
|
||||
getset( _simuSW, "simuSW" ,false );
|
||||
getset( _useWizard, "useWizard" ,true );
|
||||
|
||||
getset( _backLight, "backLight" ,0 );
|
||||
getset( _embedSplashes, "embedded_splashes" ,0 );
|
||||
getset( _fwServerFails, "fwserver" ,0 );
|
||||
getset( _generalEditTab, "generalEditTab" ,0 );
|
||||
getset( _iconSize, "icon_size" ,2 );
|
||||
getset( _jsCtrl, "js_ctrl" ,0 );
|
||||
getset( _historySize, "history_size" ,10 );
|
||||
getset( _id, "profileId" ,0 );
|
||||
getset( _theme, "theme" ,1 );
|
||||
getset( _warningId, "warningId" ,0 );
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
// All temporary and permanent global variables are defined here to make
|
||||
// initialization and storage safe and visible.
|
||||
// Do not access variables in QSettings directly, it is not type safe!
|
||||
|
||||
|
||||
#ifndef COMPANION_APPDATA_H
|
||||
#define COMPANION_APPDATA_H
|
||||
#include <QByteArray>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
#include <QSettings>
|
||||
|
||||
#define COMPANY "OpenTX Companion"
|
||||
#define PRODUCT "OpenTX"
|
||||
|
||||
#define MAX_PROFILES 15
|
||||
#define MAX_JOYSTICKS 8
|
||||
|
||||
class CompStoreObj
|
||||
{
|
||||
public:
|
||||
void clear (const QString tag1="", const QString tag2="", const QString tag3="");
|
||||
void store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const QString newString, QString &string, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const bool newTruth, bool &truth, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const int newNumber, int &number, const QString tag, const QString group1="", const QString group2="" );
|
||||
|
||||
// Retrieval functions
|
||||
void retrieve( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void retrieve( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void retrieve( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
||||
void retrieve( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||
|
||||
// Retrieve and Store functions
|
||||
void getset( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
||||
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||
};
|
||||
|
||||
class FwRevision: protected CompStoreObj
|
||||
{
|
||||
public:
|
||||
int get( const QString);
|
||||
void set( const QString, const int );
|
||||
void remove( const QString );
|
||||
};
|
||||
|
||||
class JStickData: protected CompStoreObj
|
||||
{
|
||||
private:
|
||||
int index;
|
||||
|
||||
int _stickAxe;
|
||||
int _stickMin;
|
||||
int _stickMed;
|
||||
int _stickMax;
|
||||
int _stickInv;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
int stick_axe();
|
||||
int stick_min();
|
||||
int stick_med();
|
||||
int stick_max();
|
||||
int stick_inv();
|
||||
|
||||
// All the set definitions
|
||||
void stick_axe(const int);
|
||||
void stick_min(const int);
|
||||
void stick_med(const int);
|
||||
void stick_max(const int);
|
||||
void stick_inv(const int);
|
||||
|
||||
JStickData();
|
||||
void remove();
|
||||
bool existsOnDisk();
|
||||
void init(int index);
|
||||
void flush();
|
||||
};
|
||||
|
||||
class Profile: protected CompStoreObj
|
||||
{
|
||||
private:
|
||||
// Class Internal Variable
|
||||
int index;
|
||||
|
||||
// Application Variables
|
||||
QString _fwName;
|
||||
QString _fwType;
|
||||
QString _name;
|
||||
QString _sdPath;
|
||||
QString _splashFile;
|
||||
bool _burnFirmware;
|
||||
bool _renameFwFiles;
|
||||
int _channelOrder;
|
||||
int _defaultMode;
|
||||
|
||||
// Firmware Variables
|
||||
QString _beeper;
|
||||
QString _countryCode;
|
||||
QString _display;
|
||||
QString _haptic;
|
||||
QString _speaker;
|
||||
QString _stickPotCalib;
|
||||
QString _timeStamp;
|
||||
QString _trainerCalib;
|
||||
int _currentCalib;
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
int _vBatCalib;
|
||||
int _vBatWarn;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
QString fwName() const;
|
||||
QString fwType() const;
|
||||
QString name() const;
|
||||
QString sdPath() const;
|
||||
QString splashFile() const;
|
||||
bool burnFirmware() const;
|
||||
bool renameFwFiles() const;
|
||||
int channelOrder() const;
|
||||
int defaultMode() const;
|
||||
|
||||
QString beeper() const;
|
||||
QString countryCode() const;
|
||||
QString display() const;
|
||||
QString haptic() const;
|
||||
QString speaker() const;
|
||||
QString stickPotCalib() const;
|
||||
QString timeStamp() const;
|
||||
QString trainerCalib() const;
|
||||
int currentCalib() const;
|
||||
int gsStickMode() const;
|
||||
int ppmMultiplier() const;
|
||||
int vBatCalib() const;
|
||||
int vBatWarn() const;
|
||||
|
||||
// All the set definitions
|
||||
void name (const QString);
|
||||
void fwName (const QString);
|
||||
void fwType (const QString);
|
||||
void sdPath (const QString);
|
||||
void splashFile (const QString);
|
||||
void burnFirmware (const bool);
|
||||
void renameFwFiles (const bool);
|
||||
void channelOrder (const int);
|
||||
void defaultMode (const int);
|
||||
|
||||
void beeper (const QString);
|
||||
void countryCode (const QString);
|
||||
void display (const QString);
|
||||
void haptic (const QString);
|
||||
void speaker (const QString);
|
||||
void stickPotCalib (const QString);
|
||||
void timeStamp (const QString);
|
||||
void trainerCalib (const QString);
|
||||
void currentCalib (const int);
|
||||
void gsStickMode (const int);
|
||||
void ppmMultiplier (const int);
|
||||
void vBatCalib (const int);
|
||||
void vBatWarn (const int);
|
||||
|
||||
Profile();
|
||||
Profile& operator=(const Profile&);
|
||||
void remove();
|
||||
bool existsOnDisk();
|
||||
void init(int newIndex);
|
||||
void initFwVariables();
|
||||
void flush();
|
||||
};
|
||||
|
||||
class AppData: protected CompStoreObj
|
||||
{
|
||||
// All the global variables
|
||||
public:
|
||||
Profile profile[MAX_PROFILES];
|
||||
JStickData joystick[MAX_JOYSTICKS];
|
||||
FwRevision fwRev;
|
||||
|
||||
private:
|
||||
QStringList _recentFiles;
|
||||
QByteArray _mainWinGeo;
|
||||
QByteArray _mainWinState;
|
||||
QByteArray _modelEditGeo;
|
||||
|
||||
QString _armMcu;
|
||||
QString _avrArguments;
|
||||
QString _avrPort;
|
||||
QString _avrdudeLocation;
|
||||
QString _compileServer;
|
||||
QString _cpuId;
|
||||
QString _dfuArguments;
|
||||
QString _dfuLocation;
|
||||
QString _locale;
|
||||
QString _mcu;
|
||||
QString _programmer;
|
||||
QString _sambaLocation;
|
||||
QString _sambaPort;
|
||||
|
||||
QString _backupDir;
|
||||
QString _gePath;
|
||||
QString _eepromDir;
|
||||
QString _flashDir;
|
||||
QString _imagesDir;
|
||||
QString _logDir;
|
||||
QString _libDir;
|
||||
QString _snapshotDir;
|
||||
QString _updatesDir;
|
||||
|
||||
bool _enableBackup;
|
||||
bool _backupOnFlash;
|
||||
bool _maximized;
|
||||
bool _jsSupport;
|
||||
bool _rev4aSupport;
|
||||
bool _showSplash;
|
||||
bool _snapToClpbrd;
|
||||
bool _autoCheckApp;
|
||||
bool _autoCheckFw;
|
||||
bool _simuSW;
|
||||
bool _useWizard;
|
||||
|
||||
int _backLight;
|
||||
int _embedSplashes;
|
||||
int _fwServerFails;
|
||||
int _generalEditTab;
|
||||
int _iconSize;
|
||||
int _jsCtrl;
|
||||
int _historySize;
|
||||
int _id;
|
||||
int _theme;
|
||||
int _warningId;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
QStringList recentFiles();
|
||||
QByteArray mainWinGeo();
|
||||
QByteArray mainWinState();
|
||||
QByteArray modelEditGeo();
|
||||
|
||||
QString armMcu();
|
||||
QString avrArguments();
|
||||
QString avrPort();
|
||||
QString avrdudeLocation();
|
||||
QString compileServer();
|
||||
QString cpuId();
|
||||
QString dfuArguments();
|
||||
QString dfuLocation();
|
||||
QString lastFw();
|
||||
QString locale();
|
||||
QString mcu();
|
||||
QString programmer();
|
||||
QString sambaLocation();
|
||||
QString sambaPort();
|
||||
|
||||
QString backupDir();
|
||||
QString gePath();
|
||||
QString eepromDir();
|
||||
QString flashDir();
|
||||
QString imagesDir();
|
||||
QString logDir();
|
||||
QString libDir();
|
||||
QString snapshotDir();
|
||||
QString updatesDir();
|
||||
|
||||
bool enableBackup();
|
||||
bool backupOnFlash();
|
||||
bool jsSupport();
|
||||
bool rev4aSupport();
|
||||
bool maximized();
|
||||
bool showSplash();
|
||||
bool snapToClpbrd();
|
||||
bool autoCheckApp();
|
||||
bool autoCheckFw();
|
||||
bool simuSW();
|
||||
bool useWizard();
|
||||
|
||||
int backLight();
|
||||
int embedSplashes();
|
||||
int fwServerFails();
|
||||
int generalEditTab();
|
||||
int iconSize();
|
||||
int historySize();
|
||||
int jsCtrl();
|
||||
int id();
|
||||
int theme();
|
||||
int warningId();
|
||||
|
||||
// All the set definitions
|
||||
void recentFiles (const QStringList x);
|
||||
void mainWinGeo (const QByteArray);
|
||||
void mainWinState (const QByteArray);
|
||||
void modelEditGeo (const QByteArray);
|
||||
|
||||
void armMcu (const QString);
|
||||
void avrArguments (const QString);
|
||||
void avrPort (const QString);
|
||||
void avrdudeLocation (const QString);
|
||||
void compileServer (const QString);
|
||||
void cpuId (const QString);
|
||||
void dfuArguments (const QString);
|
||||
void dfuLocation (const QString);
|
||||
void lastFw (const QString);
|
||||
void locale (const QString);
|
||||
void mcu (const QString);
|
||||
void programmer (const QString);
|
||||
void sambaLocation (const QString);
|
||||
void sambaPort (const QString);
|
||||
|
||||
void backupDir (const QString);
|
||||
void gePath (const QString);
|
||||
void eepromDir (const QString);
|
||||
void flashDir (const QString);
|
||||
void imagesDir (const QString);
|
||||
void logDir (const QString);
|
||||
void libDir (const QString);
|
||||
void snapshotDir (const QString);
|
||||
void updatesDir (const QString);
|
||||
|
||||
void enableBackup (const bool);
|
||||
void backupOnFlash (const bool);
|
||||
void maximized (const bool);
|
||||
void jsSupport (const bool);
|
||||
void rev4aSupport (const bool);
|
||||
void showSplash (const bool);
|
||||
void snapToClpbrd (const bool);
|
||||
void autoCheckApp (const bool);
|
||||
void autoCheckFw (const bool);
|
||||
void simuSW (const bool);
|
||||
void useWizard (const bool);
|
||||
|
||||
void backLight (const int);
|
||||
void embedSplashes (const int);
|
||||
void fwServerFails (const int);
|
||||
void generalEditTab (const int);
|
||||
void iconSize (const int);
|
||||
void historySize (const int);
|
||||
void jsCtrl (const int);
|
||||
void modelEditTab (const int);
|
||||
void id (const int);
|
||||
void theme (const int);
|
||||
void warningId (const int);
|
||||
|
||||
// Constructor
|
||||
AppData();
|
||||
};
|
||||
|
||||
extern AppData g;
|
||||
|
||||
#endif // COMPANION_APPDATA_H
|
||||
@@ -0,0 +1,322 @@
|
||||
#include "apppreferencesdialog.h"
|
||||
#include "ui_apppreferencesdialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
#include "flashinterface.h"
|
||||
#ifdef JOYSTICKS
|
||||
#include "joystick.h"
|
||||
#include "joystickdialog.h"
|
||||
#endif
|
||||
#include <QDesktopServices>
|
||||
#include <QtGui>
|
||||
|
||||
appPreferencesDialog::appPreferencesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::appPreferencesDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("apppreferences.png"));
|
||||
initSettings();
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
||||
#ifndef JOYSTICKS
|
||||
ui->joystickCB->hide();
|
||||
ui->joystickCB->setDisabled(true);
|
||||
ui->joystickcalButton->hide();
|
||||
ui->joystickChkB->hide();
|
||||
ui->label_11->hide();
|
||||
#endif
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
appPreferencesDialog::~appPreferencesDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void appPreferencesDialog::writeValues()
|
||||
{
|
||||
g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
|
||||
g.autoCheckFw(ui->startupCheck_fw->isChecked());
|
||||
g.showSplash(ui->showSplash->isChecked());
|
||||
g.simuSW(ui->simuSW->isChecked());
|
||||
g.useWizard(ui->modelWizard_CB->isChecked());
|
||||
g.historySize(ui->historySize->value());
|
||||
g.backLight(ui->backLightColor->currentIndex());
|
||||
g.libDir(ui->libraryPath->text());
|
||||
g.gePath(ui->ge_lineedit->text());
|
||||
g.embedSplashes(ui->splashincludeCB->currentIndex());
|
||||
g.enableBackup(ui->backupEnable->isChecked());
|
||||
|
||||
if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) {
|
||||
g.jsSupport(ui->joystickChkB ->isChecked());
|
||||
g.jsCtrl(ui->joystickCB ->currentIndex());
|
||||
}
|
||||
else {
|
||||
g.jsSupport(false);
|
||||
g.jsCtrl(0);
|
||||
}
|
||||
g.profile[g.id()].channelOrder(ui->channelorderCB->currentIndex());
|
||||
g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex());
|
||||
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
|
||||
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
|
||||
g.profile[g.id()].sdPath(ui->sdPath->text());
|
||||
g.profile[g.id()].splashFile(ui->SplashFileName->text());
|
||||
|
||||
// The profile name may NEVER be empty
|
||||
if (ui->profileNameLE->text().isEmpty())
|
||||
g.profile[g.id()].name(tr("My Radio"));
|
||||
else
|
||||
g.profile[g.id()].name(ui->profileNameLE->text());
|
||||
|
||||
// If a new radio type has been choosen, several things need to reset
|
||||
if ( initialRadioType != ui->radioCB->currentIndex())
|
||||
{
|
||||
g.profile[g.id()].fwName("");
|
||||
g.profile[g.id()].fwType(getDefaultFwType(ui->radioCB->currentIndex()));
|
||||
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
|
||||
g.profile[g.id()].initFwVariables();
|
||||
}
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_snapshotPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
g.snapshotDir(fileName);
|
||||
g.snapToClpbrd(false);
|
||||
ui->snapshotPath->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void appPreferencesDialog::initSettings()
|
||||
{
|
||||
ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd());
|
||||
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
|
||||
ui->snapshotPath->setText(g.snapshotDir());
|
||||
ui->snapshotPath->setReadOnly(true);
|
||||
if (ui->snapshotClipboardCKB->isChecked())
|
||||
{
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
ui->startupCheck_companion9x->setChecked(g.autoCheckApp());
|
||||
ui->startupCheck_fw->setChecked(g.autoCheckFw());
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
ui->backLightColor->setCurrentIndex(g.backLight());
|
||||
if (getRadioType(g.profile[g.id()].fwType())==6) // TODO - NOT AT ALL OK. THERE SHOULD BE A COMMON RADIO DEFINITION.
|
||||
ui->backLightColor->setEnabled(false);
|
||||
ui->simuSW->setChecked(g.simuSW());
|
||||
ui->modelWizard_CB->setChecked(g.useWizard());
|
||||
ui->libraryPath->setText(g.libDir());
|
||||
ui->ge_lineedit->setText(g.gePath());
|
||||
|
||||
if (!g.backupDir().isEmpty()) {
|
||||
if (QDir(g.backupDir()).exists()) {
|
||||
ui->backupPath->setText(g.backupDir());
|
||||
ui->backupEnable->setEnabled(true);
|
||||
ui->backupEnable->setChecked(g.enableBackup());
|
||||
} else {
|
||||
ui->backupEnable->setDisabled(true);
|
||||
}
|
||||
} else {
|
||||
ui->backupEnable->setDisabled(true);
|
||||
}
|
||||
ui->splashincludeCB->setCurrentIndex(g.embedSplashes());
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
ui->joystickChkB->setChecked(g.jsSupport());
|
||||
if (ui->joystickChkB->isChecked()) {
|
||||
QStringList joystickNames;
|
||||
joystickNames << tr("No joysticks found");
|
||||
joystick = new Joystick(0,false,0,0);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
ui->joystickCB->setDisabled(true);
|
||||
|
||||
if ( joystick ) {
|
||||
if ( joystick->joystickNames.count() > 0 ) {
|
||||
joystickNames = joystick->joystickNames;
|
||||
ui->joystickCB->setEnabled(true);
|
||||
ui->joystickcalButton->setEnabled(true);
|
||||
}
|
||||
joystick->close();
|
||||
}
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->insertItems(0, joystickNames);
|
||||
ui->joystickCB->setCurrentIndex(g.jsCtrl());
|
||||
}
|
||||
else {
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->setDisabled(true);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
}
|
||||
#endif
|
||||
// Profile Tab Inits
|
||||
ui->channelorderCB->setCurrentIndex(g.profile[g.id()].channelOrder());
|
||||
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
|
||||
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
|
||||
ui->sdPath->setText(g.profile[g.id()].sdPath());
|
||||
ui->profileNameLE->setText(g.profile[g.id()].name());
|
||||
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
|
||||
initialRadioType = getRadioType(g.profile[g.id()].fwType());
|
||||
ui->radioCB->setCurrentIndex(initialRadioType);
|
||||
displayImage( g.profile[g.id()].splashFile() );
|
||||
|
||||
QString hwSettings;
|
||||
if (g.profile[g.id()].stickPotCalib() == "" ) {
|
||||
hwSettings = QString(tr("EMPTY: No radio settings stored in profile"));
|
||||
}
|
||||
else {
|
||||
QString str = g.profile[g.id()].timeStamp();
|
||||
if (str.isEmpty())
|
||||
hwSettings = QString(tr("AVAILABLE: Radio settings of unknown age"));
|
||||
else
|
||||
hwSettings = QString(tr("AVAILABLE: Radio settings stored %1").arg(str));
|
||||
}
|
||||
ui->lblGeneralSettings->setText(hwSettings);
|
||||
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_libraryPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
g.libDir(fileName);
|
||||
ui->libraryPath->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_snapshotClipboardCKB_clicked()
|
||||
{
|
||||
if (ui->snapshotClipboardCKB->isChecked()) {
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
g.snapToClpbrd(true);
|
||||
} else {
|
||||
ui->snapshotPath->setEnabled(true);
|
||||
ui->snapshotPath->setReadOnly(true);
|
||||
ui->snapshotPathButton->setEnabled(true);
|
||||
g.snapToClpbrd(false);
|
||||
}
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_backupPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
g.backupDir(fileName);
|
||||
ui->backupPath->setText(fileName);
|
||||
}
|
||||
ui->backupEnable->setEnabled(true);
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_ge_pathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text());
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->ge_lineedit->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
void appPreferencesDialog::on_joystickChkB_clicked() {
|
||||
if (ui->joystickChkB->isChecked()) {
|
||||
QStringList joystickNames;
|
||||
joystickNames << tr("No joysticks found");
|
||||
joystick = new Joystick(0,false,0,0);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
ui->joystickCB->setDisabled(true);
|
||||
|
||||
if ( joystick ) {
|
||||
if ( joystick->joystickNames.count() > 0 ) {
|
||||
joystickNames = joystick->joystickNames;
|
||||
ui->joystickCB->setEnabled(true);
|
||||
ui->joystickcalButton->setEnabled(true);
|
||||
}
|
||||
joystick->close();
|
||||
}
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->insertItems(0, joystickNames);
|
||||
}
|
||||
else {
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->setDisabled(true);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_joystickcalButton_clicked() {
|
||||
joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex());
|
||||
jd->exec();
|
||||
}
|
||||
#endif
|
||||
|
||||
// ******** Profile tab functions
|
||||
|
||||
void appPreferencesDialog::on_sdPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.profile[g.id()].sdPath());
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->sdPath->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_removeProfileButton_clicked()
|
||||
{
|
||||
if ( g.id() == 0 )
|
||||
QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed."));
|
||||
else
|
||||
{
|
||||
g.profile[g.id()].remove();
|
||||
g.id( 0 );
|
||||
initSettings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool appPreferencesDialog::displayImage( QString fileName )
|
||||
{
|
||||
// Start by clearing the pixmap
|
||||
ui->imageLabel->setPixmap(QPixmap());
|
||||
|
||||
QImage image(fileName);
|
||||
if (image.isNull())
|
||||
return false;
|
||||
|
||||
// Use the firmware name to determine splash width
|
||||
int width = SPLASH_WIDTH;
|
||||
if (g.profile[g.id()].fwType().contains("taranis"))
|
||||
width = SPLASHX9D_WIDTH;
|
||||
|
||||
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
|
||||
ui->imageLabel->setFixedSize(width, SPLASH_HEIGHT);
|
||||
return true;
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_SplashSelect_clicked()
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
|
||||
if (!fileName.isEmpty()){
|
||||
g.imagesDir(QFileInfo(fileName).dir().absolutePath());
|
||||
|
||||
displayImage(fileName);
|
||||
ui->SplashFileName->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void appPreferencesDialog::on_clearImageButton_clicked() {
|
||||
ui->imageLabel->clear();
|
||||
ui->SplashFileName->clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef APPPREFERENCESDIALOG_H
|
||||
#define APPPREFERENCESDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QCheckBox>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class appPreferencesDialog;
|
||||
}
|
||||
|
||||
class Joystick;
|
||||
|
||||
class appPreferencesDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit appPreferencesDialog(QWidget *parent = 0);
|
||||
~appPreferencesDialog();
|
||||
Joystick *joystick;
|
||||
|
||||
private:
|
||||
int initialRadioType;
|
||||
Ui::appPreferencesDialog *ui;
|
||||
void initSettings();
|
||||
bool displayImage( QString fileName );
|
||||
void loadProfileString(QString profile, QString label);
|
||||
void loadFromProfile();
|
||||
|
||||
private slots:
|
||||
void writeValues();
|
||||
void on_libraryPathButton_clicked();
|
||||
void on_snapshotPathButton_clicked();
|
||||
void on_snapshotClipboardCKB_clicked();
|
||||
void on_backupPathButton_clicked();
|
||||
void on_ge_pathButton_clicked();
|
||||
|
||||
void on_sdPathButton_clicked();
|
||||
void on_removeProfileButton_clicked();
|
||||
void on_SplashSelect_clicked();
|
||||
void on_clearImageButton_clicked();
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
void on_joystickChkB_clicked();
|
||||
void on_joystickcalButton_clicked();
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // APPPREFERENCESDIALOG_H
|
||||
@@ -38,7 +38,8 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
|
||||
if (arg.count()<2) {
|
||||
closeOpt = AVR_DIALOG_FORCE_CLOSE;
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
sourceFile=arg.at(0);
|
||||
destFile=arg.at(1);
|
||||
if (!displayDetails) {
|
||||
@@ -50,30 +51,32 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
|
||||
ui->progressBar->setMaximum(127);
|
||||
QTimer::singleShot(500, this, SLOT(doCopy()));
|
||||
}
|
||||
} else {
|
||||
if(wTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " " + tr("result"));
|
||||
}
|
||||
else {
|
||||
if (wTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " " + tr("result"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + wTitle);
|
||||
setWindowTitle(getProgrammer() + " - " + wTitle);
|
||||
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 {
|
||||
}
|
||||
else {
|
||||
foreach(QString str, arg) cmdLine.append(" " + str);
|
||||
lfuse = 0;
|
||||
hfuse = 0;
|
||||
efuse = 0;
|
||||
phase=0;
|
||||
currLine.clear();
|
||||
prevLine.clear();
|
||||
if (!displayDetails) {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
} else {
|
||||
ui->checkBox->setChecked(true);
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
else {
|
||||
ui->checkBox->setChecked(true);
|
||||
}
|
||||
process = new QProcess(this);
|
||||
connect(process,SIGNAL(readyReadStandardError()), this, SLOT(doAddTextStdErr()));
|
||||
@@ -132,11 +135,12 @@ void avrOutputDialog::doCopy()
|
||||
char * pointer=buf;
|
||||
QFile source(sourceFile);
|
||||
int blocks=(source.size()/BLKSIZE);
|
||||
ui->progressBar->setMaximum(blocks-1);
|
||||
ui->progressBar->setMaximum(blocks-1);
|
||||
if (!source.open(QIODevice::ReadOnly)) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file"));
|
||||
hasErrors=true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
source.read(buf,READBUF);
|
||||
source.close();
|
||||
QFile dest(destFile);
|
||||
@@ -183,7 +187,6 @@ void avrOutputDialog::runAgain(QString prog, QStringList arg, int closeBehaviour
|
||||
foreach(QString str, arg) cmdLine.append(" " + str);
|
||||
closeOpt = closeBehaviour;
|
||||
currLine.clear();
|
||||
prevLine.clear();
|
||||
process->start(prog,arg);
|
||||
}
|
||||
|
||||
@@ -194,12 +197,18 @@ void avrOutputDialog::waitForFinish()
|
||||
|
||||
void avrOutputDialog::addText(const QString &text)
|
||||
{
|
||||
int val = ui->plainTextEdit->verticalScrollBar()->maximum();
|
||||
ui->plainTextEdit->insertPlainText(text);
|
||||
if(val!=ui->plainTextEdit->verticalScrollBar()->maximum())
|
||||
ui->plainTextEdit->verticalScrollBar()->setValue(ui->plainTextEdit->verticalScrollBar()->maximum());
|
||||
}
|
||||
QTextCursor cursor(ui->plainTextEdit->textCursor());
|
||||
|
||||
// is the scrollbar at the end?
|
||||
bool atEnd = (ui->plainTextEdit->verticalScrollBar()->value() == ui->plainTextEdit->verticalScrollBar()->maximum());
|
||||
|
||||
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
|
||||
cursor.insertText(text);
|
||||
|
||||
if (atEnd) {
|
||||
ui->plainTextEdit->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::doAddTextStdOut()
|
||||
{
|
||||
@@ -209,37 +218,34 @@ void avrOutputDialog::doAddTextStdOut()
|
||||
int nlPos, pos, size;
|
||||
|
||||
addText(text);
|
||||
|
||||
currStdLine.append(text);
|
||||
if (currStdLine.contains("size = ")) {
|
||||
pos=currStdLine.lastIndexOf("size = ");
|
||||
temp=currStdLine.mid(pos+7);
|
||||
pos=temp.lastIndexOf("\n");
|
||||
size=temp.left(pos).toInt();
|
||||
pos = currStdLine.lastIndexOf("size = ");
|
||||
temp = currStdLine.mid(pos+7);
|
||||
pos = temp.lastIndexOf("\n");
|
||||
size = temp.left(pos).toInt();
|
||||
ui->progressBar->setMaximum(size/2048);
|
||||
}
|
||||
if (currStdLine.contains("\n")) {
|
||||
nlPos=currStdLine.lastIndexOf("\n");
|
||||
prevStdLine=currStdLine.left(nlPos).trimmed();
|
||||
currStdLine=currStdLine.mid(nlPos+1);
|
||||
nlPos = currStdLine.lastIndexOf("\n");
|
||||
currStdLine = currStdLine.mid(nlPos+1);
|
||||
}
|
||||
if (!currStdLine.isEmpty()) {
|
||||
if (currStdLine.at(0)==QChar('.')) {
|
||||
pos=currStdLine.lastIndexOf(".");
|
||||
if (currStdLine.at(0) == QChar('.')) {
|
||||
pos = currStdLine.lastIndexOf(".");
|
||||
ui->progressBar->setValue(pos);
|
||||
}
|
||||
}
|
||||
if (!currStdLine.isEmpty()) {
|
||||
if (currStdLine.startsWith("Starting upload: [")) {
|
||||
pos=(currStdLine.lastIndexOf("#")-19)/(MAX_FSIZE/204800.0);
|
||||
else if (currStdLine.startsWith("Starting upload: [")) {
|
||||
pos = (currStdLine.lastIndexOf("#")-19)/(MAX_FSIZE/204800.0);
|
||||
ui->progressBar->setValue(pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains("Complete ")) {
|
||||
#if !__GNUC__
|
||||
if (kill_timer) {
|
||||
delete kill_timer;
|
||||
kill_timer = NULL;
|
||||
}
|
||||
delete kill_timer;
|
||||
kill_timer = NULL;
|
||||
#endif
|
||||
int start = text.indexOf("Complete ");
|
||||
int end = text.indexOf("%");
|
||||
@@ -250,19 +256,15 @@ void avrOutputDialog::doAddTextStdOut()
|
||||
}
|
||||
}
|
||||
|
||||
//addText("\n=====\n" + text + "\n=====\n");
|
||||
|
||||
if(text.contains(":010000")) //contains fuse info
|
||||
{
|
||||
QStringList stl = text.split(":01000000");
|
||||
|
||||
foreach (QString t, stl)
|
||||
{
|
||||
bool ok = false;
|
||||
if(!lfuse) lfuse = t.left(2).toInt(&ok,16);
|
||||
if(!hfuse && !ok) hfuse = t.left(2).toInt(&ok,16);
|
||||
if(!efuse && !ok) efuse = t.left(2).toInt(&ok,16);
|
||||
}
|
||||
if (text.contains(":010000")) {
|
||||
//contains fuse info
|
||||
QStringList stl = text.split(":01000000");
|
||||
foreach (QString t, stl) {
|
||||
bool ok = false;
|
||||
if (!lfuse) lfuse = t.left(2).toInt(&ok,16);
|
||||
if (!hfuse && !ok) hfuse = t.left(2).toInt(&ok,16);
|
||||
if (!efuse && !ok) efuse = t.left(2).toInt(&ok,16);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains("-E-")) {
|
||||
@@ -276,9 +278,11 @@ QString avrOutputDialog::getProgrammer()
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
return "DFU Util";
|
||||
} else if (eepromInterface->getBoard()==BOARD_SKY9X) {
|
||||
}
|
||||
else if (eepromInterface->getBoard()==BOARD_SKY9X) {
|
||||
return "SAM-BA";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return "AVRDUDE";
|
||||
}
|
||||
}
|
||||
@@ -298,27 +302,33 @@ void avrOutputDialog::errorWizard()
|
||||
DeviceStr="Atmega 64";
|
||||
FwStr="\n"+tr("ie: OpenTX for 9X board or OpenTX for 9XR board");
|
||||
fwexist=true;
|
||||
} else if (DeviceId=="0x1e9702") {
|
||||
}
|
||||
else if (DeviceId=="0x1e9702") {
|
||||
DeviceStr="Atmega 128";
|
||||
FwStr="\n"+tr("ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip");
|
||||
fwexist=true;
|
||||
} else if (DeviceId=="0x1e9703") {
|
||||
}
|
||||
else if (DeviceId=="0x1e9703") {
|
||||
DeviceStr="Atmega 1280";
|
||||
} else if (DeviceId=="0x1e9704") {
|
||||
}
|
||||
else if (DeviceId=="0x1e9704") {
|
||||
DeviceStr="Atmega 1281";
|
||||
} else if (DeviceId=="0x1e9801") {
|
||||
}
|
||||
else if (DeviceId=="0x1e9801") {
|
||||
DeviceStr="Atmega 2560";
|
||||
FwStr="\n"+tr("ie: OpenTX for Gruvin9X board");
|
||||
fwexist=true;
|
||||
} else if (DeviceId=="0x1e9802") {
|
||||
}
|
||||
else if (DeviceId=="0x1e9802") {
|
||||
DeviceStr="Atmega 2561";
|
||||
}
|
||||
}
|
||||
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));
|
||||
} else {
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,7 +343,7 @@ void avrOutputDialog::doAddTextStdErr()
|
||||
|
||||
currLine.append(text);
|
||||
if (currLine.contains("#")) {
|
||||
avrphase=currLine.left(1).toLower();
|
||||
avrphase = currLine.left(1).toLower();
|
||||
if (avrphase=="w") {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #ff0000; text-align:center;}:");
|
||||
phase=1;
|
||||
@@ -344,14 +354,15 @@ void avrOutputDialog::doAddTextStdErr()
|
||||
pbvalue=currLine.count("#")*2;
|
||||
ui->progressBar->setValue(pbvalue);
|
||||
}
|
||||
if (avrphase=="r") {
|
||||
else if (avrphase=="r") {
|
||||
if (phase==0) {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #00ff00; text-align:center;}:");
|
||||
if(winTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " - " + tr("Reading"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Reading"));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #0000ff; text-align:center;}:");
|
||||
phase=2;
|
||||
if(winTitle.isEmpty())
|
||||
@@ -363,11 +374,12 @@ void avrOutputDialog::doAddTextStdErr()
|
||||
ui->progressBar->setValue(pbvalue);
|
||||
}
|
||||
}
|
||||
|
||||
if (currLine.contains("\n")) {
|
||||
nlPos=currLine.lastIndexOf("\n");
|
||||
prevLine=currLine.left(nlPos).trimmed();
|
||||
currLine=currLine.mid(nlPos+1);
|
||||
nlPos = currLine.lastIndexOf("\n");
|
||||
currLine = currLine.mid(nlPos+1);
|
||||
}
|
||||
|
||||
if (text.contains("-E-") && !text.contains("-E- No receive file name")) {
|
||||
hasErrors = true;
|
||||
}
|
||||
@@ -376,6 +388,7 @@ void avrOutputDialog::doAddTextStdErr()
|
||||
}
|
||||
|
||||
#define HLINE_SEPARATOR "================================================================================="
|
||||
|
||||
void avrOutputDialog::doFinished(int code=0)
|
||||
{
|
||||
addText("\n" HLINE_SEPARATOR);
|
||||
@@ -385,17 +398,22 @@ void avrOutputDialog::doFinished(int code=0)
|
||||
if (code) {
|
||||
ui->checkBox->setChecked(true);
|
||||
addText("\n" + getProgrammer() + " " + tr("done - exit code %1").arg(code));
|
||||
} else if (hasErrors) {
|
||||
}
|
||||
else if (hasErrors) {
|
||||
ui->checkBox->setChecked(true);
|
||||
addText("\n" + getProgrammer() + " " + tr("done with errors"));
|
||||
} else if (!cmdLine.isEmpty()) {
|
||||
}
|
||||
else if (!cmdLine.isEmpty()) {
|
||||
addText("\n" + getProgrammer() + " " + tr("done - SUCCESSFUL"));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
addText(tr("done - SUCCESSFUL"));
|
||||
}
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
|
||||
if(lfuse || hfuse || efuse) addReadFuses();
|
||||
if(lfuse || hfuse || efuse) {
|
||||
addReadFuses();
|
||||
}
|
||||
|
||||
switch(closeOpt)
|
||||
{
|
||||
@@ -416,24 +434,27 @@ 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"));
|
||||
} else {
|
||||
int res = QMessageBox::question(this, "companion9x",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
|
||||
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
|
||||
}
|
||||
else {
|
||||
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 {
|
||||
}
|
||||
else {
|
||||
if (!cmdLine.isEmpty()) {
|
||||
ui->progressBar->setValue(100);
|
||||
QMessageBox::information(this, "companion9x", getProgrammer() + " " + tr("finished correctly"));
|
||||
ui->progressBar->setValue(ui->progressBar->maximum());
|
||||
QMessageBox::information(this, "Companion", getProgrammer() + " " + tr("finished correctly"));
|
||||
accept();
|
||||
} else {
|
||||
QMessageBox::information(this, "companion9x", tr("Copy finished correctly"));
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, "Companion", tr("Copy finished correctly"));
|
||||
accept();
|
||||
}
|
||||
}
|
||||
@@ -454,8 +475,6 @@ void avrOutputDialog::doProcessStarted()
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void avrOutputDialog::addReadFuses()
|
||||
{
|
||||
addText(HLINE_SEPARATOR "\n");
|
||||
@@ -463,19 +482,23 @@ void avrOutputDialog::addReadFuses()
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
}
|
||||
|
||||
void avrOutputDialog::on_checkBox_toggled(bool checked) {
|
||||
void avrOutputDialog::on_checkBox_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->plainTextEdit->show();
|
||||
} else {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
ui->plainTextEdit->show();
|
||||
}
|
||||
else {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::shrink() {
|
||||
void avrOutputDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
void avrOutputDialog::forceClose() {
|
||||
accept();;
|
||||
void avrOutputDialog::forceClose()
|
||||
{
|
||||
accept();
|
||||
}
|
||||
|
||||
@@ -52,9 +52,7 @@ private:
|
||||
quint8 lfuse;
|
||||
quint8 hfuse;
|
||||
quint8 efuse;
|
||||
QString prevLine;
|
||||
QString currLine;
|
||||
QString prevStdLine;
|
||||
QString currStdLine;
|
||||
int phase;
|
||||
QString winTitle;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
@@ -109,7 +109,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "ui_burnconfigdialog.h"
|
||||
#include "avroutputdialog.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include <QtGui>
|
||||
|
||||
#if !defined WIN32 && defined __GNUC__
|
||||
@@ -13,6 +15,7 @@ burnConfigDialog::burnConfigDialog(QWidget *parent) :
|
||||
ui(new Ui::burnConfigDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("configure.png"));
|
||||
ui->avrdude_programmer->model()->sort(0);
|
||||
|
||||
getSettings();
|
||||
@@ -82,33 +85,42 @@ burnConfigDialog::~burnConfigDialog()
|
||||
|
||||
void burnConfigDialog::getSettings()
|
||||
{
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
avrLoc = g.avrdudeLocation();
|
||||
sambaLoc = g.sambaLocation();
|
||||
dfuLoc = g.dfuLocation();
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
avrLoc = settings.value("avrdude_location", QFileInfo("avrdude.exe").absoluteFilePath()).toString();
|
||||
sambaLoc = settings.value("samba_location", QFileInfo("sam-ba.exe").absoluteFilePath()).toString();
|
||||
dfuLoc = settings.value("dfu_location", QFileInfo("dfu-util.exe").absoluteFilePath()).toString();
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = QFileInfo("avrdude.exe").absoluteFilePath();
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = QFileInfo("sam-ba.exe").absoluteFilePath();
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo("dfu-util.exe").absoluteFilePath();
|
||||
#elif defined __APPLE__
|
||||
avrLoc = settings.value("avrdude_location", "/usr/local/bin/avrdude").toString();
|
||||
sambaLoc = settings.value("samba_location", "/usr/local/bin/sam-ba").toString();
|
||||
dfuLoc = settings.value("dfu_location", QFileInfo("/opt/local/bin/dfu-util").absoluteFilePath()).toString();
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = "/usr/local/bin/avrdude";
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = "/usr/local/bin/sam-ba";
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo("/opt/local/bin/dfu-util").absoluteFilePath();
|
||||
#else
|
||||
avrLoc = settings.value("avrdude_location", "/usr/bin/avrdude").toString();
|
||||
sambaLoc = settings.value("samba_location", "/usr/bin/sam-ba").toString();
|
||||
dfuLoc = settings.value("dfu_location", QFileInfo("/usr/bin/dfu-util").absoluteFilePath()).toString();
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = "/usr/bin/avrdude";
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = "/usr/bin/sam-ba";
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo("/usr/bin/dfu-util").absoluteFilePath();
|
||||
#endif
|
||||
QString str = settings.value("avr_arguments").toString();
|
||||
avrArgs = str.split(" ", QString::SkipEmptyParts);
|
||||
|
||||
avrProgrammer = settings.value("programmer", QString("usbasp")).toString();
|
||||
|
||||
avrMCU = settings.value("mcu", QString("m64")).toString();
|
||||
armMCU = settings.value("arm_mcu", QString("at91sam3s4-9x")).toString();
|
||||
dfuArgs = g.dfuArguments().split(" ", QString::SkipEmptyParts);
|
||||
avrArgs = g.avrArguments().split(" ", QString::SkipEmptyParts);
|
||||
avrProgrammer = g.programmer();
|
||||
avrPort = g.avrPort();
|
||||
avrMCU = g.mcu();
|
||||
armMCU = g.armMcu();
|
||||
sambaPort = g.sambaPort();
|
||||
|
||||
avrPort = settings.value("avr_port", "").toString();
|
||||
sambaPort = settings.value("samba_port", "\\USBserial\\COM23").toString();
|
||||
|
||||
str = settings.value("dfu_arguments", "-a 0").toString();
|
||||
dfuArgs = str.split(" ", QString::SkipEmptyParts);
|
||||
ui->avrdude_location->setText(getAVRDUDE());
|
||||
ui->avrArgs->setText(getAVRArgs().join(" "));
|
||||
|
||||
@@ -136,17 +148,16 @@ void burnConfigDialog::getSettings()
|
||||
|
||||
void burnConfigDialog::putSettings()
|
||||
{
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
settings.setValue("avrdude_location", avrLoc);
|
||||
settings.setValue("programmer", avrProgrammer);
|
||||
settings.setValue("mcu", avrMCU);
|
||||
settings.setValue("avr_port", avrPort);
|
||||
settings.setValue("avr_arguments", avrArgs.join(" "));
|
||||
settings.setValue("samba_location", sambaLoc);
|
||||
settings.setValue("samba_port", sambaPort);
|
||||
settings.setValue("arm_mcu", armMCU);
|
||||
settings.setValue("dfu_location", dfuLoc);
|
||||
settings.setValue("dfu_arguments", dfuArgs.join(" "));
|
||||
g.avrdudeLocation( avrLoc );
|
||||
g.programmer( avrProgrammer);
|
||||
g.mcu( avrMCU );
|
||||
g.avrPort( avrPort );
|
||||
g.avrArguments( avrArgs.join(" ") );
|
||||
g.sambaLocation( sambaLoc );
|
||||
g.sambaPort( sambaPort );
|
||||
g.armMcu( armMCU );
|
||||
g.dfuLocation( dfuLoc );
|
||||
g.dfuArguments( dfuArgs.join(" ") );
|
||||
}
|
||||
|
||||
void burnConfigDialog::populateProgrammers()
|
||||
@@ -278,8 +289,9 @@ void burnConfigDialog::listProgrammers()
|
||||
QStringList arguments;
|
||||
arguments << "-c?";
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE);
|
||||
ad->setWindowIcon(QIcon(":/images/list.png"));
|
||||
ad->setWindowIcon(CompanionIcon("list.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_pushButton_3_clicked()
|
||||
@@ -295,8 +307,9 @@ void burnConfigDialog::on_pushButton_4_clicked()
|
||||
arguments << "-?";
|
||||
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(QIcon(":/images/configure.png"));
|
||||
ad->setWindowIcon(CompanionIcon("configure.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
|
||||
@@ -312,8 +325,9 @@ void burnConfigDialog::readFuses()
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
|
||||
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(QIcon(":/images/fuses.png"));
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
void burnConfigDialog::restFuses(bool eeProtect)
|
||||
@@ -324,8 +338,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
|
||||
|
||||
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)
|
||||
@@ -338,7 +351,8 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||
QString erStr = eeProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m";
|
||||
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
QString tempDir = QDir::tempPath();
|
||||
QString tempFile;
|
||||
QString lfuses;
|
||||
@@ -346,8 +360,9 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||
QStringList argread;
|
||||
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
|
||||
ad->setWindowIcon(QIcon(":/images/fuses.png"));
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
QFile file(tempFile);
|
||||
if (file.exists() && file.size()==1) {
|
||||
file.open(QIODevice::ReadOnly);
|
||||
@@ -355,12 +370,14 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||
file.read(bin_flash, 1);
|
||||
if (bin_flash[0]==0x0E) {
|
||||
lfuses="lfuse:w:0x0E:m";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
lfuses="lfuse:w:0x3F:m";
|
||||
}
|
||||
file.close();
|
||||
unlink(tempFile.toAscii());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
lfuses="lfuse:w:0x3F:m";
|
||||
}
|
||||
|
||||
@@ -371,12 +388,14 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
||||
QStringList arguments;
|
||||
if (avrMCU=="m2560") {
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-u" << str;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str;
|
||||
}
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(QIcon(":/images/fuses.png"));
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -388,24 +407,29 @@ void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
ui->label_dfu2->show();
|
||||
ui->dfuArgs->show();
|
||||
} else if (eepromInterface->getBoard()==BOARD_SKY9X) {
|
||||
}
|
||||
else if (eepromInterface->getBoard()==BOARD_SKY9X) {
|
||||
ui->label_sb2->show();
|
||||
ui->arm_mcu->show();
|
||||
} else {
|
||||
}
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
ui->label_dfu2->hide();
|
||||
ui->dfuArgs->hide();
|
||||
} else if (eepromInterface->getBoard()==BOARD_SKY9X) {
|
||||
}
|
||||
else if (eepromInterface->getBoard()==BOARD_SKY9X) {
|
||||
ui->label_sb2->hide();
|
||||
ui->arm_mcu->hide();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->label_av3->hide();
|
||||
ui->avrdude_mcu->hide();
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
<string>Programmer Configuration</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
@@ -501,6 +501,61 @@ Please only use this if you know what you are doing. There are no error checks
|
||||
<string notr="true">com4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com5</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com6</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com7</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com8</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com9</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com10</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com11</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com12</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com13</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com14</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com15</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt1</string>
|
||||
@@ -760,7 +815,7 @@ Please only use this if you know what you are doing. There are no error checks
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#include "splashlibrary.h"
|
||||
#include "flashinterface.h"
|
||||
#include "hexinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
// Type 1 = Burn EEPROM, Type 2= Burn Flash
|
||||
burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * backupEE, QString DocName):
|
||||
QDialog(parent),
|
||||
ui(new Ui::burnDialog),
|
||||
@@ -16,76 +18,69 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
|
||||
hexType(Type)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("write_flash.png"));
|
||||
|
||||
if (!g.profile[g.id()].splashFile().isEmpty()){
|
||||
imageSource=PROFILE;
|
||||
imageFile=g.profile[g.id()].splashFile();
|
||||
}
|
||||
else {
|
||||
ui->useProfileImageCB->setDisabled(true);
|
||||
imageSource=FIRMWARE;
|
||||
imageFile="";
|
||||
}
|
||||
ui->SplashFrame->hide();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->EEbackupCB->hide();
|
||||
ui->EEbackupCB->setCheckState(*backup ? Qt::Checked : Qt::Unchecked);
|
||||
if (Type == 2) {
|
||||
if (Type == FLASH_FILE_TYPE ) {
|
||||
ui->EEpromCB->hide();
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchhw_CB->hide();
|
||||
ui->InvertColorButton->setDisabled(true);
|
||||
this->setWindowTitle(tr("Write firmware to TX"));
|
||||
setWindowTitle(tr("Write firmware to Radio"));
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEbackupCB->hide();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->FlashLoadButton->setText(tr("Browse for file"));
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchhw_CB->hide();
|
||||
ui->EEpromCB->hide();
|
||||
ui->ImageLoadButton->setDisabled(true);
|
||||
ui->libraryButton->setDisabled(true);
|
||||
ui->InvertColorButton->setDisabled(true);
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->ImageFileName->clear();
|
||||
ui->FwImage->clear();
|
||||
ui->FWFileName->clear();
|
||||
ui->DateField->clear();
|
||||
ui->SVNField->clear();
|
||||
ui->versionField->clear();
|
||||
ui->ModField->clear();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->SplashFrame->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->EEbackupCB->hide();
|
||||
if (DocName.isEmpty()) {
|
||||
this->setWindowTitle(tr("Write Models and Settings to TX"));
|
||||
} else {
|
||||
this->setWindowTitle(tr("Write Models and Settings in %1 to TX").arg(DocName));
|
||||
setWindowTitle(tr("Write Backup to Radio"));
|
||||
}
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int profileid=settings.value("profileId", 1).toInt();
|
||||
settings.beginGroup("Profiles");
|
||||
QString profile=QString("profile%1").arg(profileid);
|
||||
settings.beginGroup(profile);
|
||||
QString Name=settings.value("Name","").toString();
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
ui->profile_label->setText(tr("Current profile")+QString(": ")+Name);
|
||||
else {
|
||||
setWindowTitle(tr("Write Backup from %1 to Radio").arg(DocName));
|
||||
}
|
||||
ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].name());
|
||||
}
|
||||
if (!hexfileName->isEmpty()) {
|
||||
ui->FWFileName->setText(*hexfileName);
|
||||
if (Type==2) {
|
||||
if (Type==FLASH_FILE_TYPE) {
|
||||
checkFw(*hexfileName);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
burnraw=false;
|
||||
if (checkeEprom(*hexfileName)) {
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int profileid=settings.value("profileId", 1).toInt();
|
||||
settings.beginGroup("Profiles");
|
||||
QString profile=QString("profile%1").arg(profileid);
|
||||
settings.beginGroup(profile);
|
||||
QString Name=settings.value("Name","").toString();
|
||||
QString calib=settings.value("StickPotCalib","").toString();
|
||||
QString trainercalib=settings.value("TrainerCalib","").toString();
|
||||
QString DisplaySet=settings.value("Display","").toString();
|
||||
QString BeeperSet=settings.value("Beeper","").toString();
|
||||
QString HapticSet=settings.value("Haptic","").toString();
|
||||
QString SpeakerSet=settings.value("Speaker","").toString();
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
QString Name = g.profile[g.id()].name();
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
QString DisplaySet = g.profile[g.id()].display();
|
||||
QString BeeperSet = g.profile[g.id()].beeper();
|
||||
QString HapticSet = g.profile[g.id()].haptic();
|
||||
QString SpeakerSet = g.profile[g.id()].speaker();
|
||||
if (!Name.isEmpty()) {
|
||||
ui->profile_label->show();
|
||||
ui->patchcalib_CB->show();
|
||||
@@ -97,12 +92,14 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
|
||||
if (!((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6))) {
|
||||
ui->patchhw_CB->setDisabled(true);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->profile_label->hide();
|
||||
}
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEpromCB->show();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->EEpromCB->setChecked(false);
|
||||
}
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
@@ -112,46 +109,44 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
|
||||
ui->FlashLoadButton->hide();
|
||||
hexfileName->clear();
|
||||
}
|
||||
else if (Type==2) {
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString FileName;
|
||||
FileName = settings.value("lastFw").toString();
|
||||
else if (Type==FLASH_FILE_TYPE) {
|
||||
QString FileName = g.profile[g.id()].fwName();
|
||||
QFile file(FileName);
|
||||
if (file.exists()) {
|
||||
checkFw(FileName);
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
resize(0, 0);
|
||||
}
|
||||
|
||||
burnDialog::~burnDialog() {
|
||||
burnDialog::~burnDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void burnDialog::on_FlashLoadButton_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
ui->ImageLoadButton->setDisabled(true);
|
||||
ui->libraryButton->setDisabled(true);
|
||||
ui->InvertColorButton->setDisabled(true);
|
||||
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->ImageFileName->clear();
|
||||
ui->FwImage->clear();
|
||||
ui->FWFileName->clear();
|
||||
ui->DateField->clear();
|
||||
ui->SVNField->clear();
|
||||
ui->versionField->clear();
|
||||
ui->ModField->clear();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->SplashFrame->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->EEbackupCB->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
if (hexType==2) {
|
||||
fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER);
|
||||
if (hexType==FLASH_FILE_TYPE) {
|
||||
fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||
if(fileName.isEmpty())
|
||||
return;
|
||||
checkFw(fileName);
|
||||
} else {
|
||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Choose file to load Models and Settings from"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER));
|
||||
}
|
||||
else {
|
||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
|
||||
if (checkeEprom(fileName)) {
|
||||
if (burnraw==false) {
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
@@ -160,10 +155,12 @@ void burnDialog::on_FlashLoadButton_clicked()
|
||||
ui->patchhw_CB->show();
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEpromCB->show();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->EEpromCB->setChecked(false);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->setChecked(false);
|
||||
@@ -174,6 +171,7 @@ void burnDialog::on_FlashLoadButton_clicked()
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::checkFw(QString fileName)
|
||||
@@ -181,10 +179,11 @@ void burnDialog::checkFw(QString fileName)
|
||||
if (fileName.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEbackupCB->show();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->EEbackupCB->setChecked(false);
|
||||
*backup=false;
|
||||
}
|
||||
@@ -193,59 +192,21 @@ void burnDialog::checkFw(QString fileName)
|
||||
if (flash.isValid()) {
|
||||
ui->FramFWInfo->show();
|
||||
ui->DateField->setText(flash.getDate() + " " + flash.getTime());
|
||||
ui->SVNField->setText(flash.getSvn());
|
||||
ui->ModField->setText(flash.getBuild());
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
ui->BurnFlashButton->setText(tr("Write to TX"));
|
||||
ui->versionField->setText(flash.getVersion().isEmpty() ? flash.getSvn() : flash.getVersion());
|
||||
ui->ModField->setText(flash.getEEprom());
|
||||
|
||||
ui->SplashFrame->hide();
|
||||
if (flash.hasSplash()) {
|
||||
ui->SplashFrame->show();
|
||||
ui->ImageLoadButton->setEnabled(true);
|
||||
ui->libraryButton->setEnabled(true);
|
||||
ui->FwImage->setFixedSize(flash.getSplashWidth(),flash.getSplashHeight());
|
||||
ui->imageLabel->setFixedSize(flash.getSplashWidth(),flash.getSplashHeight());
|
||||
ui->FwImage->show();
|
||||
ui->FwImage->setPixmap(QPixmap::fromImage(flash.getSplash()));
|
||||
QString ImageStr = settings.value("SplashImage", "").toString();
|
||||
bool PatchFwCB = settings.value("patchImage", false).toBool();
|
||||
if (!ImageStr.isEmpty()) {
|
||||
QImage Image = qstring2image(ImageStr);
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(Image.convertToFormat(flash.getSplashFormat())));
|
||||
ui->InvertColorButton->setEnabled(true);
|
||||
ui->PreferredImageCB->setChecked(true);
|
||||
ui->PatchFWCB->setChecked(PatchFwCB);
|
||||
}
|
||||
else {
|
||||
QString fileName=ui->ImageFileName->text();
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
if (!image.isNull()) {
|
||||
ui->InvertColorButton->setEnabled(true);
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()).convertToFormat(flash.getSplashFormat())));
|
||||
ui->PatchFWCB->setEnabled(true);
|
||||
ui->PatchFWCB->setChecked(PatchFwCB);
|
||||
} else {
|
||||
ui->PatchFWCB->setDisabled(true);
|
||||
ui->PatchFWCB->setChecked(false);
|
||||
ui->PreferredImageCB->setDisabled(true);
|
||||
}
|
||||
} else {
|
||||
ui->PatchFWCB->setDisabled(true);
|
||||
ui->PatchFWCB->setChecked(false);
|
||||
ui->PreferredImageCB->setDisabled(true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ui->FwImage->hide();
|
||||
ui->ImageFileName->setText("");
|
||||
ui->SplashFrame->hide();
|
||||
ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
|
||||
}
|
||||
} else {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("%1 is not a known firmware").arg(fileName));
|
||||
ui->BurnFlashButton->setText(tr("Burn anyway !"));
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName));
|
||||
}
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath());
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
}
|
||||
|
||||
bool burnDialog::checkeEprom(QString fileName)
|
||||
@@ -267,7 +228,8 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
}
|
||||
QTextStream inputStream(&file);
|
||||
XmlInterface(inputStream).load(radioData);
|
||||
} else if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
}
|
||||
else if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
@@ -292,7 +254,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 +264,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;
|
||||
}
|
||||
@@ -310,7 +272,8 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
ui->FWFileName->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
} else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
}
|
||||
else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
int eeprom_size = file.size();
|
||||
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
@@ -325,7 +288,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;
|
||||
}
|
||||
@@ -336,53 +299,92 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
return true;
|
||||
}
|
||||
|
||||
void burnDialog::on_ImageLoadButton_clicked()
|
||||
void burnDialog::displaySplash()
|
||||
{
|
||||
QImage image;
|
||||
if (imageSource == FIRMWARE){
|
||||
FlashInterface flash(ui->FWFileName->text());
|
||||
image = flash.getSplash();
|
||||
}
|
||||
else {
|
||||
image.load(imageFile);
|
||||
}
|
||||
if (image.isNull()) {
|
||||
return;
|
||||
}
|
||||
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
|
||||
}
|
||||
|
||||
void burnDialog::updateUI()
|
||||
{
|
||||
if (hexType==EEPROM_FILE_TYPE)
|
||||
return;
|
||||
|
||||
ui->useProfileImageCB->setChecked( imageSource == PROFILE );
|
||||
ui->useFwImageCB->setChecked( imageSource == FIRMWARE );
|
||||
ui->useLibraryImageCB->setChecked( imageSource == LIBRARY );
|
||||
ui->useAnotherImageCB->setChecked( imageSource == ANOTHER );
|
||||
|
||||
displaySplash();
|
||||
}
|
||||
|
||||
void burnDialog::on_useFwImageCB_clicked()
|
||||
{
|
||||
QString fileName = ui->FWFileName->text();
|
||||
FlashInterface flash(fileName);
|
||||
if (!flash.isValid()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr( "The firmware file is not valid." ));
|
||||
}
|
||||
else {
|
||||
if (!flash.hasSplash()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr( "There is no start screen image in the firmware file." ));
|
||||
}
|
||||
else{
|
||||
imageSource = FIRMWARE;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useProfileImageCB_clicked()
|
||||
{
|
||||
QString fileName = g.profile[g.id()].splashFile();
|
||||
if (!fileName.isEmpty()){
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("The profile image %1 does not contain an image.").arg(fileName));
|
||||
}
|
||||
else {
|
||||
imageSource = PROFILE;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useAnotherImageCB_clicked()
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as radio start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
if (!fileName.isEmpty()){
|
||||
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
||||
ui->PatchFWCB->setDisabled(true);
|
||||
ui->PatchFWCB->setChecked(false);
|
||||
ui->InvertColorButton->setDisabled(true);
|
||||
return;
|
||||
QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName));
|
||||
}
|
||||
ui->ImageFileName->setText(fileName);
|
||||
ui->InvertColorButton->setEnabled(true);
|
||||
if (ui->imageLabel->width()!=128) {
|
||||
image=image.convertToFormat(QImage::Format_RGB32);
|
||||
QRgb col;
|
||||
int gray;
|
||||
int width = image.width();
|
||||
int height = image.height();
|
||||
for (int i = 0; i < width; ++i)
|
||||
{
|
||||
for (int j = 0; j < height; ++j)
|
||||
{
|
||||
col = image.pixel(i, j);
|
||||
gray = qGray(col);
|
||||
image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||
}
|
||||
}
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height())));
|
||||
} else {
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()).convertToFormat(QImage::Format_Mono)));
|
||||
}
|
||||
ui->PatchFWCB->setEnabled(true);
|
||||
else{
|
||||
imageSource = ANOTHER;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_libraryButton_clicked()
|
||||
void burnDialog::on_useLibraryImageCB_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
splashLibrary *ld = new splashLibrary(this,&fileName);
|
||||
@@ -390,50 +392,26 @@ void burnDialog::on_libraryButton_clicked()
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
||||
ui->PatchFWCB->setDisabled(true);
|
||||
ui->PatchFWCB->setChecked(false);
|
||||
ui->InvertColorButton->setDisabled(true);
|
||||
return;
|
||||
QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded"));
|
||||
}
|
||||
ui->ImageFileName->setText(fileName);
|
||||
ui->InvertColorButton->setEnabled(true);
|
||||
if (ui->imageLabel->width()!=128) {
|
||||
image=image.convertToFormat(QImage::Format_RGB32);
|
||||
QRgb col;
|
||||
int gray;
|
||||
int width = image.width();
|
||||
int height = image.height();
|
||||
for (int i = 0; i < width; ++i)
|
||||
{
|
||||
for (int j = 0; j < height; ++j)
|
||||
{
|
||||
col = image.pixel(i, j);
|
||||
gray = qGray(col);
|
||||
image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||
}
|
||||
}
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height())));
|
||||
} else {
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height()).convertToFormat(QImage::Format_Mono)));
|
||||
else{
|
||||
imageSource = LIBRARY;
|
||||
imageFile = fileName;
|
||||
}
|
||||
ui->PatchFWCB->setEnabled(true);
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_BurnFlashButton_clicked()
|
||||
{
|
||||
if (hexType==2) {
|
||||
if (hexType==FLASH_FILE_TYPE) {
|
||||
QString fileName=ui->FWFileName->text();
|
||||
if (!fileName.isEmpty()) {
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath());
|
||||
settings.setValue("lastFw", fileName);
|
||||
if (ui->PatchFWCB->isChecked()) {
|
||||
settings.setValue("patchImage", true);
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
if (!ui->useFwImageCB->isChecked()) {
|
||||
QImage image = ui->imageLabel->pixmap()->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
|
||||
if (!image.isNull()) {
|
||||
QString tempDir = QDir::tempPath();
|
||||
QString tempDir = QDir::tempPath();
|
||||
QString tempFile;
|
||||
if (getFileType(fileName) == FILE_TYPE_HEX)
|
||||
tempFile = tempDir + "/flash.hex";
|
||||
@@ -448,41 +426,36 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
hexfileName->clear();
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Custom image not found"));
|
||||
}
|
||||
} else {
|
||||
settings.setValue("patchImage", false);
|
||||
hexfileName->clear();
|
||||
hexfileName->append(fileName);
|
||||
}
|
||||
} else {
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(fileName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
|
||||
hexfileName->clear();
|
||||
}
|
||||
}
|
||||
if (hexType==1) {
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int profileid=settings.value("profileId", 1).toInt();
|
||||
settings.beginGroup("Profiles");
|
||||
QString profile=QString("profile%1").arg(profileid);
|
||||
settings.beginGroup(profile);
|
||||
QString calib=settings.value("StickPotCalib","").toString();
|
||||
QString trainercalib=settings.value("TrainerCalib","").toString();
|
||||
if (hexType==EEPROM_FILE_TYPE) {
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
int potsnum=GetEepromInterface()->getCapability(Pots);
|
||||
int8_t vBatCalib=(int8_t)settings.value("VbatCalib", radioData.generalSettings.vBatCalib).toInt();
|
||||
int8_t currentCalib=(int8_t)settings.value("currentCalib", radioData.generalSettings.currentCalib).toInt();
|
||||
int8_t PPM_Multiplier=(int8_t)settings.value("PPM_Multiplier", radioData.generalSettings.PPM_Multiplier).toInt();
|
||||
uint8_t GSStickMode=(uint8_t)settings.value("GSStickMode", radioData.generalSettings.stickMode).toUInt();
|
||||
uint8_t vBatWarn=(uint8_t)settings.value("vBatWarn",radioData.generalSettings.vBatWarn).toUInt();
|
||||
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
|
||||
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
|
||||
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
|
||||
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
|
||||
|
||||
QString DisplaySet=settings.value("Display","").toString();
|
||||
QString BeeperSet=settings.value("Beeper","").toString();
|
||||
QString HapticSet=settings.value("Haptic","").toString();
|
||||
QString SpeakerSet=settings.value("Speaker","").toString();
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
QString DisplaySet= g.profile[g.id()].display();
|
||||
QString BeeperSet= g.profile[g.id()].beeper();
|
||||
QString HapticSet= g.profile[g.id()].haptic();
|
||||
QString SpeakerSet= g.profile[g.id()].speaker();
|
||||
bool patch=false;
|
||||
if (ui->patchcalib_CB->isChecked()) {
|
||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||
@@ -618,99 +591,9 @@ void burnDialog::on_cancelButton_clicked()
|
||||
this->close();
|
||||
}
|
||||
|
||||
void burnDialog::on_InvertColorButton_clicked()
|
||||
{
|
||||
if (ui->imageLabel->pixmap()) {
|
||||
QImage image = ui->imageLabel->pixmap()->toImage();
|
||||
image.invertPixels();
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image));
|
||||
}
|
||||
}
|
||||
|
||||
void burnDialog::on_EEpromCB_toggled(bool checked)
|
||||
{
|
||||
if (ui->EEpromCB->isChecked()) {
|
||||
*backup=true;
|
||||
} else {
|
||||
*backup=false;
|
||||
}
|
||||
}
|
||||
|
||||
void burnDialog::on_PreferredImageCB_toggled(bool checked)
|
||||
{
|
||||
QString tmpFileName;
|
||||
if (checked) {
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString ImageStr = settings.value("SplashImage", "").toString();
|
||||
if (!ImageStr.isEmpty()) {
|
||||
QImage Image = qstring2image(ImageStr);
|
||||
if (ui->imageLabel->width()!=128) {
|
||||
Image=Image.convertToFormat(QImage::Format_RGB32);
|
||||
QRgb col;
|
||||
int gray;
|
||||
int width = Image.width();
|
||||
int height = Image.height();
|
||||
for (int i = 0; i < width; ++i)
|
||||
{
|
||||
for (int j = 0; j < height; ++j)
|
||||
{
|
||||
col = Image.pixel(i, j);
|
||||
gray = qGray(col);
|
||||
Image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Image=Image.convertToFormat(QImage::Format_Mono);
|
||||
}
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(Image));
|
||||
ui->InvertColorButton->setEnabled(true);
|
||||
ui->PreferredImageCB->setChecked(true);
|
||||
ui->ImageFileName->setDisabled(true);
|
||||
ui->ImageLoadButton->setDisabled(true);
|
||||
ui->libraryButton->setDisabled(true);
|
||||
ui->PatchFWCB->setEnabled(true);
|
||||
}
|
||||
} else {
|
||||
ui->imageLabel->clear();
|
||||
ui->ImageLoadButton->setEnabled(true);
|
||||
ui->libraryButton->setEnabled(true);
|
||||
tmpFileName = ui->ImageFileName->text();
|
||||
if (!tmpFileName.isEmpty()) {
|
||||
QImage image(tmpFileName);
|
||||
if (!image.isNull()) {
|
||||
if (ui->imageLabel->width()!=128) {
|
||||
image=image.convertToFormat(QImage::Format_RGB32);
|
||||
QRgb col;
|
||||
int gray;
|
||||
int width = image.width();
|
||||
int height = image.height();
|
||||
for (int i = 0; i < width; ++i)
|
||||
{
|
||||
for (int j = 0; j < height; ++j)
|
||||
{
|
||||
col = image.pixel(i, j);
|
||||
gray = qGray(col);
|
||||
image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
image=image.convertToFormat(QImage::Format_Mono);
|
||||
}
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width(), ui->imageLabel->height())));
|
||||
ui->InvertColorButton->setEnabled(true);
|
||||
ui->ImageFileName->setEnabled(true);
|
||||
ui->PatchFWCB->setDisabled(false);
|
||||
} else {
|
||||
ui->InvertColorButton->setDisabled(true);
|
||||
ui->PatchFWCB->setDisabled(true);
|
||||
ui->PatchFWCB->setChecked(false);
|
||||
}
|
||||
} else {
|
||||
ui->InvertColorButton->setDisabled(true);
|
||||
ui->PatchFWCB->setDisabled(true);
|
||||
ui->PatchFWCB->setChecked(false);
|
||||
}
|
||||
}
|
||||
*backup = ui->EEpromCB->isChecked();
|
||||
}
|
||||
|
||||
void burnDialog::shrink()
|
||||
@@ -720,9 +603,5 @@ void burnDialog::shrink()
|
||||
|
||||
void burnDialog::on_EEbackupCB_clicked()
|
||||
{
|
||||
if (ui->EEbackupCB->isChecked()) {
|
||||
*backup=true;
|
||||
} else {
|
||||
*backup=false;
|
||||
}
|
||||
*backup = ui->EEbackupCB->isChecked();
|
||||
}
|
||||
|
||||
@@ -7,18 +7,17 @@
|
||||
#include "flashinterface.h"
|
||||
#include "xmlinterface.h"
|
||||
|
||||
#define XML_FILES_FILTER "XML files (*.xml);;"
|
||||
#define HEX_FILES_FILTER "HEX files (*.hex);;"
|
||||
#define BIN_FILES_FILTER "BIN files (*.bin);;"
|
||||
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
|
||||
#define EEPM_FILES_FILTER "EEPE MODEL files (*.eepm);;"
|
||||
// #define EEPROM_FILES_FILTER "EEPE files (*.xml *.eepe *.eepm *.bin *.hex);;" XML_FILES_FILTER EEPE_FILES_FILTER EEPM_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
#define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE"
|
||||
#define EEPROM_FILE_TYPE 1
|
||||
#define FLASH_FILE_TYPE 2
|
||||
|
||||
|
||||
namespace Ui
|
||||
@@ -36,18 +35,22 @@ public:
|
||||
|
||||
private slots:
|
||||
void on_FlashLoadButton_clicked();
|
||||
void on_ImageLoadButton_clicked();
|
||||
void on_libraryButton_clicked();
|
||||
void on_BurnFlashButton_clicked();
|
||||
void on_cancelButton_clicked();
|
||||
void on_InvertColorButton_clicked();
|
||||
void on_EEbackupCB_clicked();
|
||||
void on_PreferredImageCB_toggled(bool checked);
|
||||
void on_EEpromCB_toggled(bool checked);
|
||||
void checkFw(QString fileName);
|
||||
void on_EEpromCB_toggled(bool checked);
|
||||
bool checkeEprom(QString fileName);
|
||||
void on_useProfileImageCB_clicked();
|
||||
void on_useFwImageCB_clicked();
|
||||
void on_useLibraryImageCB_clicked();
|
||||
void on_useAnotherImageCB_clicked();
|
||||
|
||||
void checkFw(QString fileName);
|
||||
void displaySplash();
|
||||
void updateUI();
|
||||
void shrink();
|
||||
|
||||
|
||||
private:
|
||||
Ui::burnDialog *ui;
|
||||
QString * hexfileName;
|
||||
@@ -55,6 +58,9 @@ private:
|
||||
int hexType;
|
||||
RadioData radioData;
|
||||
bool burnraw;
|
||||
enum ImageSource {FIRMWARE, PROFILE, LIBRARY, ANOTHER};
|
||||
ImageSource imageSource;
|
||||
QString imageFile;
|
||||
};
|
||||
|
||||
#endif // BURNDIALOG_H
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>440</width>
|
||||
<height>418</height>
|
||||
<width>399</width>
|
||||
<height>564</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -18,7 +18,7 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>440</width>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@@ -26,25 +26,12 @@
|
||||
<string>Customize Splash</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>:/images/c_home.png</normaloff>:/images/c_home.png</iconset>
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="hs2">
|
||||
<property name="orientation">
|
||||
@@ -71,19 +58,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="BurnFlashButton">
|
||||
<property name="enabled">
|
||||
@@ -100,19 +74,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="hs2_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
@@ -152,48 +113,7 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="2" rowspan="3">
|
||||
<widget class="QLabel" name="FwImage">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>212</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="DateField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="dateLabel">
|
||||
<property name="text">
|
||||
<string>Date & Time</string>
|
||||
@@ -201,16 +121,16 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="SVNField">
|
||||
<widget class="QLineEdit" name="versionField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="svnLabel">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="buildLabel">
|
||||
<property name="text">
|
||||
<string>SVN</string>
|
||||
<string>Variant</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -221,10 +141,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="buildLabel">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="versionLabel">
|
||||
<property name="text">
|
||||
<string>Variant</string>
|
||||
<string>Version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="DateField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -244,6 +171,12 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -273,7 +206,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>
|
||||
@@ -325,16 +258,9 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="SplashLayout" rowstretch="0,0,0,1">
|
||||
<item row="0" column="1" rowspan="4">
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="1,0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="InvertColorButton">
|
||||
<property name="text">
|
||||
<string>Invert Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<layout class="QGridLayout" name="SplashLayout" rowstretch="0,0,0,0,0,0,0">
|
||||
<item row="0" column="1" rowspan="7">
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
@@ -351,15 +277,18 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>212</width>
|
||||
<height>64</height>
|
||||
<width>214</width>
|
||||
<height>66</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@@ -372,7 +301,21 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="PreferredImageCB">
|
||||
<widget class="QCheckBox" name="useFwImageCB">
|
||||
<property name="text">
|
||||
<string>Use firmware start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="useAnotherImageCB">
|
||||
<property name="text">
|
||||
<string>Use another start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="useProfileImageCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -380,90 +323,14 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use image in settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="PatchFWCB">
|
||||
<property name="text">
|
||||
<string>Substitute image in firmware</string>
|
||||
<string>Use profile start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="ImageFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ImageLoadButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QCheckBox" name="useLibraryImageCB">
|
||||
<property name="text">
|
||||
<string>Load Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="libraryButton">
|
||||
<property name="toolTip">
|
||||
<string>Open Splash Library</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<normaloff>:/images/library.png</normaloff>:/images/library.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
<string>Use library start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -474,21 +341,39 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>BurnFlashButton</tabstop>
|
||||
<tabstop>FWFileName</tabstop>
|
||||
<tabstop>FlashLoadButton</tabstop>
|
||||
<tabstop>ImageFileName</tabstop>
|
||||
<tabstop>ImageLoadButton</tabstop>
|
||||
<tabstop>libraryButton</tabstop>
|
||||
<tabstop>versionField</tabstop>
|
||||
<tabstop>ModField</tabstop>
|
||||
<tabstop>useProfileImageCB</tabstop>
|
||||
<tabstop>useFwImageCB</tabstop>
|
||||
<tabstop>useLibraryImageCB</tabstop>
|
||||
<tabstop>useAnotherImageCB</tabstop>
|
||||
<tabstop>EEbackupCB</tabstop>
|
||||
<tabstop>patchcalib_CB</tabstop>
|
||||
<tabstop>patchhw_CB</tabstop>
|
||||
<tabstop>EEpromCB</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
<tabstop>BurnFlashButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -45,12 +45,12 @@
|
||||
#include <QString>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QSettings>
|
||||
#include <QSplashScreen>
|
||||
#include <QThread>
|
||||
#include <iostream>
|
||||
#include "mainwindow.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
@@ -76,55 +76,52 @@ class MyProxyStyle : public QProxyStyle
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(companion9x);
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("Companion9x");
|
||||
Q_INIT_RESOURCE(companion);
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("OpenTX Companion");
|
||||
app.setOrganizationName("OpenTX");
|
||||
app.setOrganizationDomain("open-tx.org");
|
||||
|
||||
#ifdef __APPLE__
|
||||
app.setStyle(new MyProxyStyle);
|
||||
app.setStyle(new MyProxyStyle);
|
||||
#endif
|
||||
QString dir;
|
||||
if(argc) dir = QFileInfo(argv[0]).canonicalPath() + "/lang";
|
||||
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString locale = settings.value("locale",QLocale::system().name()).toString();
|
||||
bool showSplash = settings.value("show_splash", true).toBool();
|
||||
QTranslator companionTranslator;
|
||||
companionTranslator.load(":/companion_" + g.locale());
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load((QString)"qt_" + g.locale().left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
app.installTranslator(&companionTranslator);
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTranslator companion9xTranslator;
|
||||
companion9xTranslator.load(":/companion9x_" + 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(&qtTranslator);
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
if (g.profile[g.id()].fwType().isEmpty()){
|
||||
g.profile[g.id()].fwType(default_firmware_variant.id);
|
||||
g.profile[g.id()].fwName("");
|
||||
}
|
||||
|
||||
|
||||
QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString();
|
||||
firmware_id.replace("open9x", "opentx");
|
||||
firmware_id.replace("x9da", "taranis");
|
||||
QPixmap pixmap;
|
||||
if (firmware_id.contains("taranis"))
|
||||
pixmap = QPixmap(":/images/splasht.png");
|
||||
else
|
||||
pixmap = QPixmap(":/images/splash.png");
|
||||
QSplashScreen *splash = new QSplashScreen(pixmap);
|
||||
QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png");
|
||||
QSplashScreen *splash = new QSplashScreen(pixmap);
|
||||
|
||||
RegisterFirmwares();
|
||||
RegisterFirmwares();
|
||||
|
||||
settings.setValue("firmware", firmware_id);
|
||||
current_firmware_variant = GetFirmwareVariant(firmware_id);
|
||||
// qDebug() << current_firmware_variant;
|
||||
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
|
||||
|
||||
MainWindow mainWin;
|
||||
|
||||
if (showSplash) {
|
||||
splash->show();
|
||||
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
|
||||
QTimer::singleShot(1000*SPLASH_TIME, &mainWin, SLOT(show()));
|
||||
}
|
||||
else {
|
||||
mainWin.show();
|
||||
}
|
||||
return app.exec();
|
||||
MainWindow *mainWin = new MainWindow();
|
||||
if (g.showSplash()) {
|
||||
splash->show();
|
||||
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
|
||||
QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show()));
|
||||
}
|
||||
else {
|
||||
mainWin->show();
|
||||
}
|
||||
|
||||
int result = app.exec();
|
||||
|
||||
delete splash;
|
||||
delete mainWin;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
Before Width: | Height: | Size: 5.2 KiB |
@@ -1,338 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icon.png</file>
|
||||
<file>../../CREDITS.txt</file>
|
||||
<file>../../DONATIONS.txt</file>
|
||||
<file>../releasenotes.txt</file>
|
||||
<file>images/9xdb.png</file>
|
||||
<file>images/9xdl.png</file>
|
||||
<file>images/9xdr.png</file>
|
||||
<file>images/9xdt.png</file>
|
||||
<file>images/9xdb-bl.png</file>
|
||||
<file>images/9xdl-bl.png</file>
|
||||
<file>images/9xdr-bl.png</file>
|
||||
<file>images/9xdt-bl.png</file>
|
||||
<file>images/9xdb-gr.png</file>
|
||||
<file>images/9xdl-gr.png</file>
|
||||
<file>images/9xdr-gr.png</file>
|
||||
<file>images/9xdt-gr.png</file>
|
||||
<file>images/9xdb-or.png</file>
|
||||
<file>images/9xdl-or.png</file>
|
||||
<file>images/9xdr-or.png</file>
|
||||
<file>images/9xdt-or.png</file>
|
||||
<file>images/9xdb-yl.png</file>
|
||||
<file>images/9xdl-yl.png</file>
|
||||
<file>images/9xdr-yl.png</file>
|
||||
<file>images/9xdt-yl.png</file>
|
||||
<file>images/9xdb-rd.png</file>
|
||||
<file>images/9xdl-rd.png</file>
|
||||
<file>images/9xdr-rd.png</file>
|
||||
<file>images/9xdt-rd.png</file>
|
||||
<file>images/9xmenu.png</file>
|
||||
<file>images/9xmenumenu.png</file>
|
||||
<file>images/9xmenuexit.png</file>
|
||||
<file>images/9xcurs.png</file>
|
||||
<file>images/9xcursup.png</file>
|
||||
<file>images/9xcursplus.png</file>
|
||||
<file>images/9xcursmin.png</file>
|
||||
<file>images/9xcursdown.png</file>
|
||||
<file>images/9xcursphoto.png</file>
|
||||
<file>images/copy.png</file>
|
||||
<file>images/cut.png</file>
|
||||
<file>images/currentmodel.png</file>
|
||||
<file>images/new.png</file>
|
||||
<file>images/open.png</file>
|
||||
<file>images/paste.png</file>
|
||||
<file>images/save.png</file>
|
||||
<file>images/saveas.png</file>
|
||||
<file>images/screenshot.png</file>
|
||||
<file>images/splash.png</file>
|
||||
<file>images/splasht.png</file>
|
||||
<file>images/companion9x-title.png</file>
|
||||
<file>images/read_eeprom.png</file>
|
||||
<file>images/write_eeprom.png</file>
|
||||
<file>images/write_flash.png</file>
|
||||
<file>images/read_flash.png</file>
|
||||
<file>images/simulate.png</file>
|
||||
<file>images/configure.png</file>
|
||||
<file>images/customize.png</file>
|
||||
<file>images/print.png</file>
|
||||
<file>images/clear.png</file>
|
||||
<file>images/add.png</file>
|
||||
<file>images/edit.png</file>
|
||||
<file>images/wizard.png</file>
|
||||
<file>images/duplicate.png</file>
|
||||
<file>images/fuses.png</file>
|
||||
<file>images/list.png</file>
|
||||
<file>images/maps.png</file>
|
||||
<file>images/track.png</file>
|
||||
<file>images/track0.png</file>
|
||||
<file>images/play.png</file>
|
||||
<file>images/stop.png</file>
|
||||
<file>images/read_eeprom_file.png</file>
|
||||
<file>images/write_eeprom_file.png</file>
|
||||
<file>images/moveup.png</file>
|
||||
<file>images/movedown.png</file>
|
||||
<file>images/update.png</file>
|
||||
<file>images/contributors.png</file>
|
||||
<file>images/changelog.png</file>
|
||||
<file>images/preferences.png</file>
|
||||
<file>images/switch_dir.png</file>
|
||||
<file>images/exit.png</file>
|
||||
<file>images/recentdocument.png</file>
|
||||
<file>images/profiles.png</file>
|
||||
<file>images/library.png</file>
|
||||
<file>images/logs.png</file>
|
||||
<file>images/arrow-left.png</file>
|
||||
<file>images/arrow-right.png</file>
|
||||
<file>images/compare.png</file>
|
||||
<file>images/x9b0.png</file>
|
||||
<file>images/x9l0.png</file>
|
||||
<file>images/x9l1.png</file>
|
||||
<file>images/x9l2.png</file>
|
||||
<file>images/x9l3.png</file>
|
||||
<file>images/x9l4.png</file>
|
||||
<file>images/x9r0.png</file>
|
||||
<file>images/x9r1.png</file>
|
||||
<file>images/x9r2.png</file>
|
||||
<file>images/x9r3.png</file>
|
||||
<file>images/x9s0.png</file>
|
||||
<file>images/x9t0.png</file>
|
||||
<file>images/mcw/aicon.png</file>
|
||||
<file>images/mcw/dicon.png</file>
|
||||
<file>images/mcw/gicon.png</file>
|
||||
<file>images/mcw/hicon.png</file>
|
||||
<file>images/mcw/at1e1r.png</file>
|
||||
<file>images/mcw/at2e1r.png</file>
|
||||
<file>images/mcw/atailv.png</file>
|
||||
<file>images/mcw/aw0a0f.png</file>
|
||||
<file>images/mcw/aw1a0f.png</file>
|
||||
<file>images/mcw/aw1a1f.png</file>
|
||||
<file>images/mcw/aw1a2f.png</file>
|
||||
<file>images/mcw/aw2a0f.png</file>
|
||||
<file>images/mcw/aw2a1f.png</file>
|
||||
<file>images/mcw/aw2a2f.png</file>
|
||||
<file>images/mcw/h90.png</file>
|
||||
<file>images/mcw/h120.png</file>
|
||||
<file>images/mcw/h120x.png</file>
|
||||
<file>images/mcw/h140.png</file>
|
||||
<file>images/mcw/hfbl.png</file>
|
||||
<file>images/mcw/htailg.png</file>
|
||||
<file>images/mcw/htailng.png</file>
|
||||
<file>images/mcw/htailfblg.png</file>
|
||||
<file>images/mcw/htailfblng.png</file>
|
||||
<file>images/mcw/gt1e1r.png</file>
|
||||
<file>images/mcw/gt2e1r.png</file>
|
||||
<file>images/mcw/gtailv.png</file>
|
||||
<file>images/mcw/gw0t0a0f0s.png</file>
|
||||
<file>images/mcw/gw0t1a0f0s.png</file>
|
||||
<file>images/mcw/gw0t1a0f1s.png</file>
|
||||
<file>images/mcw/gw0t1a0f2s.png</file>
|
||||
<file>images/mcw/gw0t1a1f0s.png</file>
|
||||
<file>images/mcw/gw0t1a1f1s.png</file>
|
||||
<file>images/mcw/gw0t1a1f2s.png</file>
|
||||
<file>images/mcw/gw0t1a2f0s.png</file>
|
||||
<file>images/mcw/gw0t1a2f1s.png</file>
|
||||
<file>images/mcw/gw0t1a2f2s.png</file>
|
||||
<file>images/mcw/gw0t2a0f0s.png</file>
|
||||
<file>images/mcw/gw0t2a0f1s.png</file>
|
||||
<file>images/mcw/gw0t2a0f2s.png</file>
|
||||
<file>images/mcw/gw0t2a1f0s.png</file>
|
||||
<file>images/mcw/gw0t2a1f1s.png</file>
|
||||
<file>images/mcw/gw0t2a1f2s.png</file>
|
||||
<file>images/mcw/gw0t2a2f0s.png</file>
|
||||
<file>images/mcw/gw0t2a2f1s.png</file>
|
||||
<file>images/mcw/gw0t2a2f2s.png</file>
|
||||
<file>images/mcw/gw1t0a0f0s.png</file>
|
||||
<file>images/mcw/gw1t1a0f0s.png</file>
|
||||
<file>images/mcw/gw1t1a0f1s.png</file>
|
||||
<file>images/mcw/gw1t1a0f2s.png</file>
|
||||
<file>images/mcw/gw1t1a1f0s.png</file>
|
||||
<file>images/mcw/gw1t1a1f1s.png</file>
|
||||
<file>images/mcw/gw1t1a1f2s.png</file>
|
||||
<file>images/mcw/gw1t1a2f0s.png</file>
|
||||
<file>images/mcw/gw1t1a2f1s.png</file>
|
||||
<file>images/mcw/gw1t1a2f2s.png</file>
|
||||
<file>images/mcw/gw1t2a0f0s.png</file>
|
||||
<file>images/mcw/gw1t2a0f1s.png</file>
|
||||
<file>images/mcw/gw1t2a0f2s.png</file>
|
||||
<file>images/mcw/gw1t2a1f0s.png</file>
|
||||
<file>images/mcw/gw1t2a1f1s.png</file>
|
||||
<file>images/mcw/gw1t2a1f2s.png</file>
|
||||
<file>images/mcw/gw1t2a2f0s.png</file>
|
||||
<file>images/mcw/gw1t2a2f1s.png</file>
|
||||
<file>images/mcw/gw1t2a2f2s.png</file>
|
||||
<file>images/mcw/db0t2e0f0r.png</file>
|
||||
<file>images/mcw/db0t2e0f1r.png</file>
|
||||
<file>images/mcw/db0t2e0f2r.png</file>
|
||||
<file>images/mcw/db0t2e1f0r.png</file>
|
||||
<file>images/mcw/db0t2e1f1r.png</file>
|
||||
<file>images/mcw/db0t2e1f2r.png</file>
|
||||
<file>images/mcw/db0t2e2f0r.png</file>
|
||||
<file>images/mcw/db0t2e2f1r.png</file>
|
||||
<file>images/mcw/db0t2e2f2r.png</file>
|
||||
<file>images/mcw/db1t2e0f0r.png</file>
|
||||
<file>images/mcw/db1t2e0f1r.png</file>
|
||||
<file>images/mcw/db1t2e0f2r.png</file>
|
||||
<file>images/mcw/db1t2e1f0r.png</file>
|
||||
<file>images/mcw/db1t2e1f1r.png</file>
|
||||
<file>images/mcw/db1t2e1f2r.png</file>
|
||||
<file>images/mcw/db1t2e2f0r.png</file>
|
||||
<file>images/mcw/db1t2e2f1r.png</file>
|
||||
<file>images/mcw/db1t2e2f2r.png</file>
|
||||
<file>images/mcw/dt0t2e0f0r.png</file>
|
||||
<file>images/mcw/dt0t2e0f1r.png</file>
|
||||
<file>images/mcw/dt0t2e0f2r.png</file>
|
||||
<file>images/mcw/dt0t2e1f0r.png</file>
|
||||
<file>images/mcw/dt0t2e1f1r.png</file>
|
||||
<file>images/mcw/dt0t2e1f2r.png</file>
|
||||
<file>images/mcw/dt0t2e2f0r.png</file>
|
||||
<file>images/mcw/dt0t2e2f1r.png</file>
|
||||
<file>images/mcw/dt0t2e2f2r.png</file>
|
||||
<file>images/mcw/dt1t2e0f0r.png</file>
|
||||
<file>images/mcw/dt1t2e0f1r.png</file>
|
||||
<file>images/mcw/dt1t2e0f2r.png</file>
|
||||
<file>images/mcw/dt1t2e1f0r.png</file>
|
||||
<file>images/mcw/dt1t2e1f1r.png</file>
|
||||
<file>images/mcw/dt1t2e1f2r.png</file>
|
||||
<file>images/mcw/dt1t2e2f0r.png</file>
|
||||
<file>images/mcw/dt1t2e2f1r.png</file>
|
||||
<file>images/mcw/dt1t2e2f2r.png</file>
|
||||
<file>images/library/00001.png</file>
|
||||
<file>images/library/00002.png</file>
|
||||
<file>images/library/00003.png</file>
|
||||
<file>images/library/00004.png</file>
|
||||
<file>images/library/00005.png</file>
|
||||
<file>images/library/00006.png</file>
|
||||
<file>images/library/00007.png</file>
|
||||
<file>images/library/00008.png</file>
|
||||
<file>images/library/00009.png</file>
|
||||
<file>images/library/00010.png</file>
|
||||
<file>images/library/00011.png</file>
|
||||
<file>images/library/00012.png</file>
|
||||
<file>images/library/00013.png</file>
|
||||
<file>images/library/00014.png</file>
|
||||
<file>images/library/00015.png</file>
|
||||
<file>images/library/00016.png</file>
|
||||
<file>images/library/01001.png</file>
|
||||
<file>images/library/01002.png</file>
|
||||
<file>images/library/01003.png</file>
|
||||
<file>images/library/01004.png</file>
|
||||
<file>images/library/01005.png</file>
|
||||
<file>images/library/01006.png</file>
|
||||
<file>images/library/01007.png</file>
|
||||
<file>images/library/01008.png</file>
|
||||
<file>images/library/10001.png</file>
|
||||
<file>images/library/10002.png</file>
|
||||
<file>images/library/10003.png</file>
|
||||
<file>images/library/10004.png</file>
|
||||
<file>images/library/10005.png</file>
|
||||
<file>images/library/10006.png</file>
|
||||
<file>images/library/10007.png</file>
|
||||
<file>images/library/10008.png</file>
|
||||
<file>images/library/10009.png</file>
|
||||
<file>images/library/10010.png</file>
|
||||
<file>images/library/10011.png</file>
|
||||
<file>images/library/10012.png</file>
|
||||
<file>images/library/10013.png</file>
|
||||
<file>images/library/10014.png</file>
|
||||
<file>images/library/10015.png</file>
|
||||
<file>images/library/10016.png</file>
|
||||
<file>images/library/10017.png</file>
|
||||
<file>images/library/10018.png</file>
|
||||
<file>images/library/10019.png</file>
|
||||
<file>images/library/10020.png</file>
|
||||
<file>images/library/10021.png</file>
|
||||
<file>images/library/10022.png</file>
|
||||
<file>images/library/10023.png</file>
|
||||
<file>images/library/10024.png</file>
|
||||
<file>images/library/10033.png</file>
|
||||
<file>images/library/10034.png</file>
|
||||
<file>images/library/10035.png</file>
|
||||
<file>images/library/10036.png</file>
|
||||
<file>images/library/10049.png</file>
|
||||
<file>images/library/10050.png</file>
|
||||
<file>images/library/10051.png</file>
|
||||
<file>images/library/10052.png</file>
|
||||
<file>images/library/10037.png</file>
|
||||
<file>images/library/10038.png</file>
|
||||
<file>images/library/10039.png</file>
|
||||
<file>images/library/10040.png</file>
|
||||
<file>images/library/10053.png</file>
|
||||
<file>images/library/10054.png</file>
|
||||
<file>images/library/10055.png</file>
|
||||
<file>images/library/10056.png</file>
|
||||
<file>images/library/10025.png</file>
|
||||
<file>images/library/10026.png</file>
|
||||
<file>images/library/10027.png</file>
|
||||
<file>images/library/10028.png</file>
|
||||
<file>images/library/10029.png</file>
|
||||
<file>images/library/10030.png</file>
|
||||
<file>images/library/10031.png</file>
|
||||
<file>images/library/10032.png</file>
|
||||
<file>images/library/10041.png</file>
|
||||
<file>images/library/10042.png</file>
|
||||
<file>images/library/10043.png</file>
|
||||
<file>images/library/10044.png</file>
|
||||
<file>images/library/10057.png</file>
|
||||
<file>images/library/10058.png</file>
|
||||
<file>images/library/10059.png</file>
|
||||
<file>images/library/10060.png</file>
|
||||
<file>images/library/10045.png</file>
|
||||
<file>images/library/10046.png</file>
|
||||
<file>images/library/10047.png</file>
|
||||
<file>images/library/10048.png</file>
|
||||
<file>images/library/10061.png</file>
|
||||
<file>images/library/10062.png</file>
|
||||
<file>images/library/10063.png</file>
|
||||
<file>images/library/10064.png</file>
|
||||
<file>images/library/10065.png</file>
|
||||
<file>images/library/10066.png</file>
|
||||
<file>images/library/10067.png</file>
|
||||
<file>images/library/10068.png</file>
|
||||
<file>images/library/10081.png</file>
|
||||
<file>images/library/10082.png</file>
|
||||
<file>images/library/10083.png</file>
|
||||
<file>images/library/10084.png</file>
|
||||
<file>images/library/10069.png</file>
|
||||
<file>images/library/10070.png</file>
|
||||
<file>images/library/10071.png</file>
|
||||
<file>images/library/10072.png</file>
|
||||
<file>images/library/10085.png</file>
|
||||
<file>images/library/10086.png</file>
|
||||
<file>images/library/10087.png</file>
|
||||
<file>images/library/10088.png</file>
|
||||
<file>images/library/10073.png</file>
|
||||
<file>images/library/10074.png</file>
|
||||
<file>images/library/10075.png</file>
|
||||
<file>images/library/10076.png</file>
|
||||
<file>images/library/10089.png</file>
|
||||
<file>images/library/10090.png</file>
|
||||
<file>images/library/10091.png</file>
|
||||
<file>images/library/10092.png</file>
|
||||
<file>images/library/10077.png</file>
|
||||
<file>images/library/10078.png</file>
|
||||
<file>images/library/10079.png</file>
|
||||
<file>images/library/10080.png</file>
|
||||
<file>images/library/10093.png</file>
|
||||
<file>images/library/10094.png</file>
|
||||
<file>images/library/10095.png</file>
|
||||
<file>images/library/10096.png</file>
|
||||
<file>images/library/10097.png</file>
|
||||
<file>images/library/10098.png</file>
|
||||
<file>images/library/10099.png</file>
|
||||
<file>images/library/10100.png</file>
|
||||
<file>images/library/10101.png</file>
|
||||
<file>images/library/10102.png</file>
|
||||
<file>images/library/10103.png</file>
|
||||
<file>images/library/10104.png</file>
|
||||
<file>images/library/20001.png</file>
|
||||
<file>images/library/20002.png</file>
|
||||
<file>images/library/20003.png</file>
|
||||
<file>images/library/20004.png</file>
|
||||
<file>images/library/30001.png</file>
|
||||
<file>images/library/30002.png</file>
|
||||
<file>images/library/30003.png</file>
|
||||
<file>images/library/30004.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -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) :
|
||||
@@ -29,6 +29,7 @@ compareDialog::compareDialog(QWidget *parent, GeneralSettings *gg) :
|
||||
ui(new Ui::compareDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowIcon(CompanionIcon("compare.png"));
|
||||
g_eeGeneral = gg;
|
||||
eepromInterface = GetEepromInterface();
|
||||
te = ui->textEdit;
|
||||
@@ -48,7 +49,7 @@ compareDialog::compareDialog(QWidget *parent, GeneralSettings *gg) :
|
||||
|
||||
void compareDialog::dragMoveEvent(QDragMoveEvent *event)
|
||||
{
|
||||
if (event->mimeData()->hasFormat("application/x-companion9x")) {
|
||||
if (event->mimeData()->hasFormat("application/x-companion")) {
|
||||
event->acceptProposedAction();
|
||||
} else {
|
||||
event->ignore();
|
||||
@@ -58,7 +59,7 @@ void compareDialog::dragMoveEvent(QDragMoveEvent *event)
|
||||
void compareDialog::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
// accept just text/uri-list mime format
|
||||
if (event->mimeData()->hasFormat("application/x-companion9x")) {
|
||||
if (event->mimeData()->hasFormat("application/x-companion")) {
|
||||
event->acceptProposedAction();
|
||||
} else {
|
||||
event->ignore();
|
||||
@@ -83,7 +84,6 @@ void compareDialog::printDiff()
|
||||
printCurves();
|
||||
printGvars();
|
||||
printSwitches();
|
||||
printSafetySwitches();
|
||||
printFSwitches();
|
||||
printFrSky();
|
||||
te->scrollToAnchor("1");
|
||||
@@ -95,8 +95,8 @@ void compareDialog::dropEvent(QDropEvent *event)
|
||||
const QMimeData *mimeData = event->mimeData();
|
||||
if (child) {
|
||||
if (child->objectName().contains("label_1")) {
|
||||
if(mimeData->hasFormat("application/x-companion9x")) {
|
||||
QByteArray gmData = mimeData->data("application/x-companion9x");
|
||||
if(mimeData->hasFormat("application/x-companion")) {
|
||||
QByteArray gmData = mimeData->data("application/x-companion");
|
||||
DragDropHeader *header = (DragDropHeader *)gmData.data();
|
||||
if (!header->general_settings) {
|
||||
char *gData = gmData.data()+sizeof(DragDropHeader);//new char[gmData.size() + 1];
|
||||
@@ -120,8 +120,8 @@ void compareDialog::dropEvent(QDropEvent *event)
|
||||
}
|
||||
}
|
||||
else if (child->objectName().contains("label_2")) {
|
||||
if(mimeData->hasFormat("application/x-companion9x")) {
|
||||
QByteArray gmData = mimeData->data("application/x-companion9x");
|
||||
if(mimeData->hasFormat("application/x-companion")) {
|
||||
QByteArray gmData = mimeData->data("application/x-companion");
|
||||
DragDropHeader *header = (DragDropHeader *)gmData.data();
|
||||
if (!header->general_settings) {
|
||||
char *gData = gmData.data()+sizeof(DragDropHeader);//new char[gmData.size() + 1];
|
||||
@@ -305,7 +305,7 @@ void compareDialog::printPhases()
|
||||
str.append("</b></td><td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"80\"><b>"+tr("Flight mode name"));
|
||||
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
|
||||
for (i=0; i<4; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getStickStr(i)));
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
|
||||
@@ -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%\">");
|
||||
@@ -406,7 +406,7 @@ void compareDialog::printPhases()
|
||||
str.append("</b></td><td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"80\"><b>"+tr("Flight mode name"));
|
||||
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
|
||||
for (i=0; i<4; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getStickStr(i)));
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
|
||||
@@ -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("<", "<").replace(">", ">");
|
||||
|
||||
if (GetEepromInterface()->getCapability(FlightPhases)) {
|
||||
if(ed->phases) {
|
||||
if (ed->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) {
|
||||
@@ -681,21 +682,19 @@ 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("<", "<").replace(">", ">"));
|
||||
str += "</font></td></tr>";
|
||||
}
|
||||
}
|
||||
str.append("</table></td>");
|
||||
str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+getStickStr(i)+"</b></td>");
|
||||
str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+getInputStr(*g_model2, i)+"</b></td>");
|
||||
str.append("<td width=\"45%\">");
|
||||
str.append("<table border=0 cellspacing=0 cellpadding=0>");
|
||||
for (int j=0; j<C9X_MAX_EXPOS; j++) {
|
||||
@@ -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("<", "<").replace(">", ">");
|
||||
|
||||
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("<", "<").replace(">", ">"));
|
||||
|
||||
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("<", "<").replace(">", ">"));
|
||||
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
|
||||
str += md->curve.toString().replace("<", "<").replace(">", ">");
|
||||
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("<", "<").replace(">", ">"));
|
||||
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("<", "<").replace(">", ">"));
|
||||
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);
|
||||
@@ -1049,19 +1038,19 @@ void compareDialog::printSwitches()
|
||||
int sc=0;
|
||||
QString color;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str.append("<tr><td><h2>"+tr("Custom Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(CustomSwitches); i++) {
|
||||
QString sw1 = getCustomSwitchStr(&g_model1->customSw[i], *g_model1);
|
||||
QString sw2 = getCustomSwitchStr(&g_model2->customSw[i], *g_model2);
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
QString sw1 = g_model1->customSw[i].toString(*g_model1);
|
||||
QString sw2 = g_model2->customSw[i].toString(*g_model2);
|
||||
if (!(sw1.isEmpty() && sw2.isEmpty())) {
|
||||
str.append("<tr>");
|
||||
color=getColor1(sw1,sw2);
|
||||
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw1+"</font></td>");
|
||||
if (i<9) {
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("CS")+QString("%1</b></td>").arg(i+1));
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+QString("%1</b></td>").arg(i+1));
|
||||
} else {
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("CS")+('A'+(i-9))+"</b></td>");
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+('A'+(i-9))+"</b></td>");
|
||||
}
|
||||
color=getColor2(sw1,sw2);
|
||||
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw2+"</font></td>");
|
||||
@@ -1080,7 +1069,7 @@ void compareDialog::printFSwitches()
|
||||
QString color2;
|
||||
int sc=0;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-before:always;\" width=\"100%\">";
|
||||
str.append("<tr><td><h2>"+tr("Custom Functions")+"</h2></td></tr>");
|
||||
str.append("<tr><td><h2>"+tr("Special Functions")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\"><tr>");
|
||||
str.append("<td width=\"7%\" align=\"center\"><b>"+tr("Switch")+"</b></td>");
|
||||
str.append("<td width=\"12%\" align=\"center\"><b>"+tr("Function")+"</b></td>");
|
||||
@@ -1107,8 +1096,8 @@ void compareDialog::printFSwitches()
|
||||
str.append("<tr>");
|
||||
if (g_model1->funcSw[i].swtch.type) {
|
||||
str.append(doTC(g_model1->funcSw[i].swtch.toString(),color1));
|
||||
str.append(doTC(getFuncName(g_model1->funcSw[i].func),color1));
|
||||
str.append(doTC(FuncParam(g_model1->funcSw[i].func,g_model1->funcSw[i].param,g_model1->funcSw[i].paramarm, g_model1->funcSw[i].adjustMode),color1));
|
||||
str.append(doTC(g_model1->funcSw[i].funcToString(),color1));
|
||||
str.append(doTC(g_model1->funcSw[i].paramToString(),color1));
|
||||
int index=g_model1->funcSw[i].func;
|
||||
if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
|
||||
str.append(doTC(QString("%1").arg(g_model1->funcSw[i].repeatParam),color1));
|
||||
@@ -1123,11 +1112,11 @@ void compareDialog::printFSwitches()
|
||||
} else {
|
||||
str.append("<td> </td><td> </td><td> </td><td> </td><td> </td>");
|
||||
}
|
||||
str.append(doTC(tr("CF")+QString("%1").arg(i+1),"",true));
|
||||
str.append(doTC(tr("SF")+QString("%1").arg(i+1),"",true));
|
||||
if (g_model2->funcSw[i].swtch.type) {
|
||||
str.append(doTC(g_model2->funcSw[i].swtch.toString(),color2));
|
||||
str.append(doTC(getFuncName(g_model2->funcSw[i].func),color2));
|
||||
str.append(doTC(FuncParam(g_model2->funcSw[i].func,g_model2->funcSw[i].param,g_model2->funcSw[i].paramarm, g_model2->funcSw[i].adjustMode),color2));
|
||||
str.append(doTC(g_model2->funcSw[i].funcToString(),color2));
|
||||
str.append(doTC(g_model2->funcSw[i].paramToString(),color2));
|
||||
int index=g_model2->funcSw[i].func;
|
||||
if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
|
||||
str.append(doTC(QString("%1").arg(g_model2->funcSw[i].repeatParam),color2));
|
||||
@@ -1153,55 +1142,6 @@ void compareDialog::printFSwitches()
|
||||
te->append(str);
|
||||
}
|
||||
|
||||
void compareDialog::printSafetySwitches()
|
||||
{
|
||||
QString color1;
|
||||
QString color2;
|
||||
int sc=0;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-before:always;\" width=\"100%\">";
|
||||
str.append("<tr><td><h2>"+tr("Safety Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\"><tr>");
|
||||
str.append("<td width=\"8%\" align=\"center\"><b>"+tr("Switch")+"</b></td>");
|
||||
str.append("<td width=\"37%\" align=\"center\"><b>"+tr("Value")+"</b></td>");
|
||||
str.append("<td width=\"10%\"> </td>");
|
||||
str.append("<td width=\"8%\" align=\"center\"><b>"+tr("Switch")+"</b></td>");
|
||||
str.append("<td width=\"37%\" align=\"center\"><b>"+tr("Value")+"</b></td>");
|
||||
str.append("</tr>");
|
||||
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++)
|
||||
{
|
||||
if ((g_model1->safetySw[i].swtch.type!=SWITCH_TYPE_NONE)||(g_model2->safetySw[i].swtch.type!=SWITCH_TYPE_NONE)) {
|
||||
if ((g_model1->safetySw[i].swtch!=g_model2->safetySw[i].swtch)||(g_model1->safetySw[i].val!=g_model2->safetySw[i].val)) {
|
||||
color1="green";
|
||||
color2="red";
|
||||
} else {
|
||||
color1="grey";
|
||||
color2="grey";
|
||||
}
|
||||
str.append("<tr>");
|
||||
if (g_model1->safetySw[i].swtch.type) {
|
||||
str.append(doTC(g_model1->safetySw[i].swtch.toString(),color1));
|
||||
str.append(doTC(QString::number(g_model1->safetySw[i].val),color1));
|
||||
}
|
||||
else {
|
||||
str.append("<td> </td><td> </td>");
|
||||
}
|
||||
str.append(doTC(tr("CH")+QString("%1").arg(i+1),"",true));
|
||||
if (g_model2->safetySw[i].swtch.type) {
|
||||
str.append(doTC(g_model2->safetySw[i].swtch.toString(),color2));
|
||||
str.append(doTC(QString::number(g_model2->safetySw[i].val),color2));
|
||||
} else {
|
||||
str.append("<td> </td><td> </td>");
|
||||
}
|
||||
str.append("</tr>");
|
||||
sc++;
|
||||
}
|
||||
}
|
||||
str.append("</table></td></tr></table>");
|
||||
str.append("<br>");
|
||||
if (sc!=0)
|
||||
te->append(str);
|
||||
}
|
||||
|
||||
void compareDialog::printFrSky()
|
||||
{
|
||||
QString color;
|
||||
@@ -1271,6 +1211,7 @@ void compareDialog::printFrSky()
|
||||
color=getColor1(fd1->rssiAlarms[1].value,fd2->rssiAlarms[1].value);
|
||||
str.append("<td align=\"center\"><font color="+color+">"+QString::number(fd1->rssiAlarms[1].value,10)+"</td>");
|
||||
str.append("</table>");
|
||||
#if 0
|
||||
if (GetEepromInterface()->getCapability(TelemetryBars) || GetEepromInterface()->getCapability(TelemetryCSFields)) {
|
||||
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields);
|
||||
if (cols==0) cols=2;
|
||||
@@ -1311,13 +1252,13 @@ void compareDialog::printFrSky()
|
||||
if (fd1->screens[0].type==fd2->screens[0].type)
|
||||
color=getColor1(fd1->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].source);
|
||||
str.append("<td align=\"Center\"><font color="+color+">"+getFrSkySrc(fd1->screens[0].body.bars[i].source)+"</font></td>");
|
||||
value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
|
||||
value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
|
||||
// TODO value1 = getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
|
||||
// TODO value2 = getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
|
||||
if (fd1->screens[0].type==fd2->screens[0].type)
|
||||
color=getColor1(value1,value2);
|
||||
str.append("<td align=\"Right\"><font color="+color+">"+QString::number(value1)+"</td>");
|
||||
value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
|
||||
value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
|
||||
// TODO value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
|
||||
// TODO value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
|
||||
if (fd1->screens[0].type==fd2->screens[0].type)
|
||||
color=getColor1(value1,value2);
|
||||
str.append("<td align=\"Right\"><font color="+color+">"+QString::number(value1)+"</td></tr>");
|
||||
@@ -1326,6 +1267,7 @@ void compareDialog::printFrSky()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
str.append("</td><td width=\"50%\">");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
@@ -1388,7 +1330,7 @@ void compareDialog::printFrSky()
|
||||
color=getColor2(fd1->rssiAlarms[1].value,fd2->rssiAlarms[1].value);
|
||||
str.append("<td align=\"center\"><font color="+color+">"+QString::number(fd2->rssiAlarms[1].value,10)+"</td>");
|
||||
str.append("</table></br>");
|
||||
|
||||
#if 0
|
||||
if (GetEepromInterface()->getCapability(TelemetryBars) || GetEepromInterface()->getCapability(TelemetryCSFields)) {
|
||||
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields);
|
||||
if (cols==0) cols=2;
|
||||
@@ -1429,13 +1371,13 @@ void compareDialog::printFrSky()
|
||||
if (fd1->screens[0].type==fd2->screens[0].type)
|
||||
color=getColor2(fd1->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].source);
|
||||
str.append("<td align=\"Center\"><font color="+color+">"+getFrSkySrc(fd2->screens[0].body.bars[i].source)+"</font></td>");
|
||||
value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
|
||||
value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
|
||||
// TODO value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
|
||||
// TODO value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
|
||||
if (fd1->screens[0].type==fd2->screens[0].type)
|
||||
color=getColor2(value1,value2);
|
||||
str.append("<td align=\"Right\"><font color="+color+">"+QString::number(value2)+"</font></td>");
|
||||
value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
|
||||
value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
|
||||
// TODO value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
|
||||
// TODO value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
|
||||
if (fd1->screens[0].type==fd2->screens[0].type)
|
||||
color=getColor2(value1,value2);
|
||||
str.append("<td align=\"Right\"><font color="+color+">"+QString::number(value2)+"</font></td></tr>");
|
||||
@@ -1444,6 +1386,7 @@ void compareDialog::printFrSky()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
str.append("</td></tr></table>");
|
||||
te->append(str);
|
||||
}
|
||||
|
||||
@@ -26,11 +26,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<normaloff>:/images/print.png</normaloff>:/images/print.png</iconset>
|
||||
<string>Compare Models</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
@@ -129,7 +125,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "contributorsdialog.h"
|
||||
#include "ui_contributorsdialog.h"
|
||||
#include <QtGui>
|
||||
#define CLINESEP "=====================================================\n"
|
||||
#include "helpers.h"
|
||||
|
||||
contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
@@ -9,44 +9,92 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
|
||||
{
|
||||
ui->setupUi(this);
|
||||
switch (contest) {
|
||||
case 0: {
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
ui->textBrowser->insertPlainText(tr("People who have contributed to this project")+"\n");
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
QFile file(":/contributors");
|
||||
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
ui->textBrowser->insertPlainText(file.readAll());
|
||||
case 0:
|
||||
{
|
||||
this->setWindowIcon(CompanionIcon("contributors.png"));
|
||||
QFile file(":/DONATIONS.txt");
|
||||
QString str;
|
||||
str.append("<html><head>");
|
||||
str.append("<style type=\"text/css\">\n");
|
||||
str.append(".mycss\n{\nfont-weight:normal;\ncolor:#000000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append(".mycssb\n{\nfont-weight:bold;\ncolor:#C00000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append(".myhead\n{\nfont-weight:bold;\ncolor:#000000;font-size:14px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append("</style>\n</head><body class=\"mycss\"><table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
str.append("<tr><td class=\"myhead\">"+tr("People who have contributed to this project")+"</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
int columns=6;
|
||||
float cwidth=100.0/columns;
|
||||
while (!file.atEnd()) {
|
||||
str.append("<tr>");
|
||||
for (int i=0; i<columns; i++) {
|
||||
str.append(QString("<td width=\"%1%\" ").arg(cwidth));
|
||||
if (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
if (line.contains("monthly") || line.contains("mensual")) {
|
||||
str.append("class=\"mycssb\">");
|
||||
} else {
|
||||
str.append("class=\"mycss\">");
|
||||
}
|
||||
str.append(line.trimmed()+"</td>");
|
||||
} else {
|
||||
str.append("class=\"mycss\"> </td>");
|
||||
}
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
ui->textBrowser->insertPlainText("\n");
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
ui->textBrowser->insertPlainText(tr("Coders")+"\n");
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
QFile file2(":/coders");
|
||||
str.append("</table>");
|
||||
QFile file2(":/CREDITS.txt");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
str.append("<tr><td class=\"mycss\"> </td></tr>");
|
||||
str.append("<tr><td class=\"myhead\">"+tr("Coders")+"</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
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("\n\n");
|
||||
ui->textBrowser->insertPlainText(tr("Thank you all !!!"));
|
||||
ui->textBrowser->setReadOnly(true);
|
||||
ui->textBrowser->verticalScrollBar()->setValue(0);
|
||||
this->setWindowTitle(tr("Contributors"));
|
||||
while (!file2.atEnd()) {
|
||||
str.append("<tr>");
|
||||
for (int i=0; i<3; i++) {
|
||||
str.append("<td width=\"33.33%\" class=\"mycss\">");
|
||||
if (!file2.atEnd()) {
|
||||
QByteArray line = file2.readLine();
|
||||
str.append(line.trimmed());
|
||||
} else {
|
||||
str.append(" ");
|
||||
}
|
||||
str.append("</td>");
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
str.append("<tr><td class=\"mycss\"> </td></tr>");
|
||||
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>");
|
||||
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Thank you all !!!") + "</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("</body></html>");
|
||||
ui->textEditor->setHtml(str);
|
||||
ui->textEditor->scroll(0, 0);
|
||||
setWindowTitle(tr("Contributors"));
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:{
|
||||
QFile file(":/releasenotes");
|
||||
case 1:
|
||||
{
|
||||
this->setWindowIcon(CompanionIcon("changelog.png"));
|
||||
QFile file(":/releasenotes.txt");
|
||||
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
ui->textBrowser->insertHtml(file.readAll());
|
||||
}
|
||||
ui->textBrowser->setReadOnly(true);
|
||||
ui->textBrowser->verticalScrollBar()->setValue(0);
|
||||
this->setWindowTitle(tr("Companion9x Release Notes"));
|
||||
ui->textEditor->setHtml(file.readAll());
|
||||
}
|
||||
ui->textEditor->scroll(0,0);
|
||||
setWindowTitle(tr("Companion Release Notes"));
|
||||
break;
|
||||
case 2:{
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
if (!rnurl.isEmpty()) {
|
||||
this->setWindowIcon(CompanionIcon("changelog.png"));
|
||||
this->setWindowTitle(tr("OpenTX Release Notes"));
|
||||
manager = new QNetworkAccessManager(this);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
|
||||
@@ -54,7 +102,8 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
|
||||
QNetworkRequest request(url);
|
||||
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
|
||||
manager->get(request);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
}
|
||||
break;
|
||||
@@ -64,7 +113,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
|
||||
|
||||
void contributorsDialog::showEvent ( QShowEvent * )
|
||||
{
|
||||
ui->textBrowser->verticalScrollBar()->setValue(0);
|
||||
ui->textEditor->scroll(0, 0);
|
||||
}
|
||||
|
||||
contributorsDialog::~contributorsDialog()
|
||||
@@ -74,9 +123,10 @@ contributorsDialog::~contributorsDialog()
|
||||
|
||||
void contributorsDialog::replyFinished(QNetworkReply * reply)
|
||||
{
|
||||
ui->textBrowser->insertHtml(reply->readAll());
|
||||
ui->textEditor->setHtml(reply->readAll());
|
||||
}
|
||||
|
||||
void contributorsDialog::forceClose() {
|
||||
void contributorsDialog::forceClose()
|
||||
{
|
||||
accept();;
|
||||
}
|
||||
|
||||
@@ -6,25 +6,21 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>926</width>
|
||||
<height>333</height>
|
||||
<width>788</width>
|
||||
<height>528</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextBrowser" name="textBrowser"/>
|
||||
<widget class="QTextEdit" name="textEditor"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -2,186 +2,268 @@
|
||||
#include "ui_customizesplashdialog.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
#include "burndialog.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "flashinterface.h"
|
||||
|
||||
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::customizeSplashDialog) {
|
||||
ui->setupUi(this);
|
||||
ui->HowToLabel->clear();
|
||||
ui->HowToLabel->append("<center>" + tr("Select an original firmware file") + "</center>");
|
||||
//*** Side Class ***
|
||||
|
||||
Side::Side(){
|
||||
imageLabel = 0;
|
||||
fileNameEdit = 0;
|
||||
saveButton = 0;
|
||||
loadFwButton=0;
|
||||
loadPictButton = 0;
|
||||
loadProfileButton = 0;
|
||||
saveToFileName = new QString("");
|
||||
source = new Source(UNDEFINED);
|
||||
format = new LCDFormat(LCDTARANIS);
|
||||
}
|
||||
|
||||
customizeSplashDialog::~customizeSplashDialog() {
|
||||
void Side::markSourceButton()
|
||||
{
|
||||
loadFwButton->setChecked(*source == FW ? true : false );
|
||||
loadPictButton->setChecked(*source == PICT ? true : false );
|
||||
loadProfileButton->setChecked(*source == PROFILE ? true : false );
|
||||
}
|
||||
|
||||
void Side::copyImage( Side side )
|
||||
{
|
||||
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
|
||||
imageLabel->setPixmap(*side.imageLabel->pixmap());
|
||||
}
|
||||
|
||||
bool Side::displayImage( QString fileName, Source pictSource )
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
|
||||
// Determine which picture format to use
|
||||
if (pictSource == FW ){
|
||||
FlashInterface flash(fileName);
|
||||
if (!flash.hasSplash())
|
||||
return false;
|
||||
else
|
||||
image = flash.getSplash();
|
||||
*format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
|
||||
}
|
||||
else {
|
||||
image.load(fileName);
|
||||
if (pictSource== PICT)
|
||||
*format = image.width()>WIDTH_9X ? LCDTARANIS : LCD9X;
|
||||
else if (pictSource == PROFILE)
|
||||
*format = (g.profile[g.id()].fwType().contains("taranis")) ? LCDTARANIS : LCD9X;
|
||||
}
|
||||
if (image.isNull()) {
|
||||
return false;
|
||||
}
|
||||
// Load image
|
||||
if (*format==LCDTARANIS) {
|
||||
imageLabel->setPixmap( makePixMap( image, "taranis" ));
|
||||
imageLabel->setFixedSize(WIDTH_TARANIS*2, HEIGHT_TARANIS*2);
|
||||
}
|
||||
else {
|
||||
imageLabel->setPixmap( makePixMap( image, "9x" ));
|
||||
imageLabel->setFixedSize(WIDTH_9X*2, HEIGHT_9X*2);
|
||||
}
|
||||
|
||||
switch (pictSource){
|
||||
case FW:
|
||||
fileNameEdit->setText(QObject::tr("FW: %1").arg(fileName));
|
||||
*saveToFileName = fileName;
|
||||
*source=FW;
|
||||
break;
|
||||
case PICT:
|
||||
fileNameEdit->setText(QObject::tr("Pict: %1").arg(fileName));
|
||||
*saveToFileName = fileName;
|
||||
*source=PICT;
|
||||
break;
|
||||
case PROFILE:
|
||||
fileNameEdit->setText(QObject::tr("Profile image"));
|
||||
*saveToFileName = fileName;
|
||||
*source=PROFILE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
saveButton->setEnabled(true);
|
||||
libraryButton->setEnabled(true);
|
||||
invertButton->setEnabled(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Side::refreshImage()
|
||||
{
|
||||
return displayImage( *saveToFileName, *source );
|
||||
}
|
||||
|
||||
bool Side::saveImage()
|
||||
{
|
||||
if (*source == FW )
|
||||
{
|
||||
FlashInterface flash(*saveToFileName);
|
||||
if (!flash.hasSplash()) {
|
||||
return false;
|
||||
}
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
|
||||
if (flash.setSplash(image) && (flash.saveFlash(*saveToFileName) > 0)) {
|
||||
g.flashDir( QFileInfo(*saveToFileName).dir().absolutePath() );
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (*source == PICT) {
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
||||
if (image.save(*saveToFileName)) {
|
||||
g.imagesDir( QFileInfo(*saveToFileName).dir().absolutePath() );
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (*source == PROFILE) {
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
||||
if (!image.save(*saveToFileName)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//*** customizeSplashDialog Class ***
|
||||
|
||||
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::customizeSplashDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("paintbrush.png"));
|
||||
ui->leftLibraryButton->setIcon(CompanionIcon("library.png"));
|
||||
ui->rightLibraryButton->setIcon(CompanionIcon("library.png"));
|
||||
|
||||
left.imageLabel = ui->leftImageLabel;
|
||||
right.imageLabel = ui->rightImageLabel;
|
||||
left.fileNameEdit = ui->leftFileNameEdit;
|
||||
right.fileNameEdit = ui->rightFileNameEdit;
|
||||
left.saveButton = ui->leftSaveButton;
|
||||
right.saveButton = ui->rightSaveButton;
|
||||
left.libraryButton = ui->leftLibraryButton;
|
||||
right.libraryButton = ui->rightLibraryButton;
|
||||
left.invertButton = ui->leftInvertButton;
|
||||
right.invertButton = ui->rightInvertButton;
|
||||
|
||||
left.loadFwButton = ui->leftLoadFwButton;
|
||||
right.loadFwButton = ui->rightLoadFwButton;
|
||||
left.loadPictButton = ui->leftLoadPictButton;
|
||||
right.loadPictButton = ui->rightLoadPictButton;
|
||||
left.loadProfileButton = ui->leftLoadProfileButton;
|
||||
right.loadProfileButton = ui->rightLoadProfileButton;
|
||||
|
||||
loadProfile(left);
|
||||
left.markSourceButton();
|
||||
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
customizeSplashDialog::~customizeSplashDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_FlashLoadButton_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
ui->ImageLoadButton->setDisabled(true);
|
||||
ui->libraryButton->setDisabled(true);
|
||||
ui->SaveFlashButton->setDisabled(true);
|
||||
ui->SaveImageButton->setDisabled(true);
|
||||
ui->ImageFileName->clear();
|
||||
ui->imageLabel->clear();
|
||||
ui->HowToLabel->clear();
|
||||
ui->HowToLabel->setStyleSheet("background:rgb(255, 255, 0)");
|
||||
fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER);
|
||||
QFile file(fileName);
|
||||
if (!file.exists()) {
|
||||
ui->FWFileName->clear();
|
||||
ui->HowToLabel->append("<center>" + tr("Select an original firmware file") + "</center>");
|
||||
return;
|
||||
}
|
||||
if (fileName.isEmpty()) {
|
||||
ui->FWFileName->clear();
|
||||
ui->HowToLabel->append("<center>" + tr("Select an original firmware file") + "</center>");
|
||||
return;
|
||||
}
|
||||
|
||||
ui->FWFileName->setText(fileName);
|
||||
FlashInterface flash(fileName);
|
||||
if (flash.hasSplash()) {
|
||||
ui->HowToLabel->append("<center>" + tr("Select an image to customize your splash <br />or save actual firmware splash") + "</center>");
|
||||
ui->ImageLoadButton->setEnabled(true);
|
||||
ui->libraryButton->setEnabled(true);
|
||||
ui->SaveImageButton->setEnabled(true);
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(flash.getSplash()));
|
||||
ui->imageLabel->setFixedSize(flash.getSplashWidth()*2,flash.getSplashHeight()*2);
|
||||
} else {
|
||||
QMessageBox::information(this, tr("Error"), tr("Could not find bitmap to replace in file"));
|
||||
return;
|
||||
}
|
||||
settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath());
|
||||
void customizeSplashDialog::on_copyRightToLeftButton_clicked() {
|
||||
left.copyImage(right);
|
||||
}
|
||||
void customizeSplashDialog::on_copyLeftToRightButton_clicked() {
|
||||
right.copyImage(left);
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_ImageLoadButton_clicked() {
|
||||
|
||||
void customizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);}
|
||||
void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
|
||||
void customizeSplashDialog::loadFirmware(Side side)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||
if (!fileName.isEmpty()) {
|
||||
if (!side.displayImage( fileName, FW ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can not load embedded image from firmware file %1.").arg(fileName));
|
||||
else
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
}
|
||||
side.markSourceButton();
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);}
|
||||
void customizeSplashDialog::on_rightLoadPictButton_clicked() {loadPicture(right);}
|
||||
void customizeSplashDialog::loadPicture(Side side)
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
||||
return;
|
||||
}
|
||||
ui->HowToLabel->clear();
|
||||
ui->ImageFileName->setText(fileName);
|
||||
if (ui->imageLabel->width()==424) {
|
||||
image=image.convertToFormat(QImage::Format_RGB32);
|
||||
QRgb col;
|
||||
int gray;
|
||||
int width = image.width();
|
||||
int height = image.height();
|
||||
for (int i = 0; i < width; ++i)
|
||||
{
|
||||
for (int j = 0; j < height; ++j)
|
||||
{
|
||||
col = image.pixel(i, j);
|
||||
gray = qGray(col);
|
||||
image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||
}
|
||||
}
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width()/2, ui->imageLabel->height()/2)));
|
||||
} else {
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width()/2, ui->imageLabel->height()/2).convertToFormat(QImage::Format_Mono)));
|
||||
}
|
||||
ui->SaveFlashButton->setEnabled(true);
|
||||
ui->HowToLabel->append("<center>" + tr("Save your custimized firmware") + "</center>");
|
||||
if (!side.displayImage( fileName, PICT ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load the image file %1.").arg(fileName));
|
||||
else
|
||||
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
}
|
||||
side.markSourceButton();
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_libraryButton_clicked() {
|
||||
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
|
||||
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
|
||||
void customizeSplashDialog::loadProfile(Side side)
|
||||
{
|
||||
QString fileName=g.profile[g.id()].splashFile();
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
if (!side.displayImage( fileName, PROFILE ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load the profile image %1.").arg(fileName));
|
||||
}
|
||||
side.markSourceButton();
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
|
||||
void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicked(right);}
|
||||
void customizeSplashDialog::libraryButton_clicked( Side side )
|
||||
{
|
||||
QString fileName;
|
||||
|
||||
splashLibrary *ld = new splashLibrary(this,&fileName);
|
||||
ld->exec();
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
||||
return;
|
||||
}
|
||||
ui->HowToLabel->clear();
|
||||
ui->ImageFileName->setText(fileName);
|
||||
if (ui->imageLabel->width()==424) {
|
||||
image=image.convertToFormat(QImage::Format_RGB32);
|
||||
QRgb col;
|
||||
int gray;
|
||||
int width = image.width();
|
||||
int height = image.height();
|
||||
for (int i = 0; i < width; ++i)
|
||||
{
|
||||
for (int j = 0; j < height; ++j)
|
||||
{
|
||||
col = image.pixel(i, j);
|
||||
gray = qGray(col);
|
||||
image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||
}
|
||||
}
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width()/2, ui->imageLabel->height()/2)));
|
||||
} else {
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(ui->imageLabel->width()/2, ui->imageLabel->height()/2).convertToFormat(QImage::Format_Mono)));
|
||||
}
|
||||
ui->SaveFlashButton->setEnabled(true);
|
||||
ui->HowToLabel->append("<center>" + tr("Save your custimized firmware") + "</center>");
|
||||
if (!side.displayImage( fileName, UNDEFINED ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load the library image %1.").arg(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_SaveFlashButton_clicked()
|
||||
void customizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
|
||||
void customizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
|
||||
void customizeSplashDialog::saveButton_clicked( Side side )
|
||||
{
|
||||
QString fileName;
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
ui->HowToLabel->clear();
|
||||
fileName = QFileDialog::getSaveFileName(this, tr("Write to file"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER, 0, QFileDialog::DontConfirmOverwrite);
|
||||
if (fileName.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
FlashInterface flash(ui->FWFileName->text());
|
||||
if (!flash.hasSplash()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Error reading file %1").arg(fileName));
|
||||
return;
|
||||
}
|
||||
settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath());
|
||||
QImage image = ui->imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
|
||||
flash.setSplash(image);
|
||||
if (flash.saveFlash(fileName) > 0) {
|
||||
ui->HowToLabel->setStyleSheet("background:rgb(0,255.0);");
|
||||
ui->HowToLabel->append("<center>" + tr("Firmware correctly saved.") + "</center>");
|
||||
} else {
|
||||
ui->HowToLabel->setStyleSheet("background:rgb(255.0.0);");
|
||||
ui->HowToLabel->append("<center>" + tr("Firmware not saved.") + "</center>");
|
||||
if (side.saveImage()){
|
||||
QMessageBox::information(this, tr("File Saved"), tr("The image was saved to the file %1").arg(*side.saveToFileName));
|
||||
if ( !side.refreshImage()){
|
||||
QMessageBox::critical(this, tr("Image Refresh Error"), tr("Failed to refresh image from file %1").arg(*side.saveToFileName));
|
||||
}
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(this, tr("File Save Error"), tr("Failed to write image to %1").arg(*side.saveToFileName));
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_InvertColorButton_clicked()
|
||||
void customizeSplashDialog::on_leftInvertButton_clicked(){invertButton_clicked(left);}
|
||||
void customizeSplashDialog::on_rightInvertButton_clicked(){invertButton_clicked(right);}
|
||||
void customizeSplashDialog::invertButton_clicked(Side side)
|
||||
{
|
||||
QImage image = ui->imageLabel->pixmap()->toImage();
|
||||
QImage image = side.imageLabel->pixmap()->toImage();
|
||||
image.invertPixels();
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(image));
|
||||
side.imageLabel->setPixmap(QPixmap::fromImage(image));
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_SaveImageButton_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
|
||||
fileName = QFileDialog::getSaveFileName(this, tr("Write to file"), settings.value("lastImagesDir").toString(), tr("PNG images (*.png);;"), 0, QFileDialog::DontConfirmOverwrite);
|
||||
if (!fileName.isEmpty()) {
|
||||
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
||||
QImage image = ui->imageLabel->pixmap()->toImage().scaled(ui->imageLabel->width()/2, ui->imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
||||
image.save(fileName, "PNG");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,24 +10,78 @@ namespace Ui
|
||||
class customizeSplashDialog;
|
||||
}
|
||||
|
||||
const int WIDTH_TARANIS = 212;
|
||||
const int HEIGHT_TARANIS = 64;
|
||||
const int WIDTH_9X = 128;
|
||||
const int HEIGHT_9X = 64;
|
||||
|
||||
enum Source {FW, PICT, PROFILE, UNDEFINED};
|
||||
enum LCDFormat {LCD9X, LCDTARANIS};
|
||||
|
||||
class Side
|
||||
{
|
||||
public:
|
||||
Side();
|
||||
void markSourceButton();
|
||||
void copyImage( Side );
|
||||
bool displayImage( QString fileName, Source source );
|
||||
bool saveImage();
|
||||
bool refreshImage();
|
||||
|
||||
QLabel *imageLabel;
|
||||
QLineEdit *fileNameEdit;
|
||||
QPushButton *saveButton;
|
||||
QPushButton *invertButton;
|
||||
QToolButton *libraryButton;
|
||||
QPushButton *loadFwButton;
|
||||
QPushButton *loadPictButton;
|
||||
QPushButton *loadProfileButton;
|
||||
|
||||
QString *saveToFileName;
|
||||
|
||||
private:
|
||||
Source *source;
|
||||
LCDFormat *format;
|
||||
};
|
||||
|
||||
class customizeSplashDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Side left;
|
||||
Side right;
|
||||
|
||||
public:
|
||||
explicit customizeSplashDialog(QWidget *parent = 0);
|
||||
~customizeSplashDialog();
|
||||
|
||||
private slots:
|
||||
void on_FlashLoadButton_clicked();
|
||||
void on_ImageLoadButton_clicked();
|
||||
void on_libraryButton_clicked();
|
||||
void on_SaveFlashButton_clicked();
|
||||
void on_InvertColorButton_clicked();
|
||||
void on_SaveImageButton_clicked();
|
||||
void on_leftLoadFwButton_clicked();
|
||||
void on_leftLoadPictButton_clicked();
|
||||
void on_leftLoadProfileButton_clicked();
|
||||
void on_leftLibraryButton_clicked();
|
||||
void on_leftSaveButton_clicked();
|
||||
void on_leftInvertButton_clicked();
|
||||
|
||||
void on_rightLoadFwButton_clicked();
|
||||
void on_rightLoadPictButton_clicked();
|
||||
void on_rightLoadProfileButton_clicked();
|
||||
void on_rightLibraryButton_clicked();
|
||||
void on_rightSaveButton_clicked();
|
||||
void on_rightInvertButton_clicked();
|
||||
|
||||
void on_copyRightToLeftButton_clicked();
|
||||
void on_copyLeftToRightButton_clicked();
|
||||
|
||||
private:
|
||||
void loadFirmware( Side );
|
||||
void loadPicture( Side );
|
||||
void loadProfile( Side );
|
||||
void libraryButton_clicked( Side );
|
||||
void saveButton_clicked( Side );
|
||||
void invertButton_clicked( Side );
|
||||
|
||||
Ui::customizeSplashDialog *ui;
|
||||
enum sideEnum { LEFT, RIGHT };
|
||||
};
|
||||
|
||||
#endif // CUSTOMIZESPLASHDIALOG_H
|
||||
|
||||
@@ -2,88 +2,519 @@
|
||||
<ui version="4.0">
|
||||
<class>customizeSplashDialog</class>
|
||||
<widget class="QDialog" name="customizeSplashDialog">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>366</width>
|
||||
<height>303</height>
|
||||
<width>1087</width>
|
||||
<height>298</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Customize Splash</string>
|
||||
<string>Transmitter Splash Screen Editor</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>:/images/c_home.png</normaloff>:/images/c_home.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>256</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="companion9x.qrc">:/images/customize.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
<widget class="Line" name="line_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="SaveImageButton">
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leftFileNameEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>426</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="leftImageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save Image</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftInvertButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Invert</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="leftLibraryButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open Splash Library</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftLoadProfileButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftLoadFwButton">
|
||||
<property name="text">
|
||||
<string>Load FW</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftLoadPictButton">
|
||||
<property name="text">
|
||||
<string>Load Pict</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftSaveButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QToolButton" name="copyRightToLeftButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::LeftArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="copyLeftToRightButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::RightArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="Line" name="line_14">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="rightFileNameEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>426</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="rightImageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightInvertButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Invert</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -101,170 +532,136 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="InvertColorButton">
|
||||
<widget class="QToolButton" name="rightLibraryButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open Splash Library</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Invert Color</string>
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightLoadProfileButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightLoadFwButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load FW</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightLoadPictButton">
|
||||
<property name="text">
|
||||
<string>Load Pict</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightSaveButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTextEdit" name="HowToLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:rgb(255, 255, 0);</string>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="acceptRichText">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="FWFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QPushButton" name="FlashLoadButton">
|
||||
<property name="text">
|
||||
<string>Load Firmware</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="ImageFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="ImageLoadButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="libraryButton">
|
||||
<property name="toolTip">
|
||||
<string>Open Splash Library</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<normaloff>:/images/library.png</normaloff>:/images/library.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>208</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QPushButton" name="SaveFlashButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save Firmware</string>
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>leftFileNameEdit</tabstop>
|
||||
<tabstop>leftInvertButton</tabstop>
|
||||
<tabstop>leftLibraryButton</tabstop>
|
||||
<tabstop>leftLoadProfileButton</tabstop>
|
||||
<tabstop>leftLoadFwButton</tabstop>
|
||||
<tabstop>leftLoadPictButton</tabstop>
|
||||
<tabstop>leftSaveButton</tabstop>
|
||||
<tabstop>copyLeftToRightButton</tabstop>
|
||||
<tabstop>copyRightToLeftButton</tabstop>
|
||||
<tabstop>rightFileNameEdit</tabstop>
|
||||
<tabstop>rightInvertButton</tabstop>
|
||||
<tabstop>rightLibraryButton</tabstop>
|
||||
<tabstop>rightLoadProfileButton</tabstop>
|
||||
<tabstop>rightLoadFwButton</tabstop>
|
||||
<tabstop>rightLoadPictButton</tabstop>
|
||||
<tabstop>rightSaveButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#include "ui_downloaddialog.h"
|
||||
#include <QMessageBox>
|
||||
#include <QtGui>
|
||||
#include <QTime>
|
||||
#include "helpers.h"
|
||||
|
||||
downloadDialog::downloadDialog(QWidget *parent, QString src, QString tgt) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::downloadDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
this->setWindowIcon(CompanionIcon("fwpreferences.png"));
|
||||
ui->progressBar->setValue(1);
|
||||
ui->progressBar->setMinimum(0);
|
||||
ui->progressBar->setMaximum(0);
|
||||
@@ -21,7 +23,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 +53,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;
|
||||
@@ -86,3 +88,14 @@ void downloadDialog::fileError()
|
||||
file = 0;
|
||||
reject();
|
||||
}
|
||||
|
||||
void downloadDialog::closeEvent( QCloseEvent * event)
|
||||
{
|
||||
// Delay closing 2 seconds to avoid unpleasant flashing download dialogs
|
||||
QTime closeTime= QTime::currentTime().addSecs(2);
|
||||
while( QTime::currentTime() < closeTime )
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ private slots:
|
||||
void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
|
||||
|
||||
private:
|
||||
void closeEvent( QCloseEvent * event);
|
||||
Ui::downloadDialog *ui;
|
||||
|
||||
QNetworkAccessManager qnam;
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Downloading: </string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
@@ -51,7 +47,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -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))
|
||||
@@ -90,6 +93,17 @@ class DataField {
|
||||
const char *name;
|
||||
};
|
||||
|
||||
class ProxyField: public DataField {
|
||||
public:
|
||||
ProxyField():
|
||||
DataField("Proxy")
|
||||
{
|
||||
}
|
||||
|
||||
virtual DataField * getField() = 0;
|
||||
|
||||
};
|
||||
|
||||
template<int N>
|
||||
class UnsignedField: public DataField {
|
||||
public:
|
||||
@@ -270,9 +284,10 @@ class SpareBitsField: public UnsignedField<N> {
|
||||
template<int N>
|
||||
class CharField: public DataField {
|
||||
public:
|
||||
CharField(char *field):
|
||||
CharField(char *field, bool truncate=true):
|
||||
DataField("Char"),
|
||||
field(field)
|
||||
field(field),
|
||||
truncate(truncate)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -280,7 +295,7 @@ class CharField: public DataField {
|
||||
{
|
||||
output.resize(N*8);
|
||||
int b = 0;
|
||||
int len = strlen(field);
|
||||
int len = truncate ? strlen(field) : N;
|
||||
for (int i=0; i<N; i++) {
|
||||
int idx = (i>=len ? 0 : field[i]);
|
||||
for (int j=0; j<8; j++, b++) {
|
||||
@@ -310,6 +325,7 @@ class CharField: public DataField {
|
||||
|
||||
protected:
|
||||
char * field;
|
||||
bool truncate;
|
||||
};
|
||||
|
||||
int8_t char2idx(char c);
|
||||
@@ -422,7 +438,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 +563,7 @@ class ConversionField: public TransformedField {
|
||||
_field(0),
|
||||
table(table),
|
||||
shift(0),
|
||||
scale(1),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX),
|
||||
exportFunc(NULL),
|
||||
@@ -562,6 +579,7 @@ class ConversionField: public TransformedField {
|
||||
_field(0),
|
||||
table(table),
|
||||
shift(0),
|
||||
scale(0),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX),
|
||||
exportFunc(NULL),
|
||||
@@ -577,6 +595,7 @@ class ConversionField: public TransformedField {
|
||||
_field(0),
|
||||
table(NULL),
|
||||
shift(0),
|
||||
scale(0),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX),
|
||||
exportFunc(exportFunc),
|
||||
@@ -585,13 +604,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 +620,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,33 +638,49 @@ class ConversionField: public TransformedField {
|
||||
|
||||
virtual void beforeExport()
|
||||
{
|
||||
_field = field;
|
||||
|
||||
if (scale) {
|
||||
_field /= scale;
|
||||
}
|
||||
|
||||
if (table) {
|
||||
if (table->exportValue(field, _field))
|
||||
if (table->exportValue(_field, _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 (shift) {
|
||||
if (_field < min) _field = min + shift;
|
||||
else if (_field > max) _field = max + shift;
|
||||
else _field += shift;
|
||||
}
|
||||
else {
|
||||
_field = exportFunc(field);
|
||||
|
||||
if (exportFunc) {
|
||||
_field = exportFunc(_field);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
field = _field;
|
||||
|
||||
if (table) {
|
||||
if (table->importValue(_field, field))
|
||||
if (table->importValue(field, field))
|
||||
return;
|
||||
}
|
||||
else if (shift) {
|
||||
field = _field - shift;
|
||||
|
||||
if (shift) {
|
||||
field -= shift;
|
||||
}
|
||||
else {
|
||||
field = importFunc(_field);
|
||||
|
||||
if (importFunc) {
|
||||
field = importFunc(field);
|
||||
}
|
||||
|
||||
if (scale) {
|
||||
field *= scale;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,6 +690,7 @@ class ConversionField: public TransformedField {
|
||||
int _field;
|
||||
ConversionTable * table;
|
||||
int shift;
|
||||
int scale;
|
||||
int min;
|
||||
int max;
|
||||
int (*exportFunc)(int);
|
||||
|
||||
@@ -44,14 +44,18 @@ 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_9X(board) (board==BOARD_STOCK || board==BOARD_M128)
|
||||
#define IS_STOCK(board) (board==BOARD_STOCK)
|
||||
#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,17 +63,18 @@ 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 NUM_SAFETY_CHNOUT 16
|
||||
#define C9X_MAX_INPUTS 32
|
||||
#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 C9X_NUM_CHNOUT 32 // number of real output channels
|
||||
#define C9X_NUM_CSW 32 // number of custom switches
|
||||
#define C9X_MAX_CUSTOM_FUNCTIONS 32 // number of functions assigned to switches
|
||||
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
|
||||
#define C9X_NUM_MODULES 2
|
||||
|
||||
#define STK_RUD 1
|
||||
@@ -101,11 +106,17 @@ const uint8_t modn12x3[4][4]= {
|
||||
#define DSW_SG1 19
|
||||
#define DSW_SG2 20
|
||||
|
||||
const uint8_t chout_ar[] = { //First number is 0..23 -> template setup, Second is relevant channel out
|
||||
1,2,3,4 , 1,2,4,3 , 1,3,2,4 , 1,3,4,2 , 1,4,2,3 , 1,4,3,2,
|
||||
2,1,3,4 , 2,1,4,3 , 2,3,1,4 , 2,3,4,1 , 2,4,1,3 , 2,4,3,1,
|
||||
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 {
|
||||
@@ -129,44 +140,6 @@ enum EnumKeys {
|
||||
#endif
|
||||
};
|
||||
|
||||
enum CSFunction {
|
||||
CS_FN_OFF,
|
||||
CS_FN_VPOS,
|
||||
CS_FN_VNEG,
|
||||
CS_FN_APOS,
|
||||
CS_FN_ANEG,
|
||||
CS_FN_AND,
|
||||
CS_FN_OR,
|
||||
CS_FN_XOR,
|
||||
CS_FN_EQUAL,
|
||||
CS_FN_NEQUAL,
|
||||
CS_FN_GREATER,
|
||||
CS_FN_LESS,
|
||||
CS_FN_EGREATER,
|
||||
CS_FN_ELESS,
|
||||
CS_FN_DPOS,
|
||||
CS_FN_DAPOS,
|
||||
CS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
CS_FN_TIM,
|
||||
CS_FN_MAXF
|
||||
};
|
||||
|
||||
enum CSFunctionFamily {
|
||||
CS_FAMILY_VOFS,
|
||||
CS_FAMILY_VBOOL,
|
||||
CS_FAMILY_VCOMP,
|
||||
CS_FAMILY_TIMERS
|
||||
};
|
||||
|
||||
inline CSFunctionFamily getCSFunctionFamily(int fn)
|
||||
{
|
||||
if (fn==CS_FN_TIM) {
|
||||
return (CS_FAMILY_TIMERS);
|
||||
} else {
|
||||
return ((fn<CS_FN_AND || fn>CS_FN_ELESS) ? CS_FAMILY_VOFS : (fn<CS_FN_EQUAL ? CS_FAMILY_VBOOL : CS_FAMILY_VCOMP));
|
||||
}
|
||||
}
|
||||
|
||||
#define CHAR_FOR_NAMES " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-."
|
||||
#define CHAR_FOR_NAMES_REGEX "[ A-Za-z0-9_.-,]*"
|
||||
|
||||
@@ -180,23 +153,41 @@ enum HeliSwashTypes {
|
||||
|
||||
#define NUM_STICKS 4
|
||||
#define BOARD_9X_NUM_POTS 3
|
||||
#define BOARD_X9D_NUM_POTS 4
|
||||
#define C9X_NUM_POTS 4
|
||||
#define C9X_NUM_POTS 5
|
||||
#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 ThrottleSource {
|
||||
THROTTLE_SOURCE_THR,
|
||||
THROTTLE_SOURCE_P1,
|
||||
THROTTLE_SOURCE_P2,
|
||||
THROTTLE_SOURCE_P3,
|
||||
THROTTLE_SOURCE_S1 = THROTTLE_SOURCE_P1,
|
||||
THROTTLE_SOURCE_S2,
|
||||
THROTTLE_SOURCE_S3,
|
||||
THROTTLE_SOURCE_LS,
|
||||
THROTTLE_SOURCE_RS,
|
||||
THROTTLE_SOURCE_FIRST_CHANNEL,
|
||||
};
|
||||
|
||||
enum TelemetrySource {
|
||||
TELEMETRY_SOURCE_TX_BATT,
|
||||
TELEMETRY_SOURCE_TIMER1,
|
||||
TELEMETRY_SOURCE_TIMER2,
|
||||
TELEMETRY_SOURCE_SWR,
|
||||
TELEMETRY_SOURCE_RSSI_TX,
|
||||
TELEMETRY_SOURCE_RSSI_RX,
|
||||
TELEMETRY_SOURCE_RX_BATT,
|
||||
TELEMETRY_SOURCE_A1,
|
||||
TELEMETRY_SOURCE_A2,
|
||||
TELEMETRY_SOURCE_A3,
|
||||
TELEMETRY_SOURCE_A4,
|
||||
TELEMETRY_SOURCE_ALT,
|
||||
TELEMETRY_SOURCE_RPM,
|
||||
TELEMETRY_SOURCE_FUEL,
|
||||
@@ -216,8 +207,12 @@ enum TelemetrySource {
|
||||
TELEMETRY_SOURCE_ACCZ,
|
||||
TELEMETRY_SOURCE_HDG,
|
||||
TELEMETRY_SOURCE_VERTICAL_SPEED,
|
||||
TELEMETRY_SOURCE_ASPD,
|
||||
TELEMETRY_SOURCE_DTE,
|
||||
TELEMETRY_SOURCE_A1_MIN,
|
||||
TELEMETRY_SOURCE_A2_MIN,
|
||||
TELEMETRY_SOURCE_A3_MIN,
|
||||
TELEMETRY_SOURCE_A4_MIN,
|
||||
TELEMETRY_SOURCE_ALT_MIN,
|
||||
TELEMETRY_SOURCE_ALT_MAX,
|
||||
TELEMETRY_SOURCE_RPM_MAX,
|
||||
@@ -225,14 +220,17 @@ enum TelemetrySource {
|
||||
TELEMETRY_SOURCE_T2_MAX,
|
||||
TELEMETRY_SOURCE_SPEED_MAX,
|
||||
TELEMETRY_SOURCE_DIST_MAX,
|
||||
TELEMETRY_SOURCE_CELL_MIN,
|
||||
TELEMETRY_SOURCE_CELLS_MIN,
|
||||
TELEMETRY_SOURCE_VFAS_MIN,
|
||||
TELEMETRY_SOURCE_CURRENT_MAX,
|
||||
TELEMETRY_SOURCE_POWER_MAX,
|
||||
TELEMETRY_SOURCE_ACC,
|
||||
TELEMETRY_SOURCE_GPS_TIME,
|
||||
TELEMETRY_SOURCES_STATUS_COUNT,
|
||||
TELEMETRY_SOURCES_DISPLAY_COUNT = TELEMETRY_SOURCES_STATUS_COUNT-2,
|
||||
|
||||
TELEMETRY_SOURCES_COUNT = TELEMETRY_SOURCE_VERTICAL_SPEED,
|
||||
TELEMETRY_SOURCES_STATUS_COUNT = TELEMETRY_SOURCE_GPS_TIME+1,
|
||||
TELEMETRY_SOURCES_DISPLAY_COUNT = TELEMETRY_SOURCE_POWER_MAX+1,
|
||||
TELEMETRY_SOURCES_COUNT = TELEMETRY_SOURCE_DTE+1,
|
||||
TELEMETRY_SOURCE_RESERVE = -1
|
||||
};
|
||||
|
||||
#define TM_HASTELEMETRY 0x01
|
||||
@@ -241,6 +239,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,25 +254,56 @@ enum RawSourceType {
|
||||
SOURCE_TYPE_TELEMETRY,
|
||||
MAX_SOURCE_TYPE
|
||||
};
|
||||
|
||||
class ModelData;
|
||||
|
||||
QString AnalogString(int index);
|
||||
QString RotaryEncoderString(int index);
|
||||
|
||||
class RawSourceRange
|
||||
{
|
||||
public:
|
||||
RawSourceRange():
|
||||
decimals(0),
|
||||
min(0.0),
|
||||
max(0.0),
|
||||
step(1.0),
|
||||
offset(0.0)
|
||||
{
|
||||
}
|
||||
|
||||
float getValue(int value) {
|
||||
return min + float(value) * step;
|
||||
}
|
||||
|
||||
int decimals;
|
||||
double min;
|
||||
double max;
|
||||
double step;
|
||||
double offset;
|
||||
|
||||
};
|
||||
|
||||
class RawSource {
|
||||
public:
|
||||
RawSource():
|
||||
type(SOURCE_TYPE_NONE),
|
||||
index(0)
|
||||
index(0),
|
||||
model(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
RawSource(int value):
|
||||
RawSource(int value, const ModelData * model=NULL):
|
||||
type(RawSourceType(abs(value)/65536)),
|
||||
index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536))
|
||||
index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536)),
|
||||
model(model)
|
||||
{
|
||||
}
|
||||
|
||||
RawSource(RawSourceType type, int index=0):
|
||||
RawSource(RawSourceType type, int index=0, const ModelData * model=NULL):
|
||||
type(type),
|
||||
index(index)
|
||||
index(index),
|
||||
model(model)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -283,32 +314,31 @@ class RawSource {
|
||||
|
||||
QString toString();
|
||||
|
||||
int getDecimals(const ModelData & Model);
|
||||
double getMin(const ModelData & Model);
|
||||
double getMax(const ModelData & Model);
|
||||
double getStep(const ModelData & Model);
|
||||
double getOffset(const ModelData & Model);
|
||||
int getRawOffset(const ModelData & Model);
|
||||
RawSourceRange getRange(bool singleprec=false);
|
||||
|
||||
bool operator== ( const RawSource& other) {
|
||||
bool operator == ( const RawSource & other) {
|
||||
return (this->type == other.type) && (this->index == other.index);
|
||||
}
|
||||
|
||||
bool operator != ( const RawSource & other) {
|
||||
return (this->type != other.type) || (this->index != other.index);
|
||||
}
|
||||
|
||||
RawSourceType type;
|
||||
int index;
|
||||
const ModelData * model;
|
||||
};
|
||||
|
||||
enum RawSwitchType {
|
||||
SWITCH_TYPE_NONE,
|
||||
SWITCH_TYPE_SWITCH,
|
||||
SWITCH_TYPE_VIRTUAL,
|
||||
SWITCH_TYPE_MOMENT_SWITCH,
|
||||
SWITCH_TYPE_MOMENT_VIRTUAL,
|
||||
SWITCH_TYPE_MULTIPOS_POT,
|
||||
SWITCH_TYPE_TRIM,
|
||||
SWITCH_TYPE_ROTARY_ENCODER,
|
||||
SWITCH_TYPE_ON,
|
||||
SWITCH_TYPE_OFF,
|
||||
SWITCH_TYPE_ONM,
|
||||
SWITCH_TYPE_TRN,
|
||||
SWITCH_TYPE_REA,
|
||||
SWITCH_TYPE_TIMER_MODE
|
||||
};
|
||||
|
||||
class RawSwitch {
|
||||
@@ -378,6 +408,11 @@ enum BeeperMode {
|
||||
class GeneralSettings {
|
||||
public:
|
||||
GeneralSettings();
|
||||
|
||||
int getDefaultStick(unsigned int channel) const;
|
||||
RawSource getDefaultSource(unsigned int channel) const;
|
||||
int getDefaultChannel(unsigned int stick) const;
|
||||
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
int calibMid[NUM_STICKS+C9X_NUM_POTS];
|
||||
@@ -404,7 +439,6 @@ class GeneralSettings {
|
||||
int timezone;
|
||||
bool optrexDisplay;
|
||||
unsigned int inactivityTimer;
|
||||
bool throttleReversed;
|
||||
bool minuteBeep;
|
||||
bool preBeep;
|
||||
bool flashBeep;
|
||||
@@ -412,11 +446,12 @@ class GeneralSettings {
|
||||
bool frskyinternalalarm;
|
||||
bool disableBG;
|
||||
unsigned int splashMode;
|
||||
int splashDuration;
|
||||
uint8_t filterInput; // TODO enum
|
||||
unsigned int backlightDelay;
|
||||
bool blightinv;
|
||||
bool stickScroll;
|
||||
unsigned int templateSetup; //RETA order according to chout_ar array // TODO enum
|
||||
unsigned int templateSetup; //RETA order according to chout_ar array
|
||||
int PPM_Multiplier;
|
||||
int hapticLength;
|
||||
unsigned int reNavigation;
|
||||
@@ -446,22 +481,61 @@ class GeneralSettings {
|
||||
int beepVolume;
|
||||
int wavVolume;
|
||||
int varioVolume;
|
||||
int varioPitch;
|
||||
int varioRange;
|
||||
int varioRepeat;
|
||||
int backgroundVolume;
|
||||
unsigned int mavbaud;
|
||||
unsigned int switchUnlockStates;
|
||||
unsigned int hw_uartMode;
|
||||
unsigned int potsType[8];
|
||||
};
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
enum InputMode {
|
||||
INPUT_MODE_NONE,
|
||||
INPUT_MODE_POS,
|
||||
INPUT_MODE_NEG,
|
||||
INPUT_MODE_BOTH
|
||||
};
|
||||
|
||||
class ExpoData {
|
||||
public:
|
||||
ExpoData() { clear(); }
|
||||
unsigned int mode; // 0=end, 1=pos, 2=neg, 3=both
|
||||
RawSource srcRaw;
|
||||
unsigned int scale;
|
||||
unsigned int mode;
|
||||
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 +548,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,7 +574,8 @@ class LimitData {
|
||||
int ppmCenter;
|
||||
bool symetrical;
|
||||
char name[6+1];
|
||||
void clear() { memset(this, 0, sizeof(LimitData)); min = -100; max = +100; }
|
||||
CurveReference curve;
|
||||
void clear() { memset(this, 0, sizeof(LimitData)); min = -1000; max = +1000; }
|
||||
};
|
||||
|
||||
enum MltpxValue {
|
||||
@@ -501,17 +584,14 @@ enum MltpxValue {
|
||||
MLTPX_REP=2
|
||||
};
|
||||
|
||||
|
||||
class MixData {
|
||||
public:
|
||||
MixData() { clear(); }
|
||||
unsigned int destCh; // 1..C9X_NUM_CHNOUT
|
||||
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,39 +600,71 @@ 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];
|
||||
|
||||
void clear() { memset(this, 0, sizeof(MixData)); }
|
||||
};
|
||||
|
||||
class CustomSwData { // Custom Switches data
|
||||
public:
|
||||
CustomSwData() { clear(); }
|
||||
int val1; //input
|
||||
int val2; //offset
|
||||
unsigned int func;
|
||||
unsigned int delay;
|
||||
unsigned int duration;
|
||||
unsigned int andsw;
|
||||
void clear() { memset(this, 0, sizeof(CustomSwData)); }
|
||||
enum CSFunction {
|
||||
LS_FN_OFF,
|
||||
LS_FN_VPOS,
|
||||
LS_FN_VNEG,
|
||||
LS_FN_APOS,
|
||||
LS_FN_ANEG,
|
||||
LS_FN_AND,
|
||||
LS_FN_OR,
|
||||
LS_FN_XOR,
|
||||
LS_FN_EQUAL,
|
||||
LS_FN_NEQUAL,
|
||||
LS_FN_GREATER,
|
||||
LS_FN_LESS,
|
||||
LS_FN_EGREATER,
|
||||
LS_FN_ELESS,
|
||||
LS_FN_DPOS,
|
||||
LS_FN_DAPOS,
|
||||
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
LS_FN_VALMOSTEQUAL,
|
||||
LS_FN_TIMER,
|
||||
LS_FN_STICKY,
|
||||
LS_FN_STAY,
|
||||
// later ... LS_FN_RANGE,
|
||||
LS_FN_MAX
|
||||
};
|
||||
|
||||
class SafetySwData { // Custom Switches data
|
||||
public:
|
||||
SafetySwData() { clear(); }
|
||||
RawSwitch swtch;
|
||||
int val;
|
||||
enum CSFunctionFamily {
|
||||
LS_FAMILY_VOFS,
|
||||
LS_FAMILY_VBOOL,
|
||||
LS_FAMILY_VCOMP,
|
||||
LS_FAMILY_TIMER,
|
||||
LS_FAMILY_STICKY,
|
||||
LS_FAMILY_STAY,
|
||||
};
|
||||
|
||||
void clear() { memset(this, 0, sizeof(SafetySwData)); }
|
||||
class LogicalSwitchData { // Custom Switches data
|
||||
public:
|
||||
LogicalSwitchData(unsigned int func=0)
|
||||
{
|
||||
clear();
|
||||
this->func = func;
|
||||
}
|
||||
unsigned int func;
|
||||
int val1;
|
||||
int val2;
|
||||
int val3;
|
||||
unsigned int delay;
|
||||
unsigned int duration;
|
||||
int andsw;
|
||||
void clear() { memset(this, 0, sizeof(LogicalSwitchData)); }
|
||||
CSFunctionFamily getFunctionFamily();
|
||||
QString funcToString();
|
||||
QString toString(const ModelData & model);
|
||||
};
|
||||
|
||||
enum AssignFunc {
|
||||
FuncSafetyCh1 = 0,
|
||||
FuncSafetyCh16 = FuncSafetyCh1+15,
|
||||
FuncSafetyCh32 = FuncSafetyCh1+C9X_NUM_CHNOUT-1,
|
||||
FuncTrainer,
|
||||
FuncTrainerRUD,
|
||||
FuncTrainerELE,
|
||||
@@ -562,6 +674,8 @@ enum AssignFunc {
|
||||
FuncPlaySound,
|
||||
FuncPlayHaptic,
|
||||
FuncReset,
|
||||
FuncSetTimer1,
|
||||
FuncSetTimer2,
|
||||
FuncVario,
|
||||
FuncPlayPrompt,
|
||||
FuncPlayBoth,
|
||||
@@ -572,38 +686,41 @@ enum AssignFunc {
|
||||
FuncBackgroundMusic,
|
||||
FuncBackgroundMusicPause,
|
||||
FuncAdjustGV1,
|
||||
FuncAdjustGV2,
|
||||
FuncAdjustGV3,
|
||||
FuncAdjustGV4,
|
||||
FuncAdjustGV5,
|
||||
FuncCount
|
||||
FuncAdjustGVLast = FuncAdjustGV1+C9X_MAX_GVARS-1,
|
||||
FuncCount,
|
||||
FuncReserve = -1
|
||||
};
|
||||
|
||||
class FuncSwData { // Function Switches data
|
||||
public:
|
||||
FuncSwData() { clear(); }
|
||||
FuncSwData(AssignFunc func=FuncSafetyCh1) { clear(); this->func = func; }
|
||||
RawSwitch swtch;
|
||||
AssignFunc func;
|
||||
int param;
|
||||
char paramarm[10];
|
||||
unsigned int enabled; // TODO perhaps not any more the right name
|
||||
unsigned int adjustMode;
|
||||
unsigned int repeatParam;
|
||||
int repeatParam;
|
||||
void clear() { memset(this, 0, sizeof(FuncSwData)); }
|
||||
QString funcToString();
|
||||
QString paramToString();
|
||||
QString repeatToString();
|
||||
QStringList toStringList();
|
||||
};
|
||||
|
||||
class PhaseData {
|
||||
public:
|
||||
PhaseData() { clear(); }
|
||||
int trimRef[NUM_STICKS]; //
|
||||
int trimMode[NUM_STICKS];
|
||||
int trimRef[NUM_STICKS];
|
||||
int trim[NUM_STICKS];
|
||||
RawSwitch swtch;
|
||||
char name[10+1];
|
||||
unsigned int fadeIn;
|
||||
unsigned int fadeOut;
|
||||
int rotaryEncoders[2];
|
||||
int gvars[5];
|
||||
void clear() { memset(this, 0, sizeof(PhaseData)); for (int i=0; i<NUM_STICKS; i++) trimRef[i] = -1; }
|
||||
int gvars[C9X_MAX_GVARS];
|
||||
void clear() { memset(this, 0, sizeof(PhaseData)); }
|
||||
};
|
||||
|
||||
class SwashRingData { // Swash Ring data
|
||||
@@ -654,6 +771,14 @@ class FrSkyChannelData {
|
||||
unsigned int multiplier;
|
||||
FrSkyAlarmData alarms[2];
|
||||
|
||||
float getRatio() const
|
||||
{
|
||||
if (type==0 || type==1 || type==2)
|
||||
return float(ratio << multiplier) / 10.0;
|
||||
else
|
||||
return ratio << multiplier;
|
||||
}
|
||||
|
||||
void clear() { memset(this, 0, sizeof(FrSkyChannelData)); }
|
||||
};
|
||||
|
||||
@@ -688,7 +813,7 @@ class FrSkyData {
|
||||
FrSkyChannelData channels[2];
|
||||
unsigned int usrProto;
|
||||
unsigned int imperial;
|
||||
unsigned int blades;
|
||||
int blades;
|
||||
unsigned int voltsSource;
|
||||
bool altitudeDisplayed;
|
||||
unsigned int currentSource;
|
||||
@@ -700,8 +825,11 @@ class FrSkyData {
|
||||
int varioCenterMin; // if increment in 0.2m/s = 3.0m/s max
|
||||
int varioCenterMax;
|
||||
int varioMax;
|
||||
bool mAhPersistent;
|
||||
unsigned int storedMah;
|
||||
int fasOffset;
|
||||
|
||||
void clear() { memset(this, 0, sizeof(FrSkyData)); rssiAlarms[0].clear(2, 45); rssiAlarms[1].clear(3, 42); varioSource = 2/*VARIO*/; }
|
||||
void clear();
|
||||
};
|
||||
|
||||
class MavlinkData {
|
||||
@@ -712,33 +840,17 @@ class MavlinkData {
|
||||
void clear() { memset(this, 0, sizeof(MavlinkData)); }
|
||||
};
|
||||
|
||||
enum TimerMode {
|
||||
TMRMODE_OFF=0,
|
||||
TMRMODE_ABS,
|
||||
TMRMODE_THs,
|
||||
TMRMODE_THp,
|
||||
TMRMODE_THt,
|
||||
TMRMODE_FIRST_SWITCH,
|
||||
TMRMODE_FIRST_MOMENT_SWITCH = TMRMODE_FIRST_SWITCH+64,
|
||||
TMRMODE_FIRST_CHPERC = TMRMODE_FIRST_MOMENT_SWITCH+64,
|
||||
|
||||
TMRMODE_FIRST_NEG_SWITCH=-TMRMODE_FIRST_SWITCH,
|
||||
TMRMODE_FIRST_NEG_MOMENT_SWITCH=-TMRMODE_FIRST_MOMENT_SWITCH,
|
||||
/* sw/!sw, !m_sw/!m_sw */
|
||||
};
|
||||
|
||||
class TimerData {
|
||||
public:
|
||||
TimerData() { clear(); }
|
||||
TimerMode mode; // timer trigger source -> off, abs, THs, TH%, THt, sw/!sw, !m_sw/!m_sw
|
||||
int8_t modeB;
|
||||
bool minuteBeep;
|
||||
bool countdownBeep;
|
||||
bool dir; // 0=>Count Down, 1=>Count Up
|
||||
RawSwitch mode;
|
||||
bool minuteBeep;
|
||||
unsigned int countdownBeep;
|
||||
bool dir; // 0=>Count Down, 1=>Count Up
|
||||
unsigned int val;
|
||||
bool persistent;
|
||||
int pvalue;
|
||||
void clear() { memset(this, 0, sizeof(TimerData)); }
|
||||
bool persistent;
|
||||
int pvalue;
|
||||
void clear() { memset(this, 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
|
||||
};
|
||||
|
||||
enum Protocol {
|
||||
@@ -774,16 +886,33 @@ class ModuleData {
|
||||
void clear() { memset(this, 0, sizeof(ModuleData)); }
|
||||
};
|
||||
|
||||
#define C9X_MAX_SCRIPTS 7
|
||||
#define C9X_MAX_SCRIPT_INPUTS 10
|
||||
class ScriptData {
|
||||
public:
|
||||
ScriptData() { clear(); }
|
||||
char filename[10+1];
|
||||
char name[10+1];
|
||||
int inputs[C9X_MAX_SCRIPT_INPUTS];
|
||||
void clear() { memset(this, 0, sizeof(ScriptData)); }
|
||||
};
|
||||
|
||||
class ModelData {
|
||||
public:
|
||||
ModelData();
|
||||
ModelData(const ModelData & src);
|
||||
ModelData & operator = (const ModelData & src);
|
||||
|
||||
ExpoData * insertInput(const int idx);
|
||||
void removeInput(const int idx);
|
||||
|
||||
bool used;
|
||||
char name[12+1];
|
||||
uint8_t modelVoice;
|
||||
TimerData timers[2];
|
||||
bool thrTrim; // Enable Throttle Trim
|
||||
bool thrExpo; // Enable Throttle Expo
|
||||
unsigned int trimInc; // Trim Increments
|
||||
int trimInc; // Trim Increments
|
||||
bool disableThrottleWarning;
|
||||
|
||||
unsigned int beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
@@ -794,18 +923,25 @@ class ModelData {
|
||||
PhaseData phaseData[C9X_MAX_PHASES];
|
||||
MixData mixData[C9X_MAX_MIXERS];
|
||||
LimitData limitData[C9X_NUM_CHNOUT];
|
||||
|
||||
char inputNames[C9X_MAX_INPUTS][4+1];
|
||||
ExpoData expoData[C9X_MAX_EXPOS];
|
||||
|
||||
CurveData curves[C9X_MAX_CURVES];
|
||||
CustomSwData customSw[C9X_NUM_CSW];
|
||||
LogicalSwitchData customSw[C9X_NUM_CSW];
|
||||
FuncSwData funcSw[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
SafetySwData safetySw[C9X_NUM_CHNOUT];
|
||||
SwashRingData swashRingData;
|
||||
unsigned int thrTraceSrc;
|
||||
int8_t traineron; // 0 disable trainer, 1 allow trainer
|
||||
int8_t t2throttle; // Start timer2 using throttle
|
||||
unsigned int modelId;
|
||||
unsigned int modelId;
|
||||
unsigned int switchWarningStates;
|
||||
unsigned int nSwToWarn;
|
||||
unsigned int nPotsToWarn;
|
||||
int potPosition[C9X_NUM_POTS];
|
||||
bool displayText;
|
||||
// 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;
|
||||
@@ -821,13 +957,21 @@ class ModelData {
|
||||
|
||||
ModuleData moduleData[C9X_NUM_MODULES+1/*trainer*/];
|
||||
|
||||
ScriptData scriptData[C9X_MAX_SCRIPTS];
|
||||
|
||||
void clear();
|
||||
bool isempty();
|
||||
void setDefault(uint8_t id);
|
||||
unsigned int getTrimFlightPhase(uint8_t idx, int8_t phase);
|
||||
void setDefaultInputs(const GeneralSettings & settings);
|
||||
void setDefaultMixes(const GeneralSettings & settings);
|
||||
void setDefaultValues(unsigned int id, const GeneralSettings & settings);
|
||||
|
||||
int getTrimValue(int phaseIdx, int trimIdx);
|
||||
void setTrimValue(int phaseIdx, int trimIdx, int value);
|
||||
ModelData removeGlobalVars();
|
||||
|
||||
void clearMixes();
|
||||
void clearInputs();
|
||||
|
||||
protected:
|
||||
void removeGlobalVar(int & var);
|
||||
};
|
||||
@@ -835,52 +979,37 @@ 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,
|
||||
CustomFunctions,
|
||||
VoicesAsNumbers,
|
||||
VoicesMaxLength,
|
||||
ModelVoice,
|
||||
MultiLangVoice,
|
||||
ModelImage,
|
||||
InstantTrimSW,
|
||||
Pots,
|
||||
Switches,
|
||||
SwitchesPositions,
|
||||
CustomSwitches,
|
||||
LogicalSwitches,
|
||||
CustomAndSwitches,
|
||||
HasNegAndSwitches,
|
||||
CustomSwitchesExt,
|
||||
LogicalSwitchesExt,
|
||||
RotaryEncoders,
|
||||
Outputs,
|
||||
ChannelsName,
|
||||
ExtraChannels,
|
||||
ExtraInputs,
|
||||
ExtraTrims,
|
||||
ExtendedTrims,
|
||||
HasNegCurves,
|
||||
HasInputFilter,
|
||||
HasExpoCurves,
|
||||
ExpoIsCurve,
|
||||
ExpoCurve5,
|
||||
ExpoCurve9,
|
||||
CustomCurves,
|
||||
NumCurves3,
|
||||
NumCurves5,
|
||||
NumCurves9,
|
||||
NumCurves,
|
||||
NumCurvePoints,
|
||||
OffsetWeight,
|
||||
@@ -893,14 +1022,9 @@ enum Capability {
|
||||
Haptic,
|
||||
HapticLength,
|
||||
HapticMode,
|
||||
HasBlInvert,
|
||||
HasBeeper,
|
||||
BandgapMeasure,
|
||||
PotScrolling,
|
||||
TrainerSwitch,
|
||||
ModelTrainerEnable,
|
||||
Timer2ThrTrig,
|
||||
HasTTrace,
|
||||
HasExpoNames,
|
||||
HasMixerNames,
|
||||
HasChNames,
|
||||
@@ -910,15 +1034,9 @@ enum Capability {
|
||||
HasPPMStart,
|
||||
HasGeneralUnits,
|
||||
HasFAIMode,
|
||||
NoTimerDirs,
|
||||
NoThrExpo,
|
||||
OptrexDisplay,
|
||||
PPMExtCtrl,
|
||||
PPMFrameLength,
|
||||
MixFmTrim,
|
||||
gsSwitchMask,
|
||||
pmSwitchMask,
|
||||
BLonStickMove,
|
||||
DSM2Indexes,
|
||||
Telemetry,
|
||||
TelemetryUnits,
|
||||
@@ -928,17 +1046,11 @@ enum Capability {
|
||||
GvarsInCS,
|
||||
GvarsAreNamed,
|
||||
GvarsFlightPhases,
|
||||
GvarsHaveSources,
|
||||
GvarsAsSources,
|
||||
GvarsAsWeight,
|
||||
GvarsNum,
|
||||
GvarsOfsNum,
|
||||
GvarsName,
|
||||
NoTelemetryProtocol,
|
||||
TelemetryCSFields,
|
||||
TelemetryColsCSFields,
|
||||
TelemetryCustomScreens,
|
||||
TelemetryCustomScreensFieldsPerLine,
|
||||
TelemetryRSSIModel,
|
||||
TelemetryAlarm,
|
||||
TelemetryInternalAlarm,
|
||||
TelemetryTimeshift,
|
||||
TelemetryMaxMultiplier,
|
||||
HasAltitudeSel,
|
||||
@@ -946,14 +1058,8 @@ enum Capability {
|
||||
HasVarioSink,
|
||||
HasVariants,
|
||||
HasFailsafe,
|
||||
HasPPMSim,
|
||||
HasCrossTrims,
|
||||
HasStickScroll,
|
||||
HasFixOffset,
|
||||
HasSoundMixer,
|
||||
NumModules,
|
||||
FSSwitch,
|
||||
DiffMixers,
|
||||
PPMCenter,
|
||||
SYMLimits,
|
||||
HasCurrentCalibration,
|
||||
@@ -961,8 +1067,6 @@ enum Capability {
|
||||
HasBrightness,
|
||||
HasContrast,
|
||||
PerModelTimers,
|
||||
PerModelThrottleWarning,
|
||||
PerModelThrottleInvert,
|
||||
SlowScale,
|
||||
SlowRange,
|
||||
PermTimers,
|
||||
@@ -970,14 +1074,17 @@ enum Capability {
|
||||
CSFunc,
|
||||
LCDWidth,
|
||||
GetThrSwitch,
|
||||
};
|
||||
|
||||
enum UseContext {
|
||||
DefaultContext,
|
||||
TimerContext,
|
||||
FlightPhaseContext,
|
||||
MixerContext,
|
||||
ExpoContext,
|
||||
HasDisplayText,
|
||||
VirtualInputs,
|
||||
TrainerInputs,
|
||||
LuaInputs,
|
||||
LimitsPer1000,
|
||||
EnhancedCurves,
|
||||
HasFasOffset,
|
||||
HasMahPersistent,
|
||||
MultiposPots,
|
||||
MultiposPotsPositions,
|
||||
SimulatorVariant,
|
||||
};
|
||||
|
||||
class SimulatorInterface;
|
||||
@@ -996,7 +1103,7 @@ class EEPROMInterface
|
||||
|
||||
inline BoardEnum getBoard() { return board; }
|
||||
|
||||
virtual bool load(RadioData &radioData, uint8_t *eeprom, int size) = 0;
|
||||
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
|
||||
|
||||
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
|
||||
|
||||
@@ -1012,11 +1119,7 @@ class EEPROMInterface
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0) = 0;
|
||||
|
||||
virtual bool isAvailable(const RawSwitch & swtch, UseContext context) { return true; }
|
||||
|
||||
virtual bool isAvailable(const RawSource & source, UseContext context) { return true; }
|
||||
|
||||
virtual SimulatorInterface * getSimulator() = 0;
|
||||
virtual SimulatorInterface * getSimulator() { return NULL; }
|
||||
|
||||
virtual const int getEEpromSize() = 0;
|
||||
|
||||
@@ -1038,6 +1141,12 @@ extern QString EEPROMWarnings;
|
||||
void setEEPROMString(char *dst, const char *src, int size);
|
||||
void getEEPROMString(char *dst, const char *src, int size);
|
||||
|
||||
float ValToTim(int value);
|
||||
int TimToVal(float value);
|
||||
|
||||
QString getSignedStr(int value);
|
||||
QString getGVarString(int16_t val, bool sign=false);
|
||||
|
||||
inline int applyStickMode(int stick, unsigned int mode)
|
||||
{
|
||||
if (mode == 0 || mode > 4) {
|
||||
@@ -1097,14 +1206,14 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
|
||||
// virtual switches
|
||||
for (int i=0; i<C9X_NUM_CSW; i++) {
|
||||
RawSource source;
|
||||
switch (getCSFunctionFamily(model.customSw[i].func)) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
switch (model.customSw[i].getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
source = RawSource(model.customSw[i].val2);
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
source.index = applyStickMode(source.index + 1, mode) - 1;
|
||||
model.customSw[i].val2 = source.toValue();
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
source = RawSource(model.customSw[i].val1);
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
source.index = applyStickMode(source.index + 1, mode) - 1;
|
||||
@@ -1123,7 +1232,7 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
|
||||
void RegisterFirmwares();
|
||||
|
||||
bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
|
||||
bool LoadEeprom(RadioData &radioData, uint8_t *eeprom, int size);
|
||||
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
|
||||
bool LoadEepromXml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
struct Option {
|
||||
@@ -1259,6 +1368,11 @@ inline unsigned int GetCurrentFirmwareVariant()
|
||||
return current_firmware_variant.variant;
|
||||
}
|
||||
|
||||
inline int divRoundClosest(const int n, const int d)
|
||||
{
|
||||
return ((n < 0) ^ (d < 0)) ? ((n - d/2)/d) : ((n + d/2)/d);
|
||||
}
|
||||
|
||||
#define CHECK_IN_ARRAY(T, index) ((unsigned int)index < (unsigned int)(sizeof(T)/sizeof(T[0])) ? T[(unsigned int)index] : "???")
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef EXPODIALOG_H
|
||||
#define EXPODIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class ExpoDialog;
|
||||
}
|
||||
|
||||
class ExpoDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExpoDialog(QWidget *parent, ExpoData *mixdata, int stickMode);
|
||||
~ExpoDialog();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private slots:
|
||||
void valuesChanged();
|
||||
void widgetChanged();
|
||||
void shrink();
|
||||
|
||||
private:
|
||||
Ui::ExpoDialog *ui;
|
||||
ExpoData *ed;
|
||||
};
|
||||
|
||||
#endif // EXPODIALOG_H
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
@@ -37,9 +17,9 @@ RawSwitch er9xToSwitch(int8_t sw)
|
||||
else if (sw == -22)
|
||||
return RawSwitch(SWITCH_TYPE_OFF);
|
||||
else if (swa <= 22+9)
|
||||
return RawSwitch(SWITCH_TYPE_MOMENT_SWITCH, sw > 0 ? sw-22 : sw+22);
|
||||
return RawSwitch(SWITCH_TYPE_SWITCH, sw > 0 ? sw-22 : sw+22);
|
||||
else
|
||||
return RawSwitch(SWITCH_TYPE_MOMENT_VIRTUAL, sw > 0 ? sw-22-9 : sw+22+9);
|
||||
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-22-9 : sw+22+9);
|
||||
}
|
||||
|
||||
t_Er9xTrainerMix::t_Er9xTrainerMix()
|
||||
@@ -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,49 +269,22 @@ RawSource er9xToSource(int8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
t_Er9xCustomSwData::t_Er9xCustomSwData(CustomSwData &c9x)
|
||||
Er9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
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;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = er9xToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = er9xToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = er9xToSwitch(v1).toValue();
|
||||
c9x.val2 = er9xToSwitch(v2).toValue();
|
||||
}
|
||||
@@ -559,50 +298,11 @@ 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;
|
||||
c9x.swtch = er9xToSwitch(swtch);
|
||||
c9x.val = val;
|
||||
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 +322,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,28 +335,11 @@ 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)
|
||||
RawSwitch getEr9xTimerMode(int mode)
|
||||
{
|
||||
/*
|
||||
if (mode <= -33)
|
||||
return TimerMode(TMRMODE_FIRST_NEG_MOMENT_SWITCH+(mode+33));
|
||||
return TimerMode(TMRMODE_FIRST_NEG_SWITCH+(mode+33));
|
||||
else if (mode <= -1)
|
||||
return TimerMode(TMRMODE_FIRST_NEG_SWITCH+(mode+1));
|
||||
else if (mode < 16)
|
||||
@@ -672,163 +347,9 @@ TimerMode getEr9xTimerMode(int mode)
|
||||
else if (mode < 16+21)
|
||||
return TimerMode(TMRMODE_FIRST_SWITCH+(mode-16));
|
||||
else
|
||||
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;
|
||||
}
|
||||
return TimerMode(TMRMODE_FIRST_SWITCH+(mode-16-21));
|
||||
*/
|
||||
return RawSwitch();
|
||||
}
|
||||
|
||||
t_Er9xModelData::operator ModelData ()
|
||||
@@ -840,9 +361,7 @@ t_Er9xModelData::operator ModelData ()
|
||||
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
|
||||
c9x.timers[0].dir = tmrDir;
|
||||
c9x.timers[0].val = tmrVal;
|
||||
c9x.timers[0].modeB = tmrModeB;
|
||||
|
||||
switch(protocol) {
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
@@ -857,12 +376,12 @@ t_Er9xModelData::operator ModelData ()
|
||||
break;
|
||||
}
|
||||
c9x.traineron= traineron;
|
||||
c9x.t2throttle = t2throttle;
|
||||
// c9x.t2throttle = t2throttle;
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncInstantTrim;
|
||||
if (trimSw) {
|
||||
@@ -902,7 +421,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 +435,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 +449,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 +456,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;
|
||||
@@ -943,8 +466,8 @@ t_Er9xModelData::operator ModelData ()
|
||||
for (int i=0; i<ER9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
|
||||
for (int i=0; i<ER9X_NUM_CHNOUT; i++)
|
||||
c9x.safetySw[i] = safetySw[i];
|
||||
// for (int i=0; i<ER9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
|
||||
@@ -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,28 +151,24 @@ PACK(typedef struct t_Er9xMixData {
|
||||
|
||||
operator MixData();
|
||||
t_Er9xMixData();
|
||||
t_Er9xMixData(MixData&);
|
||||
}) Er9xMixData;
|
||||
|
||||
|
||||
PACK(typedef struct t_Er9xCustomSwData { // Custom Switches data
|
||||
PACK(typedef struct t_Er9xLogicalSwitchData { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func:4;
|
||||
uint8_t andsw:4;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Er9xCustomSwData() { memset(this, 0, sizeof(t_Er9xCustomSwData)); }
|
||||
t_Er9xCustomSwData(CustomSwData&);
|
||||
}) Er9xCustomSwData;
|
||||
operator LogicalSwitchData();
|
||||
t_Er9xLogicalSwitchData() { memset(this, 0, sizeof(t_Er9xLogicalSwitchData)); }
|
||||
}) Er9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Er9xSafetySwData { // Custom Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
operator SafetySwData();
|
||||
t_Er9xSafetySwData();
|
||||
t_Er9xSafetySwData(SafetySwData&);
|
||||
}) Er9xSafetySwData;
|
||||
|
||||
PACK(typedef struct t_Er9xFrSkyChannelData {
|
||||
@@ -191,7 +180,6 @@ PACK(typedef struct t_Er9xFrSkyChannelData {
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Er9xFrSkyChannelData();
|
||||
t_Er9xFrSkyChannelData(FrSkyChannelData&);
|
||||
}) Er9xFrSkyChannelData;
|
||||
|
||||
PACK(typedef struct t_Er9xFrSkyData {
|
||||
@@ -199,7 +187,6 @@ PACK(typedef struct t_Er9xFrSkyData {
|
||||
|
||||
operator FrSkyData();
|
||||
t_Er9xFrSkyData();
|
||||
t_Er9xFrSkyData(FrSkyData&);
|
||||
}) Er9xFrSkyData;
|
||||
|
||||
PACK(typedef struct t_gvar {
|
||||
@@ -254,7 +241,7 @@ PACK(typedef struct t_Er9xModelData {
|
||||
int8_t trim[4];
|
||||
int8_t curves5[ER9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ER9X_MAX_CURVE9][9];
|
||||
Er9xCustomSwData customSw[ER9X_NUM_CSW];
|
||||
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
int8_t tmrModeB;
|
||||
uint8_t numVoice;
|
||||
@@ -268,9 +255,6 @@ PACK(typedef struct t_Er9xModelData {
|
||||
|
||||
operator ModelData();
|
||||
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
|
||||
t_Er9xModelData(ModelData&);
|
||||
}) Er9xModelData;
|
||||
|
||||
|
||||
#endif
|
||||
/*eof*/
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "er9xeeprom.h"
|
||||
#include "er9xsimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
@@ -44,8 +45,7 @@ const char * Er9xInterface::getName()
|
||||
|
||||
const int Er9xInterface::getEEpromSize()
|
||||
{
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString avrMCU = settings.value("mcu", QString("m64")).toString();
|
||||
QString avrMCU = g.mcu();
|
||||
if (avrMCU==QString("m128")) {
|
||||
return 2*EESIZE_STOCK;
|
||||
}
|
||||
@@ -75,11 +75,11 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
|
||||
for (int i=0; i<ER9X_MAX_MIXERS; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ER9X_NUM_CSW; i++) {
|
||||
switch (getCSFunctionFamily(model.customSw[i].func)) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
@@ -114,7 +114,7 @@ bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Er9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying er9x import... ";
|
||||
|
||||
@@ -123,7 +123,7 @@ bool Er9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
@@ -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,34 +207,20 @@ 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:
|
||||
return 1;
|
||||
case Timer2ThrTrig:
|
||||
return 1;
|
||||
case TrainerSwitch:
|
||||
return 1;
|
||||
case OffsetWeight:
|
||||
return 125;
|
||||
case BandgapMeasure:
|
||||
return 1;
|
||||
case PotScrolling:
|
||||
return 1;
|
||||
case SoundMod:
|
||||
return 1;
|
||||
case SoundPitch:
|
||||
return 1;
|
||||
case Haptic:
|
||||
return 1;
|
||||
case OwnerName:
|
||||
return 10;
|
||||
case Timers:
|
||||
return 1;
|
||||
case Pots:
|
||||
@@ -282,14 +231,10 @@ int Er9xInterface::getCapability(const Capability capability)
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 0;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return 12;
|
||||
case CustomAndSwitches:
|
||||
return 5;
|
||||
case GvarsNum:
|
||||
return 7;
|
||||
case GvarsOfsNum:
|
||||
return 5;
|
||||
case CSFunc:
|
||||
return 13;
|
||||
case Outputs:
|
||||
@@ -298,16 +243,10 @@ int Er9xInterface::getCapability(const Capability capability)
|
||||
return 0;
|
||||
case Simulation:
|
||||
return 1;
|
||||
case gsSwitchMask:
|
||||
return 1;
|
||||
case BLonStickMove:
|
||||
return 1;
|
||||
case Telemetry:
|
||||
return TM_HASTELEMETRY|TM_HASWSHH;
|
||||
case TelemetryUnits:
|
||||
return 1;
|
||||
case TimerTriggerB:
|
||||
return 1;
|
||||
case TelemetryMaxMultiplier:
|
||||
return 2;
|
||||
case MaxVolume:
|
||||
@@ -319,24 +258,12 @@ int Er9xInterface::getCapability(const Capability capability)
|
||||
case LCDWidth:
|
||||
return 128;
|
||||
case VoicesAsNumbers:
|
||||
case TelemetryInternalAlarm:
|
||||
case HasPPMSim:
|
||||
case HasCrossTrims:
|
||||
case HasStickScroll:
|
||||
case HasAltitudeSel:
|
||||
case HasContrast:
|
||||
case InstantTrimSW:
|
||||
case HasVolume:
|
||||
case HasBlInvert:
|
||||
case ModelVoice:
|
||||
case DiffMixers:
|
||||
case HasNegCurves:
|
||||
case HasFixOffset:
|
||||
case Gvars:
|
||||
case GvarsHaveSources:
|
||||
case GvarsAsSources:
|
||||
case GvarsAsWeight:
|
||||
return 1;
|
||||
return 7;
|
||||
case GetThrSwitch:
|
||||
return DSW_THR;
|
||||
default:
|
||||
@@ -359,7 +286,7 @@ int Er9xInterface::isAvailable(Protocol prot, int port)
|
||||
|
||||
SimulatorInterface * Er9xInterface::getSimulator()
|
||||
{
|
||||
return new Er9xSimulator(this);
|
||||
return NULL; // new Er9xSimulator(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class Er9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t * eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
#include <inttypes.h>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
extern TimerMode getEr9xTimerMode(int mode);
|
||||
extern int setEr9xTimerMode(TimerMode mode);
|
||||
extern RawSwitch getEr9xTimerMode(int mode);
|
||||
|
||||
//eeprom data
|
||||
#define ERSKY9X_MAX_MIXERS_V10 32
|
||||
@@ -51,8 +50,6 @@ PACK(typedef struct t_Ersky9xTrainerMix {
|
||||
|
||||
operator TrainerMix();
|
||||
t_Ersky9xTrainerMix();
|
||||
t_Ersky9xTrainerMix(TrainerMix&);
|
||||
|
||||
}) Ersky9xTrainerMix; //
|
||||
|
||||
PACK(typedef struct t_Ersky9xTrainerData {
|
||||
@@ -61,8 +58,6 @@ PACK(typedef struct t_Ersky9xTrainerData {
|
||||
|
||||
operator TrainerData();
|
||||
t_Ersky9xTrainerData();
|
||||
t_Ersky9xTrainerData(TrainerData&);
|
||||
|
||||
}) Ersky9xTrainerData;
|
||||
|
||||
PACK(typedef struct t_Ersky9xGeneral {
|
||||
@@ -122,8 +117,6 @@ PACK(typedef struct t_Ersky9xGeneral {
|
||||
uint8_t rotaryDivisor ;
|
||||
operator GeneralSettings();
|
||||
t_Ersky9xGeneral();
|
||||
t_Ersky9xGeneral(GeneralSettings&);
|
||||
|
||||
}) Ersky9xGeneral;
|
||||
|
||||
PACK(typedef struct t_Ersky9xExpoData {
|
||||
@@ -143,7 +136,6 @@ PACK(typedef struct t_Ersky9xLimitData {
|
||||
|
||||
operator LimitData();
|
||||
t_Ersky9xLimitData() ;
|
||||
t_Ersky9xLimitData(LimitData&);
|
||||
}) Ersky9xLimitData;
|
||||
|
||||
#define MLTPX_ADD 0
|
||||
@@ -170,7 +162,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,40 +183,33 @@ 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
|
||||
PACK(typedef struct t_Ersky9xLogicalSwitchData_v10 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Ersky9xCustomSwData_v10() { memset(this, 0, sizeof(t_Ersky9xCustomSwData_v10)); }
|
||||
t_Ersky9xCustomSwData_v10(CustomSwData&);
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v10() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v10)); }
|
||||
}) Ersky9xLogicalSwitchData_v10;
|
||||
|
||||
}) Ersky9xCustomSwData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xCustomSwData_v11 { // Custom Switches data
|
||||
PACK(typedef struct t_Ersky9xLogicalSwitchData_v11 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
uint8_t andsw;
|
||||
uint8_t res ;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Ersky9xCustomSwData_v11() { memset(this, 0, sizeof(t_Ersky9xCustomSwData_v11)); }
|
||||
t_Ersky9xCustomSwData_v11(CustomSwData&);
|
||||
|
||||
}) Ersky9xCustomSwData_v11;
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v11() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v11)); }
|
||||
}) Ersky9xLogicalSwitchData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xSafetySwData_v10 { // Custom Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
operator SafetySwData();
|
||||
t_Ersky9xSafetySwData_v10();
|
||||
t_Ersky9xSafetySwData_v10(SafetySwData&);
|
||||
}) Ersky9xSafetySwData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xSafetySwData_v11 { // Custom Switches data
|
||||
@@ -244,9 +228,7 @@ PACK(typedef struct t_Ersky9xSafetySwData_v11 { // Custom Switches data
|
||||
} vs ;
|
||||
} opt ;
|
||||
|
||||
operator SafetySwData();
|
||||
t_Ersky9xSafetySwData_v11();
|
||||
t_Ersky9xSafetySwData_v11(SafetySwData&);
|
||||
}) Ersky9xSafetySwData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xgvar {
|
||||
@@ -281,7 +263,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 +270,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 +283,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 +290,6 @@ PACK(typedef struct t_Ersky9xFrSkyData_v11 {
|
||||
|
||||
operator FrSkyData();
|
||||
t_Ersky9xFrSkyData_v11();
|
||||
t_Ersky9xFrSkyData_v11(FrSkyData&);
|
||||
}) Ersky9xFrSkyData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyalarms_v11 {
|
||||
@@ -382,7 +360,7 @@ PACK(typedef struct t_Ersky9xModelData_v10 {
|
||||
int8_t trim[4];
|
||||
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
|
||||
Ersky9xCustomSwData_v10 customSw[ERSKY9X_NUM_CSW_V10];
|
||||
Ersky9xLogicalSwitchData_v10 customSw[ERSKY9X_NUM_CSW_V10];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
uint8_t res3[2];
|
||||
Ersky9xSafetySwData_v10 safetySw[ERSKY9X_NUM_CHNOUT_V10];
|
||||
@@ -390,7 +368,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 {
|
||||
@@ -432,7 +409,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
|
||||
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
|
||||
int8_t curvexy[18];
|
||||
Ersky9xCustomSwData_v11 customSw[ERSKY9X_NUM_CSW_V11];
|
||||
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
uint8_t bt_telemetry;
|
||||
uint8_t numVoice; // 0-16, rest are Safety switches
|
||||
@@ -449,8 +426,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*/
|
||||
|
||||
@@ -74,11 +74,11 @@ inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mod
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++) {
|
||||
switch (getCSFunctionFamily(model.customSw[i].func)) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
@@ -106,11 +106,11 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++) {
|
||||
switch (getCSFunctionFamily(model.customSw[i].func)) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
@@ -151,7 +151,7 @@ bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying ersky9x import... ";
|
||||
|
||||
@@ -160,7 +160,7 @@ bool Ersky9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_SKY9X)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
@@ -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,51 +249,33 @@ 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:
|
||||
return 1;
|
||||
case Timer2ThrTrig:
|
||||
return 1;
|
||||
case TrainerSwitch:
|
||||
return 1;
|
||||
case BandgapMeasure:
|
||||
return 1;
|
||||
case PotScrolling:
|
||||
return 1;
|
||||
case SoundMod:
|
||||
return 1;
|
||||
case SoundPitch:
|
||||
return 1;
|
||||
case Haptic:
|
||||
return 1;
|
||||
case OwnerName:
|
||||
return 10;
|
||||
case HasInputFilter:
|
||||
return 0;
|
||||
case ModelVoice:
|
||||
return 1;
|
||||
case Timers:
|
||||
return 2;
|
||||
case Pots:
|
||||
return 3;
|
||||
case GvarsNum:
|
||||
case Gvars:
|
||||
return 7;
|
||||
case GvarsOfsNum:
|
||||
return 5;
|
||||
case Switches:
|
||||
return 7;
|
||||
case SwitchesPositions:
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 0;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return ERSKY9X_NUM_CSW_V11;
|
||||
case CustomAndSwitches:
|
||||
return 1;
|
||||
@@ -328,18 +287,12 @@ int Ersky9xInterface::getCapability(const Capability capability)
|
||||
return 0;
|
||||
case Simulation:
|
||||
return 1;
|
||||
case gsSwitchMask:
|
||||
return 1;
|
||||
case BLonStickMove:
|
||||
return 1;
|
||||
case Telemetry:
|
||||
return TM_HASTELEMETRY|TM_HASWSHH;
|
||||
case TelemetryUnits:
|
||||
return 1;
|
||||
case OptrexDisplay:
|
||||
return 1;
|
||||
case TimerTriggerB:
|
||||
return 2;
|
||||
case HasAltitudeSel:
|
||||
case HasCurrentCalibration:
|
||||
case HasVolume:
|
||||
@@ -350,13 +303,6 @@ 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;
|
||||
case LCDWidth:
|
||||
@@ -383,7 +329,7 @@ int Ersky9xInterface::isAvailable(Protocol prot, int port)
|
||||
|
||||
SimulatorInterface * Ersky9xInterface::getSimulator()
|
||||
{
|
||||
return new Ersky9xSimulator(this);
|
||||
return NULL; // new Ersky9xSimulator(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class Ersky9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t * eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
|
||||
@@ -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,49 +301,22 @@ RawSource gruvin9xToSource(int8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
t_Gruvin9xCustomSwData::t_Gruvin9xCustomSwData(CustomSwData &c9x)
|
||||
Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
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;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = gruvin9xToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = gruvin9xToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = gruvin9xToSwitch(v1).toValue();
|
||||
c9x.val2 = gruvin9xToSwitch(v2).toValue();
|
||||
}
|
||||
@@ -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,35 +332,11 @@ Gruvin9xFuncSwData::operator FuncSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xSafetySwData::t_Gruvin9xSafetySwData(SafetySwData &c9x)
|
||||
{
|
||||
swtch = gruvin9xFromSwitch(c9x.swtch);
|
||||
val = c9x.val;
|
||||
}
|
||||
|
||||
t_Gruvin9xSafetySwData::operator SafetySwData ()
|
||||
{
|
||||
SafetySwData c9x;
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
c9x.val = val;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
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 +373,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);
|
||||
extern RawSwitch getEr9xTimerMode(int mode);
|
||||
|
||||
t_Gruvin9xTimerData::operator TimerData ()
|
||||
{
|
||||
@@ -670,29 +384,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 +403,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 +416,6 @@ t_Gruvin9xFrSkyData::operator FrSkyData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
|
||||
t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
@@ -763,7 +450,7 @@ t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
@@ -778,7 +465,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 +472,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;
|
||||
@@ -796,8 +481,8 @@ t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.safetySw[i] = safetySw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
return c9x;
|
||||
@@ -836,7 +521,7 @@ t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
@@ -851,7 +536,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 +543,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;
|
||||
@@ -869,8 +552,8 @@ t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.safetySw[i] = safetySw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
return c9x;
|
||||
@@ -909,7 +592,7 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
@@ -941,7 +624,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 +631,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;
|
||||
@@ -961,8 +642,8 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<G9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.safetySw[i] = safetySw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
|
||||
@@ -1002,7 +683,7 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.thrExpo = thrExpo;
|
||||
c9x.trimInc = trimInc;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
@@ -1027,7 +708,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 +715,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;
|
||||
@@ -1047,107 +726,11 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<G9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.safetySw[i] = safetySw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
|
||||
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,29 +184,22 @@ PACK(typedef struct t_Gruvin9xMixData {
|
||||
|
||||
operator MixData();
|
||||
t_Gruvin9xMixData();
|
||||
t_Gruvin9xMixData(MixData&);
|
||||
|
||||
}) Gruvin9xMixData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xCustomSwData { // Custom Switches data
|
||||
PACK(typedef struct t_Gruvin9xLogicalSwitchData { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Gruvin9xCustomSwData() { memset(this, 0, sizeof(t_Gruvin9xCustomSwData)); }
|
||||
t_Gruvin9xCustomSwData(CustomSwData&);
|
||||
|
||||
}) Gruvin9xCustomSwData;
|
||||
operator LogicalSwitchData();
|
||||
t_Gruvin9xLogicalSwitchData() { memset(this, 0, sizeof(t_Gruvin9xLogicalSwitchData)); }
|
||||
}) Gruvin9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
operator SafetySwData();
|
||||
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
|
||||
t_Gruvin9xSafetySwData(SafetySwData&);
|
||||
|
||||
}) Gruvin9xSafetySwData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
|
||||
@@ -225,8 +208,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 +223,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 +242,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 +266,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 +275,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
|
||||
@@ -336,7 +309,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES];
|
||||
@@ -368,7 +341,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES];
|
||||
@@ -400,7 +373,7 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
@@ -410,8 +383,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 {
|
||||
@@ -434,7 +405,7 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
@@ -443,11 +414,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*/
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "gruvin9xinterface.h"
|
||||
#include "gruvin9xeeprom.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
@@ -47,8 +48,7 @@ const char * Gruvin9xInterface::getName()
|
||||
const int Gruvin9xInterface::getEEpromSize()
|
||||
{
|
||||
if (board == BOARD_STOCK) {
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString avrMCU = settings.value("mcu", QString("m64")).toString();
|
||||
QString avrMCU = g.mcu();
|
||||
if (avrMCU==QString("m128")) {
|
||||
return EESIZE_STOCK*2;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
|
||||
|
||||
bool Gruvin9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import... ";
|
||||
|
||||
@@ -108,7 +108,7 @@ bool Gruvin9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
@@ -200,73 +200,25 @@ 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)
|
||||
{
|
||||
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:
|
||||
@@ -283,7 +235,7 @@ int Gruvin9xInterface::getCapability(const Capability capability)
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 12;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return 12;
|
||||
case CSFunc:
|
||||
return 13;
|
||||
@@ -297,7 +249,6 @@ int Gruvin9xInterface::getCapability(const Capability capability)
|
||||
return true;
|
||||
case OffsetWeight:
|
||||
return 125;
|
||||
case HasExpoCurves:
|
||||
case HasContrast:
|
||||
return true;
|
||||
case Telemetry:
|
||||
|
||||
@@ -35,7 +35,7 @@ class Gruvin9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t *eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
|
||||
|
||||
|
||||
@@ -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,35 +108,29 @@ 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
|
||||
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v207 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xGruvin9xCustomSwData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomSwData_v207)); }
|
||||
t_Open9xGruvin9xCustomSwData_v207(CustomSwData&);
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xGruvin9xLogicalSwitchData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v207)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
}) Open9xGruvin9xLogicalSwitchData_v207;
|
||||
|
||||
}) Open9xGruvin9xCustomSwData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xCustomSwData_v209 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xGruvin9xCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomSwData_v209)); }
|
||||
t_Open9xGruvin9xCustomSwData_v209(CustomSwData&);
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xGruvin9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v209)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
|
||||
}) Open9xGruvin9xCustomSwData_v209;
|
||||
}) Open9xGruvin9xLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
@@ -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 {
|
||||
@@ -214,7 +194,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xCustomSwData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_PHASES];
|
||||
@@ -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 {
|
||||
@@ -250,7 +228,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xCustomSwData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
@@ -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 {
|
||||
@@ -291,7 +267,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
@@ -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 {
|
||||
@@ -333,7 +307,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
@@ -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 {
|
||||
@@ -373,7 +345,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
@@ -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
|
||||
|
||||
@@ -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,40 +188,36 @@ 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
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xArmCustomSwData_v208() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v208)); }
|
||||
t_Open9xArmCustomSwData_v208(CustomSwData&);
|
||||
}) Open9xArmCustomSwData_v208;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v208)); }
|
||||
}) Open9xArmLogicalSwitchData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmCustomSwData_v209 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xArmCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v209)); }
|
||||
t_Open9xArmCustomSwData_v209(CustomSwData&);
|
||||
}) Open9xArmCustomSwData_v209;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v209)); }
|
||||
}) Open9xArmLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xArmCustomSwData_v210 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
uint8_t delay;
|
||||
uint8_t duration;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xArmCustomSwData_v210() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v210)); }
|
||||
t_Open9xArmCustomSwData_v210(CustomSwData&);
|
||||
}) Open9xArmCustomSwData_v210;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
|
||||
}) Open9xArmLogicalSwitchData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
@@ -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 {
|
||||
@@ -377,7 +343,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmCustomSwData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v208 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -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 {
|
||||
@@ -418,7 +382,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmCustomSwData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -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 {
|
||||
@@ -460,7 +422,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmCustomSwData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -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;
|
||||
|
||||
@@ -500,7 +461,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmCustomSwData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -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 {
|
||||
@@ -540,7 +499,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
Open9xArmExpoData_v212 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmCustomSwData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v210 swashR;
|
||||
Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -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
|
||||
|
||||
@@ -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,38 +219,32 @@ 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
|
||||
PACK(typedef struct t_Open9xLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xCustomSwData_v208() { memset(this, 0, sizeof(t_Open9xCustomSwData_v208)); }
|
||||
t_Open9xCustomSwData_v208(CustomSwData&);
|
||||
}) Open9xCustomSwData_v208;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v208)); }
|
||||
t_Open9xLogicalSwitchData_v208(LogicalSwitchData&);
|
||||
}) Open9xLogicalSwitchData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xCustomSwData_v209 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xCustomSwData_v209)); }
|
||||
t_Open9xCustomSwData_v209(CustomSwData&);
|
||||
}) Open9xCustomSwData_v209;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v209)); }
|
||||
}) Open9xLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
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 +253,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 +262,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 +272,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 +287,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 +302,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 +315,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 +328,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 +361,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 +373,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 +386,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 +399,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 +419,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 +431,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 +443,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 +455,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 +473,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 {
|
||||
@@ -570,7 +516,7 @@ PACK(typedef struct t_Open9xModelData_v201 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
@@ -579,8 +525,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 {
|
||||
@@ -603,7 +547,7 @@ PACK(typedef struct t_Open9xModelData_v202 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
@@ -615,8 +559,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 {
|
||||
@@ -639,7 +581,7 @@ PACK(typedef struct t_Open9xModelData_v203 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -650,8 +592,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 {
|
||||
@@ -674,7 +614,7 @@ PACK(typedef struct t_Open9xModelData_v204 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -686,8 +626,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 {
|
||||
@@ -709,7 +647,7 @@ PACK(typedef struct t_Open9xModelData_v205 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -723,8 +661,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 {
|
||||
@@ -746,7 +682,7 @@ PACK(typedef struct t_Open9xModelData_v208 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -764,8 +700,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 {
|
||||
@@ -787,7 +721,7 @@ PACK(typedef struct t_Open9xModelData_v209 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -806,8 +740,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 {
|
||||
@@ -829,7 +761,7 @@ PACK(typedef struct t_Open9xModelData_v210 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -846,8 +778,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 {
|
||||
@@ -869,7 +799,7 @@ PACK(typedef struct t_Open9xModelData_v211 {
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -884,8 +814,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
|
||||
@@ -74,6 +74,7 @@ namespace Open9xGruvin9x {
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
||||
@@ -98,14 +99,14 @@ bool hasExtendedTrims()
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return g_eeGeneral.stickMode;
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xGruvin9x;
|
||||
|
||||
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator(Open9xInterface * open9xInterface):
|
||||
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator(OpenTxInterface * open9xInterface):
|
||||
open9xInterface(open9xInterface)
|
||||
{
|
||||
}
|
||||
@@ -128,15 +129,23 @@ bool Open9xGruvin9xSimulator::lcdChanged(bool & lightEnable)
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::start(RadioData &radioData, bool tests)
|
||||
void Open9xGruvin9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
open9xInterface->save(&eeprom[0], radioData, SIMU_GRUVIN9X_VARIANTS);
|
||||
memcpy(Open9xGruvin9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xGruvin9x::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
@@ -160,7 +169,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 +183,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;
|
||||
@@ -20,15 +20,17 @@
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Open9xInterface;
|
||||
class OpenTxInterface;
|
||||
|
||||
class Open9xGruvin9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xGruvin9xSimulator(Open9xInterface *);
|
||||
Open9xGruvin9xSimulator(OpenTxInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
@@ -54,7 +56,7 @@ class Open9xGruvin9xSimulator : public SimulatorInterface {
|
||||
|
||||
protected:
|
||||
|
||||
Open9xInterface * open9xInterface;
|
||||
OpenTxInterface * open9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -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
|
||||
@@ -73,6 +73,7 @@ namespace Open9xM128 {
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/targets/stock/voice.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
@@ -96,14 +97,14 @@ bool hasExtendedTrims()
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return g_eeGeneral.stickMode;
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xM128;
|
||||
|
||||
Open9xM128Simulator::Open9xM128Simulator(Open9xInterface * open9xInterface):
|
||||
Open9xM128Simulator::Open9xM128Simulator(OpenTxInterface * open9xInterface):
|
||||
open9xInterface(open9xInterface)
|
||||
{
|
||||
}
|
||||
@@ -126,13 +127,19 @@ bool Open9xM128Simulator::lcdChanged(bool & lightEnable)
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::start(RadioData &radioData, bool tests)
|
||||
void Open9xM128Simulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
open9xInterface->save(&eeprom[0], radioData, SIMU_M128_VARIANTS);
|
||||
memcpy(Open9xM128::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xM128::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
@@ -154,7 +161,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 +175,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;
|
||||
@@ -20,15 +20,17 @@
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Open9xInterface;
|
||||
class OpenTxInterface;
|
||||
|
||||
class Open9xM128Simulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xM128Simulator(Open9xInterface *);
|
||||
Open9xM128Simulator(OpenTxInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
@@ -54,7 +56,7 @@ class Open9xM128Simulator : public SimulatorInterface {
|
||||
|
||||
protected:
|
||||
|
||||
Open9xInterface * open9xInterface;
|
||||
OpenTxInterface * open9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -14,8 +14,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "open9xSky9xsimulator.h"
|
||||
#include "open9xinterface.h"
|
||||
#include "opentxSky9xsimulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
@@ -53,6 +54,7 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
#undef min
|
||||
@@ -89,6 +91,7 @@ namespace Open9xSky9x {
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
@@ -125,18 +128,17 @@ bool hasExtendedTrims()
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return g_eeGeneral.stickMode;
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xSky9x;
|
||||
|
||||
Open9xSky9xSimulator::Open9xSky9xSimulator(Open9xInterface * open9xInterface):
|
||||
Open9xSky9xSimulator::Open9xSky9xSimulator(OpenTxInterface * open9xInterface):
|
||||
open9xInterface(open9xInterface)
|
||||
{
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString path=settings.value("sdPath", ".").toString()+"/";
|
||||
QString path=g.profile[g.id()].sdPath()+"/";
|
||||
int i=0;
|
||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
||||
simuSdDirectory[i]=path.at(i).toAscii();
|
||||
@@ -162,14 +164,21 @@ bool Open9xSky9xSimulator::lcdChanged(bool & lightEnable)
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::start(RadioData &radioData, bool tests)
|
||||
void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
open9xInterface->save(&eeprom[0], radioData);
|
||||
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
@@ -193,7 +202,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 +216,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;
|
||||
@@ -20,15 +20,17 @@
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Open9xInterface;
|
||||
class OpenTxInterface;
|
||||
|
||||
class Open9xSky9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xSky9xSimulator(Open9xInterface *);
|
||||
Open9xSky9xSimulator(OpenTxInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
@@ -54,7 +56,7 @@ class Open9xSky9xSimulator : public SimulatorInterface {
|
||||
|
||||
protected:
|
||||
|
||||
Open9xInterface * open9xInterface;
|
||||
OpenTxInterface * open9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -15,14 +15,14 @@
|
||||
*/
|
||||
|
||||
#include "opentxTaranisSimulator.h"
|
||||
#include "open9xinterface.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBTARANIS
|
||||
#define CPUARM
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
@@ -35,6 +35,8 @@
|
||||
#define AUDIO
|
||||
#define VOICE
|
||||
#define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define DBLKEYS
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
@@ -47,8 +49,12 @@
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define FAI_CHOICE
|
||||
#define LUA
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
#define NUM_POTS 5
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
@@ -65,7 +71,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
||||
#include "radio/src/protocols/ppm_arm.cpp"
|
||||
#include "radio/src/protocols/pxx_arm.cpp"
|
||||
#include "radio/src/targets/taranis/pwr_driver.cpp"
|
||||
#include "radio/src/protocols/dsm2_arm.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
@@ -73,6 +79,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||
#include "radio/src/targets/taranis/uart3_driver.cpp"
|
||||
#include "radio/src/protocols/pulses_arm.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
@@ -95,8 +102,8 @@ inline int geteepromsize() {
|
||||
#undef SDCARD
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#define SDCARD
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
@@ -110,14 +117,41 @@ inline int geteepromsize() {
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
|
||||
#include "radio/src/lua.cpp"
|
||||
#include "radio/src/lua/src/lapi.c"
|
||||
#include "radio/src/lua/src/lcode.c"
|
||||
#include "radio/src/lua/src/lctype.c"
|
||||
#include "radio/src/lua/src/ldebug.c"
|
||||
#include "radio/src/lua/src/ldo.c"
|
||||
#include "radio/src/lua/src/ldump.c"
|
||||
#include "radio/src/lua/src/lfunc.c"
|
||||
#include "radio/src/lua/src/lgc.c"
|
||||
#include "radio/src/lua/src/llex.c"
|
||||
#include "radio/src/lua/src/lmem.c"
|
||||
#include "radio/src/lua/src/lobject.c"
|
||||
#include "radio/src/lua/src/lopcodes.c"
|
||||
#include "radio/src/lua/src/lparser.c"
|
||||
#include "radio/src/lua/src/lstate.c"
|
||||
#include "radio/src/lua/src/lstring.c"
|
||||
#include "radio/src/lua/src/ltable.c"
|
||||
#include "radio/src/lua/src/ltm.c"
|
||||
#include "radio/src/lua/src/lundump.c"
|
||||
#include "radio/src/lua/src/lvm.c"
|
||||
#include "radio/src/lua/src/lzio.c"
|
||||
#include "radio/src/lua/src/lbaselib.c"
|
||||
#include "radio/src/lua/src/linit.c"
|
||||
#include "radio/src/lua/src/lmathlib.c"
|
||||
#include "radio/src/lua/src/loadlib.c"
|
||||
#include "radio/src/lua/src/lauxlib.c"
|
||||
#include "radio/src/lua/src/ltablib.c"
|
||||
#include "radio/src/lua/src/lcorolib.c"
|
||||
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_X9D_NUM_POTS];
|
||||
int16_t g_anas[NUM_STICKS+5];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 8)
|
||||
return 1800;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
@@ -128,7 +162,7 @@ bool hasExtendedTrims()
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return g_eeGeneral.stickMode;
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
void resetTrims()
|
||||
@@ -141,12 +175,11 @@ void resetTrims()
|
||||
|
||||
using namespace Open9xX9D;
|
||||
|
||||
OpentxTaranisSimulator::OpentxTaranisSimulator(Open9xInterface * open9xInterface):
|
||||
OpentxTaranisSimulator::OpentxTaranisSimulator(OpenTxInterface * open9xInterface):
|
||||
open9xInterface(open9xInterface)
|
||||
{
|
||||
taranisSimulatorBoard = GetEepromInterface()->getBoard();
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString path=settings.value("sdPath", ".").toString()+"/";
|
||||
QString path=g.profile[g.id()].sdPath()+"/";
|
||||
int i=0;
|
||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
||||
simuSdDirectory[i]=path.at(i).toAscii();
|
||||
@@ -172,13 +205,19 @@ bool OpentxTaranisSimulator::lcdChanged(bool & lightEnable)
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::start(RadioData &radioData, bool tests)
|
||||
void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
open9xInterface->save(Open9xX9D::eeprom, radioData);
|
||||
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
@@ -200,7 +239,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 +253,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;
|
||||
|
||||
@@ -20,15 +20,17 @@
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Open9xInterface;
|
||||
class OpenTxInterface;
|
||||
|
||||
class OpentxTaranisSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
OpentxTaranisSimulator(Open9xInterface *);
|
||||
OpentxTaranisSimulator(OpenTxInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
@@ -54,7 +56,7 @@ class OpentxTaranisSimulator : public SimulatorInterface {
|
||||
|
||||
protected:
|
||||
|
||||
Open9xInterface * open9xInterface;
|
||||
OpenTxInterface * open9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
|
||||
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
|
||||
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
|
||||
#define SIMU_GRUVIN9X_VARIANTS (0)
|
||||
#define SIMU_ARM_VARIANTS (0)
|
||||
|
||||
#define O9X_MAX_TIMERS 2
|
||||
#define O9X_MAX_PHASES 5
|
||||
@@ -42,7 +40,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,14 +47,13 @@
|
||||
#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
|
||||
|
||||
class Open9xGeneralDataNew: public TransformedField {
|
||||
class OpenTxGeneralData: public TransformedField {
|
||||
public:
|
||||
Open9xGeneralDataNew(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant=0);
|
||||
OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant=0);
|
||||
|
||||
protected:
|
||||
virtual void beforeExport();
|
||||
@@ -66,8 +62,10 @@ class Open9xGeneralDataNew: public TransformedField {
|
||||
StructField internalField;
|
||||
GeneralSettings & generalData;
|
||||
BoardEnum board;
|
||||
unsigned int version;
|
||||
int inputsCount;
|
||||
unsigned int chkSum;
|
||||
unsigned int potsType[4];
|
||||
};
|
||||
|
||||
class ProtocolsConversionTable: public ConversionTable
|
||||
@@ -76,8 +74,9 @@ class ProtocolsConversionTable: public ConversionTable
|
||||
ProtocolsConversionTable(BoardEnum board)
|
||||
{
|
||||
int val = 0;
|
||||
if (IS_TARANIS(board))
|
||||
if (IS_TARANIS(board)) {
|
||||
addConversion(OFF, val++);
|
||||
}
|
||||
addConversion(PPM, val++);
|
||||
if (!IS_ARM(board)) {
|
||||
addConversion(PPM16, val++);
|
||||
@@ -88,9 +87,13 @@ class ProtocolsConversionTable: public ConversionTable
|
||||
addConversion(PXX_XJT_D8, val);
|
||||
addConversion(PXX_XJT_LR12, val++);
|
||||
}
|
||||
addConversion(PXX_DJT, val++);
|
||||
else {
|
||||
addConversion(PXX_DJT, val++);
|
||||
}
|
||||
if (IS_TARANIS(board)) {
|
||||
addConversion(DSM2, val++);
|
||||
addConversion(LP45, val);
|
||||
addConversion(DSM2, val);
|
||||
addConversion(DSMX, val++);
|
||||
}
|
||||
else {
|
||||
addConversion(LP45, val++);
|
||||
@@ -100,6 +103,12 @@ class ProtocolsConversionTable: public ConversionTable
|
||||
}
|
||||
};
|
||||
|
||||
class ThrottleSourceConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
ThrottleSourceConversionTable(BoardEnum board, unsigned int version);
|
||||
};
|
||||
|
||||
class ChannelsConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
@@ -111,9 +120,9 @@ class ChannelsConversionTable: public ConversionTable
|
||||
};
|
||||
|
||||
|
||||
class Open9xModelDataNew: public TransformedField {
|
||||
class OpenTxModelData: public TransformedField {
|
||||
public:
|
||||
Open9xModelDataNew(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant);
|
||||
OpenTxModelData(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant);
|
||||
|
||||
const char * getName() { return name; }
|
||||
|
||||
@@ -124,12 +133,14 @@ class Open9xModelDataNew: public TransformedField {
|
||||
StructField internalField;
|
||||
ModelData & modelData;
|
||||
BoardEnum board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
|
||||
private:
|
||||
char name[256];
|
||||
signed int subprotocols[C9X_NUM_MODULES+1/*trainer*/];
|
||||
int subprotocols[C9X_NUM_MODULES+1/*trainer*/];
|
||||
ProtocolsConversionTable protocolsConversionTable;
|
||||
ThrottleSourceConversionTable throttleSourceConversionTable;
|
||||
ChannelsConversionTable channelsConversionTable;
|
||||
};
|
||||
|
||||
@@ -16,16 +16,17 @@
|
||||
|
||||
#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"
|
||||
#include "appdata.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
@@ -42,42 +43,38 @@ size_t SizeOfArray( T(&)[ N ] )
|
||||
return N;
|
||||
}
|
||||
|
||||
QStringList o9xservers;
|
||||
|
||||
Open9xInterface::Open9xInterface(BoardEnum board):
|
||||
OpenTxInterface::OpenTxInterface(BoardEnum board):
|
||||
EEPROMInterface(board),
|
||||
efile(new EFile())
|
||||
{
|
||||
o9xservers.clear();
|
||||
o9xservers << "93.51.182.154" << "open9x.9xforums.com";
|
||||
}
|
||||
|
||||
Open9xInterface::~Open9xInterface()
|
||||
OpenTxInterface::~OpenTxInterface()
|
||||
{
|
||||
delete efile;
|
||||
}
|
||||
|
||||
const char * Open9xInterface::getName()
|
||||
const char * OpenTxInterface::getName()
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
return "openTx for 9X board";
|
||||
return "OpenTX for 9X board";
|
||||
case BOARD_M128:
|
||||
return "openTx for M128 / 9X board";
|
||||
return "OpenTX for M128 / 9X board";
|
||||
case BOARD_GRUVIN9X:
|
||||
return "openTx for Gruvin9x board / 9X";
|
||||
return "OpenTX for Gruvin9x board / 9X";
|
||||
case BOARD_TARANIS:
|
||||
return "openTx for FrSky Taranis";
|
||||
return "OpenTX for FrSky Taranis";
|
||||
case BOARD_TARANIS_REV4a:
|
||||
return "openTx for FrSky Taranis Rev4a";
|
||||
return "OpenTX for FrSky Taranis Rev4a";
|
||||
case BOARD_SKY9X:
|
||||
return "openTx for Sky9x board / 9X";
|
||||
return "OpenTX for Sky9x board / 9X";
|
||||
default:
|
||||
return "openTx for an unknown board";
|
||||
return "OpenTX for an unknown board";
|
||||
}
|
||||
}
|
||||
|
||||
const int Open9xInterface::getEEpromSize()
|
||||
const int OpenTxInterface::getEEpromSize()
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
@@ -97,7 +94,7 @@ const int Open9xInterface::getEEpromSize()
|
||||
}
|
||||
}
|
||||
|
||||
const int Open9xInterface::getMaxModels()
|
||||
const int OpenTxInterface::getMaxModels()
|
||||
{
|
||||
if (IS_ARM(board))
|
||||
return 60;
|
||||
@@ -110,7 +107,7 @@ const int Open9xInterface::getMaxModels()
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Open9xInterface::loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode)
|
||||
bool OpenTxInterface::loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode)
|
||||
{
|
||||
T _model;
|
||||
|
||||
@@ -143,7 +140,7 @@ bool Open9xInterface::loadModel(ModelData &model, uint8_t *data, int index, unsi
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Open9xInterface::loadModelVariant(unsigned int index, ModelData &model, uint8_t *data, unsigned int version, unsigned int variant)
|
||||
bool OpenTxInterface::loadModelVariant(unsigned int index, ModelData &model, uint8_t *data, unsigned int version, unsigned int variant)
|
||||
{
|
||||
T open9xModel(model, board, version, variant);
|
||||
|
||||
@@ -170,7 +167,7 @@ bool Open9xInterface::loadModelVariant(unsigned int index, ModelData &model, uin
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Open9xInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data, int index, unsigned int variant, unsigned int stickMode)
|
||||
bool OpenTxInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data, int index, unsigned int variant, unsigned int stickMode)
|
||||
{
|
||||
if (version == 201) {
|
||||
return loadModel<Open9xModelData_v201>(model, data, index, stickMode);
|
||||
@@ -239,11 +236,11 @@ bool Open9xInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data
|
||||
return loadModel<Open9xArmModelData_v212>(model, data, index);
|
||||
}
|
||||
else {
|
||||
return loadModelVariant<Open9xModelDataNew>(index, model, data, version, variant);
|
||||
return loadModelVariant<OpenTxModelData>(index, model, data, version, variant);
|
||||
}
|
||||
}
|
||||
else if (version >= 213) {
|
||||
return loadModelVariant<Open9xModelDataNew>(index, model, data, version, variant);
|
||||
return loadModelVariant<OpenTxModelData>(index, model, data, version, variant);
|
||||
}
|
||||
|
||||
std::cout << " ko\n";
|
||||
@@ -251,7 +248,7 @@ bool Open9xInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Open9xInterface::loadGeneral(GeneralSettings &settings, unsigned int version)
|
||||
bool OpenTxInterface::loadGeneral(GeneralSettings &settings, unsigned int version)
|
||||
{
|
||||
QByteArray eepromData(sizeof(settings), 0); // GeneralSettings should be always bigger than the EEPROM struct
|
||||
T open9xSettings(settings, board, version);
|
||||
@@ -267,7 +264,7 @@ bool Open9xInterface::loadGeneral(GeneralSettings &settings, unsigned int versio
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Open9xInterface::saveGeneral(GeneralSettings &settings, BoardEnum board, uint32_t version, uint32_t variant)
|
||||
bool OpenTxInterface::saveGeneral(GeneralSettings &settings, BoardEnum board, uint32_t version, uint32_t variant)
|
||||
{
|
||||
T open9xSettings(settings, board, version, variant);
|
||||
// open9xSettings.Dump();
|
||||
@@ -278,15 +275,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 OpenTxInterface::saveModel(unsigned int index, ModelData &model, unsigned int version, unsigned int variant)
|
||||
{
|
||||
T open9xModel(model, board, version, variant);
|
||||
// open9xModel.Dump();
|
||||
@@ -296,12 +285,12 @@ bool Open9xInterface::saveModelVariant(unsigned int index, ModelData &model, uns
|
||||
return (sz == eeprom.size());
|
||||
}
|
||||
|
||||
bool Open9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
bool OpenTxInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Open9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool OpenTxInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import...";
|
||||
|
||||
@@ -316,8 +305,9 @@ bool Open9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
if (notnull) {
|
||||
std::cout << " wrong size (" << size << ")\n";
|
||||
return false;
|
||||
} else {
|
||||
QMessageBox::warning(NULL,"companion9x", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(NULL, "companion", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
|
||||
size=2048;
|
||||
}
|
||||
} else {
|
||||
@@ -326,7 +316,7 @@ bool Open9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
}
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, board)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, board)) {
|
||||
std::cout << " wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
@@ -346,7 +336,7 @@ bool Open9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!loadGeneral<Open9xGeneralDataNew>(radioData.generalSettings, version)) {
|
||||
if (!loadGeneral<OpenTxGeneralData>(radioData.generalSettings, version)) {
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
}
|
||||
@@ -362,7 +352,7 @@ bool Open9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return true;
|
||||
}
|
||||
|
||||
int Open9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
int OpenTxInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
{
|
||||
EEPROMWarnings.clear();
|
||||
|
||||
@@ -371,16 +361,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 +379,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<OpenTxGeneralData>(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<OpenTxModelData>(i, radioData.models[i], version, variant);
|
||||
if (!result) {
|
||||
return 0;
|
||||
}
|
||||
if (!result)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,7 +405,7 @@ int Open9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varian
|
||||
return size;
|
||||
}
|
||||
|
||||
int Open9xInterface::getSize(ModelData &model)
|
||||
int OpenTxInterface::getSize(ModelData &model)
|
||||
{
|
||||
if (board == BOARD_SKY9X)
|
||||
return 0;
|
||||
@@ -487,8 +417,7 @@ int Open9xInterface::getSize(ModelData &model)
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board);
|
||||
|
||||
Open9xModelDataNew open9xModel(model, board, 255, GetCurrentFirmwareVariant());
|
||||
// open9xModel.Dump();
|
||||
OpenTxModelData open9xModel(model, board, 255, GetCurrentFirmwareVariant());
|
||||
|
||||
QByteArray eeprom;
|
||||
open9xModel.Export(eeprom);
|
||||
@@ -499,7 +428,7 @@ int Open9xInterface::getSize(ModelData &model)
|
||||
return efile->size(0);
|
||||
}
|
||||
|
||||
int Open9xInterface::getSize(GeneralSettings &settings)
|
||||
int OpenTxInterface::getSize(GeneralSettings &settings)
|
||||
{
|
||||
if (board == BOARD_SKY9X)
|
||||
return 0;
|
||||
@@ -507,7 +436,7 @@ int Open9xInterface::getSize(GeneralSettings &settings)
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board);
|
||||
|
||||
Open9xGeneralDataNew open9xGeneral(settings, board, 255, GetCurrentFirmwareVariant());
|
||||
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmwareVariant());
|
||||
// open9xGeneral.Dump();
|
||||
|
||||
QByteArray eeprom;
|
||||
@@ -519,21 +448,14 @@ int Open9xInterface::getSize(GeneralSettings &settings)
|
||||
return efile->size(0);
|
||||
}
|
||||
|
||||
int Open9xInterface::getCapability(const Capability capability)
|
||||
int OpenTxInterface::getCapability(const Capability capability)
|
||||
{
|
||||
switch (capability) {
|
||||
case OwnerName:
|
||||
return 0;
|
||||
case ModelImage:
|
||||
if (IS_TARANIS(board))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
case SimulatorType:
|
||||
if (IS_TARANIS(board))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
case HasBeeper:
|
||||
if (IS_ARM(board))
|
||||
return 0;
|
||||
@@ -562,12 +484,16 @@ 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 HasChNames:
|
||||
return (IS_TARANIS(board) ? 1 : 0);
|
||||
case GvarsInCS:
|
||||
case GvarsAsWeight:
|
||||
case ExpoIsCurve:
|
||||
case HasFAIMode:
|
||||
return 1;
|
||||
case GvarsAreNamed:
|
||||
@@ -584,24 +510,20 @@ int Open9xInterface::getCapability(const Capability capability)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
case minuteBeep:
|
||||
return 1;
|
||||
case countdownBeep:
|
||||
return 1;
|
||||
case Pots:
|
||||
return (IS_TARANIS(board) ? 4 : 3);
|
||||
return (IS_TARANIS(board) ? 5 : 3);
|
||||
case Switches:
|
||||
return (IS_TARANIS(board) ? 8 : 7);
|
||||
case SwitchesPositions:
|
||||
return (IS_TARANIS(board) ? 22 : 9);
|
||||
case CustomFunctions:
|
||||
if (IS_ARM(board))
|
||||
return 32;
|
||||
return 64;
|
||||
else if (board==BOARD_GRUVIN9X||board==BOARD_M128)
|
||||
return 24;
|
||||
else
|
||||
return 16;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
if (IS_ARM(board))
|
||||
return 32;
|
||||
else if (board==BOARD_GRUVIN9X||board==BOARD_M128)
|
||||
@@ -610,10 +532,10 @@ int Open9xInterface::getCapability(const Capability capability)
|
||||
return 12;
|
||||
case CustomAndSwitches:
|
||||
if (IS_ARM(board))
|
||||
return getCapability(CustomSwitches);
|
||||
return getCapability(LogicalSwitches);
|
||||
else
|
||||
return 15/*4bits*/-9/*sw positions*/;
|
||||
case CustomSwitchesExt:
|
||||
case LogicalSwitchesExt:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
case RotaryEncoders:
|
||||
if (board == BOARD_GRUVIN9X)
|
||||
@@ -629,7 +551,7 @@ int Open9xInterface::getCapability(const Capability capability)
|
||||
case VoicesAsNumbers:
|
||||
return (IS_ARM(board) ? 0 : 1);
|
||||
case VoicesMaxLength:
|
||||
return (IS_ARM(board) ? (IS_TARANIS(board) ? 10 : 6) : 0);
|
||||
return (IS_ARM(board) ? (IS_TARANIS(board) ? 8 : 6) : 0);
|
||||
case MultiLangVoice:
|
||||
return (IS_ARM(board) ? 1 : 0);
|
||||
case SoundPitch:
|
||||
@@ -663,79 +585,44 @@ 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:
|
||||
return 1;
|
||||
case Simulation:
|
||||
return 1;
|
||||
case DSM2Indexes:
|
||||
return 1;
|
||||
case FSSwitch:
|
||||
return 1;
|
||||
case HasTTrace:
|
||||
return 1;
|
||||
case CustomCurves:
|
||||
return 1;
|
||||
case MixesWithoutExpo:
|
||||
return 1;
|
||||
case NumCurves:
|
||||
return (IS_ARM(board) ? 16 : 8);
|
||||
return (IS_TARANIS(board) ? 32 : (IS_ARM(board) ? 16 : 8));
|
||||
case HasMixerNames:
|
||||
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:
|
||||
return 1;
|
||||
case TelemetryCSFields:
|
||||
if (IS_TARANIS(board)) {
|
||||
return 36;
|
||||
} else {
|
||||
return IS_ARM(board) ? 24 : 16;
|
||||
}
|
||||
case TelemetryColsCSFields:
|
||||
if (IS_TARANIS(board)) {
|
||||
return 3;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
case TelemetryCustomScreens:
|
||||
return IS_TARANIS(board) ? 3 : 2;
|
||||
case TelemetryCustomScreensFieldsPerLine:
|
||||
return IS_TARANIS(board) ? 3 : 2;
|
||||
case NoTelemetryProtocol:
|
||||
if (IS_TARANIS(board)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return IS_TARANIS(board) ? 1 : 0;
|
||||
case TelemetryUnits:
|
||||
return 0;
|
||||
case TelemetryBlades:
|
||||
return 1;
|
||||
case TelemetryRSSIModel:
|
||||
return 1;
|
||||
case TelemetryAlarm:
|
||||
return 0;
|
||||
case TelemetryTimeshift:
|
||||
return 1;
|
||||
case TelemetryMaxMultiplier:
|
||||
return (IS_ARM(board) ? 32 : 8);
|
||||
case DiffMixers:
|
||||
return 1;
|
||||
case PPMCenter:
|
||||
return 1;
|
||||
case SYMLimits:
|
||||
@@ -766,10 +653,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,21 +660,41 @@ 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 HasDisplayText:
|
||||
case VirtualInputs:
|
||||
return IS_TARANIS(board) ? 32 : 0;
|
||||
case TrainerInputs:
|
||||
return IS_ARM(board) ? 16 : 8;
|
||||
case LuaInputs:
|
||||
case LimitsPer1000:
|
||||
case EnhancedCurves:
|
||||
case HasFasOffset:
|
||||
return (IS_STOCK(board) ? false : true);
|
||||
case HasMahPersistent:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
case MultiposPots:
|
||||
return IS_TARANIS(board) ? 3 : 0;
|
||||
case MultiposPotsPositions:
|
||||
return IS_TARANIS(board) ? 6 : 0;
|
||||
case SimulatorVariant:
|
||||
if (board == BOARD_STOCK)
|
||||
return SIMU_STOCK_VARIANTS;
|
||||
else if (board == BOARD_M128)
|
||||
return SIMU_M128_VARIANTS;
|
||||
else
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int Open9xInterface::isAvailable(Protocol proto, int port)
|
||||
int OpenTxInterface::isAvailable(Protocol proto, int port)
|
||||
{
|
||||
if (IS_TARANIS(board)) {
|
||||
switch (port) {
|
||||
@@ -813,13 +716,16 @@ int Open9xInterface::isAvailable(Protocol proto, int port)
|
||||
case PXX_XJT_X16:
|
||||
case PXX_XJT_D8:
|
||||
case PXX_XJT_LR12:
|
||||
case PXX_DJT:
|
||||
//case PXX_DJT: // Unavailable for now
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case DSMX:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case -1:
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
return 1;
|
||||
@@ -873,7 +779,7 @@ int Open9xInterface::isAvailable(Protocol proto, int port)
|
||||
}
|
||||
}
|
||||
|
||||
SimulatorInterface * Open9xInterface::getSimulator()
|
||||
SimulatorInterface * OpenTxInterface::getSimulator()
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
@@ -885,7 +791,6 @@ SimulatorInterface * Open9xInterface::getSimulator()
|
||||
case BOARD_SKY9X:
|
||||
return new Open9xSky9xSimulator(this);
|
||||
case BOARD_TARANIS:
|
||||
return new OpentxTaranisSimulator(this);
|
||||
case BOARD_TARANIS_REV4a:
|
||||
return new OpentxTaranisSimulator(this);
|
||||
default:
|
||||
@@ -898,7 +803,7 @@ size_t getSizeA(T (&)[SIZE]) {
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
bool Open9xInterface::checkVersion(unsigned int version)
|
||||
bool OpenTxInterface::checkVersion(unsigned int version)
|
||||
{
|
||||
switch(version) {
|
||||
case 201:
|
||||
@@ -954,6 +859,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;
|
||||
}
|
||||
@@ -961,7 +869,7 @@ bool Open9xInterface::checkVersion(unsigned int version)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Open9xInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
bool OpenTxInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
{
|
||||
if (board == BOARD_M128 && !(variant & 0x8000)) {
|
||||
if (version == 212) {
|
||||
@@ -983,7 +891,7 @@ bool Open9xInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
}
|
||||
}
|
||||
|
||||
bool Open9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
bool OpenTxInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
std::cout << "trying " << getName() << " backup import...";
|
||||
|
||||
@@ -1026,14 +934,11 @@ bool Open9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esiz
|
||||
|
||||
QString geturl( int board)
|
||||
{
|
||||
QString url="http://";
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int server = settings.value("fwserver", 0).toInt();
|
||||
if (server >= o9xservers.count()) {
|
||||
server = 0;
|
||||
settings.setValue("fwserver",server);
|
||||
}
|
||||
url.append(o9xservers.at(server));
|
||||
QString url = g.compileServer();
|
||||
if (url.isEmpty()){
|
||||
url= OPENTX_FIRMWARE_DOWNLOADS;
|
||||
g.compileServer(url);
|
||||
}
|
||||
switch(board) {
|
||||
case BOARD_STOCK:
|
||||
case BOARD_M128:
|
||||
@@ -1054,27 +959,24 @@ QString geturl( int board)
|
||||
|
||||
QString getstamp( int board)
|
||||
{
|
||||
QString url="http://";
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int server = settings.value("fwserver",0).toInt();
|
||||
if (server >=o9xservers.count()) {
|
||||
server=0;
|
||||
settings.setValue("fwserver",server);
|
||||
}
|
||||
url.append(o9xservers.at(server));
|
||||
url.append("/binaries/stamp-opentx-");
|
||||
QString url = g.compileServer();
|
||||
if (url.isEmpty()){
|
||||
url= OPENTX_FIRMWARE_DOWNLOADS;
|
||||
g.compileServer(url);
|
||||
}
|
||||
url.append("/stamp-opentx-");
|
||||
switch(board) {
|
||||
case BOARD_STOCK:
|
||||
url.append("stock.txt");
|
||||
url.append("9x.txt");
|
||||
break;
|
||||
case BOARD_M128:
|
||||
url.append("stock128.txt");
|
||||
url.append("9x128.txt");
|
||||
break;
|
||||
case BOARD_GRUVIN9X:
|
||||
url.append("v4.txt");
|
||||
url.append("gruvin9x.txt");
|
||||
break;
|
||||
case BOARD_SKY9X:
|
||||
url.append("arm.txt");
|
||||
url.append("sky9x.txt");
|
||||
break;
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_REV4a:
|
||||
@@ -1089,16 +991,13 @@ QString getstamp( int board)
|
||||
|
||||
QString getrnurl( int board)
|
||||
{
|
||||
QString url="http://";
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int server = settings.value("fwserver",0).toInt();
|
||||
if (server >=o9xservers.count()) {
|
||||
server=0;
|
||||
settings.setValue("fwserver",server);
|
||||
}
|
||||
url.append(o9xservers.at(server));
|
||||
url.append("/docs/releasenotes-");
|
||||
switch(board) {
|
||||
QString url = g.compileServer();
|
||||
if (url.isEmpty()){
|
||||
url= OPENTX_FIRMWARE_DOWNLOADS;
|
||||
g.compileServer(url);
|
||||
}
|
||||
url.append("/releasenotes-");
|
||||
switch(board) {
|
||||
case BOARD_STOCK:
|
||||
case BOARD_M128:
|
||||
case BOARD_GRUVIN9X:
|
||||
@@ -1125,7 +1024,7 @@ void RegisterOpen9xFirmwares()
|
||||
Option extr_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
|
||||
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
|
||||
/* 9x board */
|
||||
open9x = new Open9xFirmware("opentx-stock", QObject::tr("openTx for 9X board"), new Open9xInterface(BOARD_STOCK), geturl(BOARD_STOCK), getstamp(BOARD_STOCK), getrnurl(BOARD_STOCK), false);
|
||||
open9x = new Open9xFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), new OpenTxInterface(BOARD_STOCK), geturl(BOARD_STOCK), getstamp(BOARD_STOCK), getrnurl(BOARD_STOCK), false);
|
||||
open9x->addOptions(ext_options);
|
||||
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1157,11 +1056,12 @@ void RegisterOpen9xFirmwares()
|
||||
open9x->addOption("novario", QObject::tr("No vario support"));
|
||||
open9x->addOption("nogps", QObject::tr("No GPS support"));
|
||||
open9x->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
|
||||
open9x->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
|
||||
open9x->addOptions(fai_options);
|
||||
firmwares.push_back(open9x);
|
||||
|
||||
/* 9x board with M128 chip */
|
||||
open9x = new Open9xFirmware("opentx-stock128", QObject::tr("openTx for M128 / 9X board"), new Open9xInterface(BOARD_M128), geturl(BOARD_M128), getstamp(BOARD_M128),getrnurl(BOARD_M128), false);
|
||||
open9x = new Open9xFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), new OpenTxInterface(BOARD_M128), geturl(BOARD_M128), getstamp(BOARD_M128),getrnurl(BOARD_M128), false);
|
||||
open9x->addOptions(ext_options);
|
||||
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1193,7 +1093,7 @@ void RegisterOpen9xFirmwares()
|
||||
firmwares.push_back(open9x);
|
||||
|
||||
/* 9XR board */
|
||||
open9x = new Open9xFirmware("opentx-9xr", QObject::tr("openTx for 9XR"), new Open9xInterface(BOARD_STOCK), geturl(BOARD_STOCK), getstamp(BOARD_STOCK),getrnurl(BOARD_STOCK), false);
|
||||
open9x = new Open9xFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), new OpenTxInterface(BOARD_STOCK), geturl(BOARD_STOCK), getstamp(BOARD_STOCK),getrnurl(BOARD_STOCK), false);
|
||||
open9x->addOptions(extr_options);
|
||||
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1227,7 +1127,7 @@ void RegisterOpen9xFirmwares()
|
||||
firmwares.push_back(open9x);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
open9x = new Open9xFirmware("opentx-9xr128", QObject::tr("openTx for 9XR with M128 chip"), new Open9xInterface(BOARD_M128), geturl(BOARD_M128), getstamp(BOARD_M128),getrnurl(BOARD_M128), false);
|
||||
open9x = new Open9xFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), new OpenTxInterface(BOARD_M128), geturl(BOARD_M128), getstamp(BOARD_M128),getrnurl(BOARD_M128), false);
|
||||
open9x->addOptions(extr_options);
|
||||
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1257,7 +1157,7 @@ void RegisterOpen9xFirmwares()
|
||||
firmwares.push_back(open9x);
|
||||
|
||||
/* Gruvin9x board */
|
||||
open9x = new Open9xFirmware("opentx-v4", QObject::tr("openTx for Gruvin9x board / 9X"), new Open9xInterface(BOARD_GRUVIN9X), geturl(BOARD_GRUVIN9X), getstamp(BOARD_GRUVIN9X),getrnurl(BOARD_GRUVIN9X), false);
|
||||
open9x = new Open9xFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), new OpenTxInterface(BOARD_GRUVIN9X), geturl(BOARD_GRUVIN9X), getstamp(BOARD_GRUVIN9X),getrnurl(BOARD_GRUVIN9X), false);
|
||||
open9x->setVariantBase(FRSKY_VARIANT);
|
||||
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1287,7 +1187,7 @@ void RegisterOpen9xFirmwares()
|
||||
|
||||
#ifndef __APPLE__
|
||||
/* SKY9X board */
|
||||
open9x = new Open9xFirmware("opentx-sky9x", QObject::tr("openTx for Sky9x board / 9X"), new Open9xInterface(BOARD_SKY9X), geturl(BOARD_SKY9X), getstamp(BOARD_SKY9X),getrnurl(BOARD_SKY9X), true);
|
||||
open9x = new Open9xFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), new OpenTxInterface(BOARD_SKY9X), geturl(BOARD_SKY9X), getstamp(BOARD_SKY9X),getrnurl(BOARD_SKY9X), true);
|
||||
open9x->setVariantBase(FRSKY_VARIANT);
|
||||
open9x->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1312,7 +1212,7 @@ void RegisterOpen9xFirmwares()
|
||||
#endif
|
||||
|
||||
/* Taranis board */
|
||||
open9x = new Open9xFirmware("opentx-taranis", QObject::tr("openTx for FrSky Taranis"), new Open9xInterface(BOARD_TARANIS), geturl(BOARD_TARANIS), getstamp(BOARD_TARANIS),getrnurl(BOARD_TARANIS), true);
|
||||
open9x = new Open9xFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), new OpenTxInterface(BOARD_TARANIS), geturl(BOARD_TARANIS), getstamp(BOARD_TARANIS),getrnurl(BOARD_TARANIS), true);
|
||||
open9x->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
open9x->addOption("notemplates", QObject::tr("Disable TEMPLATES menu"));
|
||||
open9x->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
@@ -1321,10 +1221,8 @@ void RegisterOpen9xFirmwares()
|
||||
open9x->addOptions(fai_options);
|
||||
firmwares.push_back(open9x);
|
||||
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int rev4a = settings.value("rev4asupport",0).toInt();
|
||||
if (rev4a) {
|
||||
open9x = new Open9xFirmware("opentx-taranisrev4a", QObject::tr("openTx for FrSky Taranis Rev4a"), new Open9xInterface(BOARD_TARANIS_REV4a), geturl(BOARD_TARANIS_REV4a), getstamp(BOARD_TARANIS_REV4a),getrnurl(BOARD_TARANIS), true);
|
||||
if (g.rev4aSupport()) {
|
||||
open9x = new Open9xFirmware("opentx-taranisrev4a", QObject::tr("OpenTX for FrSky Taranis Rev4a"), new OpenTxInterface(BOARD_TARANIS_REV4a), geturl(BOARD_TARANIS_REV4a), getstamp(BOARD_TARANIS_REV4a),getrnurl(BOARD_TARANIS), true);
|
||||
open9x->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
open9x->addOption("notemplates", QObject::tr("Disable TEMPLATES menu"));
|
||||
open9x->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
@@ -18,15 +18,18 @@
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads.open-tx.org/companion"
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads.open-tx.org/firmware"
|
||||
|
||||
class EFile;
|
||||
|
||||
class Open9xInterface : public EEPROMInterface
|
||||
class OpenTxInterface : public EEPROMInterface
|
||||
{
|
||||
public:
|
||||
|
||||
Open9xInterface(BoardEnum board);
|
||||
OpenTxInterface(BoardEnum board);
|
||||
|
||||
virtual ~Open9xInterface();
|
||||
virtual ~OpenTxInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
@@ -34,7 +37,7 @@ class Open9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t *eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
@@ -67,10 +70,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);
|
||||
@@ -94,6 +94,7 @@ class Open9xFirmware: public FirmwareInfo {
|
||||
addLanguage("se");
|
||||
addLanguage("cz");
|
||||
addLanguage("es");
|
||||
addLanguage("pl");
|
||||
addLanguage("pt");
|
||||
|
||||
addTTSLanguage("en");
|
||||
@@ -103,6 +104,7 @@ class Open9xFirmware: public FirmwareInfo {
|
||||
addTTSLanguage("se");
|
||||
addTTSLanguage("cz");
|
||||
addTTSLanguage("sk");
|
||||
addTTSLanguage("pl");
|
||||
addTTSLanguage("pt");
|
||||
addTTSLanguage("es");
|
||||
}
|
||||
@@ -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
|
||||
@@ -53,6 +53,8 @@
|
||||
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
#define NUM_POTS 3
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
@@ -78,6 +80,7 @@ namespace Open9x {
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/targets/stock/voice.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
@@ -100,14 +103,14 @@ bool hasExtendedTrims()
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return g_eeGeneral.stickMode;
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9x;
|
||||
|
||||
Open9xSimulator::Open9xSimulator(Open9xInterface * open9xInterface):
|
||||
Open9xSimulator::Open9xSimulator(OpenTxInterface * open9xInterface):
|
||||
open9xInterface(open9xInterface)
|
||||
{
|
||||
#define INIT_IMPORT
|
||||
@@ -132,13 +135,20 @@ bool Open9xSimulator::lcdChanged(bool & lightEnable)
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSimulator::start(RadioData &radioData, bool tests)
|
||||
void Open9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
open9xInterface->save(&Open9x::eeprom[0], radioData, SIMU_STOCK_VARIANTS);
|
||||
memcpy(&Open9x::eeprom[0], eeprom.data(), 2048);
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
// open9xInterface->save(&Open9x::eeprom[0], radioData, SIMU_STOCK_VARIANTS);
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
@@ -162,7 +172,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 +186,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;
|
||||
@@ -19,15 +19,17 @@
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class Open9xInterface;
|
||||
class OpenTxInterface;
|
||||
|
||||
class Open9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xSimulator(Open9xInterface *);
|
||||
Open9xSimulator(OpenTxInterface *);
|
||||
|
||||
virtual void start(RadioData &radioData, bool tests);
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
@@ -53,7 +55,7 @@ class Open9xSimulator : public SimulatorInterface {
|
||||
|
||||
protected:
|
||||
|
||||
Open9xInterface * open9xInterface;
|
||||
OpenTxInterface * open9xInterface;
|
||||
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Automatically generated file (CMake) - do not edit
|
||||
#define DATE_STR "@DATE@"
|
||||
#define TIME_STR "@TIME@"
|
||||
#define VERS_STR "c9x"
|
||||
#define SVN_STR "@FIRMWARE@-r@G9X_WC_REVISION@"
|
||||
#define VERS_STR "@C9X_VERSION@"
|
||||
#define MOD_STR "FH"
|
||||
|
||||
@@ -2,18 +2,6 @@
|
||||
#include "helpers.h"
|
||||
#include "th9xeeprom.h"
|
||||
|
||||
int8_t th9xFromSwitch(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;
|
||||
}
|
||||
}
|
||||
|
||||
RawSwitch th9xToSwitch(int8_t sw)
|
||||
{
|
||||
if (sw == 0)
|
||||
@@ -29,15 +17,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 +32,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 +47,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 +85,6 @@ Th9xGeneral::operator GeneralSettings ()
|
||||
}
|
||||
result.stickMode = stickMode;
|
||||
result.inactivityTimer = inactivityMin;
|
||||
result.throttleReversed = thr0pos;
|
||||
result.filterInput = adcFilt;
|
||||
return result;
|
||||
}
|
||||
@@ -169,35 +95,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 +122,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 +132,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,57 +155,36 @@ 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)
|
||||
t_Th9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
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;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = opCmp;
|
||||
c9x.val1 = val1;
|
||||
c9x.val2 = val2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = toSource(val1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = toSource(val2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = th9xToSwitch(val1).toValue();
|
||||
c9x.val2 = th9xToSwitch(val2).toValue();
|
||||
}
|
||||
@@ -331,7 +192,7 @@ t_Th9xCustomSwData::operator CustomSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
int8_t t_Th9xCustomSwData::fromSource(RawSource source)
|
||||
int8_t t_Th9xLogicalSwitchData::fromSource(RawSource source)
|
||||
{
|
||||
int v1 = 0;
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
@@ -355,7 +216,7 @@ int8_t t_Th9xCustomSwData::fromSource(RawSource source)
|
||||
return v1;
|
||||
}
|
||||
|
||||
RawSource t_Th9xCustomSwData::toSource(int8_t value)
|
||||
RawSource t_Th9xLogicalSwitchData::toSource(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
@@ -388,82 +249,12 @@ 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;
|
||||
c9x.used = true;
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
switch(tmrMode) {
|
||||
/*switch(tmrMode) {
|
||||
case 1:
|
||||
c9x.timers[0].mode = TMRMODE_ABS;
|
||||
break;
|
||||
@@ -476,7 +267,7 @@ t_Th9xModelData::operator ModelData ()
|
||||
default:
|
||||
c9x.timers[0].mode = TMRMODE_OFF;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
// c9x.timers[0].dir = tmrDir;
|
||||
c9x.timers[0].val = tmrVal;
|
||||
/*c9x.protocol = (Protocol)protocol;
|
||||
@@ -507,7 +298,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 +305,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 +312,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;
|
||||
}
|
||||
|
||||
@@ -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,22 +136,20 @@ PACK(typedef struct t_Th9xMixData {
|
||||
|
||||
operator MixData();
|
||||
t_Th9xMixData();
|
||||
t_Th9xMixData(MixData&);
|
||||
}) Th9xMixData;
|
||||
|
||||
PACK(typedef struct t_Th9xCustomSwData {
|
||||
PACK(typedef struct t_Th9xLogicalSwitchData {
|
||||
uint8_t sw:3; // 0..7
|
||||
uint8_t opCmp:2; // < & | ^
|
||||
uint8_t opRes:3; // 0 => 1=> 0=> !=> & | ^
|
||||
int8_t val1;
|
||||
int8_t val2;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Th9xCustomSwData() { memset(this, 0, sizeof(t_Th9xCustomSwData)); }
|
||||
t_Th9xCustomSwData(CustomSwData &);
|
||||
operator LogicalSwitchData();
|
||||
t_Th9xLogicalSwitchData() { memset(this, 0, sizeof(t_Th9xLogicalSwitchData)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
}) Th9xCustomSwData;
|
||||
}) Th9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Th9xTrimData {
|
||||
int8_t itrim:6; //trim index
|
||||
@@ -183,13 +173,10 @@ PACK(typedef struct t_Th9xModelData {
|
||||
int8_t curves3[TH9X_MAX_CURVES3][3]; // 9 new143
|
||||
int8_t curves5[TH9X_MAX_CURVES5][5]; // 10
|
||||
int8_t curves9[TH9X_MAX_CURVES9][9]; // 18
|
||||
Th9xCustomSwData switchTab[TH9X_MAX_SWITCHES];//
|
||||
Th9xLogicalSwitchData switchTab[TH9X_MAX_SWITCHES];//
|
||||
Th9xTrimData trimData[NUM_STICKS]; // 3*4 -> 1*4
|
||||
operator ModelData();
|
||||
t_Th9xModelData();
|
||||
t_Th9xModelData(ModelData&);
|
||||
}) Th9xModelData;
|
||||
|
||||
|
||||
#endif
|
||||
/*eof*/
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "th9xeeprom.h"
|
||||
#include "th9xsimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
@@ -44,8 +45,7 @@ const char * Th9xInterface::getName()
|
||||
|
||||
const int Th9xInterface::getEEpromSize()
|
||||
{
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString avrMCU = settings.value("mcu", QString("m64")).toString();
|
||||
QString avrMCU = g.mcu();
|
||||
if (avrMCU==QString("m128")) {
|
||||
return 2*EESIZE_STOCK;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Th9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying th9x import... ";
|
||||
|
||||
@@ -71,7 +71,7 @@ bool Th9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
@@ -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,14 +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:
|
||||
return 1;
|
||||
case Pots:
|
||||
@@ -199,7 +155,7 @@ int Th9xInterface::getCapability(const Capability capability)
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 0;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return TH9X_MAX_SWITCHES;
|
||||
case Outputs:
|
||||
return 8;
|
||||
@@ -210,8 +166,6 @@ int Th9xInterface::getCapability(const Capability capability)
|
||||
case Simulation:
|
||||
return 1;
|
||||
case HasContrast:
|
||||
case HasInputFilter:
|
||||
return 1;
|
||||
case CSFunc:
|
||||
return 13;
|
||||
case SlowScale:
|
||||
@@ -244,5 +198,5 @@ int Th9xInterface::isAvailable(Protocol proto, int port)
|
||||
|
||||
SimulatorInterface * Th9xInterface::getSimulator()
|
||||
{
|
||||
return new Th9xSimulator(this);
|
||||
return NULL; // new Th9xSimulator(this);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class Th9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t *eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
|
||||
@@ -13,407 +13,238 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtGui>
|
||||
#include "hexinterface.h"
|
||||
#include "splash.h"
|
||||
#include "flashinterface.h"
|
||||
|
||||
#define VERS_MARK "VERS"
|
||||
#define SVN_MARK "SVN"
|
||||
#define DATE_MARK "DATE"
|
||||
#define TIME_MARK "TIME"
|
||||
#define BLD_MARK "BLD"
|
||||
#define EEPR_MARK "EEPR"
|
||||
|
||||
int getFileType(const QString &fullFileName)
|
||||
{
|
||||
if(QFileInfo(fullFileName).suffix().toUpper()=="HEX") return FILE_TYPE_HEX;
|
||||
if(QFileInfo(fullFileName).suffix().toUpper()=="BIN") return FILE_TYPE_BIN;
|
||||
if(QFileInfo(fullFileName).suffix().toUpper()=="EEPM") return FILE_TYPE_EEPM;
|
||||
if(QFileInfo(fullFileName).suffix().toUpper()=="EEPE") return FILE_TYPE_EEPE;
|
||||
if(QFileInfo(fullFileName).suffix().toUpper()=="XML") return FILE_TYPE_XML;
|
||||
return 0;
|
||||
QString suffix = QFileInfo(fullFileName).suffix().toUpper();
|
||||
if (suffix == "HEX")
|
||||
return FILE_TYPE_HEX;
|
||||
else if (suffix == "BIN")
|
||||
return FILE_TYPE_BIN;
|
||||
else if (suffix == "EEPM")
|
||||
return FILE_TYPE_EEPM;
|
||||
else if (suffix == "EEPE")
|
||||
return FILE_TYPE_EEPE;
|
||||
else if (suffix == "XML")
|
||||
return FILE_TYPE_XML;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
FlashInterface::FlashInterface(QString fileName)
|
||||
FlashInterface::FlashInterface(QString fileName):
|
||||
flash(MAX_FSIZE, 0),
|
||||
flash_size(0),
|
||||
splash_offset(0),
|
||||
splash_size(0),
|
||||
splash_width(0),
|
||||
splash_height(0),
|
||||
isValidFlag(false)
|
||||
{
|
||||
char * temp = (char *)malloc(MAX_FSIZE);
|
||||
date = "";
|
||||
time = "";
|
||||
svn = "";
|
||||
build = "";
|
||||
isValidFlag = true;
|
||||
QFile file(fileName);
|
||||
flash_size=0;
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
isValidFlag = false;
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { // reading HEX TEXT file
|
||||
QTextStream inputStream(&file);
|
||||
flash_size = HexInterface(inputStream).load((uint8_t *)flash.data(), MAX_FSIZE);
|
||||
file.close();
|
||||
if (flash_size == 0) {
|
||||
file.open(QIODevice::ReadOnly);
|
||||
flash_size = file.read((char *)flash.data(), MAX_FSIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flash_size > 0) {
|
||||
svn = seekLabel(SVN_MARK);
|
||||
version = seekLabel(VERS_MARK);
|
||||
date = seekLabel(DATE_MARK);
|
||||
time = seekLabel(TIME_MARK);
|
||||
eeprom = seekLabel(EEPR_MARK);
|
||||
SeekSplash();
|
||||
isValidFlag = true;
|
||||
}
|
||||
}
|
||||
|
||||
QString FlashInterface::seekString(const QString & string)
|
||||
{
|
||||
QString result = "";
|
||||
|
||||
int start = flash.indexOf(string);
|
||||
if (start > 0) {
|
||||
start += string.length();
|
||||
int end = -1;
|
||||
for (int i=start; i<start+20; i++) {
|
||||
char c = flash.at(i);
|
||||
if (c == '\0' || c == '\036') {
|
||||
end = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (end > 0) {
|
||||
result = flash.mid(start, (end - start)).trimmed();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QString FlashInterface::seekLabel(const QString & label)
|
||||
{
|
||||
QString result = seekString(label + "\037\033:");
|
||||
if (!result.isEmpty())
|
||||
return result;
|
||||
|
||||
return seekString(label + ":");
|
||||
}
|
||||
|
||||
bool FlashInterface::SeekSplash(QByteArray splash)
|
||||
{
|
||||
int start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset = start;
|
||||
splash_size = splash.size();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
QTextStream inputStream(&file);
|
||||
flash_size = HexInterface(inputStream).load((uint8_t *)temp, MAX_FSIZE);
|
||||
file.close();
|
||||
inputStream.reset();
|
||||
if (flash_size == 0) {
|
||||
QFile file(fileName);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
char * bin_flash = (char *)malloc(MAX_FSIZE);
|
||||
flash_size = file.read(bin_flash, MAX_FSIZE);
|
||||
flash = QByteArray(bin_flash, flash_size);
|
||||
free(bin_flash);
|
||||
}
|
||||
else {
|
||||
flash = QByteArray(temp, flash_size);
|
||||
}
|
||||
if (flash_size > 0) {
|
||||
SeekSvn();
|
||||
SeekDate();
|
||||
SeekTime();
|
||||
SeekBuild();
|
||||
SeekSplash();
|
||||
}
|
||||
else {
|
||||
isValidFlag = false;
|
||||
}
|
||||
}
|
||||
free(temp);
|
||||
}
|
||||
|
||||
QString FlashInterface::getDate(void)
|
||||
{
|
||||
return date;
|
||||
}
|
||||
|
||||
QString FlashInterface::getTime(void)
|
||||
{
|
||||
return time;
|
||||
}
|
||||
|
||||
QString FlashInterface::getSvn(void)
|
||||
{
|
||||
return svn;
|
||||
}
|
||||
|
||||
QString FlashInterface::getBuild(void)
|
||||
{
|
||||
return build;
|
||||
}
|
||||
|
||||
int FlashInterface::getSize()
|
||||
{
|
||||
return flash_size;
|
||||
}
|
||||
|
||||
void FlashInterface::SeekSvn(void)
|
||||
{
|
||||
int i, start = -1, end = -1;
|
||||
start = flash.indexOf(QString(SVN_MARK));
|
||||
if (start > 0) {
|
||||
start += QString(SVN_MARK).length();
|
||||
for (i = start; i < (start + 20); i++) {
|
||||
if (flash.at(i) == 0) {
|
||||
end = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (end > 0) {
|
||||
svn = QString(flash.mid(start, (end - start))).trimmed();
|
||||
}
|
||||
else {
|
||||
svn = QString("");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void FlashInterface::SeekDate(void)
|
||||
bool FlashInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
{
|
||||
int i, start = -1, end = -1, startsvn=0;
|
||||
startsvn = flash.indexOf(QString(SVN_MARK));
|
||||
if (startsvn>0) {
|
||||
start = flash.indexOf(QString(DATE_MARK),startsvn);
|
||||
} else {
|
||||
start = flash.indexOf(QString(DATE_MARK));
|
||||
}
|
||||
if (start > 0) {
|
||||
start += QString(DATE_MARK).length();
|
||||
for (i = start; i < (start + 20); i++) {
|
||||
if (flash.at(i) == 0) {
|
||||
end = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (end > 0) {
|
||||
date = QString(flash.mid(start, (end - start))).trimmed();
|
||||
}
|
||||
else {
|
||||
date = QString("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FlashInterface::SeekTime(void)
|
||||
{
|
||||
int i, start = -1, end = -1, startsvn=0;
|
||||
startsvn = flash.indexOf(QString(SVN_MARK));
|
||||
if (startsvn>0) {
|
||||
start = flash.indexOf(QString(TIME_MARK),startsvn);
|
||||
} else {
|
||||
start = flash.indexOf(QString(TIME_MARK));
|
||||
}
|
||||
if (start > 0) {
|
||||
start += QString(TIME_MARK).length();
|
||||
for (i = start; i < (start + 20); i++) {
|
||||
if (flash.at(i) == 0) {
|
||||
end = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (end > 0) {
|
||||
time = QString(flash.mid(start, (end - start))).trimmed();
|
||||
}
|
||||
else {
|
||||
time = QString("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FlashInterface::SeekBuild(void)
|
||||
{
|
||||
int i, start = -1, end = -1;
|
||||
start = flash.indexOf(QString(BLD_MARK));
|
||||
if (start > 0) {
|
||||
start += QString(BLD_MARK).length();
|
||||
for (i = start; i < (start + 20); i++) {
|
||||
if (flash.at(i) == 0) {
|
||||
end = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (end > 0) {
|
||||
build = QString(flash.mid(start, (end - start))).trimmed();
|
||||
}
|
||||
else {
|
||||
build = QString("");
|
||||
}
|
||||
}
|
||||
else {
|
||||
start = flash.indexOf(QString(VAR_MARK));
|
||||
if (start > 0) {
|
||||
start += QString(VAR_MARK).length();
|
||||
for (i = start; i < (start + 20); i++) {
|
||||
if (flash.at(i) == 0) {
|
||||
end = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (end > 0) {
|
||||
build = QString(flash.mid(start, (end - start))).trimmed();
|
||||
qDebug() << "Seek";
|
||||
int start = 0;
|
||||
while (start>=0) {
|
||||
start = flash.indexOf(sps, start+1);
|
||||
if (start>0) {
|
||||
int end = start + sps.size() + size;
|
||||
if (end == flash.indexOf(spe, end)) {
|
||||
splash_offset = start + sps.size();
|
||||
splash_size = end - start - sps.size();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
build = QString("");
|
||||
qDebug() << flash.indexOf(spe, start) << end << sps.size() << spe;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#define OTX_SPS_9X "SPS\0\200\100"
|
||||
#define OTX_SPS_TARANIS "SPS\0\324\100"
|
||||
#define OTX_SPS_SIZE 6
|
||||
#define OTX_SPE "SPE"
|
||||
#define OTX_SPE_SIZE 4
|
||||
|
||||
void FlashInterface::SeekSplash(void)
|
||||
{
|
||||
QByteArray splash,spe;
|
||||
splash_offset=0;
|
||||
splash.clear();
|
||||
splash.append((char *)gr9x_splash, sizeof(gr9x_splash));
|
||||
int start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset=start;
|
||||
splash_type=1;
|
||||
splash_size=sizeof(gr9x_splash);
|
||||
}
|
||||
if (start==-1) {
|
||||
splash.clear();
|
||||
splash.append((char *)er9x_splash, sizeof(er9x_splash));
|
||||
start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset=start;
|
||||
splash_type=2;
|
||||
splash_size=sizeof(er9x_splash);
|
||||
}
|
||||
splash_size = 0;
|
||||
splash_offset = 0;
|
||||
splash_width = SPLASH_WIDTH;
|
||||
splash_height = SPLASH_HEIGHT;
|
||||
splash_format = QImage::Format_Mono;
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)gr9x_splash, sizeof(gr9x_splash))) || SeekSplash(QByteArray((const char *)gr9xv4_splash, sizeof(gr9xv4_splash)))) {
|
||||
return;
|
||||
}
|
||||
if (start==-1) {
|
||||
splash.clear();
|
||||
splash.append((char *)opentx_splash, sizeof(opentx_splash));
|
||||
start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset=start;
|
||||
splash_type=3;
|
||||
splash_size=sizeof(opentx_splash);
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)er9x_splash, sizeof(er9x_splash)))) {
|
||||
return;
|
||||
}
|
||||
if (start==-1) {
|
||||
splash.clear();
|
||||
splash.append((char *)opentxtaranis_splash, sizeof(opentxtaranis_splash));
|
||||
start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset=start;
|
||||
splash_type=5;
|
||||
splash_size=sizeof(opentxtaranis_splash);
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)opentx_splash, sizeof(opentx_splash)))) {
|
||||
return;
|
||||
}
|
||||
if (start==-1) {
|
||||
splash.clear();
|
||||
splash.append((char *)gr9xv4_splash, sizeof(gr9xv4_splash));
|
||||
start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset=start;
|
||||
splash_type=1;
|
||||
splash_size=sizeof(gr9xv4_splash);
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)opentxtaranis_splash, sizeof(opentxtaranis_splash)))) {
|
||||
splash_width = SPLASHX9D_WIDTH;
|
||||
splash_height = SPLASHX9D_HEIGHT;
|
||||
splash_format = QImage::Format_Indexed8;
|
||||
return;
|
||||
}
|
||||
if (start==-1) {
|
||||
splash.clear();
|
||||
splash.append((char *)ersky9x_splash, sizeof(ersky9x_splash));
|
||||
start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset=start;
|
||||
splash_type=4;
|
||||
splash_size=sizeof(ersky9x_splash);
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)ersky9x_splash, sizeof(ersky9x_splash)))) {
|
||||
return;
|
||||
}
|
||||
if (start==-1) {
|
||||
start=0;
|
||||
splash.clear();
|
||||
splash.append(OTX_SPS);
|
||||
splash.append('\0');
|
||||
spe.clear();
|
||||
spe.append(OTX_SPE);
|
||||
spe.append('\0');
|
||||
int diff=0;
|
||||
int end=0;
|
||||
while (start>=0) {
|
||||
start = flash.indexOf(splash,start+1);
|
||||
if (start>0) {
|
||||
end=flash.indexOf(spe,start+1);
|
||||
if (end>0) {
|
||||
diff=end-start;
|
||||
while (diff<1030 && end>0) {
|
||||
end=flash.indexOf(spe,end+1);
|
||||
diff=end-start;
|
||||
}
|
||||
if (end>0) {
|
||||
diff=end-start;
|
||||
if (diff==1030) {
|
||||
splash_offset=start+OTX_OFFSET;
|
||||
splash_type=2;
|
||||
splash_size=sizeof(opentx_splash);
|
||||
break;
|
||||
}
|
||||
if (diff==6790) {
|
||||
splash_offset=start+OTX_OFFSET;
|
||||
splash_type=5;
|
||||
splash_size=sizeof(opentxtaranis_splash);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(OTX_SPS_9X, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), 1024)) {
|
||||
return;
|
||||
}
|
||||
if (start==-1) {
|
||||
start=0;
|
||||
splash.clear();
|
||||
splash.append(ERSKY9X_SPS);
|
||||
splash.append('\0');
|
||||
spe.clear();
|
||||
spe.append(ERSKY9X_SPE);
|
||||
spe.append('\0');
|
||||
int diff=0;
|
||||
int end=0;
|
||||
while (start>=0) {
|
||||
start = flash.indexOf(splash,start+1);
|
||||
if (start>0) {
|
||||
end=flash.indexOf(spe,start+1);
|
||||
if (end>0) {
|
||||
diff=end-start;
|
||||
while (diff<1031 && end>0) {
|
||||
end=flash.indexOf(spe,end+1);
|
||||
diff=end-start;
|
||||
}
|
||||
if (end>0) {
|
||||
diff=end-start;
|
||||
if (diff==1031) {
|
||||
splash_offset=start+ERSKY9X_OFFSET;
|
||||
splash_type=4;
|
||||
splash_size=sizeof(ersky9x_splash);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(OTX_SPS_TARANIS, sizeof(OTX_SPS_TARANIS)), QByteArray(OTX_SPE, sizeof(OTX_SPE)), 6790)) {
|
||||
splash_width = SPLASHX9D_WIDTH;
|
||||
splash_height = SPLASHX9D_HEIGHT;
|
||||
splash_format = QImage::Format_Indexed8;
|
||||
return;
|
||||
}
|
||||
if (start==-1) {
|
||||
splash.clear();
|
||||
splash.append(ERSPLASH_MARKER);
|
||||
splash.append('\0');
|
||||
start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset=start+ERSPLASH_OFFSET;
|
||||
splash_type=2;
|
||||
splash_size=sizeof(er9x_splash);
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(ERSKY9X_SPS, sizeof(ERSKY9X_SPS)), QByteArray(ERSKY9X_SPE, sizeof(ERSKY9X_SPE)), 1030)) {
|
||||
return;
|
||||
}
|
||||
if (splash_offset>0) {
|
||||
if (splash_type==5) {
|
||||
splash_width=SPLASHX9D_WIDTH;
|
||||
splash_height=SPLASHX9D_HEIGHT;
|
||||
splash_colors=16;
|
||||
splash_format=QImage::Format_Indexed8;
|
||||
} else {
|
||||
splash_width=SPLASH_WIDTH;
|
||||
splash_height=SPLASH_HEIGHT;
|
||||
splash_colors=1;
|
||||
splash_format=QImage::Format_Mono;
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(ERSPLASH_MARKER, sizeof(ERSPLASH_MARKER)))) {
|
||||
splash_offset += sizeof(ERSPLASH_MARKER);
|
||||
splash_size = sizeof(er9x_splash);
|
||||
}
|
||||
}
|
||||
|
||||
bool FlashInterface::setSplash(const QImage & newsplash)
|
||||
{
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
char b[SPLASH_SIZE_MAX] = {0};
|
||||
QColor color;
|
||||
QByteArray splash;
|
||||
if (splash_offset == 0) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if (splash_colors == 16) {
|
||||
unsigned int idx = 0;
|
||||
for (unsigned int y=0; y<splash_height; y+=8) {
|
||||
for (unsigned int x=0; x<splash_width; x++) {
|
||||
unsigned int values[] = { 255, 255, 255, 255 };
|
||||
for (unsigned int z=0; z<8; z++) {
|
||||
if (y+z < splash_height) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y+z));
|
||||
for (unsigned int i=0; i<4; i++) {
|
||||
if (gray & (1<<(4+i)))
|
||||
values[i] -= 1 << z;
|
||||
}
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
unsigned int idx = 0;
|
||||
for (unsigned int y=0; y<splash_height; y+=8) {
|
||||
for (unsigned int x=0; x<splash_width; x++) {
|
||||
unsigned int values[] = { 255, 255, 255, 255 };
|
||||
for (unsigned int z=0; z<8; z++) {
|
||||
if (y+z < splash_height) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y+z));
|
||||
for (unsigned int i=0; i<4; i++) {
|
||||
if (gray & (1<<(4+i)))
|
||||
values[i] -= 1 << z;
|
||||
}
|
||||
}
|
||||
for (int i=0; i<4; i++)
|
||||
b[idx++] = values[i];
|
||||
}
|
||||
for (int i=0; i<4; i++)
|
||||
b[idx++] = values[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
QColor black = QColor(0,0,0);
|
||||
QImage blackNwhite = newsplash.convertToFormat(QImage::Format_MonoLSB);
|
||||
for (uint y=0; y<splash_height; y++) {
|
||||
for (uint x=0; x<splash_width; x++) {
|
||||
color = QColor(blackNwhite.pixel(x,y));
|
||||
b[splash_width*(y/8) + x] |=((color==black ? 1: 0)<<(y % 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
splash.clear();
|
||||
splash.append(b, splash_size);
|
||||
flash.replace(splash_offset, splash_size, splash);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
QColor black = QColor(0,0,0);
|
||||
QImage blackNwhite = newsplash.convertToFormat(QImage::Format_MonoLSB);
|
||||
for (uint y=0; y<splash_height; y++) {
|
||||
for (uint x=0; x<splash_width; x++) {
|
||||
color = QColor(blackNwhite.pixel(x,y));
|
||||
b[splash_width*(y/8) + x] |=((color==black ? 1: 0)<<(y % 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
splash.clear();
|
||||
splash.append(b, splash_size);
|
||||
flash.replace(splash_offset, splash_size, splash);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint FlashInterface::getSplashWidth()
|
||||
int FlashInterface::getSplashWidth()
|
||||
{
|
||||
return splash_width;
|
||||
}
|
||||
@@ -423,11 +254,6 @@ uint FlashInterface::getSplashHeight()
|
||||
return splash_height;
|
||||
}
|
||||
|
||||
uint FlashInterface::getSplashColors()
|
||||
{
|
||||
return splash_colors;
|
||||
}
|
||||
|
||||
QImage::Format FlashInterface::getSplashFormat()
|
||||
{
|
||||
return splash_format;
|
||||
@@ -435,7 +261,11 @@ QImage::Format FlashInterface::getSplashFormat()
|
||||
|
||||
QImage FlashInterface::getSplash()
|
||||
{
|
||||
if (splash_colors == 16) {
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
return QImage(); // empty image
|
||||
}
|
||||
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
QImage image(splash_width, splash_height, QImage::Format_RGB888);
|
||||
if (splash_offset > 0) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
@@ -472,7 +302,6 @@ bool FlashInterface::isValid()
|
||||
return isValidFlag;
|
||||
}
|
||||
|
||||
|
||||
uint FlashInterface::saveFlash(QString fileName)
|
||||
{
|
||||
uint8_t binflash[MAX_FSIZE];
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
|
||||
#ifndef FLASHINTERFACE_H
|
||||
#define FLASHINTERFACE_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
#include <inttypes.h>
|
||||
#include "file.h"
|
||||
|
||||
#define MAX_FSIZE (512*1024)
|
||||
#define SPLASH_WIDTH (128)
|
||||
#define SPLASH_HEIGHT (64)
|
||||
@@ -26,18 +28,9 @@
|
||||
#define SPLASH_SIZE_MAX (SPLASHX9D_WIDTH*SPLASHX9D_HEIGHT/2)
|
||||
#define ERSPLASH_MARKER "Splash"
|
||||
#define ERSPLASH_OFFSET (10)
|
||||
#define OTX_SPS "SPS"
|
||||
#define OTX_SPE "SPE"
|
||||
#define OTX_OFFSET (6)
|
||||
#define ERSKY9X_SPS "SPS"
|
||||
#define ERSKY9X_SPE "SPE"
|
||||
#define ERSKY9X_OFFSET (7)
|
||||
#define VERS_MARK "VERS:"
|
||||
#define SVN_MARK "SVN:"
|
||||
#define DATE_MARK "DATE:"
|
||||
#define TIME_MARK "TIME:"
|
||||
#define BLD_MARK "BLD:"
|
||||
#define VAR_MARK "EEPR:"
|
||||
|
||||
#define FILE_TYPE_BIN 1
|
||||
#define FILE_TYPE_HEX 2
|
||||
@@ -49,48 +42,45 @@ int getFileType(const QString &fullFileName);
|
||||
|
||||
class FlashInterface
|
||||
{
|
||||
public:
|
||||
FlashInterface(QString filename);
|
||||
QString getDate();
|
||||
QString getTime();
|
||||
QString getSvn();
|
||||
int getSize();
|
||||
QString getBuild();
|
||||
QImage getSplash();
|
||||
bool setSplash(const QImage & newsplash);
|
||||
bool hasSplash();
|
||||
uint getSplashWidth();
|
||||
uint getSplashHeight();
|
||||
uint getSplashColors();
|
||||
QImage::Format getSplashFormat();
|
||||
uint saveFlash(QString fileName);
|
||||
bool isValid();
|
||||
public:
|
||||
FlashInterface(QString filename);
|
||||
inline QString getDate() { return date; }
|
||||
inline QString getTime() { return time; }
|
||||
inline QString getSvn() { return svn; }
|
||||
int getSize() { return flash_size; }
|
||||
inline QString getVersion() { return version; }
|
||||
inline QString getEEprom() { return eeprom; }
|
||||
QImage getSplash();
|
||||
bool setSplash(const QImage & newsplash);
|
||||
bool hasSplash();
|
||||
int getSplashWidth();
|
||||
uint getSplashHeight();
|
||||
QImage::Format getSplashFormat();
|
||||
uint saveFlash(QString fileName);
|
||||
bool isValid();
|
||||
|
||||
private:
|
||||
QByteArray flash;
|
||||
void SeekVer();
|
||||
void SeekSvn();
|
||||
void SeekDate();
|
||||
void SeekTime();
|
||||
void SeekBuild();
|
||||
void SeekSplash();
|
||||
QString filename;
|
||||
QString date;
|
||||
QString time;
|
||||
QString svn;
|
||||
QString build;
|
||||
QByteArray splash;
|
||||
uint splash_offset;
|
||||
uint splash_type;
|
||||
uint splash_size;
|
||||
uint splash_width;
|
||||
uint splash_height;
|
||||
uint splash_colors;
|
||||
QImage::Format splash_format;
|
||||
uint flash_size;
|
||||
|
||||
protected:
|
||||
bool isValidFlag;
|
||||
private:
|
||||
QByteArray flash;
|
||||
uint flash_size;
|
||||
QString seekString(const QString & string);
|
||||
QString seekLabel(const QString & label);
|
||||
void SeekSplash();
|
||||
bool SeekSplash(QByteArray sps, QByteArray spe, int size);
|
||||
bool SeekSplash(QByteArray splash);
|
||||
QString filename;
|
||||
QString date;
|
||||
QString time;
|
||||
QString svn;
|
||||
QString version;
|
||||
QString eeprom;
|
||||
QByteArray splash;
|
||||
uint splash_offset;
|
||||
uint splash_size;
|
||||
uint splash_width;
|
||||
uint splash_height;
|
||||
QImage::Format splash_format;
|
||||
bool isValidFlag;
|
||||
};
|
||||
#endif /* FLASHINTERFACE_H */
|
||||
|
||||
#endif /* FLASHINTERFACE_H */
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#include "fusesdialog.h"
|
||||
#include "ui_fusesdialog.h"
|
||||
|
||||
#include "burnconfigdialog.h"
|
||||
#include "helpers.h"
|
||||
|
||||
fusesDialog::fusesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::fusesDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
}
|
||||
|
||||
fusesDialog::~fusesDialog()
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Fuses</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion9x.qrc">
|
||||
<normaloff>:/images/fuses.png</normaloff>:/images/fuses.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="readFuses">
|
||||
@@ -116,7 +112,7 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion9x.qrc"/>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
#include "fwpreferencesdialog.h"
|
||||
#include "ui_fwpreferencesdialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QtGui>
|
||||
|
||||
fwPreferencesDialog::fwPreferencesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::fwPreferencesDialog),
|
||||
updateLock(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("fwpreferences.png"));
|
||||
|
||||
QCheckBox * OptionCheckBox[]= {
|
||||
ui->optionCheckBox_1, ui->optionCheckBox_2, ui->optionCheckBox_3, ui->optionCheckBox_4, ui->optionCheckBox_5, ui->optionCheckBox_6, ui->optionCheckBox_7,
|
||||
ui->optionCheckBox_8, ui->optionCheckBox_9, ui->optionCheckBox_10, ui->optionCheckBox_11, ui->optionCheckBox_12, ui->optionCheckBox_13, ui->optionCheckBox_14,
|
||||
ui->optionCheckBox_15,ui->optionCheckBox_16, ui->optionCheckBox_17, ui->optionCheckBox_18, ui->optionCheckBox_19, ui->optionCheckBox_20, ui->optionCheckBox_21,
|
||||
ui->optionCheckBox_22, ui->optionCheckBox_23, ui->optionCheckBox_24, ui->optionCheckBox_25, ui->optionCheckBox_26, ui->optionCheckBox_27, ui->optionCheckBox_28,
|
||||
ui->optionCheckBox_29, ui->optionCheckBox_30, ui->optionCheckBox_31, ui->optionCheckBox_32, ui->optionCheckBox_33, ui->optionCheckBox_34, ui->optionCheckBox_35,
|
||||
ui->optionCheckBox_36, ui->optionCheckBox_37, ui->optionCheckBox_38, ui->optionCheckBox_39, ui->optionCheckBox_40, ui->optionCheckBox_41, ui->optionCheckBox_42,
|
||||
NULL };
|
||||
|
||||
voice=NULL;
|
||||
|
||||
connect(ui->langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
|
||||
connect(ui->voiceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
|
||||
|
||||
for (int i=0; OptionCheckBox[i]; i++) {
|
||||
optionsCheckBoxes.push_back(OptionCheckBox[i]);
|
||||
connect(OptionCheckBox[i], SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
|
||||
}
|
||||
|
||||
initSettings();
|
||||
|
||||
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
||||
|
||||
shrink();
|
||||
}
|
||||
|
||||
|
||||
fwPreferencesDialog::~fwPreferencesDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::showVoice(bool show)
|
||||
{
|
||||
if (show)
|
||||
showVoice();
|
||||
else
|
||||
hideVoice();
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::showVoice()
|
||||
{
|
||||
ui->voiceLine->show();
|
||||
ui->voiceLabel->show();
|
||||
ui->voiceCombo->show();
|
||||
ui->voice_dnld->show();
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::hideVoice()
|
||||
{
|
||||
ui->voiceLine->hide();
|
||||
ui->voiceLabel->hide();
|
||||
ui->voiceCombo->hide();
|
||||
ui->voice_dnld->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::baseFirmwareChanged()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
voice=NULL;
|
||||
foreach(FirmwareInfo * firmware, firmwares) {
|
||||
if (firmware->id == selected_firmware) {
|
||||
showVoice(firmware->voice);
|
||||
populateFirmwareOptions(firmware);
|
||||
break;
|
||||
}
|
||||
}
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
FirmwareVariant fwPreferencesDialog::getFirmwareVariant()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
bool voice=false;
|
||||
foreach(FirmwareInfo * firmware, firmwares) {
|
||||
if (firmware->id == selected_firmware) {
|
||||
QString id = firmware->id;
|
||||
foreach(QCheckBox *cb, optionsCheckBoxes) {
|
||||
if (cb->isChecked()) {
|
||||
if (cb->text()=="voice" && cb->isChecked())
|
||||
voice=true;
|
||||
id += QString("-") + cb->text();
|
||||
}
|
||||
}
|
||||
if (! firmware->eepromInterface->getCapability(MultiLangVoice)) {
|
||||
if (ui->voiceCombo->count() && (voice || firmware->voice))
|
||||
id += QString("-tts") + ui->voiceCombo->currentText();
|
||||
}
|
||||
if (ui->langCombo->count())
|
||||
id += QString("-") + ui->langCombo->currentText();
|
||||
|
||||
return GetFirmwareVariant(id);
|
||||
}
|
||||
}
|
||||
|
||||
// Should never occur...
|
||||
return default_firmware_variant;
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::firmwareOptionChanged(bool state)
|
||||
{
|
||||
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
|
||||
FirmwareInfo * firmware=NULL;
|
||||
if (cb && state) {
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
foreach(firmware, firmwares) {
|
||||
if (firmware->id == selected_firmware) {
|
||||
foreach(QList<Option> opts, firmware->opts) {
|
||||
foreach(Option opt, opts) {
|
||||
if (cb->text() == opt.name) {
|
||||
foreach(Option other, opts) {
|
||||
if (other.name != opt.name) {
|
||||
foreach(QCheckBox *ocb, optionsCheckBoxes) {
|
||||
if (ocb->text() == other.name)
|
||||
ocb->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
|
||||
return firmwareChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (cb && !state) {
|
||||
if (cb->text()=="voice") {
|
||||
hideVoice();
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
showVoice(voice->isChecked());
|
||||
} else if (firmware) {
|
||||
if (firmware->voice) {
|
||||
showVoice();
|
||||
}
|
||||
}
|
||||
return firmwareChanged();
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::firmwareLangChanged()
|
||||
{
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::firmwareChanged()
|
||||
{
|
||||
if (updateLock)
|
||||
return;
|
||||
|
||||
FirmwareVariant variant = getFirmwareVariant();
|
||||
QString stamp;
|
||||
stamp.append(variant.firmware->stamp);
|
||||
ui->fw_dnld->setEnabled(!variant.firmware->getUrl(variant.id).isNull());
|
||||
QString url=variant.firmware->getUrl(variant.id);
|
||||
// B-Plan
|
||||
if (false) {
|
||||
ui->CPU_ID_LE->show();
|
||||
ui->CPU_ID_LABEL->show();
|
||||
} else {
|
||||
ui->CPU_ID_LE->hide();
|
||||
ui->CPU_ID_LABEL->hide();
|
||||
}
|
||||
int fwrev = g.fwRev.get(variant.id);
|
||||
if (fwrev != 0) {
|
||||
ui->FwInfo->setText(tr("Last downloaded release: %1").arg(fwrev));
|
||||
if (!stamp.isEmpty()) {
|
||||
ui->checkFWUpdates->show();
|
||||
} else {
|
||||
ui->checkFWUpdates->hide();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ui->fw_dnld->isEnabled()) {
|
||||
ui->FwInfo->setText(tr("The selected firmware has never been downloaded by Companion."));
|
||||
ui->checkFWUpdates->hide();
|
||||
}
|
||||
else {
|
||||
ui->FwInfo->setText(tr("The selected firmware cannot be downloaded by Companion."));
|
||||
ui->checkFWUpdates->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::writeValues()
|
||||
{
|
||||
g.cpuId( ui->CPU_ID_LE->text() );
|
||||
current_firmware_variant = getFirmwareVariant();
|
||||
g.profile[g.id()].fwType( current_firmware_variant.id );
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
|
||||
{
|
||||
const FirmwareInfo * parent = firmware->parent ? firmware->parent : firmware;
|
||||
|
||||
updateLock = true;
|
||||
|
||||
ui->langCombo->clear();
|
||||
foreach(const char *lang, parent->languages) {
|
||||
ui->langCombo->addItem(lang);
|
||||
if (current_firmware_variant.id.endsWith(lang))
|
||||
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
|
||||
}
|
||||
ui->voiceCombo->clear();
|
||||
foreach(const char *lang, parent->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (current_firmware_variant.id.contains(QString("-tts%1").arg(lang)))
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
|
||||
showVoice(ui->langCombo->count()!=0);
|
||||
|
||||
int index = 0;
|
||||
foreach(QList<Option> opts, parent->opts) {
|
||||
foreach(Option opt, opts) {
|
||||
if (index >= optionsCheckBoxes.size()) {
|
||||
qDebug() << "This firmware needs more options checkboxes!";
|
||||
}
|
||||
else {
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index++);
|
||||
if (cb) {
|
||||
cb->show();
|
||||
cb->setText(opt.name);
|
||||
cb->setToolTip(opt.tooltip);
|
||||
cb->setCheckState(current_firmware_variant.id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
|
||||
|
||||
if (opt.name==QString("voice")) {
|
||||
voice=cb;
|
||||
showVoice(current_firmware_variant.id.contains(opt.name) ||firmware->voice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (; index<optionsCheckBoxes.size(); index++) {
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index);
|
||||
cb->hide();
|
||||
cb->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
|
||||
updateLock = false;
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::initSettings()
|
||||
{
|
||||
ui->CPU_ID_LE->setText(g.cpuId());
|
||||
FirmwareInfo * current_firmware = GetCurrentFirmware();
|
||||
|
||||
foreach(FirmwareInfo * firmware, firmwares) {
|
||||
ui->downloadVerCB->addItem(firmware->name, firmware->id);
|
||||
if (current_firmware == firmware) {
|
||||
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
baseFirmwareChanged();
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::on_checkFWUpdates_clicked()
|
||||
{
|
||||
FirmwareVariant variant = getFirmwareVariant();
|
||||
if (g.profile[g.id()].burnFirmware()) {
|
||||
current_firmware_variant = variant;
|
||||
g.profile[g.id()].fwType( variant.id );
|
||||
}
|
||||
MainWindow * mw = (MainWindow *)this->parent();
|
||||
mw->checkForUpdates(true, variant.id);
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::on_fw_dnld_clicked()
|
||||
{
|
||||
MainWindow * mw = (MainWindow *)this->parent();
|
||||
FirmwareVariant variant = getFirmwareVariant();
|
||||
writeValues();
|
||||
if (!variant.firmware->getUrl(variant.id).isNull()) {
|
||||
if (g.profile[g.id()].burnFirmware()) {
|
||||
current_firmware_variant = getFirmwareVariant();
|
||||
g.profile[g.id()].fwType( current_firmware_variant.id );
|
||||
}
|
||||
mw->downloadLatestFW(current_firmware_variant.firmware, current_firmware_variant.id);
|
||||
}
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void fwPreferencesDialog::on_voice_dnld_clicked()
|
||||
{
|
||||
QString url="http://fw.opentx.it/voices/";
|
||||
FirmwareVariant variant = getFirmwareVariant();
|
||||
url.append(QString("%1/%2/").arg(variant.firmware->id).arg(ui->voiceCombo->currentText()));
|
||||
QDesktopServices::openUrl(url);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#ifndef FWPREFERENCESDIALOG_H
|
||||
#define FWPREFERENCESDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QCheckBox>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class fwPreferencesDialog;
|
||||
}
|
||||
|
||||
class Joystick;
|
||||
|
||||
class fwPreferencesDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit fwPreferencesDialog(QWidget *parent = 0);
|
||||
~fwPreferencesDialog();
|
||||
|
||||
private:
|
||||
Ui::fwPreferencesDialog *ui;
|
||||
QList<QCheckBox *> optionsCheckBoxes;
|
||||
bool updateLock;
|
||||
|
||||
void showVoice(bool);
|
||||
void showVoice();
|
||||
void hideVoice();
|
||||
void populateLocale();
|
||||
void populateFirmwareOptions(const FirmwareInfo *);
|
||||
FirmwareVariant getFirmwareVariant();
|
||||
void initSettings();
|
||||
QCheckBox * voice;
|
||||
|
||||
private slots:
|
||||
void shrink();
|
||||
void writeValues();
|
||||
void firmwareLangChanged();
|
||||
void baseFirmwareChanged();
|
||||
void firmwareOptionChanged(bool state);
|
||||
void firmwareChanged();
|
||||
void on_fw_dnld_clicked();
|
||||
void on_voice_dnld_clicked();
|
||||
void on_checkFWUpdates_clicked();
|
||||
};
|
||||
|
||||
#endif // FWPREFERENCESDIALOG_H
|
||||
@@ -0,0 +1,833 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>fwPreferencesDialog</class>
|
||||
<widget class="QDialog" name="fwPreferencesDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>620</width>
|
||||
<height>437</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Downloads</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="38" column="5">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_14">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_32">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_16">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QLabel" name="langLabel">
|
||||
<property name="text">
|
||||
<string>Menu Language</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_37">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_29">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_12">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2" colspan="3">
|
||||
<widget class="QComboBox" name="downloadVerCB">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QComboBox" name="langCombo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2" colspan="3">
|
||||
<widget class="QLineEdit" name="CPU_ID_LE"/>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Firmware Type</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_28">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_42">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_17">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_35">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_36">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_26">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_41">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_18">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_11">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_21">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_20">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_33">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_24">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_23">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_22">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_38">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_34">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_31">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_30">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_27">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<widget class="QPushButton" name="checkFWUpdates">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check for updates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0">
|
||||
<widget class="QLabel" name="voiceLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Voice Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="2">
|
||||
<widget class="QComboBox" name="voiceCombo">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set language of voice.
|
||||
May be different from firmware language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="5">
|
||||
<widget class="QPushButton" name="voice_dnld">
|
||||
<property name="text">
|
||||
<string>Download Voice</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="3">
|
||||
<widget class="QCheckBox" name="optionCheckBox_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="5">
|
||||
<widget class="QPushButton" name="fw_dnld">
|
||||
<property name="text">
|
||||
<string>Download FW</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Options</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_19">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="2">
|
||||
<widget class="QCheckBox" name="optionCheckBox_25">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_15">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QLabel" name="CPU_ID_LABEL">
|
||||
<property name="text">
|
||||
<string>Processor ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="4">
|
||||
<widget class="QCheckBox" name="optionCheckBox_39">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" colspan="4">
|
||||
<widget class="QLabel" name="FwInfo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FwInfo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="5">
|
||||
<widget class="QCheckBox" name="optionCheckBox_40">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="1" colspan="5">
|
||||
<widget class="Line" name="voiceLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="37" column="1" colspan="5">
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
<tabstop>downloadVerCB</tabstop>
|
||||
<tabstop>CPU_ID_LE</tabstop>
|
||||
<tabstop>langCombo</tabstop>
|
||||
<tabstop>optionCheckBox_2</tabstop>
|
||||
<tabstop>optionCheckBox_1</tabstop>
|
||||
<tabstop>optionCheckBox_3</tabstop>
|
||||
<tabstop>optionCheckBox_4</tabstop>
|
||||
<tabstop>optionCheckBox_5</tabstop>
|
||||
<tabstop>optionCheckBox_6</tabstop>
|
||||
<tabstop>optionCheckBox_7</tabstop>
|
||||
<tabstop>optionCheckBox_8</tabstop>
|
||||
<tabstop>optionCheckBox_9</tabstop>
|
||||
<tabstop>optionCheckBox_10</tabstop>
|
||||
<tabstop>optionCheckBox_11</tabstop>
|
||||
<tabstop>optionCheckBox_12</tabstop>
|
||||
<tabstop>optionCheckBox_13</tabstop>
|
||||
<tabstop>optionCheckBox_14</tabstop>
|
||||
<tabstop>optionCheckBox_15</tabstop>
|
||||
<tabstop>optionCheckBox_16</tabstop>
|
||||
<tabstop>optionCheckBox_17</tabstop>
|
||||
<tabstop>optionCheckBox_18</tabstop>
|
||||
<tabstop>optionCheckBox_19</tabstop>
|
||||
<tabstop>optionCheckBox_20</tabstop>
|
||||
<tabstop>optionCheckBox_21</tabstop>
|
||||
<tabstop>optionCheckBox_22</tabstop>
|
||||
<tabstop>optionCheckBox_23</tabstop>
|
||||
<tabstop>optionCheckBox_24</tabstop>
|
||||
<tabstop>optionCheckBox_25</tabstop>
|
||||
<tabstop>optionCheckBox_26</tabstop>
|
||||
<tabstop>optionCheckBox_27</tabstop>
|
||||
<tabstop>optionCheckBox_28</tabstop>
|
||||
<tabstop>optionCheckBox_29</tabstop>
|
||||
<tabstop>optionCheckBox_30</tabstop>
|
||||
<tabstop>optionCheckBox_31</tabstop>
|
||||
<tabstop>optionCheckBox_32</tabstop>
|
||||
<tabstop>optionCheckBox_33</tabstop>
|
||||
<tabstop>optionCheckBox_34</tabstop>
|
||||
<tabstop>optionCheckBox_35</tabstop>
|
||||
<tabstop>optionCheckBox_36</tabstop>
|
||||
<tabstop>optionCheckBox_37</tabstop>
|
||||
<tabstop>optionCheckBox_38</tabstop>
|
||||
<tabstop>optionCheckBox_39</tabstop>
|
||||
<tabstop>optionCheckBox_40</tabstop>
|
||||
<tabstop>optionCheckBox_41</tabstop>
|
||||
<tabstop>optionCheckBox_42</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>fwPreferencesDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>370</x>
|
||||
<y>49</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>fwPreferencesDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>390</x>
|
||||
<y>55</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "generaledit.h"
|
||||
#include "ui_generaledit.h"
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include <QDateTime>
|
||||
#include <QtGui>
|
||||
|
||||
#define MAX_PROFILES 10
|
||||
#define BIT_WARN_THR ( 0x01 )
|
||||
#define BIT_WARN_SW ( 0x02 )
|
||||
#define BIT_WARN_MEM ( 0x04 )
|
||||
@@ -18,20 +19,14 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
g_eeGeneral(radioData.generalSettings)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowIcon(QIcon(":/icon.png"));
|
||||
this->setWindowIcon(CompanionIcon("open.png"));
|
||||
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString();
|
||||
ui->tabWidget->setCurrentIndex(settings.value("generalEditTab", 0).toInt());
|
||||
int profile_id=settings.value("profileId", 0).toInt();
|
||||
settings.beginGroup("Profiles");
|
||||
QString profile=QString("profile%1").arg(profile_id);
|
||||
settings.beginGroup(profile);
|
||||
QString name=settings.value("Name","").toString();
|
||||
QString firmware_id = g.profile[g.id()].fwType();
|
||||
ui->tabWidget->setCurrentIndex( g.generalEditTab() );
|
||||
QString name=g.profile[g.id()].name();
|
||||
if (name.isEmpty()) {
|
||||
ui->calstore_PB->setDisabled(true);
|
||||
}
|
||||
settings.endGroup();
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
QLabel * pmsl[] = {ui->ro_label,ui->ro1_label,ui->ro2_label,ui->ro3_label,ui->ro4_label,ui->ro5_label,ui->ro6_label,ui->ro7_label,ui->ro8_label, NULL};
|
||||
QSlider * tpmsld[] = {ui->chkSA, ui->chkSB, ui->chkSC, ui->chkSD, ui->chkSE, ui->chkSF, ui->chkSG, ui->chkSH, NULL};
|
||||
@@ -64,7 +59,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
}
|
||||
this->layout()->removeItem(ui->TaranisReadOnlyUnlock);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for (int i=0; pmsl[i]; i++) {
|
||||
pmsl[i]->hide();
|
||||
}
|
||||
@@ -75,21 +71,15 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
}
|
||||
ui->profile_CB->clear();
|
||||
for ( int i = 0; i < MAX_PROFILES; ++i) {
|
||||
QString profile=QString("profile%1").arg(i+1);
|
||||
settings.beginGroup(profile);
|
||||
QString name=settings.value("Name","").toString();
|
||||
QString name=g.profile[i].name();
|
||||
if (!name.isEmpty()) {
|
||||
ui->profile_CB->addItem(name, i+1);
|
||||
if ((i+1)==profile_id) {
|
||||
ui->profile_CB->addItem(name, i);
|
||||
if (i==g.id()) {
|
||||
ui->profile_CB->setCurrentIndex(ui->profile_CB->count()-1);
|
||||
}
|
||||
}
|
||||
settings.endGroup();
|
||||
}
|
||||
settings.endGroup();
|
||||
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
ui->ownerNameLE->setValidator(new QRegExpValidator(rx, this));
|
||||
|
||||
switchDefPosEditLock=true;
|
||||
populateBacklightCB(ui->backlightswCB, g_eeGeneral.backlightMode);
|
||||
bool voice = current_firmware_variant.id.contains("voice");
|
||||
@@ -125,18 +115,21 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->bgVolume_label->hide();
|
||||
ui->wavVolume_SL->hide();
|
||||
ui->wavVolume_label->hide();
|
||||
ui->varioP0_label->hide();
|
||||
ui->varioP0_SB->hide();
|
||||
ui->varioPMax_label->hide();
|
||||
ui->varioPMax_SB->hide();
|
||||
ui->varioR0_label->hide();
|
||||
ui->varioR0_SB->hide();
|
||||
} else {
|
||||
ui->beepVolume_SL->setValue(g_eeGeneral.beepVolume);
|
||||
ui->varioVolume_SL->setValue(g_eeGeneral.varioVolume);
|
||||
ui->bgVolume_SL->setValue(g_eeGeneral.backgroundVolume);
|
||||
ui->wavVolume_SL->setValue(g_eeGeneral.wavVolume);
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(HasBlInvert)) {
|
||||
ui->blinvert_cb->hide();
|
||||
ui->blinvert_label->hide();
|
||||
} else {
|
||||
ui->blinvert_cb->setChecked(g_eeGeneral.blightinv);
|
||||
ui->varioP0_SB->setValue(700+(g_eeGeneral.varioPitch*10));
|
||||
updateVarioPitchRange();
|
||||
ui->varioPMax_SB->setValue(700+(g_eeGeneral.varioPitch*10)+1000+(g_eeGeneral.varioRange*10));
|
||||
ui->varioR0_SB->setValue(500+(g_eeGeneral.varioRepeat*10));
|
||||
}
|
||||
if (!GetEepromInterface()->getCapability(HasFAIMode)) {
|
||||
ui->faimode_CB->hide();
|
||||
@@ -145,47 +138,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
else {
|
||||
ui->faimode_CB->setChecked(g_eeGeneral.fai);
|
||||
}
|
||||
ui->ownerNameLE->setText(g_eeGeneral.ownerName);
|
||||
if (!GetEepromInterface()->getCapability(OwnerName)) {
|
||||
ui->ownerNameLE->setDisabled(true);
|
||||
ui->label_ownerName->hide();
|
||||
ui->ownerNameLE->hide();
|
||||
ui->hideNameOnSplashChkB->setDisabled(true);
|
||||
ui->hideNameOnSplashChkB->hide();
|
||||
ui->label_hideOwnerName->hide();
|
||||
}
|
||||
if (!GetEepromInterface()->getCapability(HasInputFilter)) {
|
||||
ui->inputfilterCB->hide();
|
||||
ui->inputfilterLabel->hide();
|
||||
}
|
||||
if (!GetEepromInterface()->getCapability(HasStickScroll)) {
|
||||
ui->StickScrollChkB->hide();
|
||||
ui->StickScrollLB->hide();
|
||||
}
|
||||
if (!GetEepromInterface()->getCapability(TelemetryInternalAlarm)) {
|
||||
ui->frskyintalarmChkB->hide();
|
||||
ui->label_frskyintalarm->hide();
|
||||
}
|
||||
if (!GetEepromInterface()->getCapability(HasCrossTrims)) {
|
||||
ui->crosstrimChkB->hide();
|
||||
ui->crosstrimLB->hide();
|
||||
}
|
||||
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();
|
||||
@@ -233,9 +185,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->label_CurrentCalib->hide();
|
||||
}
|
||||
|
||||
if (GetEepromInterface()->getCapability(TelemetryRSSIModel) ) {
|
||||
ui->tabWidget->removeTab(2);
|
||||
}
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
|
||||
if (!GetEepromInterface()->getCapability(SoundMod)) {
|
||||
@@ -255,14 +204,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->hapticStrengthSB->hide();
|
||||
ui->label_hapticStrengthSB->hide();
|
||||
}
|
||||
|
||||
if (GetEepromInterface()->getCapability(PerModelTimers)) {
|
||||
ui->beepCountDownChkB->hide();
|
||||
ui->beepFlashChkB->hide();
|
||||
ui->beepMinuteChkB->hide();
|
||||
ui->label_timers->hide();
|
||||
}
|
||||
|
||||
|
||||
if (!GetEepromInterface()->getCapability(HapticMode)) {
|
||||
ui->hapticmodeCB->setDisabled(true);
|
||||
@@ -270,69 +211,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->label_hapticmode->hide();
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(BandgapMeasure)) {
|
||||
ui->BandGapEnableChkB->setDisabled(true);
|
||||
ui->BandGapEnableChkB->hide();
|
||||
ui->label_BandGapEnable->hide();
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(PotScrolling)) {
|
||||
ui->PotScrollEnableChkB->setDisabled(true);
|
||||
ui->PotScrollEnableChkB->hide();
|
||||
ui->label_PotScrollEnable->hide();
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(TrainerSwitch)) {
|
||||
ui->label_switch->hide();
|
||||
ui->swtchCB_1->setDisabled(true);
|
||||
ui->swtchCB_2->setDisabled(true);
|
||||
ui->swtchCB_3->setDisabled(true);
|
||||
ui->swtchCB_4->setDisabled(true);
|
||||
ui->swtchCB_1->hide();
|
||||
ui->swtchCB_2->hide();
|
||||
ui->swtchCB_3->hide();
|
||||
ui->swtchCB_4->hide();
|
||||
} else {
|
||||
populateSwitchCB(ui->swtchCB_1,g_eeGeneral.trainer.mix[0].swtch);
|
||||
populateSwitchCB(ui->swtchCB_2,g_eeGeneral.trainer.mix[1].swtch);
|
||||
populateSwitchCB(ui->swtchCB_3,g_eeGeneral.trainer.mix[2].swtch);
|
||||
populateSwitchCB(ui->swtchCB_4,g_eeGeneral.trainer.mix[3].swtch);
|
||||
}
|
||||
if (!GetEepromInterface()->getCapability(BLonStickMove)) {
|
||||
ui->blOnStickMoveSB->setDisabled(true);
|
||||
ui->blOnStickMoveSB->hide();
|
||||
ui->label_blOnStickMove->hide();
|
||||
} else {
|
||||
ui->blOnStickMoveSB->setValue(g_eeGeneral.lightOnStickMove*5);
|
||||
}
|
||||
if (!GetEepromInterface()->getCapability(gsSwitchMask)) {
|
||||
ui->swAILChkB->setDisabled(true);
|
||||
ui->swELEChkB->setDisabled(true);
|
||||
ui->swTHRChkB->setDisabled(true);
|
||||
ui->swRUDChkB->setDisabled(true);
|
||||
ui->swGEAChkB->setDisabled(true);
|
||||
ui->swID0ChkB->setDisabled(true);
|
||||
ui->swID1ChkB->setDisabled(true);
|
||||
ui->swID2ChkB->setDisabled(true);
|
||||
ui->swAILChkB->hide();
|
||||
ui->swELEChkB->hide();
|
||||
ui->swTHRChkB->hide();
|
||||
ui->swRUDChkB->hide();
|
||||
ui->swGEAChkB->hide();
|
||||
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)) {
|
||||
ui->telalarmsChkB->hide();
|
||||
ui->label_telalarms->hide();
|
||||
}
|
||||
int renumber=GetEepromInterface()->getCapability(RotaryEncoders);
|
||||
if (renumber==0) {
|
||||
ui->re_label->hide();
|
||||
@@ -340,37 +218,22 @@ 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);
|
||||
ui->contrastSB->setValue(g_eeGeneral.contrast);
|
||||
ui->battwarningDSB->setValue((double)g_eeGeneral.vBatWarn/10);
|
||||
ui->backlightautoSB->setValue(g_eeGeneral.backlightDelay*5);
|
||||
ui->inactimerSB->setValue(g_eeGeneral.inactivityTimer);
|
||||
|
||||
ui->crosstrimChkB->setChecked(g_eeGeneral.crosstrim);
|
||||
ui->frskyintalarmChkB->setChecked(g_eeGeneral.frskyinternalalarm);
|
||||
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);
|
||||
|
||||
ui->beepMinuteChkB->setChecked(g_eeGeneral.minuteBeep);
|
||||
ui->beepCountDownChkB->setChecked(g_eeGeneral.preBeep);
|
||||
ui->beepFlashChkB->setChecked(g_eeGeneral.flashBeep);
|
||||
ui->splashScreenChkB->setChecked(!g_eeGeneral.splashMode);
|
||||
ui->hideNameOnSplashChkB->setChecked(!g_eeGeneral.hideNameOnSplash);
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->splashScreenChkB->hide();
|
||||
ui->splashScreenDuration->setCurrentIndex(3-g_eeGeneral.splashDuration);
|
||||
}
|
||||
else {
|
||||
ui->splashScreenDuration->hide();
|
||||
ui->splashScreenChkB->setChecked(!g_eeGeneral.splashMode);
|
||||
}
|
||||
|
||||
ui->trnMode_1->setCurrentIndex(g_eeGeneral.trainer.mix[0].mode);
|
||||
ui->trnChn_1->setCurrentIndex(g_eeGeneral.trainer.mix[0].src);
|
||||
@@ -397,6 +260,29 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
for (int i=0; tpmsld[i]; i++) {
|
||||
connect(tpmsld[i], SIGNAL(valueChanged(int)),this,SLOT(unlockSwitchEdited()));
|
||||
}
|
||||
|
||||
if (GetEepromInterface()->getCapability(MultiposPots)) {
|
||||
ui->pot1Type->setCurrentIndex(g_eeGeneral.potsType[0]);
|
||||
ui->pot2Type->setCurrentIndex(g_eeGeneral.potsType[1]);
|
||||
ui->pot3Type->setCurrentIndex(g_eeGeneral.potsType[2]);
|
||||
}
|
||||
else {
|
||||
ui->potsTypeSeparator->hide();
|
||||
ui->pot1Type->hide();
|
||||
ui->pot1TypeLabel->hide();
|
||||
ui->pot2Type->hide();
|
||||
ui->pot2TypeLabel->hide();
|
||||
ui->pot3Type->hide();
|
||||
ui->pot3TypeLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
ui->serialPortMode->setCurrentIndex(g_eeGeneral.hw_uartMode);
|
||||
}
|
||||
else {
|
||||
ui->serialPortMode->hide();
|
||||
ui->serialPortLabel->hide();
|
||||
}
|
||||
}
|
||||
|
||||
GeneralEdit::~GeneralEdit()
|
||||
@@ -404,6 +290,30 @@ GeneralEdit::~GeneralEdit()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void GeneralEdit::on_pot1Type_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.potsType[0] = index;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_pot2Type_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.potsType[1] = index;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_pot3Type_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.potsType[2] = index;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_serialPortMode_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.hw_uartMode = index;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::unlockSwitchEdited()
|
||||
{
|
||||
int i=0;
|
||||
@@ -437,9 +347,8 @@ void GeneralEdit::setValues()
|
||||
ui->speakerPitchSB->setValue(g_eeGeneral.speakerPitch);
|
||||
ui->hapticStrengthSB->setValue(g_eeGeneral.hapticStrength);
|
||||
ui->hapticmodeCB->setCurrentIndex(g_eeGeneral.hapticMode+2);
|
||||
ui->battcalibDSB->setValue((double)g_eeGeneral.vBatCalib/10);
|
||||
ui->battCalibDSB->setValue((double)g_eeGeneral.vBatCalib/10);
|
||||
ui->CurrentCalib_SB->setValue((double)g_eeGeneral.currentCalib);
|
||||
ui->battCalib->setValue((double)g_eeGeneral.vBatCalib/10);
|
||||
|
||||
ui->ana1Neg->setValue(g_eeGeneral.calibSpanNeg[0]);
|
||||
ui->ana2Neg->setValue(g_eeGeneral.calibSpanNeg[1]);
|
||||
@@ -475,27 +384,6 @@ void GeneralEdit::setValues()
|
||||
ui->PPM_MultiplierDSB->setValue((qreal)(g_eeGeneral.PPM_Multiplier+10)/10);
|
||||
}
|
||||
|
||||
void GeneralEdit::setSwitchDefPos()
|
||||
{
|
||||
quint8 x = g_eeGeneral.switchWarningStates & 0x38;
|
||||
if(x==0x00 || x==0x18 || x== 0x28 || x==0x38 || x==0x30) //illegal states for ID0/1/2
|
||||
{
|
||||
g_eeGeneral.switchWarningStates &= ~0x38; // turn all off, make sure only one is on
|
||||
g_eeGeneral.switchWarningStates |= 0x08;
|
||||
}
|
||||
|
||||
switchDefPosEditLock = true;
|
||||
ui->swTHRChkB->setChecked(g_eeGeneral.switchWarningStates & 0x01);
|
||||
ui->swRUDChkB->setChecked(g_eeGeneral.switchWarningStates & 0x02);
|
||||
ui->swELEChkB->setChecked(g_eeGeneral.switchWarningStates & 0x04);
|
||||
ui->swID0ChkB->setChecked(g_eeGeneral.switchWarningStates & 0x08);
|
||||
ui->swID1ChkB->setChecked(g_eeGeneral.switchWarningStates & 0x10);
|
||||
ui->swID2ChkB->setChecked(g_eeGeneral.switchWarningStates & 0x20);
|
||||
ui->swAILChkB->setChecked(g_eeGeneral.switchWarningStates & 0x40);
|
||||
ui->swGEAChkB->setChecked(g_eeGeneral.switchWarningStates & 0x80);
|
||||
switchDefPosEditLock = false;
|
||||
}
|
||||
|
||||
void GeneralEdit::updateSettings()
|
||||
{
|
||||
radioData.generalSettings = g_eeGeneral;
|
||||
@@ -514,10 +402,9 @@ void GeneralEdit::on_battwarningDSB_editingFinished()
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_battcalibDSB_editingFinished()
|
||||
void GeneralEdit::on_battCalibDSB_editingFinished()
|
||||
{
|
||||
g_eeGeneral.vBatCalib = ui->battcalibDSB->value()*10;
|
||||
ui->battCalib->setValue(ui->battcalibDSB->value());
|
||||
g_eeGeneral.vBatCalib = ui->battCalibDSB->value()*10;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
@@ -605,53 +492,12 @@ void GeneralEdit::on_timezoneSB_editingFinished()
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
|
||||
void GeneralEdit::on_blOnStickMoveSB_editingFinished()
|
||||
{
|
||||
int i = ui->blOnStickMoveSB->value()/5;
|
||||
if((i*5)!=ui->blOnStickMoveSB->value())
|
||||
ui->blOnStickMoveSB->setValue(i*5);
|
||||
|
||||
g_eeGeneral.lightOnStickMove = i;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_inactimerSB_editingFinished()
|
||||
{
|
||||
g_eeGeneral.inactivityTimer = ui->inactimerSB->value();
|
||||
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;
|
||||
@@ -664,12 +510,6 @@ void GeneralEdit::on_alarmwarnChkB_stateChanged(int )
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_enableTelemetryAlarmChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.enableTelemetryAlarm = ui->enableTelemetryAlarmChkB->isChecked();
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_beeperCB_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.beeperMode = (BeeperMode)(index-2);
|
||||
@@ -918,13 +758,6 @@ void GeneralEdit::on_ana8Pos_editingFinished()
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_battCalib_editingFinished()
|
||||
{
|
||||
g_eeGeneral.vBatCalib = ui->battCalib->value()*10;
|
||||
ui->battcalibDSB->setValue(ui->battCalib->value());
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_volume_SB_editingFinished()
|
||||
{
|
||||
g_eeGeneral.speakerVolume = ui->volume_SB->value();
|
||||
@@ -967,6 +800,31 @@ void GeneralEdit::on_bgVolume_SL_valueChanged()
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_varioP0_SB_editingFinished()
|
||||
{
|
||||
g_eeGeneral.varioPitch = (ui->varioP0_SB->value()-700)/10;
|
||||
updateVarioPitchRange();
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::updateVarioPitchRange()
|
||||
{
|
||||
ui->varioPMax_SB->setMaximum(700+(g_eeGeneral.varioPitch*10)+1000+800);
|
||||
ui->varioPMax_SB->setMinimum(700+(g_eeGeneral.varioPitch*10)+1000-800);
|
||||
}
|
||||
|
||||
void GeneralEdit::on_varioPMax_SB_editingFinished()
|
||||
{
|
||||
g_eeGeneral.varioRange = (ui->varioPMax_SB->value()-(700+(g_eeGeneral.varioPitch*10))-1000)/10;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_varioR0_SB_editingFinished()
|
||||
{
|
||||
g_eeGeneral.varioRepeat = (ui->varioR0_SB->value()-500)/10;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_PPM1_editingFinished()
|
||||
{
|
||||
g_eeGeneral.trainer.calib[0] = ui->PPM1->value();
|
||||
@@ -993,28 +851,7 @@ void GeneralEdit::on_PPM4_editingFinished()
|
||||
|
||||
void GeneralEdit::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
// TODO why er9x here
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
settings.setValue("generalEditTab",index);//ui->tabWidget->currentIndex());
|
||||
}
|
||||
|
||||
|
||||
void GeneralEdit::on_beepMinuteChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.minuteBeep = ui->beepMinuteChkB->isChecked() ? 1 : 0;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_beepCountDownChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.preBeep = ui->beepCountDownChkB->isChecked() ? 1 : 0;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_beepFlashChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.flashBeep = ui->beepFlashChkB->isChecked() ? 1 : 0;
|
||||
updateSettings();
|
||||
g.generalEditTab(index);
|
||||
}
|
||||
|
||||
void GeneralEdit::on_splashScreenChkB_stateChanged(int )
|
||||
@@ -1023,9 +860,9 @@ void GeneralEdit::on_splashScreenChkB_stateChanged(int )
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_hideNameOnSplashChkB_stateChanged(int )
|
||||
void GeneralEdit::on_splashScreenDuration_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.hideNameOnSplash = ui->hideNameOnSplashChkB->isChecked() ? 0 : 1;
|
||||
g_eeGeneral.splashDuration = 3-index;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
@@ -1035,12 +872,6 @@ void GeneralEdit::on_PPM_MultiplierDSB_editingFinished()
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_ownerNameLE_editingFinished()
|
||||
{
|
||||
strncpy(g_eeGeneral.ownerName, ui->ownerNameLE->text().toAscii(), 10);
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_speakerPitchSB_editingFinished()
|
||||
{
|
||||
g_eeGeneral.speakerPitch = ui->speakerPitchSB->value();
|
||||
@@ -1059,22 +890,10 @@ void GeneralEdit::on_soundModeCB_currentIndexChanged(int index)
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_PotScrollEnableChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.disablePotScroll = ui->PotScrollEnableChkB->isChecked() ? false : true;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_blinvert_cb_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.blightinv = ui->blinvert_cb->isChecked();
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -1088,186 +907,25 @@ void GeneralEdit::on_faimode_CB_stateChanged(int )
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_BandGapEnableChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.disableBG = ui->BandGapEnableChkB->isChecked() ? false : true;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_crosstrimChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.crosstrim = ui->crosstrimChkB->isChecked() ? true : false;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_frskyintalarmChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.frskyinternalalarm = ui->frskyintalarmChkB->isChecked() ? true : false ;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_StickScrollChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.stickScroll = ui->StickScrollChkB->isChecked() ? true : false;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_PPMSimChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.enablePpmsim = ui->PPMSimChkB->isChecked() ? true : false;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_swtchCB_1_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.trainer.mix[0].swtch = RawSwitch(ui->swtchCB_1->itemData(ui->swtchCB_1->currentIndex()).toInt());
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_swtchCB_2_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.trainer.mix[1].swtch = RawSwitch(ui->swtchCB_2->itemData(ui->swtchCB_2->currentIndex()).toInt());
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_swtchCB_3_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.trainer.mix[2].swtch = RawSwitch(ui->swtchCB_3->itemData(ui->swtchCB_3->currentIndex()).toInt());
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_swtchCB_4_currentIndexChanged(int index)
|
||||
{
|
||||
g_eeGeneral.trainer.mix[3].swtch = RawSwitch(ui->swtchCB_4->itemData(ui->swtchCB_4->currentIndex()).toInt());
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::getGeneralSwitchDefPos(int i, bool val)
|
||||
{
|
||||
if(val)
|
||||
g_eeGeneral.switchWarningStates |= (1<<(i-1));
|
||||
else
|
||||
g_eeGeneral.switchWarningStates &= ~(1<<(i-1));
|
||||
}
|
||||
|
||||
void GeneralEdit::on_swTHRChkB_stateChanged(int )
|
||||
{
|
||||
if(switchDefPosEditLock) return;
|
||||
getGeneralSwitchDefPos(1,ui->swTHRChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_telalarmsChkB_stateChanged(int )
|
||||
{
|
||||
g_eeGeneral.enableTelemetryAlarm=ui->telalarmsChkB->isChecked();
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_swRUDChkB_stateChanged(int )
|
||||
{
|
||||
if(switchDefPosEditLock) return;
|
||||
getGeneralSwitchDefPos(2,ui->swRUDChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
void GeneralEdit::on_swELEChkB_stateChanged(int )
|
||||
{
|
||||
getGeneralSwitchDefPos(3,ui->swELEChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
void GeneralEdit::on_swID0ChkB_stateChanged(int )
|
||||
{
|
||||
if(switchDefPosEditLock) return;
|
||||
|
||||
if(ui->swID0ChkB->isChecked())
|
||||
{
|
||||
switchDefPosEditLock = true;
|
||||
ui->swID1ChkB->setChecked(false);
|
||||
ui->swID2ChkB->setChecked(false);
|
||||
switchDefPosEditLock = false;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
g_eeGeneral.switchWarningStates &= ~0x30; //turn off ID1/2
|
||||
getGeneralSwitchDefPos(4,ui->swID0ChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
void GeneralEdit::on_swID1ChkB_stateChanged(int )
|
||||
{
|
||||
if(switchDefPosEditLock) return;
|
||||
|
||||
if(ui->swID1ChkB->isChecked())
|
||||
{
|
||||
switchDefPosEditLock = true;
|
||||
ui->swID0ChkB->setChecked(false);
|
||||
ui->swID2ChkB->setChecked(false);
|
||||
switchDefPosEditLock = false;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
g_eeGeneral.switchWarningStates &= ~0x28; //turn off ID0/2
|
||||
getGeneralSwitchDefPos(5,ui->swID1ChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
void GeneralEdit::on_swID2ChkB_stateChanged(int )
|
||||
{
|
||||
if(switchDefPosEditLock) return;
|
||||
|
||||
if(ui->swID2ChkB->isChecked())
|
||||
{
|
||||
switchDefPosEditLock = true;
|
||||
ui->swID0ChkB->setChecked(false);
|
||||
ui->swID1ChkB->setChecked(false);
|
||||
switchDefPosEditLock = false;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
g_eeGeneral.switchWarningStates &= ~0x18; //turn off ID1/2
|
||||
getGeneralSwitchDefPos(6,ui->swID2ChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
void GeneralEdit::on_swAILChkB_stateChanged(int )
|
||||
{
|
||||
if(switchDefPosEditLock) return;
|
||||
getGeneralSwitchDefPos(7,ui->swAILChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
void GeneralEdit::on_swGEAChkB_stateChanged(int )
|
||||
{
|
||||
if(switchDefPosEditLock) return;
|
||||
getGeneralSwitchDefPos(8,ui->swGEAChkB->isChecked());
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
{
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
|
||||
settings.beginGroup("Profiles");
|
||||
QString profile=QString("profile%1").arg(profile_id);
|
||||
settings.beginGroup(profile);
|
||||
QString calib=settings.value("StickPotCalib","").toString();
|
||||
QString calib=g.profile[profile_id].stickPotCalib();
|
||||
int potsnum=GetEepromInterface()->getCapability(Pots);
|
||||
if (calib.isEmpty()) {
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
return;
|
||||
} else {
|
||||
QString trainercalib=settings.value("TrainerCalib","").toString();
|
||||
int8_t vBatCalib=(int8_t)settings.value("VbatCalib", g_eeGeneral.vBatCalib).toInt();
|
||||
int8_t currentCalib=(int8_t)settings.value("currentCalib", g_eeGeneral.currentCalib).toInt();
|
||||
int8_t PPM_Multiplier=(int8_t)settings.value("PPM_Multiplier", g_eeGeneral.PPM_Multiplier).toInt();
|
||||
uint8_t GSStickMode=(uint8_t)settings.value("GSStickMode", g_eeGeneral.stickMode).toUInt();
|
||||
uint8_t vBatWarn=(uint8_t)settings.value("vBatWarn",g_eeGeneral.vBatWarn).toUInt();
|
||||
QString DisplaySet=settings.value("Display","").toString();
|
||||
QString BeeperSet=settings.value("Beeper","").toString();
|
||||
QString HapticSet=settings.value("Haptic","").toString();
|
||||
QString SpeakerSet=settings.value("Speaker","").toString();
|
||||
QString CountrySet=settings.value("countryCode","").toString();
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
QString trainercalib = g.profile[profile_id].trainerCalib();
|
||||
int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib();
|
||||
int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib();
|
||||
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
||||
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
|
||||
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
|
||||
QString DisplaySet = g.profile[profile_id].display();
|
||||
QString BeeperSet = g.profile[profile_id].beeper();
|
||||
QString HapticSet = g.profile[profile_id].haptic();
|
||||
QString SpeakerSet = g.profile[profile_id].speaker();
|
||||
QString CountrySet = g.profile[profile_id].countryCode();
|
||||
|
||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||
QString Byte;
|
||||
@@ -1360,27 +1018,20 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
|
||||
void GeneralEdit::on_calstore_PB_clicked()
|
||||
{
|
||||
QSettings settings("companion9x", "companion9x");
|
||||
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
|
||||
settings.beginGroup("Profiles");
|
||||
QString profile=QString("profile%1").arg(profile_id);
|
||||
settings.beginGroup(profile);
|
||||
QString name=settings.value("Name","").toString();
|
||||
|
||||
QString name=g.profile[profile_id].name();
|
||||
int potsnum=GetEepromInterface()->getCapability(Pots);
|
||||
if (name.isEmpty()) {
|
||||
ui->calstore_PB->setDisabled(true);
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
return;
|
||||
} else {
|
||||
QString calib=settings.value("StickPotCalib","").toString();
|
||||
QString calib=g.profile[profile_id].stickPotCalib();
|
||||
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) {
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1390,25 +1041,26 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
calib.append(QString("%1").arg((uint16_t)g_eeGeneral.calibSpanNeg[i], 4, 16, QChar('0')));
|
||||
calib.append(QString("%1").arg((uint16_t)g_eeGeneral.calibSpanPos[i], 4, 16, QChar('0')));
|
||||
}
|
||||
settings.setValue("StickPotCalib",calib);
|
||||
g.profile[profile_id].stickPotCalib( calib );
|
||||
calib.clear();
|
||||
for (int i=0; i< 4; i++) {
|
||||
calib.append(QString("%1").arg((uint16_t)g_eeGeneral.trainer.calib[i], 4, 16, QChar('0')));
|
||||
}
|
||||
settings.setValue("TrainerCalib",calib);
|
||||
settings.setValue("VbatCalib",g_eeGeneral.vBatCalib);
|
||||
settings.setValue("currentCalib",g_eeGeneral.currentCalib);
|
||||
settings.setValue("vBatWarn",g_eeGeneral.vBatWarn);
|
||||
settings.setValue("PPM_Multiplier",g_eeGeneral.PPM_Multiplier);
|
||||
settings.setValue("GSStickMode",g_eeGeneral.stickMode);
|
||||
settings.setValue("Display",QString("%1%2%3").arg((g_eeGeneral.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.contrast, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.backlightBright, 2, 16, QChar('0')));
|
||||
settings.setValue("Beeper",QString("%1%2").arg(((uint8_t)g_eeGeneral.beeperMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.beeperLength, 2, 16, QChar('0')));
|
||||
settings.setValue("Haptic",QString("%1%2%3").arg(((uint8_t)g_eeGeneral.hapticMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticStrength, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticLength, 2, 16, QChar('0')));
|
||||
settings.setValue("Speaker",QString("%1%2%3").arg((uint8_t)g_eeGeneral.speakerMode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerPitch, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerVolume, 2, 16, QChar('0')));
|
||||
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."));
|
||||
g.profile[profile_id].trainerCalib( calib );
|
||||
g.profile[profile_id].vBatCalib( g_eeGeneral.vBatCalib );
|
||||
g.profile[profile_id].currentCalib( g_eeGeneral.currentCalib );
|
||||
g.profile[profile_id].vBatWarn( g_eeGeneral.vBatWarn );
|
||||
g.profile[profile_id].ppmMultiplier( g_eeGeneral.PPM_Multiplier );
|
||||
g.profile[profile_id].gsStickMode( g_eeGeneral.stickMode );
|
||||
g.profile[profile_id].display( QString("%1%2%3").arg((g_eeGeneral.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.contrast, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.backlightBright, 2, 16, QChar('0')) );
|
||||
g.profile[profile_id].beeper( QString("%1%2").arg(((uint8_t)g_eeGeneral.beeperMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.beeperLength, 2, 16, QChar('0')));
|
||||
g.profile[profile_id].haptic( QString("%1%2%3").arg(((uint8_t)g_eeGeneral.hapticMode), 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticStrength, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.hapticLength, 2, 16, QChar('0')));
|
||||
g.profile[profile_id].speaker( QString("%1%2%3").arg((uint8_t)g_eeGeneral.speakerMode, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerPitch, 2, 16, QChar('0')).arg((uint8_t)g_eeGeneral.speakerVolume, 2, 16, QChar('0')));
|
||||
g.profile[profile_id].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));
|
||||
|
||||
QDateTime dateTime = QDateTime::currentDateTime();
|
||||
g.profile[profile_id].timeStamp(dateTime.toString("yyyy-MM-dd hh:mm"));
|
||||
QMessageBox::information(this, "Companion", tr("Calibration and HW parameters saved."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,20 +27,13 @@ private:
|
||||
bool mavbaudEditLock;
|
||||
void getGeneralSwitchDefPos(int i, bool val);
|
||||
void setSwitchDefPos();
|
||||
void updateVarioPitchRange();
|
||||
|
||||
signals:
|
||||
void modelValuesChanged();
|
||||
|
||||
private slots:
|
||||
void on_ownerNameLE_editingFinished();
|
||||
void on_PotScrollEnableChkB_stateChanged(int);
|
||||
void on_blinvert_cb_stateChanged(int);
|
||||
void on_faimode_CB_stateChanged(int );
|
||||
void on_BandGapEnableChkB_stateChanged(int);
|
||||
void on_crosstrimChkB_stateChanged(int );
|
||||
void on_frskyintalarmChkB_stateChanged(int );
|
||||
void on_StickScrollChkB_stateChanged(int );
|
||||
void on_PPMSimChkB_stateChanged(int );
|
||||
void on_speakerPitchSB_editingFinished();
|
||||
void on_timezoneSB_editingFinished();
|
||||
void on_hapticStrengthSB_editingFinished();
|
||||
@@ -50,12 +43,9 @@ private slots:
|
||||
void on_hapticmodeCB_currentIndexChanged(int index);
|
||||
void on_hapticLengthCB_currentIndexChanged(int index);
|
||||
void on_PPM_MultiplierDSB_editingFinished();
|
||||
void on_splashScreenChkB_stateChanged(int );
|
||||
void on_hideNameOnSplashChkB_stateChanged(int);
|
||||
void on_beepCountDownChkB_stateChanged(int );
|
||||
void on_beepMinuteChkB_stateChanged(int );
|
||||
void on_splashScreenChkB_stateChanged(int);
|
||||
void on_splashScreenDuration_currentIndexChanged(int index);
|
||||
void on_alarmwarnChkB_stateChanged(int );
|
||||
void on_enableTelemetryAlarmChkB_stateChanged(int );
|
||||
void on_gpsFormatCB_currentIndexChanged(int index);
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
void on_displayTypeCB_currentIndexChanged(int index);
|
||||
@@ -65,22 +55,17 @@ private slots:
|
||||
void on_units_CB_currentIndexChanged(int index);
|
||||
void on_trnMode_1_currentIndexChanged(int index);
|
||||
void on_trnChn_1_currentIndexChanged(int index);
|
||||
void on_swtchCB_1_currentIndexChanged(int index);
|
||||
void on_trnWeight_1_editingFinished();
|
||||
void on_trnMode_2_currentIndexChanged(int index);
|
||||
void on_trnChn_2_currentIndexChanged(int index);
|
||||
void on_swtchCB_2_currentIndexChanged(int index);
|
||||
void on_trnWeight_2_editingFinished();
|
||||
void on_trnMode_3_currentIndexChanged(int index);
|
||||
void on_trnChn_3_currentIndexChanged(int index);
|
||||
void on_swtchCB_3_currentIndexChanged(int index);
|
||||
void on_trnWeight_3_editingFinished();
|
||||
void on_trnMode_4_currentIndexChanged(int index);
|
||||
void on_swtchCB_4_currentIndexChanged(int index);
|
||||
void on_trnChn_4_currentIndexChanged(int index);
|
||||
void on_trnWeight_4_editingFinished();
|
||||
|
||||
void on_battCalib_editingFinished();
|
||||
void on_CurrentCalib_SB_editingFinished();
|
||||
|
||||
void on_ana1Neg_editingFinished();
|
||||
@@ -119,34 +104,27 @@ private slots:
|
||||
void on_varioVolume_SL_valueChanged();
|
||||
void on_wavVolume_SL_valueChanged();
|
||||
|
||||
void on_varioP0_SB_editingFinished();
|
||||
void on_varioPMax_SB_editingFinished();
|
||||
void on_varioR0_SB_editingFinished();
|
||||
|
||||
void on_pot1Type_currentIndexChanged(int index);
|
||||
void on_pot2Type_currentIndexChanged(int index);
|
||||
void on_pot3Type_currentIndexChanged(int index);
|
||||
void on_serialPortMode_currentIndexChanged(int index);
|
||||
|
||||
void on_stickmodeCB_currentIndexChanged(int index);
|
||||
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);
|
||||
void on_mavbaud_CB_currentIndexChanged(int index);
|
||||
void on_voiceLang_CB_currentIndexChanged(int index);
|
||||
void on_blOnStickMoveSB_editingFinished();
|
||||
void on_battcalibDSB_editingFinished();
|
||||
void on_battCalibDSB_editingFinished();
|
||||
void on_battwarningDSB_editingFinished();
|
||||
void on_contrastSB_editingFinished();
|
||||
void on_beepFlashChkB_stateChanged(int );
|
||||
void on_swTHRChkB_stateChanged(int );
|
||||
void on_swRUDChkB_stateChanged(int );
|
||||
void on_swELEChkB_stateChanged(int );
|
||||
void on_swID0ChkB_stateChanged(int );
|
||||
void on_swID1ChkB_stateChanged(int );
|
||||
void on_swID2ChkB_stateChanged(int );
|
||||
void on_swAILChkB_stateChanged(int );
|
||||
void on_swGEAChkB_stateChanged(int );
|
||||
void on_calretrieve_PB_clicked();
|
||||
void on_calstore_PB_clicked();
|
||||
void unlockSwitchEdited();
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(CustomSwitches)-1)
|
||||
extern const QColor colors[C9X_MAX_CURVES];
|
||||
|
||||
//convert from mode 1 to mode g_eeGeneral.stickMode
|
||||
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(LogicalSwitches)-1)
|
||||
|
||||
//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 CURVE_BASE 7
|
||||
#define CH(x) (SRC_CH1+(x)-1-(SRC_SWC-SRC_3POS))
|
||||
#define CV(x) (CURVE_BASE+(x)-1)
|
||||
#define CC(x) (CHANNEL_ORDER(x)) //need to invert this to work with dest
|
||||
|
||||
#define CURVE5(x) ((x)-1)
|
||||
#define CURVE9(x) (MAX_CURVE5+(x)-1)
|
||||
@@ -23,61 +23,93 @@
|
||||
#define TRIM_OFF 1
|
||||
#define TRIM_OFFSET 2
|
||||
|
||||
#define TRIM_MODE_NONE 0x1F // 0b11111
|
||||
|
||||
void populateGvSourceCB(QComboBox *b, int value);
|
||||
void populateVoiceLangCB(QComboBox *b, QString language);
|
||||
void populateTTraceCB(QComboBox *b, int value);
|
||||
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
||||
void populateBacklightCB(QComboBox *b, const uint8_t value);
|
||||
|
||||
#define POPULATE_ONOFF 0x01
|
||||
#define POPULATE_MSWITCHES 0x02
|
||||
#define POPULATE_AND_SWITCHES 0x04
|
||||
void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr=0, UseContext context=DefaultContext);
|
||||
void populateFuncCB(QComboBox *b, unsigned int value);
|
||||
void populateRepeatCB(QComboBox *b, unsigned int value);
|
||||
void populateGVmodeCB(QComboBox *b, unsigned int value);
|
||||
QString FuncParam(uint function, int value, QString paramT="",unsigned int adjustmode=0);
|
||||
void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsigned int adjustmode=0);
|
||||
void populateFuncParamArmTCB(QComboBox *b, ModelData * g_model, char * value, QStringList & paramsList);
|
||||
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);
|
||||
QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model);
|
||||
QString getProtocolStr(const int proto);
|
||||
QString getTheme();
|
||||
|
||||
#define POPULATE_SOURCES 1
|
||||
#define POPULATE_TRIMS 2
|
||||
#define POPULATE_SWITCHES 4
|
||||
#define POPULATE_GVARS 8
|
||||
#define POPULATE_TELEMETRY 16
|
||||
#define POPULATE_TELEMETRYEXT 32
|
||||
class CompanionIcon: public QIcon {
|
||||
public:
|
||||
CompanionIcon(QString baseimage);
|
||||
};
|
||||
|
||||
class GVarGroup : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags=0);
|
||||
|
||||
protected slots:
|
||||
void gvarCBChanged(int);
|
||||
void valuesChanged();
|
||||
|
||||
protected:
|
||||
QCheckBox *weightGV;
|
||||
QSpinBox *weightSB;
|
||||
QComboBox *weightCB;
|
||||
int & weight;
|
||||
const unsigned int flags;
|
||||
bool lock;
|
||||
};
|
||||
|
||||
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_TIMER_MODES 0x02
|
||||
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value);
|
||||
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr=0);
|
||||
|
||||
void populatePhasesCB(QComboBox *b, int value);
|
||||
void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
||||
QString getProtocolStr(const int proto);
|
||||
QString getPhasesStr(unsigned int phases, ModelData & model);
|
||||
|
||||
#define POPULATE_SOURCES 1
|
||||
#define POPULATE_TRIMS 2
|
||||
#define POPULATE_SWITCHES 4
|
||||
#define POPULATE_GVARS 8
|
||||
#define POPULATE_TELEMETRY 16
|
||||
#define POPULATE_TELEMETRYEXT 32
|
||||
#define POPULATE_VIRTUAL_INPUTS 64
|
||||
|
||||
#define GVARS_VARIANT 0x0001
|
||||
#define FRSKY_VARIANT 0x0002
|
||||
|
||||
// void populateGVarCB(QComboBox *b, int value, int min, int max,int pgvars=5); //TODO: Clean Up
|
||||
void populateGVCB(QComboBox *b, int value);
|
||||
void populateSourceCB(QComboBox *b, const RawSource &source, unsigned int flags);
|
||||
void populateSourceCB(QComboBox *b, const RawSource &source, const ModelData & model, unsigned int flags);
|
||||
void populateCSWCB(QComboBox *b, int value);
|
||||
QString getTimerMode(int tm);
|
||||
QString getTimerModeB(int tm);
|
||||
QString getPhaseName(int val, char * phasename=NULL);
|
||||
QString getStickStr(int index);
|
||||
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 getInputStr(ModelData & model, int index);
|
||||
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);
|
||||
@@ -86,13 +118,20 @@ QString getCenterBeep(ModelData * g_model);
|
||||
|
||||
/* FrSky helpers */
|
||||
QString getFrSkyAlarmType(int alarm);
|
||||
QString getFrSkyBlades(int blades);
|
||||
QString getFrSkyUnits(int units);
|
||||
QString getFrSkyProtocol(int protocol);
|
||||
QString getFrSkyMeasure(int units);
|
||||
QString getFrSkySrc(int index);
|
||||
float getBarValue(int barId, int value, FrSkyData *fd);
|
||||
float c9xexpou(float point, float coeff);
|
||||
float ValToTim(int value);
|
||||
int TimToVal(float value);
|
||||
|
||||
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx);
|
||||
|
||||
// Format a pixmap to fit on the radio using a specific firmware
|
||||
QPixmap makePixMap( QImage image, QString firmwareType );
|
||||
|
||||
// Return a radio type derived from a firmware type string
|
||||
int getRadioType(QString firmwareType);
|
||||
|
||||
// Return the default firmware string for a specified radio
|
||||
QString getDefaultFwType( int radioType );
|
||||
|
||||
#endif // HELPERS_H
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -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 |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 30 KiB |