From fea74125fa41e4d3b3ee507e075d3246beaf4071 Mon Sep 17 00:00:00 2001 From: James Duley Date: Mon, 22 Dec 2014 14:47:27 +1300 Subject: [PATCH 01/32] OP-1654 Fix linux rpath: Refactored and changed for libs --- ground/openpilotgcs/src/app/app.pro | 5 ++++- ground/openpilotgcs/src/openpilotgcslibrary.pri | 10 +++++++--- ground/openpilotgcs/src/openpilotgcsplugin.pri | 10 +++------- ground/openpilotgcs/src/rpath.pri | 12 ++++-------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/ground/openpilotgcs/src/app/app.pro b/ground/openpilotgcs/src/app/app.pro index 8e0402565..74e692644 100644 --- a/ground/openpilotgcs/src/app/app.pro +++ b/ground/openpilotgcs/src/app/app.pro @@ -10,7 +10,6 @@ QT += xml widgets SOURCES += main.cpp \ gcssplashscreen.cpp -include(../rpath.pri) include(../libs/utils/utils.pri) include(../libs/version_info/version_info.pri) @@ -27,9 +26,13 @@ win32 { FILETYPES.files = profile.icns prifile.icns FILETYPES.path = Contents/Resources QMAKE_BUNDLE_DATA += FILETYPES + QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Plugins/ } else { target.path = /bin INSTALLS += target + QMAKE_RPATHDIR = \'\$$ORIGIN\'/../$$GCS_LIBRARY_BASENAME/openpilotgcs + QMAKE_RPATHDIR += \'\$$ORIGIN\'/../$$GCS_LIBRARY_BASENAME/qt5 + include(../rpath.pri) } OTHER_FILES += openpilotgcs.rc diff --git a/ground/openpilotgcs/src/openpilotgcslibrary.pri b/ground/openpilotgcs/src/openpilotgcslibrary.pri index d98860827..5c1651b81 100644 --- a/ground/openpilotgcs/src/openpilotgcslibrary.pri +++ b/ground/openpilotgcs/src/openpilotgcslibrary.pri @@ -6,17 +6,21 @@ win32 { DESTDIR = $$GCS_LIBRARY_PATH -include(rpath.pri) - TARGET = $$qtLibraryName($$TARGET) contains(QT_CONFIG, reduce_exports):CONFIG += hGCS_symbols -!macx { +macx { + QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Plugins/ +} else win32 { target.path = /bin target.files = $$DESTDIR/$${TARGET}.dll } else { + QMAKE_RPATHDIR = \'\$$ORIGIN\' + QMAKE_RPATHDIR += \'\$$ORIGIN\'/../qt5 + include(rpath.pri) + target.path = /$$GCS_LIBRARY_BASENAME/openpilotgcs } INSTALLS += target diff --git a/ground/openpilotgcs/src/openpilotgcsplugin.pri b/ground/openpilotgcs/src/openpilotgcsplugin.pri index 9276f1832..3752dd34b 100644 --- a/ground/openpilotgcs/src/openpilotgcsplugin.pri +++ b/ground/openpilotgcs/src/openpilotgcsplugin.pri @@ -30,13 +30,9 @@ TARGET = $$qtLibraryName($$TARGET) macx { QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Plugins/$${PROVIDER}/ } else:linux-* { - #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR - QMAKE_RPATHDIR = \$\$ORIGIN - QMAKE_RPATHDIR += \$\$ORIGIN/.. - QMAKE_RPATHDIR += \$\$ORIGIN/../.. - GCS_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") - QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${GCS_PLUGIN_RPATH}\' - QMAKE_RPATHDIR = + QMAKE_RPATHDIR = \'\$$ORIGIN\' + QMAKE_RPATHDIR += \'\$$ORIGIN\'/../.. + include(rpath.pri) } diff --git a/ground/openpilotgcs/src/rpath.pri b/ground/openpilotgcs/src/rpath.pri index 6d000262f..1b1fcd395 100644 --- a/ground/openpilotgcs/src/rpath.pri +++ b/ground/openpilotgcs/src/rpath.pri @@ -1,12 +1,8 @@ -macx { - QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Plugins/ -} else:linux-* { - #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR - # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var - QMAKE_RPATHDIR = \$\$ORIGIN/../$$GCS_LIBRARY_BASENAME/openpilotgcs - QMAKE_RPATHDIR += \$\$ORIGIN/../$$GCS_LIBRARY_BASENAME/qt5 +linux { + # HACK! Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR before Qt 5.4 + # \'\$$ORIGIN\' expands to $ORIGIN (after qmake and make), it does NOT read a qmake var GCS_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") - QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${GCS_PLUGIN_RPATH}\' + QMAKE_LFLAGS += -Wl,-z,origin,-rpath,$${GCS_PLUGIN_RPATH} QMAKE_RPATHDIR = } From ac6e0b069904dad2ec757a75c7e3b28c7a11029b Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Mon, 22 Dec 2014 21:17:52 +0100 Subject: [PATCH 02/32] OP-1656 upgraded to Qt 5.4.0 (windows) - code compiles - GCS not tested... --- ground/openpilotgcs/copydata.pro | 6 +++--- make/tools.mk | 32 +++++++++++++++----------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 40721f15d..ea2c8a3dc 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -142,9 +142,9 @@ GCS_LIBRARY_PATH Qt5MultimediaWidgets$${DS}.dll \ Qt5Quick$${DS}.dll \ Qt5Qml$${DS}.dll \ - icuin52.dll \ - icudt52.dll \ - icuuc52.dll + icuin53.dll \ + icudt53.dll \ + icuuc53.dll # it is more robust to take the following DLLs from Qt rather than from MinGW QT_DLLS += libgcc_s_dw2-1.dll \ libstdc++-6.dll \ diff --git a/make/tools.mk b/make/tools.mk index 779ac6798..dd4f6d7f1 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -9,8 +9,6 @@ # Ready to use: # arm_sdk_install # qt_sdk_install -# mingw_install (Windows only - NOT USED for Qt-5.3.x) -# python_install (Windows only - NOT USED for Qt-5.3.x) # nsis_install (Windows only) # sdl_install (Windows only) # openssl_install (Windows only) @@ -87,9 +85,9 @@ else ifeq ($(UNAME), Darwin) else ifeq ($(UNAME), Windows) ARM_SDK_URL := https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-win32.zip ARM_SDK_MD5_URL:= https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-win32.zip/+md5 - QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-windows-x86-mingw482_opengl-5.3.1.exe - QT_SDK_MD5_URL := http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-windows-x86-mingw482_opengl-5.3.1.exe.md5 - QT_SDK_ARCH := mingw482_32 + QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-windows-x86-mingw491_opengl-5.4.0.exe + QT_SDK_MD5_URL := http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-windows-x86-mingw491_opengl-5.4.0.exe.md5 + QT_SDK_ARCH := mingw491_32 NSIS_URL := http://wiki.openpilot.org/download/attachments/18612236/nsis-2.46-unicode.tar.bz2 SDL_URL := http://wiki.openpilot.org/download/attachments/18612236/SDL-devel-1.2.15-mingw32.tar.gz OPENSSL_URL := http://wiki.openpilot.org/download/attachments/18612236/openssl-1.0.1e-win32.tar.bz2 @@ -103,9 +101,9 @@ GTEST_URL := http://wiki.openpilot.org/download/attachments/18612236/gtest-1.6.0 # When changing PYTHON_DIR, you must also update it in ground/openpilotgcs/src/python.pri # When changing SDL_DIR or OPENSSL_DIR, you must also update them in ground/openpilotgcs/openpilotgcs.pri ARM_SDK_DIR := $(TOOLS_DIR)/gcc-arm-none-eabi-4_8-2014q1 -QT_SDK_DIR := $(TOOLS_DIR)/qt-5.3.1 -MINGW_DIR := $(QT_SDK_DIR)/Tools/mingw48_32 -PYTHON_DIR := $(QT_SDK_DIR)/Tools/mingw48_32/opt/bin +QT_SDK_DIR := $(TOOLS_DIR)/qt-5.4.0 +MINGW_DIR := $(QT_SDK_DIR)/Tools/mingw491_32 +PYTHON_DIR := $(QT_SDK_DIR)/Tools/mingw491_32/opt/bin NSIS_DIR := $(TOOLS_DIR)/nsis-2.46-unicode SDL_DIR := $(TOOLS_DIR)/SDL-1.2.15 OPENSSL_DIR := $(TOOLS_DIR)/openssl-1.0.1e-win32 @@ -367,14 +365,14 @@ qt_sdk_install: qt_sdk_clean | $(DL_DIR) $(TOOLS_DIR) $(V1) $(DL_DIR)/$(5) --dump-binary-data -o $(1) # Extract packages under tool directory $(V1) $(MKDIR) -p $$(call toprel, $(dir $(2))) - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0qt-project-url.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt/5.3.1ThirdPartySoftware_Listing.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0readme.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.win32_mingw482/5.3.1-0qt5_essentials.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.win32_mingw482/5.3.1-0i686-4.8.2-release-posix-dwarf-rt_v3-rev3-runtime.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.win32_mingw482/5.3.1-0icu_52_1_mingw_builds_32_4_8_2_posix_dwarf.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.win32_mingw482/5.3.1-0qt5_addons.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.tools.win32_mingw482/4.8.2i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z" | grep -v Extracting + #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0qt-project-url.7z" | grep -v Extracting + #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt/5.3.2ThirdPartySoftware_Listing.7z" | grep -v Extracting + #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0readme.7z" | grep -v Extracting + $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.win32_mingw491/5.4.0-1qt5_essentials.7z" | grep -v Extracting + $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.win32_mingw491/5.4.0-1i686-4.9.1-release-posix-dwarf-rt_v3-rev2-runtime.7z" | grep -v Extracting + $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.win32_mingw491/5.4.0-1icu_53_1_mingw_builds_4_9_1_posix_dwarf_32.7z" | grep -v Extracting + $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.win32_mingw491/5.4.0-1qt5_addons.7z" | grep -v Extracting + $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.tools.win32_mingw491/4.9.1-2i686-4.9.1-release-posix-dwarf-rt_v3-rev2.7z" | grep -v Extracting # Run patcher @$(ECHO) @$(ECHO) "Executing QtPatch in" $$(call toprel, $(QT_SDK_PREFIX)) @@ -586,7 +584,7 @@ endef ifeq ($(UNAME), Windows) -QT_SDK_PREFIX := $(QT_SDK_DIR)/5.3/$(QT_SDK_ARCH) +QT_SDK_PREFIX := $(QT_SDK_DIR)/5.4/$(QT_SDK_ARCH) # This additional configuration step should not be necessary # but it is needed as a workaround to https://bugreports.qt-project.org/browse/QTBUG-33254 From 04525a0dfd4a066ba14ff61e2aa5c56f179598e8 Mon Sep 17 00:00:00 2001 From: James Duley Date: Tue, 23 Dec 2014 16:01:37 +1300 Subject: [PATCH 03/32] OP-1657 Removed linux bin wrapper --- Makefile | 2 +- ground/openpilotgcs/bin/bin.pro | 14 ----------- ground/openpilotgcs/bin/openpilotgcs | 36 ---------------------------- ground/openpilotgcs/openpilotgcs.pri | 3 +-- ground/openpilotgcs/openpilotgcs.pro | 1 - package/linux/deb_common/rules | 2 +- 6 files changed, 3 insertions(+), 55 deletions(-) delete mode 100644 ground/openpilotgcs/bin/bin.pro delete mode 100755 ground/openpilotgcs/bin/openpilotgcs diff --git a/Makefile b/Makefile index 78738c1ef..2a561a312 100644 --- a/Makefile +++ b/Makefile @@ -954,7 +954,7 @@ install: $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/applications $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/pixmaps $(V1) $(MKDIR) -p $(DESTDIR)$(udevdir) - $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/openpilotgcs.bin $(DESTDIR)$(bindir)/openpilot-gcs + $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/openpilotgcs $(DESTDIR)$(bindir)/openpilot-gcs $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/udp_test $(DESTDIR)$(bindir) $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/lib/openpilotgcs $(DESTDIR)$(libdir) $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/share/openpilotgcs $(DESTDIR)$(datadir) diff --git a/ground/openpilotgcs/bin/bin.pro b/ground/openpilotgcs/bin/bin.pro deleted file mode 100644 index c8df2097d..000000000 --- a/ground/openpilotgcs/bin/bin.pro +++ /dev/null @@ -1,14 +0,0 @@ -include(../openpilotgcs.pri) - -TEMPLATE = app -TARGET = $$GCS_APP_WRAPPER -OBJECTS_DIR = - -PRE_TARGETDEPS = $$PWD/openpilotgcs - -QMAKE_LINK = cp $$PWD/openpilotgcs $@ && : IGNORE REST - -QMAKE_CLEAN = $$GCS_APP_WRAPPER - -target.path = /bin -INSTALLS += target diff --git a/ground/openpilotgcs/bin/openpilotgcs b/ground/openpilotgcs/bin/openpilotgcs deleted file mode 100755 index 14ff21462..000000000 --- a/ground/openpilotgcs/bin/openpilotgcs +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -makeAbsolute() { - case "$1" in - /*) - # already absolute, return it - echo "$1" - ;; - *) - # relative, prepend $2 made absolute - echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,' - ;; - esac -} - -if test -L "$0"; then - # Try readlink(1) - readlink=`type readlink 2>/dev/null` || readlink= - if test -n "$readlink"; then - # We have readlink(1), so we can use it - me=`readlink -nf "$0"` - else - # No readlink(1), so let's try ls -l - me=`ls -l "$0" | sed 's/^.*-> //'` - base=`dirname "$0"` - me=`makeAbsolute "$me" "$base"` - fi -else - me="$0" -fi - -bindir=`dirname "$me"` -libdir=`cd "${bindir}/../lib" ; pwd` -LD_LIBRARY_PATH="${libdir}/openpilotgcs:${LD_LIBRARY_PATH}" -export LD_LIBRARY_PATH -exec "${bindir}/openpilotgcs.bin" ${1+"$@"} diff --git a/ground/openpilotgcs/openpilotgcs.pri b/ground/openpilotgcs/openpilotgcs.pri index ea1481589..943dac262 100644 --- a/ground/openpilotgcs/openpilotgcs.pri +++ b/ground/openpilotgcs/openpilotgcs.pri @@ -111,8 +111,7 @@ macx { GCS_APP_TARGET = openpilotgcs copyqt = $$copydata } else { - GCS_APP_WRAPPER = openpilotgcs - GCS_APP_TARGET = openpilotgcs.bin + GCS_APP_TARGET = openpilotgcs GCS_QT_LIBRARY_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5 GCS_QT_PLUGINS_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/plugins GCS_QT_QML_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/qml diff --git a/ground/openpilotgcs/openpilotgcs.pro b/ground/openpilotgcs/openpilotgcs.pro index 54f62cc47..60c946aea 100644 --- a/ground/openpilotgcs/openpilotgcs.pro +++ b/ground/openpilotgcs/openpilotgcs.pro @@ -32,6 +32,5 @@ CONFIG += ordered DEFINES += USE_PATHPLANNER SUBDIRS = src share copydata -unix:!macx:!isEmpty(copydata):SUBDIRS += bin copydata.file = copydata.pro diff --git a/package/linux/deb_common/rules b/package/linux/deb_common/rules index 4ee22cc13..1ff03e24e 100644 --- a/package/linux/deb_common/rules +++ b/package/linux/deb_common/rules @@ -47,7 +47,7 @@ ifdef PACKAGE_DIR else $(error PACKAGE_DIR not defined! $(PACKAGE_DIR)) endif - ln -s /usr/local/OpenPilot/bin/openpilotgcs.bin `pwd`/debian/openpilot/usr/bin/openpilot-gcs + ln -s /usr/local/OpenPilot/bin/openpilotgcs `pwd`/debian/openpilot/usr/bin/openpilot-gcs rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/sounds/sounds rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/pfd/pfd rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/models/models From 1e4df5a5420c96dff0a9ece8e96fb49ff2e071e1 Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 24 Dec 2014 10:33:26 +1300 Subject: [PATCH 04/32] OP-1657 Remove linux bin wrapper: renamed installed symlink to openpilotgcs --- Makefile | 2 +- package/linux/deb_common/rules | 2 +- package/linux/openpilot.desktop | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2a561a312..a2d3d10f7 100644 --- a/Makefile +++ b/Makefile @@ -954,7 +954,7 @@ install: $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/applications $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/pixmaps $(V1) $(MKDIR) -p $(DESTDIR)$(udevdir) - $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/openpilotgcs $(DESTDIR)$(bindir)/openpilot-gcs + $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/openpilotgcs $(DESTDIR)$(bindir) $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/udp_test $(DESTDIR)$(bindir) $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/lib/openpilotgcs $(DESTDIR)$(libdir) $(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/share/openpilotgcs $(DESTDIR)$(datadir) diff --git a/package/linux/deb_common/rules b/package/linux/deb_common/rules index 1ff03e24e..0977cdeed 100644 --- a/package/linux/deb_common/rules +++ b/package/linux/deb_common/rules @@ -47,7 +47,7 @@ ifdef PACKAGE_DIR else $(error PACKAGE_DIR not defined! $(PACKAGE_DIR)) endif - ln -s /usr/local/OpenPilot/bin/openpilotgcs `pwd`/debian/openpilot/usr/bin/openpilot-gcs + ln -s /usr/local/OpenPilot/bin/openpilotgcs `pwd`/debian/openpilot/usr/bin/openpilotgcs rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/sounds/sounds rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/pfd/pfd rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/models/models diff --git a/package/linux/openpilot.desktop b/package/linux/openpilot.desktop index 5ce67af5d..3a71981c9 100644 --- a/package/linux/openpilot.desktop +++ b/package/linux/openpilot.desktop @@ -2,8 +2,8 @@ Version=0.1.0 Encoding=UTF-8 Name=OpenPilot GCS -Exec=openpilot-gcs -TryExec=openpilot-gcs +Exec=openpilotgcs +TryExec=openpilotgcs Comment=Configure, Tune, Diagnose, Track, & Upgrade FW for OpenPilot solutions Terminal=false Categories=OpenPilotMenu;Qt;Other; From e9582bf55cd6b004851510e4f08c5de3171ec19f Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 25 Dec 2014 00:14:32 +0100 Subject: [PATCH 05/32] OP-1660 Apply special neutral settings for Throttle and FlightMode - Increase Throttle neutral offset to 4%. --- .../src/plugins/config/configinputwidget.cpp | 47 ++++++++++++------- .../src/plugins/config/configinputwidget.h | 1 + 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 3ca726523..7d4483bbb 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -534,7 +534,7 @@ void ConfigInputWidget::wzNext() manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE] = manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE] + ((manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_THROTTLE] - - manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE]) * 0.02); + manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE]) * 0.04); if ((abs(manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_FLIGHTMODE] - manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_FLIGHTMODE]) < 100) || (abs(manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_FLIGHTMODE] - @@ -1547,7 +1547,11 @@ void ConfigInputWidget::updateCalibration() (reverse[i] && manualSettingsData.ChannelMax[i] > manualCommandData.Channel[i])) { manualSettingsData.ChannelMax[i] = manualCommandData.Channel[i]; } - manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; + if (i == ManualControlSettings::CHANNELNUMBER_FLIGHTMODE || i == ManualControlSettings::CHANNELNUMBER_FLIGHTMODE) { + adjustSpecialNeutrals(); + } else { + manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; + } } manualSettingsObj->setData(manualSettingsData); @@ -1575,9 +1579,9 @@ void ConfigInputWidget::simpleCalibration(bool enable) for (unsigned int i = 0; i < ManualControlCommand::CHANNEL_NUMELEM; i++) { reverse[i] = manualSettingsData.ChannelMax[i] < manualSettingsData.ChannelMin[i]; - manualSettingsData.ChannelMin[i] = manualCommandData.Channel[i]; - manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; - manualSettingsData.ChannelMax[i] = manualCommandData.Channel[i]; + manualSettingsData.ChannelMin[i] = manualCommandData.Channel[i]; + manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; + manualSettingsData.ChannelMax[i] = manualCommandData.Channel[i]; } fastMdataSingle(manualCommandObj, &manualControlMdata); @@ -1592,22 +1596,31 @@ void ConfigInputWidget::simpleCalibration(bool enable) restoreMdataSingle(manualCommandObj, &manualControlMdata); for (unsigned int i = 0; i < ManualControlCommand::CHANNEL_NUMELEM; i++) { - manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; + if (i == ManualControlSettings::CHANNELNUMBER_FLIGHTMODE || i == ManualControlSettings::CHANNELNUMBER_FLIGHTMODE) { + adjustSpecialNeutrals(); + } else { + manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; + } } - // Force flight mode neutral to middle - manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNUMBER_FLIGHTMODE] = - (manualSettingsData.ChannelMax[ManualControlSettings::CHANNELNUMBER_FLIGHTMODE] + - manualSettingsData.ChannelMin[ManualControlSettings::CHANNELNUMBER_FLIGHTMODE]) / 2; - - // Force throttle to be near min - manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE] = - manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE] + - ((manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_THROTTLE] - - manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE]) * 0.02); - manualSettingsObj->setData(manualSettingsData); disconnect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration())); } } + +void ConfigInputWidget::adjustSpecialNeutrals() +{ + // FlightMode and Throttle need special neutral settings + // + // Force flight mode neutral to middle + manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNUMBER_FLIGHTMODE] = + (manualSettingsData.ChannelMax[ManualControlSettings::CHANNELNUMBER_FLIGHTMODE] + + manualSettingsData.ChannelMin[ManualControlSettings::CHANNELNUMBER_FLIGHTMODE]) / 2; + + // Force throttle to be near min, add 4% from total range to avoid arming issues + manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE] = + manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE] + + ((manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_THROTTLE] - + manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE]) * 0.04); +} diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 636c5088b..cbd28022c 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -188,6 +188,7 @@ private slots: void updatePositionSlider(); void invertControls(); void simpleCalibration(bool state); + void adjustSpecialNeutrals(); void updateCalibration(); protected: From 0aae4e4d7aa538b6a7e770dfe444d5c0995de5ad Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 25 Dec 2014 01:30:08 +0100 Subject: [PATCH 06/32] OP-1660 Tell user Manual calibration is running (Start/Stop button change) --- .../src/plugins/config/configinputwidget.cpp | 2 ++ ground/openpilotgcs/src/plugins/config/input.ui | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 7d4483bbb..0e22d9091 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -1562,6 +1562,7 @@ void ConfigInputWidget::simpleCalibration(bool enable) { if (enable) { ui->configurationWizard->setEnabled(false); + ui->runCalibration->setText(tr("Stop Manual Calibration")); QMessageBox msgBox; msgBox.setText(tr("Arming Settings are now set to 'Always Disarmed' for your safety.")); @@ -1589,6 +1590,7 @@ void ConfigInputWidget::simpleCalibration(bool enable) connect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration())); } else { ui->configurationWizard->setEnabled(true); + ui->runCalibration->setText(tr("Start Manual Calibration")); manualCommandData = manualCommandObj->getData(); manualSettingsData = manualSettingsObj->getData(); diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 4f4621d92..dbf637b81 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -116,8 +116,8 @@ 0 0 - 772 - 514 + 774 + 497 @@ -419,7 +419,7 @@ false - Manual Calibration + Start Manual Calibration true @@ -542,8 +542,8 @@ 0 0 - 724 - 497 + 730 + 554 @@ -2044,8 +2044,8 @@ Setup the flight mode channel on the RC Input tab if you have not done so alread 0 0 - 407 - 138 + 544 + 169 From e734e2876b5e68b3688ea878c1ff7299b4ff572d Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 25 Dec 2014 14:18:34 +0100 Subject: [PATCH 07/32] OP-1660 Disable Apply/Save buttons when Manual Calibration is running, custom message --- .../src/plugins/config/configinputwidget.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 0e22d9091..bea144d7e 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -1562,11 +1562,14 @@ void ConfigInputWidget::simpleCalibration(bool enable) { if (enable) { ui->configurationWizard->setEnabled(false); + ui->saveRCInputToRAM->setEnabled(false); + ui->saveRCInputToSD->setEnabled(false); ui->runCalibration->setText(tr("Stop Manual Calibration")); QMessageBox msgBox; - msgBox.setText(tr("Arming Settings are now set to 'Always Disarmed' for your safety.")); - msgBox.setDetailedText(tr("You will have to reconfigure the arming settings manually when the wizard is finished.")); + msgBox.setText(tr("

Arming Settings are now set to 'Always Disarmed' for your safety.\n" + "Stop Manual Calibration when done

")); + msgBox.setDetailedText(tr("You will have to reconfigure the arming settings manually when the manual calibration is finished.")); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); msgBox.exec(); @@ -1590,6 +1593,8 @@ void ConfigInputWidget::simpleCalibration(bool enable) connect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration())); } else { ui->configurationWizard->setEnabled(true); + ui->saveRCInputToRAM->setEnabled(true); + ui->saveRCInputToSD->setEnabled(true); ui->runCalibration->setText(tr("Start Manual Calibration")); manualCommandData = manualCommandObj->getData(); From b82b10e83218178799fd3f925e3420ab939b388f Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 25 Dec 2014 17:49:19 +0100 Subject: [PATCH 08/32] OP-1660 Allow realtime monitoring of inputs --- .../src/plugins/config/configinputwidget.cpp | 18 +- .../src/plugins/config/configinputwidget.h | 2 + .../src/plugins/config/inputchannelform.ui | 305 +++++++++--------- 3 files changed, 166 insertions(+), 159 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index bea144d7e..8985f72c7 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -96,6 +96,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : Q_ASSERT(index < ManualControlSettings::CHANNELGROUPS_NUMELEM); InputChannelForm *form = new InputChannelForm(index, this); form->setName(name); + form->moveTo(*(ui->channelLayout)); // The order of the following binding calls is important. Since the values will be populated @@ -104,7 +105,9 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : // will not be set correctly. addWidgetBinding("ManualControlSettings", "ChannelNumber", form->ui->channelNumber, index); addWidgetBinding("ManualControlSettings", "ChannelGroups", form->ui->channelGroup, index); - addWidgetBinding("ManualControlSettings", "ChannelNeutral", form->ui->channelNeutral, index); + // Slider position based on real time Rcinput (allow monitoring) + addWidgetBinding("ManualControlCommand", "Channel", form->ui->channelNeutral, index); + // Neutral value stored on board (SpinBox) addWidgetBinding("ManualControlSettings", "ChannelNeutral", form->ui->neutralValue, index); addWidgetBinding("ManualControlSettings", "ChannelMax", form->ui->channelMax, index); addWidgetBinding("ManualControlSettings", "ChannelMin", form->ui->channelMin, index); @@ -1567,8 +1570,9 @@ void ConfigInputWidget::simpleCalibration(bool enable) ui->runCalibration->setText(tr("Stop Manual Calibration")); QMessageBox msgBox; - msgBox.setText(tr("

Arming Settings are now set to 'Always Disarmed' for your safety.\n" - "Stop Manual Calibration when done

")); + msgBox.setText(tr("

Arming Settings are now set to 'Always Disarmed' for your safety.

" + "

Be sure your receiver is powered with an external source and Transmitter is on.

" + "

Stop Manual Calibration when done

")); msgBox.setDetailedText(tr("You will have to reconfigure the arming settings manually when the manual calibration is finished.")); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); @@ -1631,3 +1635,11 @@ void ConfigInputWidget::adjustSpecialNeutrals() ((manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_THROTTLE] - manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE]) * 0.04); } + +bool ConfigInputWidget::shouldObjectBeSaved(UAVObject *object) +{ + // ManualControlCommand no need to be saved + return dynamic_cast(object) == 0; + +} + diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index cbd28022c..0cb0b34cc 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -66,6 +66,8 @@ public: } void enableControls(bool enable); + bool shouldObjectBeSaved(UAVObject *object); + private: bool growing; bool reverse[ManualControlSettings::CHANNELNEUTRAL_NUMELEM]; diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.ui b/ground/openpilotgcs/src/plugins/config/inputchannelform.ui index 0a3fc987e..156d653ac 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.ui +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.ui @@ -7,7 +7,7 @@ 0 0 923 - 51 + 57 @@ -215,7 +215,7 @@ margin:1px; - + true @@ -311,7 +311,7 @@ margin:1px; - + Qt::Horizontal @@ -343,7 +343,7 @@ margin:1px; - + Qt::Horizontal @@ -359,8 +359,8 @@ margin:1px; - - + + true @@ -408,8 +408,8 @@ margin:1px; - - + + true @@ -457,8 +457,8 @@ margin:1px; - - + + true @@ -506,52 +506,6 @@ margin:1px; - - - - true - - - - 0 - 0 - - - - - 0 - 20 - - - - - -1 - 75 - false - true - - - - Channel neutral - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - Neutral - - - Qt::AlignCenter - - - @@ -644,7 +598,7 @@ margin:1px; - + @@ -684,105 +638,7 @@ margin:1px; - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 2 - - - 0 - - - 2 - - - 0 - - - - - - 0 - 0 - - - - - 50 - 0 - - - - Qt::StrongFocus - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - 9999 - - - 1000 - - - - - - - + @@ -846,6 +702,143 @@ margin:1px;
+ + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + 9999 + + + 1000 + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Qt::StrongFocus + + + + + + + + + Qt::ImhNone + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 50 + + + + + + + true + + + + 0 + 0 + + + + + 0 + 20 + + + + + -1 + 75 + false + true + + + + Channel value + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + Channel Value + + + Qt::AlignCenter + + + + + + + Channel neutral + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + Neutral + + + Qt::AlignCenter + + +
From 4afe6f2e1a8afff235a1b63cd49c44c2609d1ed2 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 25 Dec 2014 22:48:26 +0100 Subject: [PATCH 09/32] OP-1660 Add ticks on slider, QT stylesheet bug --- .../share/openpilotgcs/stylesheets/default.qss | 5 ++++- .../openpilotgcs/src/plugins/config/inputchannelform.cpp | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss index 873b2f7de..86bef4bbe 100644 --- a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss +++ b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss @@ -7,7 +7,7 @@ MyListWidget { Utils--StyledBar { background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(200, 200, 200, 255)); } - +/* QSlider::groove:horizontal { border: 1px solid rgb(196, 196, 196); background: white; @@ -15,6 +15,7 @@ QSlider::groove:horizontal { border-radius: 2px; margin 10px 10px; } +*/ QSlider::add-page:horizontal { background: #fff; @@ -110,3 +111,5 @@ QSlider::handle:horizontal:hover { border: 1px solid #444; border-radius: 4px; } + + diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp index 8d5ff8c7f..212cb05b2 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp @@ -58,6 +58,15 @@ void InputChannelForm::minMaxUpdated() void InputChannelForm::neutralUpdated() { int neutralValue = ui->neutralValue->value(); + int min = ui->channelMin->value(); + int max = ui->channelMax->value(); + + int tickSpacing = abs((max-min) / 2); + if (ui->channelName->text() == "FlightMode") { + tickSpacing = abs((max-min) / 5); + } + ui->channelNeutral->setTickPosition(QSlider::TicksBothSides); + ui->channelNeutral->setTickInterval(tickSpacing); if (ui->channelRev->isChecked()) { if (neutralValue > ui->channelMin->value()) { From 59e461f6ce73700daeb1281e0d5d0ac82f100898 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 26 Dec 2014 00:00:08 +0100 Subject: [PATCH 10/32] OP-1660 Revert last commit + uncrustify --- .../share/openpilotgcs/stylesheets/default.qss | 3 +-- .../src/plugins/config/configinputwidget.cpp | 10 ++++------ .../src/plugins/config/inputchannelform.cpp | 9 --------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss index 86bef4bbe..75ceca382 100644 --- a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss +++ b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss @@ -7,7 +7,7 @@ MyListWidget { Utils--StyledBar { background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(200, 200, 200, 255)); } -/* + QSlider::groove:horizontal { border: 1px solid rgb(196, 196, 196); background: white; @@ -15,7 +15,6 @@ QSlider::groove:horizontal { border-radius: 2px; margin 10px 10px; } -*/ QSlider::add-page:horizontal { background: #fff; diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 8985f72c7..af3433766 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -96,7 +96,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : Q_ASSERT(index < ManualControlSettings::CHANNELGROUPS_NUMELEM); InputChannelForm *form = new InputChannelForm(index, this); form->setName(name); - + form->moveTo(*(ui->channelLayout)); // The order of the following binding calls is important. Since the values will be populated @@ -1587,9 +1587,9 @@ void ConfigInputWidget::simpleCalibration(bool enable) for (unsigned int i = 0; i < ManualControlCommand::CHANNEL_NUMELEM; i++) { reverse[i] = manualSettingsData.ChannelMax[i] < manualSettingsData.ChannelMin[i]; - manualSettingsData.ChannelMin[i] = manualCommandData.Channel[i]; - manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; - manualSettingsData.ChannelMax[i] = manualCommandData.Channel[i]; + manualSettingsData.ChannelMin[i] = manualCommandData.Channel[i]; + manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i]; + manualSettingsData.ChannelMax[i] = manualCommandData.Channel[i]; } fastMdataSingle(manualCommandObj, &manualControlMdata); @@ -1640,6 +1640,4 @@ bool ConfigInputWidget::shouldObjectBeSaved(UAVObject *object) { // ManualControlCommand no need to be saved return dynamic_cast(object) == 0; - } - diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp index 212cb05b2..8d5ff8c7f 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp @@ -58,15 +58,6 @@ void InputChannelForm::minMaxUpdated() void InputChannelForm::neutralUpdated() { int neutralValue = ui->neutralValue->value(); - int min = ui->channelMin->value(); - int max = ui->channelMax->value(); - - int tickSpacing = abs((max-min) / 2); - if (ui->channelName->text() == "FlightMode") { - tickSpacing = abs((max-min) / 5); - } - ui->channelNeutral->setTickPosition(QSlider::TicksBothSides); - ui->channelNeutral->setTickInterval(tickSpacing); if (ui->channelRev->isChecked()) { if (neutralValue > ui->channelMin->value()) { From 02903e78586063cbe5730ad91bab0278a12747a9 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 26 Dec 2014 22:45:15 +0100 Subject: [PATCH 11/32] OP-1660 Display limits for every FlightMode position on Flightmode channel --- .../src/plugins/config/configgadget.qrc | 6 ++++++ .../src/plugins/config/configinputwidget.cpp | 20 ++++++++++++++++++ .../plugins/config/images/flightmode_bg1.png | Bin 0 -> 499 bytes .../plugins/config/images/flightmode_bg2.png | Bin 0 -> 866 bytes .../plugins/config/images/flightmode_bg3.png | Bin 0 -> 1278 bytes .../plugins/config/images/flightmode_bg4.png | Bin 0 -> 1536 bytes .../plugins/config/images/flightmode_bg5.png | Bin 0 -> 1862 bytes .../plugins/config/images/flightmode_bg6.png | Bin 0 -> 2300 bytes 8 files changed, 26 insertions(+) create mode 100644 ground/openpilotgcs/src/plugins/config/images/flightmode_bg1.png create mode 100644 ground/openpilotgcs/src/plugins/config/images/flightmode_bg2.png create mode 100644 ground/openpilotgcs/src/plugins/config/images/flightmode_bg3.png create mode 100644 ground/openpilotgcs/src/plugins/config/images/flightmode_bg4.png create mode 100644 ground/openpilotgcs/src/plugins/config/images/flightmode_bg5.png create mode 100644 ground/openpilotgcs/src/plugins/config/images/flightmode_bg6.png diff --git a/ground/openpilotgcs/src/plugins/config/configgadget.qrc b/ground/openpilotgcs/src/plugins/config/configgadget.qrc index c557e7b81..01984a553 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadget.qrc +++ b/ground/openpilotgcs/src/plugins/config/configgadget.qrc @@ -1,5 +1,11 @@ + images/flightmode_bg1.png + images/flightmode_bg2.png + images/flightmode_bg3.png + images/flightmode_bg4.png + images/flightmode_bg5.png + images/flightmode_bg6.png images/help2.png images/ahrs-calib.svg images/multirotor-shapes.svg diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index af3433766..57a3a81f9 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -1536,6 +1536,26 @@ void ConfigInputWidget::updatePositionSlider() default: break; } + + QString fmNumber = QString().setNum(manualSettingsDataPriv.FlightModeNumber); + int count = 0; + foreach(QSlider * sp, findChildren()) { + // Find FlightMode slider and apply stylesheet + if (sp->objectName() == "channelNeutral") { + if (count == 4) { + sp->setStyleSheet( + "QSlider::groove:horizontal {border: 2px solid rgb(196, 196, 196); height: 20px; margin 9px 9px; border-radius: 4px; " + "border-image:url(:/configgadget/images/flightmode_bg" + fmNumber + ".png); }" + "QSlider::add-page:horizontal { background: none; border: none; }" + "QSlider::sub-page:horizontal { background: none; border: none; }" + "QSlider::handle:horizontal { background: rgba(196, 196, 196, 255); width: 10px; height: 28px; " + "margin: -4px -4px; border-radius: 3px; border: 1px solid #777; }"); + count++; + } else { + count++; + } + } + } } void ConfigInputWidget::updateCalibration() diff --git a/ground/openpilotgcs/src/plugins/config/images/flightmode_bg1.png b/ground/openpilotgcs/src/plugins/config/images/flightmode_bg1.png new file mode 100644 index 0000000000000000000000000000000000000000..ae77ac4361032c12a5221153d56745cc155ec5bc GIT binary patch literal 499 zcmeAS@N?(olHy`uVBq!ia0y~yV2S{;RXEsyWT>QzKagT6cJd720D>Bhlnx-Dv%n*= zn1Laf2ZR}Yul^DM3QCr^MwA5SrEaktG3V`_wO%ZNGRGd4AN7t{fADB_!Q#+^S%wj7cO89G)-2{~5XqZ#|8$|Qn4O{^t1ucpWF9=|;G zVa2YSRRRZe<|HuAHIwnL_S`mUj@nMYqRVB12i~&)^;vtKo3v(|9FqZmBT!e|Yet58 zpn13*jPS#s43P+x?86^RzCW(LP{eV-pG9nghnbyRgWu;)0fq%L4lprjsBK_i=;G92 gXh>q>#t_O6{-m_y#cpmsU<5IEy85}Sb4q9e0ApORQUCw| literal 0 HcmV?d00001 diff --git a/ground/openpilotgcs/src/plugins/config/images/flightmode_bg2.png b/ground/openpilotgcs/src/plugins/config/images/flightmode_bg2.png new file mode 100644 index 0000000000000000000000000000000000000000..8008aa805fabd058ada114d379c18871658e5776 GIT binary patch literal 866 zcmeAS@N?(olHy`uVBq!ia0y~yV2S{;RXEsyWT>QzKagT6cJd720D>Bhlnx-Dv%n*= zn1Laf2ZR}Yul^DM3QCr^MwA5SrEH2S`$ zi(^Q|oVRyvJ7h{3jy?Q-#A{8OpAO4glRA;GrUG`ZtRoAW#P}j4E_eyBD9UxUwpLB` zb;uPtm?qM4SZU?cRX1D$1SUF!2ppNq*zCyBCAOXWb*0yiKi{7j{kGX)uzB;*=zlX3 z%fqkT`}K4^Lk#P-eS1n@a57API%^?214B>m0VW0wp9Dq*5w#5r3|zuMpSE)9Ff<%u z5o2&jWa4I6upzr$?m))hc~4qZ>eVbKJ$ah=oZ-*m^`6@%&G9z!Eb^XYJz2(klhFe` zH>ZS+8tU84!|wY}`g-uvV-w)Vvn4ok>4x@yXweUw#OT;x2d8t7De=?dWkd%8XSN_@XMPm-T(v-S0_ zs7aqMKc3HDAg-*kK_jiUc+;dOA64F~{j}&jz{EFMdh(v1_Sc`kkGi|{fo{*71B<3C zpS)-KlWhyz8QvV8x$Euz+1B<}H-y|A69P{aJM%N#Siad)ZsuH|v+E}vZ<~Es;)j?b z!|69Ulh|Kvdp~(e_Nv#D=g5=^B`a)ThzN^+e!sBP%6k6`zHpZW#tl9D{EJHZcSK2- zh%QzH%9~AobL6Uj=Z+*pVC&9T9EWgCx*e&`TrNd4$}_gg)WZPU{Sd}7^2 z$A3M0^5e^o6BC>nmg$xHmi{raul}smZcxY6?OIvzi^)PKPNs_C^kHQufx*+&&t;ucLK6U|=5<;C literal 0 HcmV?d00001 diff --git a/ground/openpilotgcs/src/plugins/config/images/flightmode_bg3.png b/ground/openpilotgcs/src/plugins/config/images/flightmode_bg3.png new file mode 100644 index 0000000000000000000000000000000000000000..4791cab01eb9930a175420821cc93c842ff0d4f8 GIT binary patch literal 1278 zcmeAS@N?(olHy`uVBq!ia0y~yV2S{;RXEsyWT>QzKagT6cJd720D>Bhlnx-Dv%n*= zn1Laf2ZR}Yul^DM3QCr^MwA5SrEG^pCs z#WAE}&fB~3D?~yWj(=RAHc>%n_ho0#w7`xTi-c@jm_;W}&2V*;cI6D>pQO-g@P%Ld z)IlYe!{YK=+H-mjojB99AVE7oN%d5~Bfzx6b*zFXemqWF01{ zy!1&vI7!9xl_B>u70;ml$PFr&g>miS__XV zcUaH7?39yL4JP_^2b-22{ATl^Wa~XEqmo6Dt7BN#urK>!Jw>GP@qtHf)7D59)p*Ym z*JtQwI{j;&mwIKVfu3}u=t5_Yi4{wu@^xj`#W04vUiN{K@f`{gSVCS*{D>e4+aI28#YGe@8tg%;AeoxW4_kCvEMgz^(Ug-M@GL+Vzy6iroz#Gvj2Kv<`SB=oAP(-P<|0X{)}E zO(Ux|+iR<*T4%dC4}5W(mcu*8lPkAmb66x-4R;Ou9m|wDvkm)g|84BwxkSQ;y^Psi zGkoo_va_;pq^cKJJBY2}SW;;?>y!M6tOu?KnwC16_tx*1-&lS1RoCS?u3cAmd}B+! zStWntj;Z~Z?#^E)nndsYJ>Yvlbz!rI@{w&>d$(@SuJ_xZ5+uXNG~H~|6MkUu9}B39 z+;5$+iZT5lSN_HN`AREu*$ax(mjmO0`wYLhd)J|Pemk>fv-ogKam@wBzVcDN2fwoR zUS-O-ruA4uf3yNFrh--GNrzVCILR>OM6`|~5oQ}P`e4D*{+GgW@f2|j%_?9}ow zpgOh(stMd5GOvF;uDO4P1_SrBB{yoB&qywdIm%cUYWNhzG|?mQ58O5B$DO;*aubL)!Jzgf@mic^{*vby!{ciyrX z<{F>M^`76i{k&p7^<2jGGB#lBGT3-TZo0=RR`%@D9t-Im8{fZV+0mq`>Bst^>U$&5 z9>yC6Uyh`$HDaD|eK|07uLJtI&u!WswhJdFZ7tb5d&B9?2d3;(yX?6R=(LNguU5T| zcp(sUHC2L^FRN2@q2NZ{q4;E%ztX-k6wEdY0Ne~z3kA?88mq= zJn^rgBWMC`dU{#t2%13Cfd3Fmk|d4MA)y0Ek|a$U3zj5F(wJGWBuSFS%z`CJk~C%( zEJ>22F|%Mvk|d3p1xu17Y0RcW2WXi$fpx$>U>R^_*f?sj3fKs|0K5(y1AGQJ510xU zOD)#}9s+(3908mHtOAY-8A=o7UEpf!YZ$=oKpZa4`)_HE; zI#|1aKMswr11|3$f4NMfN8`MDp+A1A$zW==Ex^(wD|P`#Q$K>9295>3$A9j;|AG2Z z;s-*6RO{Uk=hfEGA=<=(HM?I9%2kpTOM%bzx}D8|GpW7y0N0dh^b+tg@U4;gmDG#g z0bXq|m)h;~z~89vwr}UZuj?-l9iNQlN(=KC@MEa&yvKR<_rQ5t!Gbl1BrB$X3xJ;j z_W~9yE!2^~ZL`cjIduHlMb4thb433GumgA)_{Grtn#L1p66^*piSz2+GK~%aHcFO0r^gk`<=`^tzot^}3yJ0^bdsOYKt9 zzsXRh(KPkr=0k%fY8eZb6wWjJZ@GGa`i<_=LS01tV$mm(tk^jCve)gb$2Fvyzsush z`e*<6TIyW^bO0<^QW!4+=gv^BRt8O_Npo?M70ZXlzY3N_ZSriKR~v`M4+CfRKVKU; zH|>A_d_&n%Xm?GL1fjjk5a$;YDs@?JMg=q zb5CkGoAiInf+aO;O@F_^fpe&Dt&iSbk8pEd&Cfa1y8_Vbc3w@g;!5fT?K^>+d)?07 zp>zFps^;UkGL0VD&)n`fuikr1Sf)`9d<;0QiC}GF!IGNu8u07kFXFt~1Z)~Tu}q^A zv0!O_PD!#N?R7gjytkNr{pd+aR$Kv`)pR(u(uaXF_A|F*WPCbs%;LsrCl|R(&AB(u zt9L?&&_vphWW`rznn2Gx+sTtnEIxx$VtXSPYJ|ScfwbE3XMwiX=+)pfO z5>1-Jf!`)s@epu7@Er9ztdps?`dSe%n22 mG4nlGS}c3#K1GtG$@Fi86+_OLZvW!|0000yQs0n7Fvo6*9>#gg`kdrOQR;OR+rFGc*|h&MN)0AiiUJhonkm zid#s^*~I7+dKfJVpwsENSW0|yL>M&+mq?4LSa(1HfNT%J^>iTPo@DA;{d6FtZ)@X5 zl%ic>n;!WGe185{h1~_rQ9Zatw~g9=4p(G(x@y4w0JSQ^jo8dn3YYFpmz6^-?poRi z*$}HpgK>1lH5+Ghf8B2K&7zlcpgOf>7QK|gTc3JXa(PK26gfRyz)D2Z3k1sEbd95A zx%tpqyRnu0(9Y0g7l zEdL3@ux>av&rkH{w6+Zv?*Ld{ z3_Hhag(B0yWbO$^m4i^Ga07ZFCnaHllQhkE#F@+@t@=)7wP{HD$rQP*zl!*^!NcbofI0SOL+a7>x+jgquW&we4IzGoI$OBKQz~!(g#vWlz5K#ltx18D1cb zEbsrD+cU@!+#5ulTa@L73&}dPV6)VzufE z1@cj>d)Mu&hx_h3UpbGyDQ5=lM06ZYITSlI&aXws)j!lQDfrN$$4D;6q(OWrORyQZ zlbYon-CxF%0`Lwb*=eNt4~*6>@|{pxV#LQ#(62;<;cHYcLRwncs&Ma%g8dd{#sRg; zi^Bz!6^WgQyu~;$68zvF_8U_)&%S{0uNn;pPYAeSh6Tp$zne_jl1@H#RDSQ6j^2D> z?!9{_^sThg{v>0fB5YCjvC|hOE4LB^Z~3+HS;q^tpz%HK>cnaviWyx07&kJ$93#r! z_MrqrXH;~2i=2DG1)ditl^-?(uO(mUl_o-ozXDyv*PDB4;2Yu8$A0CQTX)3`uyb&N zZS*rf!u#rMriy7WzJF*LSF!;GqsdI6q;EDaid7HKM48;teMIba+aK>f6}vwVbNOGnz}G0Z(K@5y@fkyxVM2vcpB-I zj?QXDHdhwUvDmK39i~4i_3caiJ{Nszb!})JWl&0pNm`6Et|eU=pnzed)C&WZ*3Ucj z=^L_w2-ClcIrNc;y`+F)Tb*m9SKk2Au1C_3ZN+J?zure|s;f9=ZX}v`B;1IrP+W- zz3z}rm4uoQ&|OUUZW7GM{W@m;rn-Bch5;xZKU1LkB8j_wHd=@)5e-9w0V4Dwj=O*_ z%-G@GH!%*5eYa}cHY9zL*UFl_I8Yn4_pfSwid11bA@pqFc(1;X_wGK_{S%@m8VCe{xQtw0Dv#za9wr#rkOmd$73O-MUPy&rExg z=KFWE>jFF^hNc6X`I5Wv(~pb_F%IZdO}F%HVZCc6o9YkNz^HKpM`(e&fw3toisJWU z^GXI0+vZ>}mWPK?5cnuVeiG&iMZs_f?NSY_!K{ S?aE32Jb>Wl=i1;x&iOBB31A8U literal 0 HcmV?d00001 diff --git a/ground/openpilotgcs/src/plugins/config/images/flightmode_bg6.png b/ground/openpilotgcs/src/plugins/config/images/flightmode_bg6.png new file mode 100644 index 0000000000000000000000000000000000000000..05a095495b10087a1617dc6b78802db51139730e GIT binary patch literal 2300 zcma)8c|6o>7yr$IY$J+7W6De1F`49+DV4Gh${I75EMeSC))CzqG{4fTbSGl2EZ=iJ=bT$kXKfVaG~@sPP{i9> zx&Q!_AbIO-la}1))GZw)3{Ek}yKR$D?6!cL5?MCfmPi2rSA|~(a;AT6yW~?n%8C%> z8b*qW@rw)uVq#(pFNTsS{(j+shGCIGIbV)z0Km4t@Rq0DuCV6E$bTaPk)2<~YWf!j z(8m7uH|pv77j!e6?ztgr_-GZ|%AF;tz375#ZAnf{%ZmEa+}aek(*5p+s=Qpg!o$|u z*c#qrOT1z$yd}Y<$o?EledZ5UgQ&Q#+@Y>KZzogJ?!4S_y`$5{S-YMuP0g)#Q%ui` zz1Onh0|=t{;z#1m5ZBHRUHg8<1-ucjtxfmR4mnhgth zNAc_fAMxvhMsK14Wo6~mRBNfsn>TOTw!8V>l5jVNeo5$ovCp-S~`FR5qUIM8A zjb{-3PBd^fjpx}P9iNLTHlUBt9s5!CcJ56Po67^I)o|#V8Mad60om5)s4pdx><7>a zEl)7HIbt(vdepi=PoDJ@Or#GI@X>JVH`_l>>MUgrBYJ#KgtD;52@z5g9jgLPJ7;`` z(NFNmx@}-)m;9r!R=!}xrAhh<&mHGy8h(9#yW;ns9tPD#?xytVs!6mw%b(3rA88hK ztV;WWRpB-d-qUI}f!JfRt@%TUUf&JoeIoFLlMP^GN?_zs+;dqDWAP!I(}Xm}Xj|yX z4Adgl_0K~waO#GBZfb&em{!(rIju2w%l$=iuPo<4Vxzcj z`Q^oyPobDR1EJpvJcK@zhH7<5~FZq9)v2IQmb#yxy=e!JA>P`zKC#kNz@a(NU99+rA9zl8~h z-lLprPz+@~ho?w&8F8$N$%SBNRZ+REO?TV3!rHgVz4r8X9Af?A?|s?K>Jcqp*hKyL zt3`czUatE=6JQ5D%Shbz4lk;LEfhxWBptrr7lb`H$XIM`Ur+N4kqNGe1nZ=CXC?5< zPMLhB={!y=&yK!3tmp5ZkA;(bscPaEJ2}X*bXpAwVh=V9A+!_w1Rbj=`%ZB~W>J&Y z8S}7-t+C|ZPzR$}u+^4P`--s`Vnx$ku+H(*xD=#9CC=`ZZ9P!@{iJUNs#plCpjTj~ z$oC?_ekImy$LeA+ub@HFB;EUcv)T0m6IdM6 zjD&1zaFAJ(vPwRuhGWx*=1@nnsCQ|P77CXXxZ}lD91FZ?-ari;r4!-b_RFj11Qc-4 zRoZ)$aG@+SB5Mn;h8qON8+Lr%8hkC4so+Bfk4kV=kl?y|0`W9eqhchv7keS8T)fk9 z4z*YqgP*#J z(AC_h8NjpfmUsu!z#ig6Wt1QmLe~_YAWnGU6W<}{MMnvTFdG?d?fp3Jp1tp$Kk-M9 z)YnY(=i}}s@L?JCl$3pxR!yO4(swzoW$@#m0)gf-I`Hyll#9v*&e}88crU40lzbzEA4z3{>Ffgwa%} zpZwa&maWM}F@c~f-)O5dWbiG`GkWw6^QQ!1FE`tIp)!LiN!N!~UErOs%qzP?nNHV#b%*#)nG?W6c%AQz}&Knltsc z&x42#X#S@>xL(|&ET)%_ES?GtNs9SA_{^kH{+)|gSs~5yVz|a zz@%%?c;z)r0!c{$lw6uCw3+^d7mX>UB=94-c4g7G59Yjl!<(Mu(SEd4&o>IbuS`4b zT5~>zm2GuTUEUi)QQpu;GKlkK7aFwkyP-l!CbyIj6GIk<7|--Sv1fb z!GCNzf5)j}U4NqyRV*_{`D8O~B0H(2hnDBW}Zuv2$v1IfM1Ow>t~jDvx5Ni)s$ZV9-8gAklrtl^5vN&kN0{@-}sgz^7AmQn0r SDVA(10N(1XWwp8QwSNFS&}UZw literal 0 HcmV?d00001 From 666f7641555e5a92e347a397c081ce5c444aaa28 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 27 Dec 2014 00:34:20 +0100 Subject: [PATCH 12/32] OP-1660 Handle fix, was cropped --- ground/openpilotgcs/src/plugins/config/configinputwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 57a3a81f9..da51d88a7 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -1549,7 +1549,7 @@ void ConfigInputWidget::updatePositionSlider() "QSlider::add-page:horizontal { background: none; border: none; }" "QSlider::sub-page:horizontal { background: none; border: none; }" "QSlider::handle:horizontal { background: rgba(196, 196, 196, 255); width: 10px; height: 28px; " - "margin: -4px -4px; border-radius: 3px; border: 1px solid #777; }"); + "margin: -4px -2px; border-radius: 3px; border: 1px solid #777; }"); count++; } else { count++; From df8cad31904ebc8bc5f00a63d69695437be8f8e6 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 27 Dec 2014 02:12:47 +0100 Subject: [PATCH 13/32] OP-1660 Pixel issue on Win32, reduce groove height. --- ground/openpilotgcs/src/plugins/config/configinputwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index da51d88a7..f9d3a7278 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -1544,12 +1544,12 @@ void ConfigInputWidget::updatePositionSlider() if (sp->objectName() == "channelNeutral") { if (count == 4) { sp->setStyleSheet( - "QSlider::groove:horizontal {border: 2px solid rgb(196, 196, 196); height: 20px; margin 9px 9px; border-radius: 4px; " + "QSlider::groove:horizontal {border: 2px solid rgb(196, 196, 196); height: 12px; margin 9px 9px; border-radius: 4px; " "border-image:url(:/configgadget/images/flightmode_bg" + fmNumber + ".png); }" "QSlider::add-page:horizontal { background: none; border: none; }" "QSlider::sub-page:horizontal { background: none; border: none; }" "QSlider::handle:horizontal { background: rgba(196, 196, 196, 255); width: 10px; height: 28px; " - "margin: -4px -2px; border-radius: 3px; border: 1px solid #777; }"); + "margin: -3px -2px; border-radius: 3px; border: 1px solid #777; }"); count++; } else { count++; From 9e91c83c60a52b6a7afda40f945038c98e734516 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 27 Dec 2014 08:09:59 +0100 Subject: [PATCH 14/32] OP-1660 Rcinput sliders : Add a small Red mark for neutral value - Tooltip for value --- .../src/plugins/config/inputchannelform.cpp | 33 +++++++++++++++++++ .../src/plugins/config/inputchannelform.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp index 8d5ff8c7f..df3f0a186 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp @@ -12,6 +12,7 @@ InputChannelForm::InputChannelForm(const int index, QWidget *parent) : connect(ui->channelMin, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated())); connect(ui->channelMax, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated())); connect(ui->neutralValue, SIGNAL(valueChanged(int)), this, SLOT(neutralUpdated())); + connect(ui->channelNeutral, SIGNAL(valueChanged(int)), this, SLOT(updateTooltip())); connect(ui->channelGroup, SIGNAL(currentIndexChanged(int)), this, SLOT(groupUpdated())); connect(ui->channelRev, SIGNAL(toggled(bool)), this, SLOT(reversedUpdated())); @@ -53,6 +54,14 @@ void InputChannelForm::minMaxUpdated() ui->channelRev->setChecked(reverse); ui->channelNeutral->setInvertedAppearance(reverse); ui->channelNeutral->setInvertedControls(reverse); + + updateNeutralMark(); +} + +void InputChannelForm::updateTooltip() +{ + int currentValue = ui->channelNeutral->value(); + ui->channelNeutral->setToolTip(QString::number(currentValue)); } void InputChannelForm::neutralUpdated() @@ -72,6 +81,30 @@ void InputChannelForm::neutralUpdated() ui->channelMax->setValue(neutralValue); } } + + updateNeutralMark(); +} + +void InputChannelForm::updateNeutralMark() +{ + // Add a small neutral red mark on groove background + int neutral = ui->neutralValue->value(); + int min = ui->channelMin->value(); + int max = ui->channelMax->value(); + + float range = max - min; + float offset = neutral - min; + float neutralPosition = offset / range; + + ui->channelNeutral->setStyleSheet( + "QSlider::groove:horizontal { border: 1px solid rgb(196, 196, 196); height: 6px; border-radius: 2px; margin 10px 10px; " + "background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:" + QString::number(neutralPosition - 0.01) + " transparent, stop:" + + QString::number(neutralPosition) + " red, stop:" + QString::number(neutralPosition + 0.01) + " transparent); }" + "QSlider::add-page:horizontal { background: rgba(255,255,255,180); border: 1px solid #777; margin: 0px 2px; border-radius: 4px; }" + "QSlider::sub-page:horizontal { background: rgba(78,147,246,180); border: 1px solid #777; margin: 0px 2px; border-radius: 4px; }" + "QSlider::handle:horizontal { background: rgba(196,196,196,180); width: 18px; height: 28px; margin: -2px 0px; border-radius: 3px; " + "border: 1px solid #777; }" + ); } void InputChannelForm::reversedUpdated() diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.h b/ground/openpilotgcs/src/plugins/config/inputchannelform.h index f48bcbd0a..7763e0d4b 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.h +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.h @@ -23,6 +23,8 @@ public: virtual void setName(const QString &name); private slots: + void updateNeutralMark(); + void updateTooltip(); void minMaxUpdated(); void neutralUpdated(); void reversedUpdated(); From fa7196ddec7cc05b89e0b7fb28d0990a187843d3 Mon Sep 17 00:00:00 2001 From: James Duley Date: Mon, 29 Dec 2014 09:04:47 +1300 Subject: [PATCH 15/32] OP-1654 fix linux rpath: removed hardcoded QMAKE_RPATHDIR --- ground/openpilotgcs/src/app/app.pro | 4 ++-- ground/openpilotgcs/src/openpilotgcslibrary.pri | 2 +- ground/openpilotgcs/src/openpilotgcsplugin.pri | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/app/app.pro b/ground/openpilotgcs/src/app/app.pro index 74e692644..598201b2b 100644 --- a/ground/openpilotgcs/src/app/app.pro +++ b/ground/openpilotgcs/src/app/app.pro @@ -30,8 +30,8 @@ win32 { } else { target.path = /bin INSTALLS += target - QMAKE_RPATHDIR = \'\$$ORIGIN\'/../$$GCS_LIBRARY_BASENAME/openpilotgcs - QMAKE_RPATHDIR += \'\$$ORIGIN\'/../$$GCS_LIBRARY_BASENAME/qt5 + QMAKE_RPATHDIR = \'\$$ORIGIN\'/$$relative_path($$GCS_LIBRARY_PATH, $$GCS_APP_PATH) + QMAKE_RPATHDIR += \'\$$ORIGIN\'/$$relative_path($$GCS_QT_LIBRARY_PATH, $$GCS_APP_PATH) include(../rpath.pri) } diff --git a/ground/openpilotgcs/src/openpilotgcslibrary.pri b/ground/openpilotgcs/src/openpilotgcslibrary.pri index 5c1651b81..59791944d 100644 --- a/ground/openpilotgcs/src/openpilotgcslibrary.pri +++ b/ground/openpilotgcs/src/openpilotgcslibrary.pri @@ -18,7 +18,7 @@ macx { target.files = $$DESTDIR/$${TARGET}.dll } else { QMAKE_RPATHDIR = \'\$$ORIGIN\' - QMAKE_RPATHDIR += \'\$$ORIGIN\'/../qt5 + QMAKE_RPATHDIR += \'\$$ORIGIN\'/$$relative_path($$GCS_QT_LIBRARY_PATH, $$GCS_LIBRARY_PATH) include(rpath.pri) target.path = /$$GCS_LIBRARY_BASENAME/openpilotgcs diff --git a/ground/openpilotgcs/src/openpilotgcsplugin.pri b/ground/openpilotgcs/src/openpilotgcsplugin.pri index 3752dd34b..0a9c8af6a 100644 --- a/ground/openpilotgcs/src/openpilotgcsplugin.pri +++ b/ground/openpilotgcs/src/openpilotgcsplugin.pri @@ -31,7 +31,7 @@ macx { QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Plugins/$${PROVIDER}/ } else:linux-* { QMAKE_RPATHDIR = \'\$$ORIGIN\' - QMAKE_RPATHDIR += \'\$$ORIGIN\'/../.. + QMAKE_RPATHDIR += \'\$$ORIGIN\'/$$relative_path($$GCS_LIBRARY_PATH, $$DESTDIR) include(rpath.pri) } From 0d17376e268108519c30e62b3c9a7040ae45dec6 Mon Sep 17 00:00:00 2001 From: James Duley Date: Mon, 29 Dec 2014 11:54:24 +1300 Subject: [PATCH 16/32] OP-1654 fix linux rpath: added Qt for plugins --- ground/openpilotgcs/src/openpilotgcsplugin.pri | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/src/openpilotgcsplugin.pri b/ground/openpilotgcs/src/openpilotgcsplugin.pri index 0a9c8af6a..2a01ffcc3 100644 --- a/ground/openpilotgcs/src/openpilotgcsplugin.pri +++ b/ground/openpilotgcs/src/openpilotgcsplugin.pri @@ -32,6 +32,7 @@ macx { } else:linux-* { QMAKE_RPATHDIR = \'\$$ORIGIN\' QMAKE_RPATHDIR += \'\$$ORIGIN\'/$$relative_path($$GCS_LIBRARY_PATH, $$DESTDIR) + QMAKE_RPATHDIR += \'\$$ORIGIN\'/$$relative_path($$GCS_QT_LIBRARY_PATH, $$DESTDIR) include(rpath.pri) } From 64cea89d3e50a6659336f11ee2c9db5ef492441b Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Mon, 29 Dec 2014 01:07:11 +0100 Subject: [PATCH 17/32] OP-1660 Reset channel data : Type and number. Prevent bad channel setting like channel type set and no channel number or wizard freezes. --- .../src/plugins/config/configinputwidget.cpp | 14 ++++++++++++++ .../src/plugins/config/configinputwidget.h | 1 + .../src/plugins/config/inputchannelform.cpp | 1 + 3 files changed, 16 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index f9d3a7278..c7b6cc938 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -412,6 +412,9 @@ void ConfigInputWidget::goToWizard() flightModeSettingsData.Arming = FlightModeSettings::ARMING_ALWAYSDISARMED; flightModeSettingsObj->setData(flightModeSettingsData); + // Now reset channel settings + resetChannelSettings(); + // Use faster input update rate. fastMdata(); @@ -1661,3 +1664,14 @@ bool ConfigInputWidget::shouldObjectBeSaved(UAVObject *object) // ManualControlCommand no need to be saved return dynamic_cast(object) == 0; } + +void ConfigInputWidget::resetChannelSettings() +{ + manualSettingsData = manualSettingsObj->getData(); + // Clear all channel data : Channel Type (PPM,PWM..) and Number + for (unsigned int channel = 0; channel < 9; channel++) { + manualSettingsData.ChannelGroups[channel] = ManualControlSettings::CHANNELGROUPS_NONE; + manualSettingsData.ChannelNumber[channel] = 0; + manualSettingsObj->setData(manualSettingsData); + } +} diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 0cb0b34cc..ecbf0830f 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -192,6 +192,7 @@ private slots: void simpleCalibration(bool state); void adjustSpecialNeutrals(); void updateCalibration(); + void resetChannelSettings(); protected: void resizeEvent(QResizeEvent *event); diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp index df3f0a186..7e9b6d361 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp @@ -61,6 +61,7 @@ void InputChannelForm::minMaxUpdated() void InputChannelForm::updateTooltip() { int currentValue = ui->channelNeutral->value(); + ui->channelNeutral->setToolTip(QString::number(currentValue)); } From bdf4386dfa30715228155b8e89af27c77a0bab88 Mon Sep 17 00:00:00 2001 From: Christian Gudrian Date: Sun, 5 Oct 2014 20:42:06 +0200 Subject: [PATCH 18/32] fixed header guards --- ground/openpilotgcs/src/plugins/hitl/fgsimulator.h | 2 +- ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.h | 4 ++-- ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h | 4 ++-- ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/hitl/fgsimulator.h b/ground/openpilotgcs/src/plugins/hitl/fgsimulator.h index be5e48539..c30183024 100644 --- a/ground/openpilotgcs/src/plugins/hitl/fgsimulator.h +++ b/ground/openpilotgcs/src/plugins/hitl/fgsimulator.h @@ -26,7 +26,7 @@ */ #ifndef FGSIMULATOR_H -#define FGSIMULATOR_H_H +#define FGSIMULATOR_H #include #include "simulator.h" diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.h b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.h index 908bd1f4d..9cfccc008 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.h +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.h @@ -25,7 +25,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef OPAMP_GADGETFACTORY_H_ +#ifndef OPMAP_GADGETFACTORY_H_ #define OPMAP_GADGETFACTORY_H_ #include @@ -49,4 +49,4 @@ public: IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; -#endif // ifndef OPAMP_GADGETFACTORY_H_ +#endif // ifndef OPMAP_GADGETFACTORY_H_ diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h index f36bbb6fe..5e6fa96a6 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h @@ -15,7 +15,7 @@ */ #ifndef PFDQMLGADGET_H_ -#define PFDQMLQMLGADGET_H_ +#define PFDQMLGADGET_H_ #include #include "pfdqmlgadgetwidget.h" @@ -51,4 +51,4 @@ private: }; -#endif // PFDQMLQMLGADGET_H_ +#endif // PFDQMLGADGET_H_ diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h index 076cd8d99..d9b466347 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h @@ -26,7 +26,7 @@ */ #ifndef QMLVIEWGADGET_H_ -#define QMLVIEWQMLGADGET_H_ +#define QMLVIEWGADGET_H_ #include #include "qmlviewgadgetwidget.h" @@ -62,4 +62,4 @@ private: }; -#endif // QMLVIEWQMLGADGET_H_ +#endif // QMLVIEWGADGET_H_ From 5caee931f556a648cc408bfafc28e89e3b5d3a82 Mon Sep 17 00:00:00 2001 From: Christian Gudrian Date: Sun, 5 Oct 2014 20:44:31 +0200 Subject: [PATCH 19/32] fixed method signature to match the one in the superclass --- ground/openpilotgcs/src/libs/utils/logfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/libs/utils/logfile.h b/ground/openpilotgcs/src/libs/utils/logfile.h index 26e0f86ca..0f84ad5d8 100644 --- a/ground/openpilotgcs/src/libs/utils/logfile.h +++ b/ground/openpilotgcs/src/libs/utils/logfile.h @@ -15,7 +15,7 @@ class QTCREATOR_UTILS_EXPORT LogFile : public QIODevice { public: explicit LogFile(QObject *parent = 0); qint64 bytesAvailable() const; - qint64 bytesToWrite() + qint64 bytesToWrite() const { return m_file.bytesToWrite(); }; From 30b97bbb290664cd7916ac2c7b8697796a87c6e8 Mon Sep 17 00:00:00 2001 From: Christian Gudrian Date: Sun, 5 Oct 2014 20:45:07 +0200 Subject: [PATCH 20/32] removed extraneous semicolon --- .../src/plugins/coreplugin/iuavgadgetconfiguration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetconfiguration.h b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetconfiguration.h index 278987b12..3aed78a4d 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetconfiguration.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetconfiguration.h @@ -69,7 +69,7 @@ public: m_locked = locked; } - virtual void saveConfig(QSettings * /*settings*/) const {}; + virtual void saveConfig(QSettings * /*settings*/) const {} virtual void saveConfig(QSettings *settings, UAVConfigInfo * /*configInfo*/) const { saveConfig(settings); From 98387d263934cba5df3d9f32135d85085166fae0 Mon Sep 17 00:00:00 2001 From: Christian Gudrian Date: Thu, 9 Oct 2014 18:18:23 +0200 Subject: [PATCH 21/32] fixed formatting of error message --- ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp index 3716fe4b5..1678f3e90 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp @@ -194,7 +194,7 @@ bool UAVConfigInfo::askToAbort(int compat, QString message) return true; default: - msgBox.setText("INTERNAL ERROR: " + message + tr(" Unknown compatibility level: " + compat)); + msgBox.setText("INTERNAL ERROR: " + message + tr(" Unknown compatibility level: %1").arg(compat)); } if (result == QMessageBox::Ok) { return false; From e5d19972e6edbcbec3a3dbde62f8d9bbc71cbcce Mon Sep 17 00:00:00 2001 From: Christian Gudrian Date: Sun, 5 Oct 2014 20:47:03 +0200 Subject: [PATCH 22/32] fixed type check warning --- ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp index d090fc0ed..58401b8a0 100644 --- a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp @@ -299,7 +299,7 @@ OP_DFU::Status DFUObject::UploadDescription(QVariant desc) cout << "Starting uploading description\n"; QByteArray array; - if (desc.type() == QMetaType::QString) { + if (desc.type() == QVariant::String) { QString description = desc.toString(); if (description.length() % 4 != 0) { int pad = description.length() / 4; @@ -310,7 +310,7 @@ OP_DFU::Status DFUObject::UploadDescription(QVariant desc) description.append(padding); } array = description.toLatin1(); - } else if (desc.type() == QMetaType::QByteArray) { + } else if (desc.type() == QVariant::ByteArray) { array = desc.toByteArray(); } From ed99869c7bd8cbfd37d0db674612042ee13ab271 Mon Sep 17 00:00:00 2001 From: Christian Gudrian Date: Sun, 5 Oct 2014 20:47:17 +0200 Subject: [PATCH 23/32] fixed comparison --- .../src/plugins/uavobjectwidgetutils/configtaskwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index a7796f0cc..eed01b3a9 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -616,7 +616,7 @@ void ConfigTaskWidget::autoLoadWidgets() uiRelation.url = str.mid(str.indexOf(":") + 1); } } - if (!uiRelation.buttonType == none) { + if (!(uiRelation.buttonType == none)) { QPushButton *button = NULL; switch (uiRelation.buttonType) { case save_button: From 04dda828f09a833003a4d8e7f3478af5609a3c23 Mon Sep 17 00:00:00 2001 From: Christian Gudrian Date: Fri, 10 Oct 2014 19:34:58 +0200 Subject: [PATCH 24/32] added config parameter --- ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h index eeeb1e8a5..2d4b7bba8 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h @@ -85,7 +85,7 @@ public slots: virtual void configurationChanged(IUAVGadgetConfiguration *) {} virtual void configurationAdded(IUAVGadgetConfiguration *) {} virtual void configurationToBeDeleted(IUAVGadgetConfiguration *) {} - virtual void configurationNameChanged(QString, QString) {} + virtual void configurationNameChanged(IUAVGadgetConfiguration *config, QString, QString) {} private slots: private: QString m_classId; From 1c764c40018e1c8e2dec96a86284764ba51b5fb4 Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Tue, 30 Dec 2014 09:41:37 +0100 Subject: [PATCH 25/32] Fixed a gcc compiler warning that was a result of clang compiler warning cleanup. --- ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h index 2d4b7bba8..46cd22146 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadget.h @@ -85,7 +85,7 @@ public slots: virtual void configurationChanged(IUAVGadgetConfiguration *) {} virtual void configurationAdded(IUAVGadgetConfiguration *) {} virtual void configurationToBeDeleted(IUAVGadgetConfiguration *) {} - virtual void configurationNameChanged(IUAVGadgetConfiguration *config, QString, QString) {} + virtual void configurationNameChanged(IUAVGadgetConfiguration *, QString, QString) {} private slots: private: QString m_classId; From 90e4e9276eeb7e04cbab8dbbc1f71950dd732f1f Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 30 Dec 2014 09:49:35 +0100 Subject: [PATCH 26/32] OP-1660 Disable all outputs while calibrate (Manual calibration or Wizard) : No servo jitter --- .../src/plugins/config/configinputwidget.cpp | 34 ++++++++++++++++++- .../src/plugins/config/configinputwidget.h | 6 ++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index c7b6cc938..49e242aa2 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -71,6 +71,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : accessoryDesiredObj0 = AccessoryDesired::GetInstance(getObjectManager(), 0); accessoryDesiredObj1 = AccessoryDesired::GetInstance(getObjectManager(), 1); accessoryDesiredObj2 = AccessoryDesired::GetInstance(getObjectManager(), 2); + actuatorSettingsObj = ActuatorSettings::GetInstance(getObjectManager()); // Only instance 0 is present if the board is not connected. // The other instances are populated lazily. @@ -411,9 +412,13 @@ void ConfigInputWidget::goToWizard() previousFlightModeSettingsData = flightModeSettingsData; flightModeSettingsData.Arming = FlightModeSettings::ARMING_ALWAYSDISARMED; flightModeSettingsObj->setData(flightModeSettingsData); + // Stash actuatorSettings + actuatorSettingsData = actuatorSettingsObj->getData(); + previousActuatorSettingsData = actuatorSettingsData; - // Now reset channel settings + // Now reset channel and actuator settings (disable outputs) resetChannelSettings(); + resetActuatorSettings(); // Use faster input update rate. fastMdata(); @@ -453,6 +458,7 @@ void ConfigInputWidget::wzCancel() // Load settings back from beginning of wizard manualSettingsObj->setData(previousManualSettingsData); flightModeSettingsObj->setData(previousFlightModeSettingsData); + actuatorSettingsObj->setData(previousActuatorSettingsData); } void ConfigInputWidget::registerControlActivity() @@ -534,6 +540,9 @@ void ConfigInputWidget::wzNext() // Restore original input update rate. restoreMdata(); + // Load actuator settings back from beginning of wizard + actuatorSettingsObj->setData(previousActuatorSettingsData); + // Leave setting the throttle neutral until the final Next press, // else the throttle scaling causes the graphical stick movement to not // match the tx stick @@ -1617,6 +1626,13 @@ void ConfigInputWidget::simpleCalibration(bool enable) fastMdataSingle(manualCommandObj, &manualControlMdata); + // Stash actuatorSettings + actuatorSettingsData = actuatorSettingsObj->getData(); + previousActuatorSettingsData = actuatorSettingsData; + + // Disable all actuators + resetActuatorSettings(); + connect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration())); } else { ui->configurationWizard->setEnabled(true); @@ -1639,6 +1655,9 @@ void ConfigInputWidget::simpleCalibration(bool enable) manualSettingsObj->setData(manualSettingsData); + // Load actuator settings back from beginning of manual calibration + actuatorSettingsObj->setData(previousActuatorSettingsData); + disconnect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration())); } } @@ -1675,3 +1694,16 @@ void ConfigInputWidget::resetChannelSettings() manualSettingsObj->setData(manualSettingsData); } } + +void ConfigInputWidget::resetActuatorSettings() +{ + actuatorSettingsData = actuatorSettingsObj->getData(); + // Clear all output data : Min, max, neutral = 1500 + // 1500 = servo middle, can be applied to all outputs because board is 'Alwaysdisarmed' + for (unsigned int output = 0; output < 12; output++) { + actuatorSettingsData.ChannelMax[output] = 1500; + actuatorSettingsData.ChannelMin[output] = 1500; + actuatorSettingsData.ChannelNeutral[output] = 1500; + actuatorSettingsObj->setData(actuatorSettingsData); + } +} diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index ecbf0830f..49e4fabc3 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -39,6 +39,7 @@ #include #include "manualcontrolcommand.h" #include "manualcontrolsettings.h" +#include "actuatorsettings.h" #include "flightmodesettings.h" #include "receiveractivity.h" #include @@ -123,6 +124,10 @@ private: ManualControlSettings::DataFields manualSettingsData; ManualControlSettings::DataFields previousManualSettingsData; + ActuatorSettings *actuatorSettingsObj; + ActuatorSettings::DataFields actuatorSettingsData; + ActuatorSettings::DataFields previousActuatorSettingsData; + FlightModeSettings *flightModeSettingsObj; FlightModeSettings::DataFields flightModeSettingsData; FlightModeSettings::DataFields previousFlightModeSettingsData; @@ -193,6 +198,7 @@ private slots: void adjustSpecialNeutrals(); void updateCalibration(); void resetChannelSettings(); + void resetActuatorSettings(); protected: void resizeEvent(QResizeEvent *event); From 45c96f33783d6b5b42f6d2089151ca258dd950e7 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 30 Dec 2014 14:57:34 +0100 Subject: [PATCH 27/32] OP-1660 Changes from review --- ground/openpilotgcs/src/plugins/config/configinputwidget.cpp | 2 +- ground/openpilotgcs/src/plugins/config/configinputwidget.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 49e242aa2..ca6e14fe6 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -1681,7 +1681,7 @@ void ConfigInputWidget::adjustSpecialNeutrals() bool ConfigInputWidget::shouldObjectBeSaved(UAVObject *object) { // ManualControlCommand no need to be saved - return dynamic_cast(object) == 0; + return dynamic_cast(object) == NULL; } void ConfigInputWidget::resetChannelSettings() diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 49e4fabc3..913d55f70 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -66,7 +66,6 @@ public: goToWizard(); } void enableControls(bool enable); - bool shouldObjectBeSaved(UAVObject *object); private: From acc124cacb86b29d92a5478eb4a7bd060e29b401 Mon Sep 17 00:00:00 2001 From: Mathieu Rondonneau Date: Tue, 30 Dec 2014 21:29:06 -0800 Subject: [PATCH 28/32] OP-1625: DSM: more robust detection of resolution This allows switching back and forth between 10 and 11 bit code which prevents getting locked up in one or the other. It also avoids a situation that can cause an infinite recursion. This changeset is cherry-picked from TauLabs (b7eaf87502085666d9738ae16c66170f187f3981). Thanks to Taulabs for improving OpenPilot's DSM autodetect feature. --- flight/pios/stm32f10x/pios_dsm.c | 16 ++++++++++++++-- flight/pios/stm32f4xx/pios_dsm.c | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/flight/pios/stm32f10x/pios_dsm.c b/flight/pios/stm32f10x/pios_dsm.c index 5fa1fb7ff..577e22949 100644 --- a/flight/pios/stm32f10x/pios_dsm.c +++ b/flight/pios/stm32f10x/pios_dsm.c @@ -213,12 +213,24 @@ static int PIOS_DSM_UnrollChannels(struct pios_dsm_dev *dsm_dev) /* extract and save the channel value */ uint8_t channel_num = (word >> resolution) & 0x0f; if (channel_num < PIOS_DSM_NUM_INPUTS) { + if (channel_log & (1 << channel_num)) { - /* Found duplicate! */ - /* Update resolution and restart processing the current frame. */ + /* Found duplicate. This should happen when in 11 bit */ + /* mode and the data is 10 bits */ + if (resolution == 10) + return -1; resolution = 10; return PIOS_DSM_UnrollChannels(dsm_dev); } + + if ((channel_log & 0xFF) == 0x55) { + /* This pattern indicates 10 bit pattern */ + if (resolution == 11) + return -1; + resolution = 11; + return PIOS_DSM_UnrollChannels(dsm_dev); + } + state->channel_data[channel_num] = (word & mask); /* keep track of this channel */ channel_log |= (1 << channel_num); diff --git a/flight/pios/stm32f4xx/pios_dsm.c b/flight/pios/stm32f4xx/pios_dsm.c index 4154f9f23..314102c0e 100644 --- a/flight/pios/stm32f4xx/pios_dsm.c +++ b/flight/pios/stm32f4xx/pios_dsm.c @@ -215,12 +215,24 @@ static int PIOS_DSM_UnrollChannels(struct pios_dsm_dev *dsm_dev) /* extract and save the channel value */ uint8_t channel_num = (word >> resolution) & 0x0f; if (channel_num < PIOS_DSM_NUM_INPUTS) { + if (channel_log & (1 << channel_num)) { - /* Found duplicate! */ - /* Update resolution and restart processing the current frame. */ + /* Found duplicate. This should happen when in 11 bit */ + /* mode and the data is 10 bits */ + if (resolution == 10) + return -1; resolution = 10; return PIOS_DSM_UnrollChannels(dsm_dev); } + + if ((channel_log & 0xFF) == 0x55) { + /* This pattern indicates 10 bit pattern */ + if (resolution == 11) + return -1; + resolution = 11; + return PIOS_DSM_UnrollChannels(dsm_dev); + } + state->channel_data[channel_num] = (word & mask); /* keep track of this channel */ channel_log |= (1 << channel_num); From 5b2eac268aa8f1fe42a7d000cdc41ec4d4d05c07 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Fri, 2 Jan 2015 22:22:31 +0100 Subject: [PATCH 29/32] OP-1656 upgraded to Qt 5.4.0 (linux) - code compiles - GCS not tested... --- ground/openpilotgcs/copydata.pro | 6 +++--- make/tools.mk | 33 +++++++++++++++----------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index ea2c8a3dc..1961dc163 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -31,9 +31,9 @@ GCS_LIBRARY_PATH libQt5DBus.so.5 \ libQt5QuickParticles.so.5 \ libqgsttools_p.so.1 \ - libicui18n.so.52 \ - libicuuc.so.52 \ - libicudata.so.52 + libicui18n.so.53 \ + libicuuc.so.53 \ + libicudata.so.53 data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_LIBRARY_PATH\") $$addNewline() for(lib, QT_LIBS) { diff --git a/make/tools.mk b/make/tools.mk index dd4f6d7f1..c026b6d0a 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -59,14 +59,14 @@ ifeq ($(UNAME), Linux) ifeq ($(ARCH), x86_64) ARM_SDK_URL := https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 ARM_SDK_MD5_URL:= https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2/+md5 - QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-linux-x64-5.3.1.run - QT_SDK_MD5_URL := http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-linux-x64-5.3.1.run.md5 + QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-linux-x64-5.4.0.run + QT_SDK_MD5_URL := http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-linux-x64-5.4.0.run.md5 QT_SDK_ARCH := gcc_64 else ARM_SDK_URL := https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 ARM_SDK_MD5_URL := https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2/+md5 - QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-linux-x86-5.3.1.run - QT_SDK_MD5_URL := http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-linux-x86-5.3.1.run.md5 + QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-linux-x86-5.4.0.run + QT_SDK_MD5_URL := http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-linux-x86-5.4.0.run.md5 QT_SDK_ARCH := gcc endif UNCRUSTIFY_URL := http://wiki.openpilot.org/download/attachments/18612236/uncrustify-0.60.tar.gz @@ -432,20 +432,17 @@ qt_sdk_install: qt_sdk_clean | $(DL_DIR) $(TOOLS_DIR) $(V1) $(DL_DIR)/$(5) --dump-binary-data -o $(1) # Extract packages under tool directory $(V1) $(MKDIR) -p $$(call toprel, $(dir $(2))) - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0qt-project-url.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt/5.3.1ThirdPartySoftware_Listing.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0readme.7z" | grep -v Extracting - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.$(6)/5.3.1-0qt5_essentials.7z" | grep -v Extracting - $(V1) if [ -f "$(1)/qt.53.$(6)/5.3.1-0icu_52_1_ubuntu_11_10_64.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.$(6)/5.3.1-0icu_52_1_ubuntu_11_10_64.7z" | grep -v Extracting; fi - $(V1) if [ -f "$(1)/qt.53.$(6)/5.3.1-0icu_52_1_ubuntu_11_10_32.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.$(6)/5.3.1-0icu_52_1_ubuntu_11_10_32.7z" | grep -v Extracting; fi - $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.53.$(6)/5.3.1-0qt5_addons.7z" | grep -v Extracting -# go to OpenPilot/tools/5.3.1/gcc_64 and call patcher.sh + #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0qt-project-url.7z" | grep -v Extracting + #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt/5.3.1ThirdPartySoftware_Listing.7z" | grep -v Extracting + #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0readme.7z" | grep -v Extracting + $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.$(6)/5.4.0-1qt5_essentials.7z" | grep -v Extracting + $(V1) if [ -f "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_64.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_64.7z" | grep -v Extracting; fi + $(V1) if [ -f "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_32.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_32.7z" | grep -v Extracting; fi + $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.$(6)/5.4.0-1qt5_addons.7z" | grep -v Extracting +# Run patcher @$(ECHO) - @$(ECHO) "Running patcher in" $$(call toprel, $(QT_SDK_PREFIX)) - $(V1) $(CD) $(QT_SDK_PREFIX) -# $(V1) "$(QT_SDK_PREFIX)/patcher.sh" $(QT_SDK_PREFIX) -# call qmake patcher @$(ECHO) "Executing QtPatch in" $$(call toprel, $(QT_SDK_PREFIX)) + $(V1) $(CD) $(QT_SDK_PREFIX) $(V1) $(DL_DIR)/$(5) --runoperation QtPatch linux $(QT_SDK_PREFIX) qt5 # Execute post build templates @@ -599,7 +596,7 @@ QT_BUILD_DIR := $(BUILD_DIR)/QT_BUILD else ifeq ($(UNAME), Linux) -QT_SDK_PREFIX := "$(QT_SDK_DIR)/5.3/$(QT_SDK_ARCH)" +QT_SDK_PREFIX := "$(QT_SDK_DIR)/5.4/$(QT_SDK_ARCH)" QT_BUILD_DIR := $(BUILD_DIR)/QT_BUILD $(eval $(call LINUX_QT_INSTALL_TEMPLATE,$(QT_BUILD_DIR),$(QT_SDK_DIR),$(QT_SDK_URL),$(QT_SDK_MD5_URL),$(notdir $(QT_SDK_URL)),$(QT_SDK_ARCH))) @@ -616,7 +613,7 @@ QT_SDK_PREFIX := $(QT_SDK_DIR) .PHONY: qt_sdk_install qt_sdk_install: @$(ECHO) $(MSG_NOTICE) -------------------------------------------------------- - @$(ECHO) $(MSG_NOTICE) Please install native Qt 5.3.x SDK using package manager + @$(ECHO) $(MSG_NOTICE) Please install native Qt 5.4.x SDK using package manager @$(ECHO) $(MSG_NOTICE) -------------------------------------------------------- .PHONY: qt_sdk_clean From 822e7e6f7398a5a480fc83af8903e1be2ec92430 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Fri, 2 Jan 2015 22:23:32 +0100 Subject: [PATCH 30/32] OP-1656 upgraded to Qt 5.4.0 - check that version 5.4.0 is used --- ground/openpilotgcs/openpilotgcs.pro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/openpilotgcs.pro b/ground/openpilotgcs/openpilotgcs.pro index 54f62cc47..e710a3aad 100644 --- a/ground/openpilotgcs/openpilotgcs.pro +++ b/ground/openpilotgcs/openpilotgcs.pro @@ -5,14 +5,14 @@ cache() -#check Qt version +# check Qt version QT_VERSION = $$[QT_VERSION] QT_VERSION = $$split(QT_VERSION, ".") QT_VER_MAJ = $$member(QT_VERSION, 0) QT_VER_MIN = $$member(QT_VERSION, 1) -lessThan(QT_VER_MAJ, 5) | lessThan(QT_VER_MIN, 1) { - error(OpenPilot GCS requires Qt 5.1.0 or newer but Qt $$[QT_VERSION] was detected.) +lessThan(QT_VER_MAJ, 5) | lessThan(QT_VER_MIN, 4) { + error(OpenPilot GCS requires Qt 5.4.0 or newer but Qt $$[QT_VERSION] was detected.) } macx { From 4edc97291ce65bbbcf1e94f56e3b87af6499fede Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 3 Jan 2015 13:01:25 +0100 Subject: [PATCH 31/32] OP-1660 Little pixel issue on groove (margin left on blue, margin right on white) and margin not needed (not active, typo) --- .../openpilotgcs/share/openpilotgcs/stylesheets/default.qss | 1 - .../openpilotgcs/src/plugins/config/configinputwidget.cpp | 2 +- ground/openpilotgcs/src/plugins/config/inputchannelform.cpp | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss index 75ceca382..44320b285 100644 --- a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss +++ b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default.qss @@ -13,7 +13,6 @@ QSlider::groove:horizontal { background: white; height: 6px; border-radius: 2px; - margin 10px 10px; } QSlider::add-page:horizontal { diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index ca6e14fe6..d7b9fd7d0 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -1556,7 +1556,7 @@ void ConfigInputWidget::updatePositionSlider() if (sp->objectName() == "channelNeutral") { if (count == 4) { sp->setStyleSheet( - "QSlider::groove:horizontal {border: 2px solid rgb(196, 196, 196); height: 12px; margin 9px 9px; border-radius: 4px; " + "QSlider::groove:horizontal {border: 2px solid rgb(196, 196, 196); height: 12px; border-radius: 4px; " "border-image:url(:/configgadget/images/flightmode_bg" + fmNumber + ".png); }" "QSlider::add-page:horizontal { background: none; border: none; }" "QSlider::sub-page:horizontal { background: none; border: none; }" diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp index 7e9b6d361..7fb7714fa 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp @@ -98,11 +98,11 @@ void InputChannelForm::updateNeutralMark() float neutralPosition = offset / range; ui->channelNeutral->setStyleSheet( - "QSlider::groove:horizontal { border: 1px solid rgb(196, 196, 196); height: 6px; border-radius: 2px; margin 10px 10px; " + "QSlider::groove:horizontal { border: 1px solid rgb(196, 196, 196); height: 6px; border-radius: 2px; " "background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:" + QString::number(neutralPosition - 0.01) + " transparent, stop:" + QString::number(neutralPosition) + " red, stop:" + QString::number(neutralPosition + 0.01) + " transparent); }" - "QSlider::add-page:horizontal { background: rgba(255,255,255,180); border: 1px solid #777; margin: 0px 2px; border-radius: 4px; }" - "QSlider::sub-page:horizontal { background: rgba(78,147,246,180); border: 1px solid #777; margin: 0px 2px; border-radius: 4px; }" + "QSlider::add-page:horizontal { background: rgba(255,255,255,180); border: 1px solid #777; margin: 0px 0px 0px 2px; border-radius: 4px; }" + "QSlider::sub-page:horizontal { background: rgba(78,147,246,180); border: 1px solid #777; margin: 0px 2px 0px 0px; border-radius: 4px; }" "QSlider::handle:horizontal { background: rgba(196,196,196,180); width: 18px; height: 28px; margin: -2px 0px; border-radius: 3px; " "border: 1px solid #777; }" ); From ab952b0f03ecce24dddfe1d3dd986f617b8e3be9 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 4 Jan 2015 12:33:42 +0100 Subject: [PATCH 32/32] OP-1656 minor post Qt 5.4.0 upgrade cleanups --- make/tools.mk | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/make/tools.mk b/make/tools.mk index c026b6d0a..4ff9da7b9 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -301,8 +301,6 @@ endef # ############################## - - define TOOL_INSTALL_TEMPLATE .PHONY: $(addprefix $(1)_, install clean distclean) @@ -365,9 +363,6 @@ qt_sdk_install: qt_sdk_clean | $(DL_DIR) $(TOOLS_DIR) $(V1) $(DL_DIR)/$(5) --dump-binary-data -o $(1) # Extract packages under tool directory $(V1) $(MKDIR) -p $$(call toprel, $(dir $(2))) - #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0qt-project-url.7z" | grep -v Extracting - #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt/5.3.2ThirdPartySoftware_Listing.7z" | grep -v Extracting - #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0readme.7z" | grep -v Extracting $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.win32_mingw491/5.4.0-1qt5_essentials.7z" | grep -v Extracting $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.win32_mingw491/5.4.0-1i686-4.9.1-release-posix-dwarf-rt_v3-rev2-runtime.7z" | grep -v Extracting $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.win32_mingw491/5.4.0-1icu_53_1_mingw_builds_4_9_1_posix_dwarf_32.7z" | grep -v Extracting @@ -432,9 +427,6 @@ qt_sdk_install: qt_sdk_clean | $(DL_DIR) $(TOOLS_DIR) $(V1) $(DL_DIR)/$(5) --dump-binary-data -o $(1) # Extract packages under tool directory $(V1) $(MKDIR) -p $$(call toprel, $(dir $(2))) - #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0qt-project-url.7z" | grep -v Extracting - #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt/5.3.1ThirdPartySoftware_Listing.7z" | grep -v Extracting - #$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0-0readme.7z" | grep -v Extracting $(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.$(6)/5.4.0-1qt5_essentials.7z" | grep -v Extracting $(V1) if [ -f "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_64.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_64.7z" | grep -v Extracting; fi $(V1) if [ -f "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_32.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.54.$(6)/5.4.0-1icu_53_1_ubuntu_11_10_32.7z" | grep -v Extracting; fi @@ -467,7 +459,6 @@ qt_sdk_distclean: endef - ############################## # # Mac QT install template @@ -545,13 +536,19 @@ endef # ARM SDK # ############################## + ifeq ($(UNAME), Windows) -#unfortunately zip package for this release is missing root directory, so adding / at the end of the path + +# unfortunately zip package for this release is missing root directory, so adding / at the end of the path # so that template interpret last part as directory and use the full path $(eval $(call TOOL_INSTALL_TEMPLATE,arm_sdk,$(ARM_SDK_DIR)/,$(ARM_SDK_URL),$(ARM_SDK_MD5_URL),$(notdir $(ARM_SDK_URL)))) + else + $(eval $(call TOOL_INSTALL_TEMPLATE,arm_sdk,$(ARM_SDK_DIR),$(ARM_SDK_URL),$(ARM_SDK_MD5_URL),$(notdir $(ARM_SDK_URL)))) + endif + ifeq ($(shell [ -d "$(ARM_SDK_DIR)" ] && $(ECHO) "exists"), exists) export ARM_SDK_PREFIX := $(ARM_SDK_DIR)/bin/arm-none-eabi- else