mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 11:29:51 +03:00
Move to Qt5 and Qt5Multimedia
This commit is contained in:
parent
d7a9710a9c
commit
aec2170e7e
98 changed files with 355 additions and 438 deletions
|
@ -5,13 +5,14 @@ before_install:
|
|||
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
|
||||
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
|
||||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
|
||||
- sudo add-apt-repository ppa:beineri/opt-qt551 --yes
|
||||
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' --yes
|
||||
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
- sudo apt-get update
|
||||
- sudo apt-get update -qq
|
||||
- rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages
|
||||
|
||||
install:
|
||||
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi libqtcore4 libqt4-dev qt4-qmake g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev python-clang-3.8 libclang-3.8-dev
|
||||
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi qt-latest g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libfox-1.6-dev libgtest-dev python-clang-3.8 libclang-3.8-dev python-qt4
|
||||
- sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS"
|
||||
- export CXX="g++-5" CC="gcc-5"
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFI
|
|||
message(STATUS "OpenTX ${VERSION}")
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_policy(SET CMP0020 NEW)
|
||||
cmake_policy(SET CMP0023 OLD)
|
||||
cmake_policy(SET CMP0043 NEW)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
|
||||
|
|
|
@ -93,7 +93,7 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
|||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
C:/Programs/SDL/lib/x86
|
||||
)
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDLmain. This is mainly for Windows and OS X. Other platforms
|
||||
|
@ -109,7 +109,6 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
|||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
)
|
||||
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
|
||||
|
|
|
@ -38,20 +38,11 @@ else()
|
|||
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
|
||||
endif()
|
||||
|
||||
find_package(Qt4 4.8.1 REQUIRED)
|
||||
set(QT_USE_QTNETWORK True)
|
||||
set(QT_USE_QTXML True)
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
message(STATUS "Looking for PHONON ")
|
||||
find_package(Phonon)
|
||||
if(PHONON_FOUND)
|
||||
include_directories(${PHONO_INCLUDE_DIR})
|
||||
message("PHONON Include Path: " ${PHONON_INCLUDE_DIR})
|
||||
add_definitions(-DPHONON)
|
||||
else()
|
||||
message("PHONON not found!")
|
||||
endif()
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
find_package(Qt5PrintSupport REQUIRED)
|
||||
find_package(Qt5Multimedia REQUIRED)
|
||||
|
||||
message(STATUS "Looking for QT lupdate ")
|
||||
find_package(Lupdate)
|
||||
|
@ -114,9 +105,10 @@ set(common_SRCS
|
|||
appdata.cpp
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
qt5_wrap_cpp(common_SRCS)
|
||||
|
||||
add_library(common ${common_SRCS})
|
||||
qt5_use_modules(common Core Xml Widgets)
|
||||
|
||||
set(companion_SRCS
|
||||
hexinterface.cpp
|
||||
|
@ -211,7 +203,7 @@ set(companion_UIS
|
|||
radionotfound.ui
|
||||
)
|
||||
|
||||
set(companion_RCS
|
||||
set(companion_RESOURCES
|
||||
companion.qrc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
||||
)
|
||||
|
@ -239,23 +231,23 @@ foreach(language ${LANGUAGES})
|
|||
set(companion_TS ${companion_TS} translations/companion_${language}.ts)
|
||||
endforeach(language)
|
||||
|
||||
set(companion_SRCS ${companion_SRCS})
|
||||
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})
|
||||
qt5_wrap_ui(companion_SRCS ${companion_UIS})
|
||||
qt5_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
|
||||
qt5_add_translation(companion_QM ${companion_TS})
|
||||
qt5_add_resources(companion_RCC ${companion_RESOURCES})
|
||||
|
||||
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
|
||||
|
||||
if(APPLE)
|
||||
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM})
|
||||
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_RCC} ${companion_QM})
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
set(CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks)
|
||||
else()
|
||||
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_QM})
|
||||
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_RCC} ${companion_QM})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${COMPANION_NAME} generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
qt5_use_modules(${COMPANION_NAME} Core Widgets Network)
|
||||
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation common qcustomplot shared ${PTHREAD_LIBRARY} ${SDL_LIBRARY})
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
|
@ -269,21 +261,20 @@ set(simu_MOC_HDRS
|
|||
modeledit/node.h
|
||||
)
|
||||
|
||||
set(simu_SRCS ${simu_SRCS})
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS})
|
||||
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
|
||||
qt5_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
|
||||
|
||||
if(WIN32)
|
||||
set(simu_SRCS ${simu_SRCS} icon.rc)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS} ${companion_RCC})
|
||||
else()
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS} ${companion_RCC})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${SIMULATOR_NAME} simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||
# TODO not the same link command than companion?
|
||||
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${OPENTX_SIMULATOR_LIBS})
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
|
@ -304,9 +295,13 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
|
||||
# Linux specific code
|
||||
set(OperatingSystem "Linux")
|
||||
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${COMPANION_NAME} DESTINATION ${QT_BINARY_DIR})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
else()
|
||||
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
|
||||
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
|
||||
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)
|
||||
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Core.dll ${QT_DLL_DIR}/Qt5Gui.dll ${QT_DLL_DIR}/Qt5Widgets.dll ${QT_DLL_DIR}/Qt5Xml.dll ${QT_DLL_DIR}/Qt5Network.dll ${QT_DLL_DIR}/Qt5PrintSupport.dll ${QT_DLL_DIR}/Qt5Multimedia.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
|
||||
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Cored.dll ${QT_DLL_DIR}/Qt5Guid.dll ${QT_DLL_DIR}/Qt5Widgetsd.dll ${QT_DLL_DIR}/Qt5Xmld.dll ${QT_DLL_DIR}/Qt5Networkd.dll ${QT_DLL_DIR}/Qt5PrintSupportd.dll ${QT_DLL_DIR}/Qt5Multimediad.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
|
|
|
@ -605,6 +605,10 @@ void AppData::warningId (const int x) { store(x, _warningId,
|
|||
|
||||
// Constructor
|
||||
AppData::AppData()
|
||||
{
|
||||
}
|
||||
|
||||
void AppData::init()
|
||||
{
|
||||
//Initialize the profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
|
|
|
@ -384,6 +384,7 @@ class AppData: protected CompStoreObj
|
|||
|
||||
// Constructor
|
||||
AppData();
|
||||
void init();
|
||||
};
|
||||
|
||||
extern AppData g;
|
||||
|
|
|
@ -109,14 +109,9 @@ void AppPreferencesDialog::initSettings()
|
|||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
#if defined(ALLOW_NIGHTLY_BUILDS)
|
||||
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
|
||||
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
|
||||
#else
|
||||
ui->useCompanionNightlyBuilds->hide();
|
||||
ui->useFirmwareNightlyBuilds->hide();
|
||||
#endif
|
||||
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
|
||||
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
|
||||
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef BURNCONFIGDIALOG_H_
|
||||
#define BURNCONFIGDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define MEM_TYPE_EEPROM 1
|
||||
#define MEM_TYPE_FLASH 2
|
||||
|
|
|
@ -82,12 +82,15 @@ class MyProxyStyle : public QProxyStyle
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(companion);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("OpenTX Companion");
|
||||
app.setOrganizationName("OpenTX");
|
||||
app.setOrganizationDomain("open-tx.org");
|
||||
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
||||
|
||||
g.init();
|
||||
|
||||
QStringList strl = QApplication::arguments();
|
||||
if (strl.contains("--version")) {
|
||||
printf("%s\n", VERSION);
|
||||
|
@ -106,7 +109,7 @@ int main(int argc, char *argv[])
|
|||
app.installTranslator(&companionTranslator);
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
uint32_t sdlFlags = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<RCC>
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>images/customize.png</file>
|
||||
<file>icon.png</file>
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef _COMPAREDIALOG_H
|
||||
#define _COMPAREDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets>
|
||||
#include "multimodelprinter.h"
|
||||
|
||||
namespace Ui {
|
||||
|
|
|
@ -27,7 +27,7 @@ bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom
|
|||
|
||||
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR)
|
||||
if (!errors.test(ALL_OK)
|
||||
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef CUSTOMIZESPLASHDIALOG_H
|
||||
#define CUSTOMIZESPLASHDIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "firmwareinterface.h"
|
||||
|
||||
namespace Ui
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "downloaddialog.h"
|
||||
#include "ui_downloaddialog.h"
|
||||
#include <QMessageBox>
|
||||
#include <QtGui>
|
||||
#include <QTime>
|
||||
#include "helpers.h"
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
#ifndef DOWNLOADDIALOG_H
|
||||
#define DOWNLOADDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QFile>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class downloadDialog;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <list>
|
||||
#include <float.h>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwares/er9x/er9xinterface.h"
|
||||
#include "firmwares/th9x/th9xinterface.h"
|
||||
|
@ -1170,8 +1171,8 @@ GeneralSettings::GeneralSettings()
|
|||
if (ok)
|
||||
imperial=byte8u;
|
||||
QString chars = t_CountrySet.mid(4, 2);
|
||||
ttsLanguage[0]=chars[0].toAscii();
|
||||
ttsLanguage[1]=chars[1].toAscii();
|
||||
ttsLanguage[0] = chars[0].toLatin1();
|
||||
ttsLanguage[1] = chars[1].toLatin1();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1685,7 +1686,7 @@ unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int
|
|||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
|
@ -1705,7 +1706,7 @@ unsigned long LoadBackup(RadioData & radioData, uint8_t * eeprom, int size, int
|
|||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
|
@ -1726,7 +1727,7 @@ unsigned long LoadEepromXml(RadioData & radioData, QDomDocument & doc)
|
|||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
#include <QtXml>
|
||||
#include <QtXml> // This should be removed from here, and remove Xml dependency from all libs which don't need it.
|
||||
#include <QComboBox>
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
@ -1507,8 +1507,7 @@ void registerOpenTxFirmwares();
|
|||
void unregisterOpenTxFirmwares();
|
||||
|
||||
enum EepromLoadErrors {
|
||||
NO_ERROR,
|
||||
|
||||
ALL_OK,
|
||||
UNKNOWN_ERROR,
|
||||
UNSUPPORTED_NEWER_VERSION,
|
||||
WRONG_SIZE,
|
||||
|
|
|
@ -114,7 +114,7 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
|||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
|
|||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral *
|
|||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData *
|
|||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
|
||||
return md;
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
|
|||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, sizeof(Er9xGeneral));
|
||||
break;
|
||||
|
@ -326,7 +326,7 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
|
|||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tmod, data, sizeof(Er9xModelData));
|
||||
break;
|
||||
|
|
|
@ -152,7 +152,7 @@ unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
|||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
|
|||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGene
|
|||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelD
|
|||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
|
||||
return md;
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral *
|
|||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, std::min((unsigned int)ba.size(), (unsigned int)sizeof(Ersky9xGeneral)));
|
||||
break;
|
||||
|
@ -373,7 +373,7 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
|
|||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
|
||||
break;
|
||||
|
|
|
@ -207,7 +207,7 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
|
|||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
|
|
@ -392,8 +392,8 @@ template <int N>
|
|||
class SwitchField: public ConversionField< SignedField<N> > {
|
||||
public:
|
||||
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toAscii(),
|
||||
QObject::tr("Switch ").toAscii()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toAscii()),
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toLatin1(),
|
||||
QObject::tr("Switch ").toLatin1()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toLatin1()),
|
||||
sw(sw),
|
||||
_switch(0)
|
||||
{
|
||||
|
|
|
@ -393,7 +393,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *e
|
|||
}
|
||||
}
|
||||
std::cout << " ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
@ -973,7 +973,7 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
|
|||
return NOT_OPENTX;
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
return ALL_OK;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
|
@ -1081,7 +1081,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *e
|
|||
}
|
||||
|
||||
std::cout << " ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
|
|
@ -107,67 +107,59 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||
# 9X with ATmega64
|
||||
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega64
|
||||
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9X with ATmega128
|
||||
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega128
|
||||
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Gruvin9x
|
||||
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Mega2560
|
||||
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560 PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-mega2560${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Sky9x
|
||||
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR-PRO
|
||||
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# AR9X
|
||||
target_include_directories(opentx-ar9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-ar9x${SUFFIX}-simulator PRIVATE PCBSKY9X AR9X CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-ar9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis standard
|
||||
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis Plus
|
||||
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis X9E
|
||||
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Horus
|
||||
target_include_directories(opentx-horus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/horus PRIVATE ${RADIO_SRC_DIRECTORY}/gui/horus PRIVATE ${RADIO_SRC_DIRECTORY}/fonts/horus PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/horus)
|
||||
target_compile_definitions(opentx-horus${SUFFIX}-simulator PRIVATE PCBHORUS CPUARM CPUSTM32 STM32F40_41xxx COLORLCD VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-horus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
foreach(library ${OPENTX_LIBRARIES})
|
||||
qt5_use_modules(${library} Core)
|
||||
target_link_libraries(${library} PRIVATE ${COMMON_LIBRARIES})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(opentx-simulators
|
||||
DEPENDS ${OPENTX_LIBRARIES}
|
||||
|
@ -175,18 +167,18 @@ add_custom_target(opentx-simulators
|
|||
|
||||
if(APPLE)
|
||||
set(SIMULATOR_BUNDLES)
|
||||
foreach(_file ${OPENTX_LIBRARIES})
|
||||
set(SIMULATOR_BUNDLE "${_file}-bundle")
|
||||
foreach(library ${OPENTX_LIBRARIES})
|
||||
set(SIMULATOR_BUNDLE "${library}-bundle")
|
||||
add_custom_target(${SIMULATOR_BUNDLE}
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${_file}.dylib
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${library}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${library}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${library}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${library}.dylib
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${library}.dylib
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMAND pwd
|
||||
COMMAND cp lib${_file}.dylib companion.app/Contents/Resources/
|
||||
DEPENDS ${_file}
|
||||
COMMAND cp lib${library}.dylib companion.app/Contents/Resources/
|
||||
DEPENDS ${library}
|
||||
)
|
||||
list(APPEND SIMULATOR_BUNDLES ${SIMULATOR_BUNDLE})
|
||||
endforeach()
|
||||
|
|
|
@ -491,7 +491,7 @@ OpenTxSimulator::OpenTxSimulator()
|
|||
void OpenTxSimulator::setSdPath(const QString &sdPath)
|
||||
{
|
||||
#if defined(SDCARD)
|
||||
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
|
||||
strncpy(simuSdDirectory, sdPath.toLatin1().constData(), sizeof(simuSdDirectory)-1);
|
||||
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
|
|||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
|||
if (xmlOK) {
|
||||
RadioData * radioData = new RadioData();
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
if (!errors.test(ALL_OK)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
|
@ -162,7 +162,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
|||
|
||||
RadioData * radioData = new RadioData();
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (eeprom_size == 0 || !errors.test(NO_ERROR)) {
|
||||
if (eeprom_size == 0 || !errors.test(ALL_OK)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef FLASHEEPROMDIALOG_H_
|
||||
#define FLASHEEPROMDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
|
|
|
@ -203,7 +203,6 @@ void FlashFirmwareDialog::on_useLibrarySplash_clicked()
|
|||
void FlashFirmwareDialog::on_burnButton_clicked()
|
||||
{
|
||||
g.flashDir(QFileInfo(fwName).dir().absolutePath());
|
||||
g.profile[g.id()].fwName(fwName);
|
||||
g.checkHardwareCompatibility(ui->checkHardwareCompatibility->isChecked());
|
||||
g.backupOnFlash(ui->backupEEprom->isChecked());
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef FLASH_FIRMWARE_DIALOG_H
|
||||
#define FLASH_FIRMWARE_DIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "xmlinterface.h"
|
||||
|
|
|
@ -24,7 +24,8 @@ foreach(name ${generaledit_NAMES})
|
|||
set(generaledit_UIS ${generaledit_UIS} ${name}.ui)
|
||||
endforeach()
|
||||
|
||||
qt4_wrap_ui(generaledit_SRCS ${generaledit_UIS})
|
||||
qt4_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
|
||||
qt5_wrap_ui(generaledit_SRCS ${generaledit_UIS})
|
||||
qt5_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
|
||||
|
||||
add_library(generaledit ${generaledit_SRCS})
|
||||
qt5_use_modules(generaledit Widgets Xml Multimedia)
|
|
@ -14,7 +14,7 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
|
|||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
this->setLayout(layout);
|
||||
|
||||
tableWidget->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
tableWidget->setColumnCount(3);
|
||||
tableWidget->setShowGrid(false);
|
||||
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
#include <QDateTime>
|
||||
#include <QtGui>
|
||||
#include <QScrollArea>
|
||||
#include "generaledit.h"
|
||||
#include "ui_generaledit.h"
|
||||
#include "helpers.h"
|
||||
|
@ -146,13 +143,13 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
|||
int16_t offset;
|
||||
bool ok;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
qba = controlNames.mid(3*i,3).toAscii();
|
||||
qba = controlNames.mid(3*i,3).toLatin1();
|
||||
strcpy(generalSettings.stickName[i], qba.data());
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
|
||||
Byte=hwtypes.mid(i,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS),3).toAscii();
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.switchConfig[i]=byte16;
|
||||
strcpy(generalSettings.switchName[i], qba.data());
|
||||
|
@ -161,7 +158,7 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
|||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.potConfig[i]=byte16;
|
||||
strcpy(generalSettings.potName[i], qba.data());
|
||||
|
@ -170,7 +167,7 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
|||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.sliderConfig[i]=byte16;
|
||||
strcpy(generalSettings.sliderName[i], qba.data());
|
||||
|
@ -225,8 +222,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
|||
if (ok)
|
||||
generalSettings.imperial=byte8u;
|
||||
chars=CountrySet.mid(4,2);
|
||||
generalSettings.ttsLanguage[0]=chars[0].toAscii();
|
||||
generalSettings.ttsLanguage[1]=chars[1].toAscii();
|
||||
generalSettings.ttsLanguage[0]=chars[0].toLatin1();
|
||||
generalSettings.ttsLanguage[1]=chars[1].toLatin1();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef GENERALEDIT_H
|
||||
#define GENERALEDIT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "genericpanel.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "generalsetup.h"
|
||||
#include "ui_generalsetup.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GeneralPanel(parent, generalSettings, firmware),
|
||||
|
@ -316,7 +315,7 @@ void GeneralSetupPanel::on_voiceLang_CB_currentIndexChanged(int index)
|
|||
if (!lock) {
|
||||
QString code = ui->voiceLang_CB->itemData(index).toString();
|
||||
for (int i=0; i<2; i++) {
|
||||
generalSettings.ttsLanguage[i] = code.at(i).toAscii();
|
||||
generalSettings.ttsLanguage[i] = code.at(i).toLatin1();
|
||||
}
|
||||
generalSettings.ttsLanguage[2] = '\0';
|
||||
emit modified();
|
||||
|
|
|
@ -86,7 +86,7 @@ void getFileComboBoxValue(QComboBox * b, char * dest, int length)
|
|||
{
|
||||
memset(dest, 0, length+1);
|
||||
if (b->currentText() != "----") {
|
||||
strncpy(dest, b->currentText().toAscii(), length);
|
||||
strncpy(dest, b->currentText().toLatin1(), length);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef HELPERS_H
|
||||
#define HELPERS_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QTableWidget>
|
||||
#include <QGridLayout>
|
||||
#include <QDebug>
|
||||
|
|
|
@ -499,12 +499,12 @@ void LogsDialog::on_fileOpen_BT_clicked()
|
|||
}
|
||||
}
|
||||
|
||||
ui->logTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
ui->logTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
QVarLengthArray<int> sizes;
|
||||
for (int i = 0; i < ui->logTable->columnCount(); i++) {
|
||||
sizes.append(ui->logTable->columnWidth(i));
|
||||
}
|
||||
ui->logTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
|
||||
ui->logTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||
for (int i = 0; i < ui->logTable->columnCount(); i++) {
|
||||
ui->logTable->setColumnWidth(i, sizes.at(i));
|
||||
}
|
||||
|
|
|
@ -42,8 +42,7 @@
|
|||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QMainWindow>
|
||||
#include <QtWidgets>
|
||||
#include <QDateTime>
|
||||
#include "downloaddialog.h"
|
||||
#include "eeprominterface.h"
|
||||
|
|
|
@ -270,7 +270,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
|||
bool xmlOK = doc.setContent(&file);
|
||||
if(xmlOK) {
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(radioData, doc));
|
||||
if (errors.test(NO_ERROR)) {
|
||||
if (errors.test(ALL_OK)) {
|
||||
ui->modelsList->refreshList();
|
||||
if(resetCurrentFile) setCurrentFile(fileName);
|
||||
return true;
|
||||
|
@ -301,7 +301,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
|||
file.close();
|
||||
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
if (!errors.test(ALL_OK)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid EEPROM File %1").arg(fileName), errors.to_ulong());
|
||||
return false;
|
||||
}
|
||||
|
@ -339,9 +339,9 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
|||
}
|
||||
|
||||
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
|
||||
if (!errorsEeprom.test(NO_ERROR)) {
|
||||
if (!errorsEeprom.test(ALL_OK)) {
|
||||
std::bitset<NUM_ERRORS> errorsBackup((unsigned long long)LoadBackup(radioData, eeprom, eeprom_size, 0));
|
||||
if (!errorsBackup.test(NO_ERROR)) {
|
||||
if (!errorsBackup.test(ALL_OK)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid binary EEPROM File %1").arg(fileName), (errorsEeprom | errorsBackup).to_ulong());
|
||||
return false;
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ bool MdiChild::loadBackup()
|
|||
}
|
||||
|
||||
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index));
|
||||
if (!errorsEeprom.test(NO_ERROR)) {
|
||||
if (!errorsEeprom.test(ALL_OK)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid binary backup File %1").arg(fileName), (errorsEeprom).to_ulong());
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,8 @@ foreach(name ${modeledit_NAMES})
|
|||
set(modeledit_UIS ${modeledit_UIS} ${name}.ui)
|
||||
endforeach()
|
||||
|
||||
qt4_wrap_ui(modeledit_SRCS ${modeledit_UIS})
|
||||
qt4_wrap_cpp(modeledit_SRCS ${modeledit_HDRS})
|
||||
qt5_wrap_ui(modeledit_SRCS ${modeledit_UIS})
|
||||
qt5_wrap_cpp(modeledit_SRCS ${modeledit_HDRS})
|
||||
|
||||
add_library(modeledit ${modeledit_SRCS})
|
||||
qt5_use_modules(modeledit Widgets Xml Multimedia)
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
#include "channels.h"
|
||||
#include "helpers.h"
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt):
|
||||
firmware(firmware),
|
||||
|
@ -200,7 +194,7 @@ void Channels::nameEdited()
|
|||
if (!lock) {
|
||||
QLineEdit *le = qobject_cast<QLineEdit*>(sender());
|
||||
int index = le->property("index").toInt();
|
||||
strcpy(model->limitData[index].name, le->text().toAscii());
|
||||
strcpy(model->limitData[index].name, le->text().toLatin1());
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "helpers.h"
|
||||
#include "modeledit.h"
|
||||
#include <QSpinBox>
|
||||
|
||||
class GVarGroup;
|
||||
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
#include "node.h"
|
||||
#include "edge.h"
|
||||
#include "helpers.h"
|
||||
#include <QSpinBox>
|
||||
#include <QCheckBox>
|
||||
#include <QPushButton>
|
||||
#include <QMessageBox>
|
||||
#include <QAction>
|
||||
|
||||
#define GFX_MARGIN 16
|
||||
|
||||
|
@ -491,7 +486,7 @@ void Curves::on_curveSmooth_currentIndexChanged(int index)
|
|||
void Curves::on_curveName_editingFinished()
|
||||
{
|
||||
memset(model->curves[currentCurve].name, 0, sizeof(model->curves[currentCurve].name));
|
||||
strcpy(model->curves[currentCurve].name, ui->curveName->text().toAscii());
|
||||
strcpy(model->curves[currentCurve].name, ui->curveName->text().toLatin1());
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QSpinBox>
|
||||
|
||||
enum CopyAction {
|
||||
CURVE_COPY,
|
||||
|
|
|
@ -43,13 +43,9 @@ void RepeatComboBox::update()
|
|||
|
||||
CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GenericPanel(parent, model, generalSettings, firmware),
|
||||
functions(model ? model->customFn : generalSettings.customFn)
|
||||
#if defined(PHONON)
|
||||
,
|
||||
phononCurrent(-1),
|
||||
clickObject(NULL),
|
||||
clickOutput(NULL)
|
||||
#endif
|
||||
functions(model ? model->customFn : generalSettings.customFn),
|
||||
mediaPlayerCurrent(-1),
|
||||
mediaPlayer(NULL)
|
||||
{
|
||||
Stopwatch s1("CustomFunctionsPanel - populate");
|
||||
lock = true;
|
||||
|
@ -178,14 +174,12 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||
paramLayout->addWidget(fswtchBLcolor[i]);
|
||||
connect(fswtchBLcolor[i], SIGNAL(sliderReleased()), this, SLOT(customFunctionEdited()));
|
||||
|
||||
#ifdef PHONON
|
||||
playBT[i] = new QPushButton(this);
|
||||
playBT[i]->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||
playBT[i]->setProperty("index", i);
|
||||
playBT[i]->setIcon(playIcon);
|
||||
paramLayout->addWidget(playBT[i]);
|
||||
connect(playBT[i], SIGNAL(pressed()), this, SLOT(playMusic()));
|
||||
#endif
|
||||
|
||||
QHBoxLayout * repeatLayout = new QHBoxLayout();
|
||||
tableLayout->addLayout(i, 4, repeatLayout);
|
||||
|
@ -220,35 +214,42 @@ CustomFunctionsPanel::~CustomFunctionsPanel()
|
|||
{
|
||||
}
|
||||
|
||||
#ifdef PHONON
|
||||
void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::State oldState)
|
||||
void CustomFunctionsPanel::onMediaPlayerStateChanged(QMediaPlayer::State state)
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
if ((newState==Phonon::ErrorState || newState==Phonon::StoppedState || newState==Phonon::PausedState) && oldState==Phonon::PlayingState) {
|
||||
clickObject->stop();
|
||||
clickObject->clearQueue();
|
||||
clickObject->clear();
|
||||
if (phononCurrent >= 0) {
|
||||
playBT[phononCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
phononCurrent = -1;
|
||||
if (state==QMediaPlayer::StoppedState || state==QMediaPlayer::PausedState) {
|
||||
mediaPlayer->stop();
|
||||
if (mediaPlayerCurrent >= 0) {
|
||||
playBT[mediaPlayerCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
mediaPlayerCurrent = -1;
|
||||
}
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::onMediaPlayerError(QMediaPlayer::Error error)
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
if (mediaPlayerCurrent >= 0) {
|
||||
playBT[mediaPlayerCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
mediaPlayerCurrent = -1;
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::playMusic()
|
||||
{
|
||||
if (!clickObject) {
|
||||
clickObject = new Phonon::MediaObject(this);
|
||||
clickOutput = new Phonon::AudioOutput(Phonon::NoCategory, this);
|
||||
Phonon::createPath(clickObject, clickOutput);
|
||||
connect(clickObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), this, SLOT(mediaPlayer_state(Phonon::State, Phonon::State)));
|
||||
if (!mediaPlayer) {
|
||||
mediaPlayer = new QMediaPlayer(this);
|
||||
connect(mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(onMediaPlayerStateChanged(QMediaPlayer::State)));
|
||||
connect(mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(onMediaPlayerError(QMediaPlayer::Error)));
|
||||
}
|
||||
|
||||
QPushButton * button = qobject_cast<QPushButton*>(sender());
|
||||
int index = button->property("index").toInt();
|
||||
int index = sender()->property("index").toInt();
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
QDir qd(path);
|
||||
QString track;
|
||||
|
@ -272,29 +273,22 @@ void CustomFunctionsPanel::playMusic()
|
|||
return;
|
||||
}
|
||||
|
||||
if (phononCurrent == index) {
|
||||
clickObject->stop();
|
||||
clickObject->clear();
|
||||
if (mediaPlayerCurrent == index) {
|
||||
mediaPlayer->stop();
|
||||
playBT[index]->setIcon(CompanionIcon("play.png"));
|
||||
phononCurrent = -1;
|
||||
mediaPlayerCurrent = -1;
|
||||
}
|
||||
else {
|
||||
if (phononCurrent >= 0) {
|
||||
playBT[phononCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
if (mediaPlayerCurrent >= 0) {
|
||||
playBT[mediaPlayerCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
}
|
||||
phononCurrent = index;
|
||||
clickObject->clear();
|
||||
#ifdef __APPLE__
|
||||
clickObject->setCurrentSource(QUrl("file://"+track));
|
||||
#else
|
||||
clickObject->setCurrentSource(QUrl(track));
|
||||
#endif
|
||||
clickObject->play();
|
||||
mediaPlayerCurrent = index;
|
||||
mediaPlayer->setMedia(QUrl::fromLocalFile(track));
|
||||
mediaPlayer->play();
|
||||
playBT[index]->setIcon(CompanionIcon("stop.png"));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#define CUSTOM_FUNCTION_NUMERIC_PARAM (1<<0)
|
||||
#define CUSTOM_FUNCTION_SOURCE_PARAM (1<<1)
|
||||
|
@ -526,9 +520,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
|||
fswtchRepeat[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_REPEAT);
|
||||
fswtchGVmode[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_GV_MODE);
|
||||
fswtchBLcolor[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_BL_COLOR);
|
||||
#ifdef PHONON
|
||||
playBT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_PLAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::update()
|
||||
|
|
|
@ -3,17 +3,7 @@
|
|||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QLabel>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QPushButton>
|
||||
#include <QTimeEdit>
|
||||
#ifdef PHONON
|
||||
#include <phonon/audiooutput.h>
|
||||
#include <phonon/mediaobject.h>
|
||||
#include <phonon/mediasource.h>
|
||||
#endif
|
||||
#include <QtMultimedia>
|
||||
|
||||
class RepeatComboBox: public QComboBox
|
||||
{
|
||||
|
@ -52,10 +42,9 @@ class CustomFunctionsPanel : public GenericPanel
|
|||
void fsw_customContextMenuRequested(QPoint pos);
|
||||
void refreshCustomFunction(int index, bool modified=false);
|
||||
void onChildModified();
|
||||
#ifdef PHONON
|
||||
void playMusic();
|
||||
void mediaPlayer_state(Phonon::State newState, Phonon::State oldState);
|
||||
#endif
|
||||
void onMediaPlayerStateChanged(QMediaPlayer::State state);
|
||||
void onMediaPlayerError(QMediaPlayer::Error error);
|
||||
void fswDelete();
|
||||
void fswCopy();
|
||||
void fswPaste();
|
||||
|
@ -68,7 +57,7 @@ class CustomFunctionsPanel : public GenericPanel
|
|||
|
||||
QSet<QString> tracksSet;
|
||||
QSet<QString> scriptsSet;
|
||||
int phononCurrent;
|
||||
int mediaPlayerCurrent;
|
||||
QComboBox * fswtchSwtch[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QComboBox * fswtchFunc[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QCheckBox * fswtchParamGV[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
|
@ -81,10 +70,7 @@ class CustomFunctionsPanel : public GenericPanel
|
|||
RepeatComboBox * fswtchRepeat[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QComboBox * fswtchGVmode[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QSlider * fswtchBLcolor[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
#ifdef PHONON
|
||||
Phonon::MediaObject *clickObject;
|
||||
Phonon::AudioOutput *clickOutput;
|
||||
#endif
|
||||
QMediaPlayer * mediaPlayer;
|
||||
|
||||
int selectedFunction;
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ void ExpoDialog::valuesChanged()
|
|||
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||
ed->mode = ui->sideCB->currentIndex() + 1;
|
||||
|
||||
strcpy(ed->name, ui->lineName->text().toAscii().data());
|
||||
strcpy(ed->name, ui->lineName->text().toLatin1().data());
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
inputName = ui->inputName->text();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef EXPODIALOG_H
|
||||
#define EXPODIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
#include "flightmodes.h"
|
||||
#include "ui_flightmode.h"
|
||||
// #include "firmwares/opentx/opentxeeprom.h" // TODO shouldn't be there
|
||||
#include "helpers.h"
|
||||
#include <QComboBox>
|
||||
#include <QGridLayout>
|
||||
|
||||
FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
|
@ -244,7 +241,7 @@ void FlightModePanel::update()
|
|||
void FlightModePanel::phaseName_editingFinished()
|
||||
{
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender());
|
||||
strcpy(phase.name, lineEdit->text().toAscii());
|
||||
strcpy(phase.name, lineEdit->text().toLatin1());
|
||||
emit modified();
|
||||
emit nameModified();
|
||||
}
|
||||
|
@ -312,7 +309,7 @@ void FlightModePanel::GVName_editingFinished()
|
|||
QLineEdit *lineedit = qobject_cast<QLineEdit*>(sender());
|
||||
int gvar = lineedit->property("index").toInt();
|
||||
memset(&model->gvars_names[gvar], 0, sizeof(model->gvars_names[gvar]));
|
||||
strcpy(model->gvars_names[gvar], lineedit->text().toAscii());
|
||||
strcpy(model->gvars_names[gvar], lineedit->text().toLatin1());
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QVector>
|
||||
#include <QLabel>
|
||||
#include <QTabWidget>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
|
||||
namespace Ui {
|
||||
class FlightMode;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "inputs.h"
|
||||
#include <QMessageBox>
|
||||
#include "expodialog.h"
|
||||
#include "helpers.h"
|
||||
|
||||
|
@ -199,7 +198,7 @@ void InputsPanel::gm_openExpo(int index)
|
|||
if (g->exec()) {
|
||||
model->expoData[index] = mixd;
|
||||
if (firmware->getCapability(VirtualInputs))
|
||||
strncpy(model->inputNames[mixd.chn], inputName.toAscii().data(), 4);
|
||||
strncpy(model->inputNames[mixd.chn], inputName.toLatin1().data(), 4);
|
||||
emit modified();
|
||||
update();
|
||||
}
|
||||
|
@ -288,8 +287,6 @@ void InputsPanel::mimeExpoDropped(int index, const QMimeData *data, Qt::DropActi
|
|||
pasteExpoMimeData(data, idx);
|
||||
}
|
||||
|
||||
#include <iostream>
|
||||
#include <QtGui/qwidget.h>
|
||||
void InputsPanel::pasteExpoMimeData(const QMimeData * mimeData, int destIdx)
|
||||
{
|
||||
if (mimeData->hasFormat("application/x-companion-expo")) {
|
||||
|
@ -328,9 +325,10 @@ void InputsPanel::exposPaste()
|
|||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
QListWidgetItem *item = ExposlistWidget->currentItem();
|
||||
if (item)
|
||||
if (item) {
|
||||
pasteExpoMimeData(mimeData, item->data(Qt::UserRole).toByteArray().at(0));
|
||||
}
|
||||
}
|
||||
|
||||
void InputsPanel::exposDuplicate()
|
||||
{
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
#include "logicalswitches.h"
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include "helpers.h"
|
||||
|
||||
LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QTimeEdit>
|
||||
|
||||
class LogicalSwitchesPanel : public ModelPanel
|
||||
{
|
||||
|
|
|
@ -159,8 +159,7 @@ void MixerDialog::valuesChanged()
|
|||
md->delayUp = round(ui->delayUpSB->value()*scale);
|
||||
md->speedDown = round(ui->slowDownSB->value()*scale);
|
||||
md->speedUp = round(ui->slowUpSB->value()*scale);
|
||||
|
||||
strcpy(md->name, ui->mixerName->text().toAscii());
|
||||
strcpy(md->name, ui->mixerName->text().toLatin1());
|
||||
|
||||
md->flightModes = 0;
|
||||
for (int i=8; i>=0 ; i--) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MIXERDIALOG_H
|
||||
#define MIXERDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class GVarGroup;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef MIXERSLIST_H
|
||||
#define MIXERSLIST_H
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#define MIX_ROW_HEIGHT_INCREASE 8 //how much space is added above mixer row (for new channel), if 0 space adding is disabled
|
||||
const int GroupHeaderRole = (Qt::UserRole+2); //defines new user role for list items. If value is > 0, then space is added before that item
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "mixes.h"
|
||||
#include "helpers.h"
|
||||
// #include <QMessageBox>
|
||||
// #include "expodialog.h"
|
||||
|
||||
MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "customfunctions.h"
|
||||
#include "telemetry.h"
|
||||
#include "appdata.h"
|
||||
#include <QScrollArea>
|
||||
|
||||
ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmware * firmware) :
|
||||
QDialog(parent),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MODELEDIT_H
|
||||
#define MODELEDIT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "genericpanel.h"
|
||||
|
||||
class RadioData;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#ifndef NODE_H
|
||||
#define NODE_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define DEFAULT_BALL_SIZE 10
|
||||
#define BALL_HEIGHT 2
|
||||
|
|
|
@ -115,7 +115,7 @@ void TimerPanel::on_minuteBeep_toggled(bool checked)
|
|||
void TimerPanel::on_name_editingFinished()
|
||||
{
|
||||
int length = ui->name->maxLength();
|
||||
strncpy(timer.name, ui->name->text().toAscii(), length);
|
||||
strncpy(timer.name, ui->name->text().toLatin1(), length);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
@ -728,14 +728,14 @@ void SetupPanel::on_throttleSource_currentIndexChanged(int index)
|
|||
void SetupPanel::on_name_editingFinished()
|
||||
{
|
||||
int length = ui->name->maxLength();
|
||||
strncpy(model->name, ui->name->text().toAscii(), length);
|
||||
strncpy(model->name, ui->name->text().toLatin1(), length);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void SetupPanel::on_image_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
strncpy(model->bitmap, ui->image->currentText().toAscii(), 10);
|
||||
strncpy(model->bitmap, ui->image->currentText().toLatin1(), 10);
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
path.append("/BMP/");
|
||||
QDir qd(path);
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QVector>
|
||||
#include <QCheckBox>
|
||||
#include <QSlider>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QLabel>
|
||||
|
||||
namespace Ui {
|
||||
class Setup;
|
||||
|
|
|
@ -648,7 +648,7 @@ void TelemetrySensorPanel::updateSourcesComboBox(AutoComboBox * cb, bool negativ
|
|||
void TelemetrySensorPanel::on_name_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
strcpy(sensor.label, ui->name->text().toAscii());
|
||||
strcpy(sensor.label, ui->name->text().toLatin1());
|
||||
emit dataModified();
|
||||
emit modified();
|
||||
}
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QGroupBox>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
class AutoComboBox;
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include "templates.h"
|
||||
#include <QListWidget>
|
||||
#include <QMessageBox>
|
||||
|
||||
#define CHANNEL_ORDER(x) generalSettings.getDefaultStick(x)
|
||||
#define CC(x) (CHANNEL_ORDER(x)) //need to invert this to work with dest
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef TEMPLATES_H
|
||||
#define TEMPLATES_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class Templates : public QWidget
|
||||
|
|
|
@ -269,7 +269,7 @@ QString ModelPrinter::printInputName(int idx)
|
|||
else {
|
||||
result = RawSource(SOURCE_TYPE_STICK, idx).toString(&model);
|
||||
}
|
||||
return Qt::escape(result);
|
||||
return result.toHtmlEscaped();
|
||||
}
|
||||
|
||||
QString ModelPrinter::printInputLine(int idx)
|
||||
|
@ -288,29 +288,29 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
|
|||
}
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
str += Qt::escape(input.srcRaw.toString(&model));
|
||||
str += input.srcRaw.toString(&model).toHtmlEscaped();
|
||||
}
|
||||
|
||||
str += " " + Qt::escape(tr("Weight")) + QString("(%1)").arg(getGVarString(input.weight,true));
|
||||
if (input.curve.value) str += " " + Qt::escape(input.curve.toString());
|
||||
str += " " + tr("Weight").toHtmlEscaped() + QString("(%1)").arg(getGVarString(input.weight,true).toHtmlEscaped());
|
||||
if (input.curve.value) str += " " + input.curve.toString().toHtmlEscaped();
|
||||
|
||||
QString flightModesStr = printFlightModes(input.flightModes);
|
||||
if (!flightModesStr.isEmpty()) str += " " + Qt::escape(flightModesStr);
|
||||
if (!flightModesStr.isEmpty()) str += " " + flightModesStr.toHtmlEscaped();
|
||||
|
||||
if (input.swtch.type != SWITCH_TYPE_NONE)
|
||||
str += " " + Qt::escape(tr("Switch")) + QString("(%1)").arg(input.swtch.toString());
|
||||
str += " " + tr("Switch").toHtmlEscaped() + QString("(%1)").arg(input.swtch.toString().toHtmlEscaped());
|
||||
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
if (input.carryTrim>0) str += " " + Qt::escape(tr("NoTrim"));
|
||||
else if (input.carryTrim<0) str += " " + Qt::escape(RawSource(SOURCE_TYPE_TRIM, (-(input.carryTrim)-1)).toString(&model));
|
||||
if (input.carryTrim>0) str += " " + tr("NoTrim").toHtmlEscaped();
|
||||
else if (input.carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(input.carryTrim)-1)).toString(&model).toHtmlEscaped();
|
||||
}
|
||||
|
||||
if (input.offset)
|
||||
str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(input.offset)));
|
||||
str += " " + tr("Offset(%1)").arg(getGVarString(input.offset)).toHtmlEscaped();
|
||||
|
||||
if (firmware->getCapability(HasExpoNames) && input.name[0])
|
||||
str += Qt::escape(QString(" [%1]").arg(input.name));
|
||||
str += QString(" [%1]").arg(input.name).toHtmlEscaped();
|
||||
|
||||
return str;
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ QString ModelPrinter::printMixerName(int curDest)
|
|||
name.append(" ");
|
||||
str += name.left(8);
|
||||
}
|
||||
return Qt::escape(str);
|
||||
return str.toHtmlEscaped();
|
||||
}
|
||||
|
||||
QString ModelPrinter::printMixerLine(int idx, bool showMultiplex, int highlightedSource)
|
||||
|
@ -349,43 +349,43 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
|
|||
str += " ";
|
||||
}
|
||||
// highlight source if needed
|
||||
QString source = Qt::escape(mix.srcRaw.toString(&model));
|
||||
QString source = mix.srcRaw.toString(&model).toHtmlEscaped();
|
||||
if ( (mix.srcRaw.type == SOURCE_TYPE_CH) && (mix.srcRaw.index+1 == (int)highlightedSource) ) {
|
||||
source = "<b>" + source + "</b>";
|
||||
}
|
||||
str += " " + source;
|
||||
|
||||
str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(mix.weight, true)));
|
||||
str += " " + tr("Weight(%1)").arg(getGVarString(mix.weight, true)).toHtmlEscaped();
|
||||
|
||||
QString flightModesStr = printFlightModes(mix.flightModes);
|
||||
if (!flightModesStr.isEmpty())
|
||||
str += " " + Qt::escape(flightModesStr);
|
||||
str += " " + flightModesStr.toHtmlEscaped();
|
||||
|
||||
if (mix.swtch.type != SWITCH_TYPE_NONE)
|
||||
str += " " + Qt::escape(tr("Switch(%1)").arg(mix.swtch.toString()));
|
||||
str += " " + tr("Switch(%1)").arg(mix.swtch.toString()).toHtmlEscaped();
|
||||
|
||||
if (mix.carryTrim > 0)
|
||||
str += " " + Qt::escape(tr("NoTrim"));
|
||||
str += " " + tr("NoTrim").toHtmlEscaped();
|
||||
else if (mix.carryTrim < 0)
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(mix.carryTrim)-1)).toString(&model);
|
||||
|
||||
if (firmware->getCapability(HasNoExpo) && mix.noExpo)
|
||||
str += " " + Qt::escape(tr("No DR/Expo"));
|
||||
str += " " + tr("No DR/Expo").toHtmlEscaped();
|
||||
if (mix.sOffset)
|
||||
str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(mix.sOffset)));
|
||||
str += " " + tr("Offset(%1)").arg(getGVarString(mix.sOffset)).toHtmlEscaped();
|
||||
if (mix.curve.value)
|
||||
str += " " + Qt::escape(mix.curve.toString());
|
||||
str += " " + mix.curve.toString().toHtmlEscaped();
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
if (mix.delayDown || mix.delayUp)
|
||||
str += " " + Qt::escape(tr("Delay(u%1:d%2)").arg((double)mix.delayUp/scale).arg((double)mix.delayDown/scale));
|
||||
str += " " + tr("Delay(u%1:d%2)").arg((double)mix.delayUp/scale).arg((double)mix.delayDown/scale).toHtmlEscaped();
|
||||
if (mix.speedDown || mix.speedUp)
|
||||
str += " " + Qt::escape(tr("Slow(u%1:d%2)").arg((double)mix.speedUp/scale).arg((double)mix.speedDown/scale));
|
||||
str += " " + tr("Slow(u%1:d%2)").arg((double)mix.speedUp/scale).arg((double)mix.speedDown/scale).toHtmlEscaped();
|
||||
if (mix.mixWarn)
|
||||
str += " " + Qt::escape(tr("Warn(%1)").arg(mix.mixWarn));
|
||||
str += " " + tr("Warn(%1)").arg(mix.mixWarn).toHtmlEscaped();
|
||||
if (firmware->getCapability(HasMixerNames) && mix.name[0])
|
||||
str += Qt::escape(QString(" [%1]").arg(mix.name));
|
||||
str += QString(" [%1]").arg(mix.name).toHtmlEscaped();
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
#ifndef MODELSLIST_H
|
||||
#define MODELSLIST_H
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include <QListWidget>
|
||||
|
||||
struct CurrentSelection
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _PRINTDIALOG_H
|
||||
#define _PRINTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "multimodelprinter.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef SYNCPROCESS_H_
|
||||
#define SYNCPROCESS_H_
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ set(qcustomplot_HDRS
|
|||
qcustomplot.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(qcustomplot_SRCS ${qcustomplot_HDRS})
|
||||
qt5_wrap_cpp(qcustomplot_SRCS ${qcustomplot_HDRS})
|
||||
|
||||
add_library(qcustomplot ${qcustomplot_SRCS})
|
||||
qt5_use_modules(qcustomplot Widgets PrintSupport)
|
||||
|
|
|
@ -45,14 +45,8 @@
|
|||
#include <QMargins>
|
||||
#include <qmath.h>
|
||||
#include <limits>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
# include <qnumeric.h>
|
||||
# include <QPrinter>
|
||||
# include <QPrintEngine>
|
||||
#else
|
||||
#include <QtNumeric>
|
||||
#include <QtPrintSupport>
|
||||
#endif
|
||||
|
||||
class QCPPainter;
|
||||
class QCustomPlot;
|
||||
|
|
|
@ -6,6 +6,8 @@ set(qxtcommandoptions_HDRS
|
|||
qxtcommandoptions.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(qxtcommandoptions_SRCS ${qxtcommandoptions_HDRS})
|
||||
qt5_wrap_cpp(qxtcommandoptions_SRCS ${qxtcommandoptions_HDRS})
|
||||
|
||||
add_library(qxtcommandoptions ${qxtcommandoptions_SRCS})
|
||||
qt5_use_modules(qxtcommandoptions Widgets)
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ set(shared_HDRS
|
|||
hexspinbox.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(shared_SRCS ${shared_HDRS})
|
||||
qt5_wrap_cpp(shared_SRCS ${shared_HDRS})
|
||||
|
||||
add_library(shared ${shared_SRCS})
|
||||
qt5_use_modules(shared Widgets)
|
|
@ -44,7 +44,7 @@ class AutoLineEdit: public QLineEdit
|
|||
void onEdited()
|
||||
{
|
||||
if (field && !lock) {
|
||||
strcpy(field, text().toAscii());
|
||||
strcpy(field, text().toLatin1());
|
||||
if (panel) {
|
||||
emit panel->modified();
|
||||
}
|
||||
|
|
|
@ -53,7 +53,8 @@ include_directories(
|
|||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
)
|
||||
|
||||
qt4_wrap_ui(simulation_SRCS ${simulation_UIS})
|
||||
qt4_wrap_cpp(simulation_SRCS ${simulation_HDRS})
|
||||
qt5_wrap_ui(simulation_SRCS ${simulation_UIS})
|
||||
qt5_wrap_cpp(simulation_SRCS ${simulation_HDRS})
|
||||
|
||||
add_library(simulation ${simulation_SRCS})
|
||||
qt5_use_modules(simulation Widgets Xml)
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#include <QStyleOption>
|
||||
|
||||
class ButtonsWidget : public QWidget
|
||||
{
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#include <QtGui>
|
||||
#include <stdint.h>
|
||||
#include "debugoutput.h"
|
||||
#include "ui_debugoutput.h"
|
||||
|
||||
|
@ -18,7 +16,6 @@ DebugOutput::DebugOutput(QWidget * parent):
|
|||
QFont newFont("Courier", 9);
|
||||
ui->Output->setFont(newFont);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
DebugOutput::~DebugOutput()
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef debugoutput_h
|
||||
#define debugoutput_h
|
||||
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
namespace Ui {
|
||||
|
|
|
@ -37,19 +37,21 @@ bool Joystick::open(int stick)
|
|||
numHats = SDL_JoystickNumHats(joystick);
|
||||
numTrackballs = SDL_JoystickNumBalls(joystick);
|
||||
joystickTimer.start(eventTimeout);
|
||||
return TRUE;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "ERROR: couldn't open SDL joystick #%d", stick);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Joystick::close()
|
||||
{
|
||||
joystickTimer.stop();
|
||||
if ( joystick )
|
||||
if (joystick) {
|
||||
SDL_JoystickClose(joystick);
|
||||
joystick = NULL;
|
||||
}
|
||||
numAxes = numButtons = numHats = numTrackballs = 0;
|
||||
}
|
||||
|
||||
|
@ -70,16 +72,20 @@ void Joystick::processEvents()
|
|||
emit axisValueChanged(i, moved);
|
||||
axes[i] = moved;
|
||||
axisRepeatTimers[i].restart();
|
||||
} else if (autoRepeat && moved != 0) {
|
||||
}
|
||||
else if (autoRepeat && moved != 0) {
|
||||
if ( axisRepeatTimers[i].elapsed() >= autoRepeatDelay ) {
|
||||
emit axisValueChanged(i, moved);
|
||||
axes[i] = moved;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
axisRepeatTimers[i].restart();
|
||||
} else
|
||||
}
|
||||
else {
|
||||
emit axisValueChanged(i, 0);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < numButtons; i++) {
|
||||
Uint8 changed = SDL_JoystickGetButton(joystick, i);
|
||||
if ( (changed != buttons[i]) ) {
|
||||
|
|
|
@ -31,7 +31,7 @@ class Joystick : public QObject
|
|||
|
||||
Joystick(QObject *parent = 0,
|
||||
int joystickEventTimeout = SDL_JOYSTICK_DEFAULT_EVENT_TIMEOUT,
|
||||
bool doAutoRepeat = TRUE,
|
||||
bool doAutoRepeat = true,
|
||||
int autoRepeatDelay = SDL_JOYSTICK_DEFAULT_AUTOREPEAT_DELAY);
|
||||
~Joystick();
|
||||
bool open(int);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "joystickdialog.h"
|
||||
#include "ui_joystickdialog.h"
|
||||
#include "appdata.h"
|
||||
#include <QtGui>
|
||||
|
||||
joystickDialog::joystickDialog(QWidget *parent, int stick) :
|
||||
QDialog(parent),
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef JOYSTICKDIALOG_H
|
||||
#define JOYSTICKDIALOG_H
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "joystick.h"
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class joystickDialog;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef SIMULATORDIALOG_H
|
||||
#define SIMULATORDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "modeledit/node.h"
|
||||
#include "telemetrysimu.h"
|
||||
#include "trainersimu.h"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <QSlider>
|
||||
#include <QtGui>
|
||||
#include <QFrame>
|
||||
|
||||
class SliderWidget : public QSlider
|
||||
{
|
||||
|
|
|
@ -518,7 +518,7 @@ uint32_t TelemetrySimulator::GPSEmulator::getNextPacketData(uint32_t packetType)
|
|||
switch (packetType) {
|
||||
case GPS_LONG_LATI_FIRST_ID:
|
||||
sendLat = !sendLat;
|
||||
return sendLat ? encodeLatLon(lat, TRUE) : encodeLatLon(lon, FALSE);
|
||||
return sendLat ? encodeLatLon(lat, true) : encodeLatLon(lon, false);
|
||||
break;
|
||||
case GPS_TIME_DATE_FIRST_ID:
|
||||
sendDate = !sendDate;
|
||||
|
|
|
@ -91,11 +91,14 @@ void showMessage(const QString & message, enum QMessageBox::Icon icon = QMessage
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(companion);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("OpenTX Simulator");
|
||||
app.setOrganizationName("OpenTX");
|
||||
app.setOrganizationDomain("open-tx.org");
|
||||
|
||||
g.init();
|
||||
|
||||
#ifdef __APPLE__
|
||||
app.setStyle(new MyProxyStyle);
|
||||
#endif
|
||||
|
@ -108,7 +111,7 @@ int main(int argc, char *argv[])
|
|||
app.installTranslator(&qtTranslator);
|
||||
*/
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
uint32_t sdlFlags = 0;
|
||||
|
@ -131,7 +134,7 @@ int main(int argc, char *argv[])
|
|||
registerSimulators();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
eedir = QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
|
||||
eedir = QDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/data/OpenTX/Simulator");
|
||||
if (!eedir.exists("OpenTX")) {
|
||||
eedir.mkdir("OpenTX");
|
||||
}
|
||||
|
@ -203,7 +206,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (options.positional().isEmpty()) {
|
||||
eepromFileName = QString("eeprom-%1.bin").arg(radioId);
|
||||
eepromFileName = eedir.filePath(eepromFileName.toAscii());
|
||||
eepromFileName = eedir.filePath(eepromFileName.toLatin1());
|
||||
}
|
||||
else {
|
||||
eepromFileName = options.positional()[0];
|
||||
|
@ -230,7 +233,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
dialog->show();
|
||||
dialog->start(eepromFileName.toAscii().constData());
|
||||
dialog->start(eepromFileName.toLatin1().constData());
|
||||
|
||||
int result = app.exec();
|
||||
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
#ifndef SPLASHLABEL_H
|
||||
#define SPLASHLABEL_H
|
||||
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
class splashLabel : public QLabel
|
||||
{
|
||||
|
@ -77,5 +75,6 @@ signals:
|
|||
private:
|
||||
int index;
|
||||
};
|
||||
|
||||
#endif /* SPLASHLABEL_H */
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "splashlibrarydialog.h"
|
||||
#include "ui_splashlibrarydialog.h"
|
||||
#include "appdata.h"
|
||||
#include <QtGui>
|
||||
#include "helpers.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "helpers.h"
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef SPLASHLIBRARY_H
|
||||
#define SPLASHLIBRARY_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
|
||||
namespace Ui {
|
||||
class SplashLibraryDialog;
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <QtGui>
|
||||
#include "wizarddialog.h"
|
||||
#include "wizarddata.h"
|
||||
#include "helpers.h"
|
||||
|
@ -296,7 +295,7 @@ bool ModelSelectionPage::validatePage()
|
|||
QString newName(nameLineEdit->text());
|
||||
newName = (newName.normalized(QString::NormalizationForm_D));
|
||||
newName = newName.replace(QRegExp("[^ A-Za-z0-9_.-,\\s]"), "");
|
||||
strncpy( wizDlg->mix.name, newName.toAscii(), WIZ_MODEL_NAME_LENGTH);
|
||||
strncpy( wizDlg->mix.name, newName.toLatin1(), WIZ_MODEL_NAME_LENGTH);
|
||||
wizDlg->mix.name[WIZ_MODEL_NAME_LENGTH] = 0;
|
||||
|
||||
if (multirotorRB->isChecked())
|
||||
|
|
|
@ -14,16 +14,9 @@
|
|||
|
||||
#ifndef WIZARDDIALOG_H
|
||||
#define WIZARDDIALOG_H
|
||||
#include <QWizard>
|
||||
#include "wizarddata.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QCheckBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QRadioButton;
|
||||
class QComboBox;
|
||||
QT_END_NAMESPACE
|
||||
#include <QtWidgets>
|
||||
#include "wizarddata.h"
|
||||
|
||||
class WizardDialog : public QWizard
|
||||
{
|
||||
|
|
|
@ -109,24 +109,25 @@ Section "OpenTX Companion" SecDummy
|
|||
!else
|
||||
File "@SYSDIR@\system32\pthreadVC2.dll"
|
||||
!endif
|
||||
File "C:\Programs\SDL\lib\SDL.dll"
|
||||
File "@SYSDIR@\msvcp100.dll"
|
||||
File "@SYSDIR@\msvcr100.dll"
|
||||
File "@QT_BINARY_DIR@\QtCore4.dll"
|
||||
File "@QT_BINARY_DIR@\QtGui4.dll"
|
||||
File "@QT_BINARY_DIR@\QtNetwork4.dll"
|
||||
File "@QT_BINARY_DIR@\Phonon4.dll"
|
||||
File "@QT_BINARY_DIR@\QtXml4.dll"
|
||||
File "@QT_DLL_DIR@\Qt5Core.dll"
|
||||
File "@QT_DLL_DIR@\Qt5Gui.dll"
|
||||
File "@QT_DLL_DIR@\Qt5Widgets.dll"
|
||||
File "@QT_DLL_DIR@\Qt5PrintSupport.dll"
|
||||
File "@QT_DLL_DIR@\Qt5Network.dll"
|
||||
File "@QT_DLL_DIR@\Qt5Multimedia.dll"
|
||||
File "@QT_DLL_DIR@\Qt5Xml.dll"
|
||||
File "@QT_DLL_DIR@\icudt54.dll"
|
||||
File "@QT_DLL_DIR@\icuin54.dll"
|
||||
File "@QT_DLL_DIR@\icuuc54.dll"
|
||||
File "@SDL_DIR@\SDL.dll"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb-1.0.dll"
|
||||
|
||||
CreateDirectory "$INSTDIR\phonon_backend"
|
||||
SetOutPath "$INSTDIR\phonon_backend"
|
||||
File "@QT_BINARY_DIR@\..\plugins\phonon_backend\Phonon_ds94.dll"
|
||||
|
||||
CreateDirectory "$INSTDIR\lang"
|
||||
SetOutPath "$INSTDIR\lang"
|
||||
File "src\*.qm"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#define WINBUILD_H
|
||||
|
||||
#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
|
||||
#undef FORCEINLINE
|
||||
#define FORCEINLINE inline
|
||||
#define NOINLINE
|
||||
|
||||
|
|
|
@ -887,6 +887,7 @@ set(CMAKE_EXE_LINKER_FLAGS "")
|
|||
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET>")
|
||||
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET>")
|
||||
|
||||
if(NOT MSVC)
|
||||
if(ARCH STREQUAL ARM)
|
||||
cmake_force_c_compiler(arm-none-eabi-gcc GNU)
|
||||
cmake_force_cxx_compiler(arm-none-eabi-g++ GNU)
|
||||
|
@ -958,3 +959,4 @@ if(CPU_FAMILY STREQUAL STM32)
|
|||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -11,76 +11,77 @@ cd -
|
|||
mkdir build || true
|
||||
cd build
|
||||
|
||||
COMMON_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/opt/qt55"
|
||||
|
||||
# Companion
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} ${SRCDIR}
|
||||
make -j2
|
||||
|
||||
# OpenTX on 9X stock with FrSky telemetry
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=9X -DHELI=YES -DEXT=FRSKY ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=9X -DHELI=YES -DEXT=FRSKY ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on 9X stock with Mavlink telemetry
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=9X -DHELI=YES -DEXT=MAVLINK ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=9X -DHELI=YES -DEXT=MAVLINK ${SRCDIR}
|
||||
make -j2 firmware
|
||||
|
||||
# OpenTX on Mega2560
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=MEGA2560 -DHELI=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=MEGA2560 -DHELI=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on Mega2560 with Mavlink telemetry
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=MEGA2560 -DEXT=MAVLINK -DHELI=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=MEGA2560 -DEXT=MAVLINK -DHELI=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on gruvin9x board
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=GRUVIN9X -DHELI=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=GRUVIN9X -DHELI=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on Sky9x
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=SKY9X -DHELI=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=SKY9X -DHELI=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on Taranis
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=TARANIS -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on Taranis X9E
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS -DPCBREV=REV9E -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=TARANIS -DPCBREV=REV9E -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on Taranis Plus
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS -DPCBREV=REVPLUS -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=TARANIS -DPCBREV=REVPLUS -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
make -j2 gtests ; ./gtests
|
||||
|
||||
# OpenTX on Horus
|
||||
rm -rf *
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=HORUS -DHELI=NO -DUSB=SERIAL -DCLI=YES -DDEBUG=YES ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=HORUS -DHELI=NO -DUSB=SERIAL -DCLI=YES -DDEBUG=YES ${SRCDIR}
|
||||
make -j2 firmware
|
||||
make -j2 simu
|
||||
#make -j2 gtests ; ./gtests
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import clang.cindex
|
||||
|
||||
|
@ -7,21 +9,21 @@ structs = []
|
|||
|
||||
def build_struct(cursor):
|
||||
structs.append(cursor.spelling)
|
||||
print "template <class A, class B>\nvoid copy%s(A * dest, B * src)\n{" % cursor.spelling
|
||||
print("template <class A, class B>\nvoid copy%s(A * dest, B * src)\n{" % cursor.spelling)
|
||||
for c in cursor.get_children():
|
||||
if c.kind == clang.cindex.CursorKind.FIELD_DECL:
|
||||
if c.type.get_array_size() > 0:
|
||||
if c.type.get_array_element_type().spelling in structs:
|
||||
print " for (int i=0; i<%d; i++) {" % c.type.get_array_size()
|
||||
print " copy%s(&dest->%s[i], &src->%s[i]);" % (c.type.get_array_element_type().spelling, c.spelling, c.spelling)
|
||||
print " }"
|
||||
print(" for (int i=0; i<%d; i++) {" % c.type.get_array_size())
|
||||
print(" copy%s(&dest->%s[i], &src->%s[i]);" % (c.type.get_array_element_type().spelling, c.spelling, c.spelling))
|
||||
print(" }")
|
||||
else:
|
||||
print " memcpy(&dest->%s, &src->%s, sizeof(dest->%s));" % (c.spelling, c.spelling, c.spelling)
|
||||
print(" memcpy(&dest->%s, &src->%s, sizeof(dest->%s));" % (c.spelling, c.spelling, c.spelling))
|
||||
elif c.type.get_declaration().spelling in structs:
|
||||
print " copy%s(&dest->%s, &src->%s);" % (c.type.get_declaration().spelling, c.spelling, c.spelling)
|
||||
print(" copy%s(&dest->%s, &src->%s);" % (c.type.get_declaration().spelling, c.spelling, c.spelling))
|
||||
else:
|
||||
print " dest->%s = src->%s;" % (c.spelling, c.spelling)
|
||||
print "}\n"
|
||||
print(" dest->%s = src->%s;" % (c.spelling, c.spelling))
|
||||
print("}\n")
|
||||
|
||||
def build(cursor):
|
||||
result = []
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
from __future__ import division, print_function
|
||||
|
||||
import sys
|
||||
try:
|
||||
from PyQt5 import Qt, QtGui
|
||||
except:
|
||||
from PyQt4 import Qt, QtGui
|
||||
|
||||
image = QtGui.QImage(sys.argv[1])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue