Commit 2396eb6e authored by Gus Grubba's avatar Gus Grubba

Merge branch 'master' of https://github.com/mavlink/qgroundcontrol

* 'master' of https://github.com/mavlink/qgroundcontrol: (37 commits)
  Update ISSUE_TEMPLATE.md
  Update ISSUE_TEMPLATE.md
  Create ISSUE_TEMPLATE.md
  Revert "Remove FileManager unit test"
  Revert "Temp removal of Onboard File"
  FileManager: fix upload complete
  QGCUASFileView.cc: fix upload complete
  Flight display: Fixed TypeErrors on startup without gstream installed
  Fix timeout logic
  10 sec timeout on vehicle
  Stack callsign below altitude
  Flight display: Create property variable
  Flight display: Remove video record button when gstreamer is not installed
  Add missing lib
  Flight display: Add callsign to transponders
  Add missing lib
  Better display of vehicle indicators for multi-vehicle
  Add support for ADSB vehicle display
  travis-ci fix indentation
  travis-ci fix google play deploy and quiet wget
  ...
parents 2e4ec106 667c1e12
......@@ -72,7 +72,7 @@ before_install:
# install ccache for osx/ios
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ccache &&
wget --quiet https://s3.amazonaws.com/px4-travis/toolchain/macos/ccache &&
chmod +x ccache && sudo mv ccache /usr/local/bin;
fi
......@@ -89,7 +89,7 @@ before_install:
install:
# linux dependencies: qt
- if [ "${SPEC}" = "linux-g++-64" ]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.7.1-linux-min.tar.bz2 &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.7.1-linux-min.tar.bz2 &&
tar jxf Qt5.7.1-linux-min.tar.bz2 -C /tmp &&
export PATH=/tmp/Qt5.7-linux/5.7/gcc_64/bin:$PATH &&
export DISPLAY=:99.0 &&
......@@ -99,12 +99,12 @@ install:
# android dependencies: qt, gstreamer, android-ndk
- if [ "${SPEC}" = "android-g++" ]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.7.1-android-min.tar.bz2 &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.7.1-android-min.tar.bz2 &&
tar jxf Qt5.7.1-android-min.tar.bz2 -C /tmp &&
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-android-armv7-1.5.2.tar.bz2 &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-android-armv7-1.5.2.tar.bz2 &&
mkdir -p ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 &&
tar jxf gstreamer-1.0-android-armv7-1.5.2.tar.bz2 -C ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 &&
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin &&
wget --quiet http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin &&
chmod +x android-ndk-r10e-linux-x86_64.bin &&
./android-ndk-r10e-linux-x86_64.bin > /dev/null &&
export ANDROID_NDK_ROOT=`pwd`/android-ndk-r10e &&
......@@ -115,13 +115,13 @@ install:
# osx dependencies: qt, gstreamer, gstreamer-devel
- if [ "${SPEC}" = "macx-clang" ]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.7.1-mac-clang-min.tar.bz2 &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.7.1-mac-clang-min.tar.bz2 &&
tar jxf Qt5.7.1-mac-clang-min.tar.bz2 -C /tmp &&
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-1.5.2-x86_64.pkg &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-1.5.2-x86_64.pkg &&
sudo installer -verboseR -pkg gstreamer-1.0-1.5.2-x86_64.pkg -target / &&
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-devel-1.5.2-x86_64.pkg &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-devel-1.5.2-x86_64.pkg &&
sudo installer -verboseR -pkg gstreamer-1.0-devel-1.5.2-x86_64.pkg -target / &&
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/osx-gstreamer.tar.bz2 &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/osx-gstreamer.tar.bz2 &&
sudo tar jxf osx-gstreamer.tar.bz2 -C /Library/Frameworks &&
export QT_DIR=Qt5.7-mac-clang/5.7/clang_64 &&
export QT_QPA_PLATFORM_PLUGIN_PATH=/tmp/$QT_DIR/plugins &&
......@@ -132,7 +132,7 @@ install:
# ios dependencies: qt, TODO: add gstreamer
- if [ "${SPEC}" = "macx-ios-clang" ]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.8.0-ios-min.tar.bz2 &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.8.0-ios-min.tar.bz2 &&
tar jxf Qt5.8.0-ios-min.tar.bz2 -C /tmp &&
export IOS_CCACHE_CC=`/usr/bin/xcrun -sdk iphoneos -find clang` &&
export IOS_CCACHE_CXX=`/usr/bin/xcrun -sdk iphoneos -find clang++` &&
......@@ -145,8 +145,8 @@ before_script:
- cd ${TRAVIS_BUILD_DIR}
# grab latest PX4 parameter and airframe metadata
- wget http://px4-travis.s3.amazonaws.com/Firmware/master/parameters.xml -O src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
- wget http://px4-travis.s3.amazonaws.com/Firmware/master/airframes.xml -O src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
- wget --quiet http://px4-travis.s3.amazonaws.com/Firmware/master/parameters.xml -O src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
- wget --quiet http://px4-travis.s3.amazonaws.com/Firmware/master/airframes.xml -O src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
# switch android config from installer to release if the android storepass isn't available
- if [[ "${SPEC}" = "android-g++" && "${CONFIG}" = "installer" && -z ${ANDROID_STOREPASS} ]]; then
......@@ -156,7 +156,7 @@ before_script:
# insert QGC version in AndroidManifest.xml
- if [ "${SPEC}" = "android-g++" ]; then
git remote set-branches origin 'master' &&
git fetch origin master &&
git fetch --tags origin master &&
./tools/update_android_version.sh;
fi
......@@ -183,12 +183,15 @@ after_success:
- cd ${TRAVIS_BUILD_DIR}
# master development builds to beta track
# tagged releases first to beta track then manually move to production
- GOOGLE_PLAY_PKG=org.mavlink.qgroundcontrolbeta
- if [ "${TRAVIS_TAG}" ]; then
GOOGLE_PLAY_PKG=org.mavlink.qgroundcontrol;
elif [ "${TRAVIS_BRANCH}" = "master" ]; then
GOOGLE_PLAY_PKG=org.mavlink.qgroundcontrolbeta;
else
GOOGLE_PLAY_PKG=none;
fi
- if [[ "${SPEC}" = "android-g++" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then
- if [[ "${SPEC}" = "android-g++" && "${TRAVIS_PULL_REQUEST}" = "false" && "${GOOGLE_PLAY_PKG}" != "none" ]]; then
pip install --user google-api-python-client PyOpenSSL &&
openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d &&
./tools/google_play_upload.py production ${GOOGLE_PLAY_PKG} ${SHADOW_BUILD_DIR}/release/package/QGroundControl.apk;
......
Note: GitHub Issues are for bugs or feature requests only. Do not enter Issues for questions regarding usage or problems building QGC yourself.
Use the appropriate support channel instead: http://qgroundcontrol.com/#resources.
Delete all of this text when create a real bug Issue.
......@@ -35,7 +35,7 @@ installer {
QMAKE_POST_LINK += && hdiutil create -verbose -stretch 4g -layout SPUD -srcfolder $${DESTDIR}/$${TARGET}.app -volname $${TARGET} $${DESTDIR}/package/$${TARGET}.dmg
}
WindowsBuild {
QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /DINSTALLER_ICON="\"$${QGC_INSTALLER_ICON}\"" /DHEADER_BITMAP="\"$${QGC_INSTALLER_HEADER_BITMAP}\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
OTHER_FILES += deploy/qgroundcontrol_installer.nsi
}
LinuxBuild {
......
......@@ -114,6 +114,8 @@ LinuxBuild {
libQt5PrintSupport.so.5 \
libQt5Qml.so.5 \
libQt5Quick.so.5 \
libQt5QuickControls2.so.5 \
libQt5QuickTemplates2.so.5 \
libQt5QuickWidgets.so.5 \
libQt5SerialPort.so.5 \
libQt5Sql.so.5 \
......
......@@ -44,9 +44,9 @@ InstallDir "$PROGRAMFILES\${APPNAME}"
SetCompressor /SOLID /FINAL lzma
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "installheader.bmp";
!define MUI_ICON "WindowsQGC.ico";
!define MUI_UNICON "WindowsQGC.ico";
!define MUI_HEADERIMAGE_BITMAP "${HEADER_BITMAP}";
!define MUI_ICON "${INSTALLER_ICON}";
!define MUI_UNICON "${INSTALLER_ICON}";
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
!insertmacro MUI_PAGE_DIRECTORY
......
......@@ -85,6 +85,8 @@
<string>Ground Station Location</string>
<key>UILaunchStoryboardName</key>
<string>QGCLaunchScreen</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>QGroundControl would like to use bluetooth.</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
......
......@@ -113,6 +113,7 @@
<file alias="scale_end.png">src/FlightMap/Images/scale_end.png</file>
<file alias="scaleLight.png">src/FlightMap/Images/scaleLight.png</file>
<file alias="scale_endLight.png">src/FlightMap/Images/scale_endLight.png</file>
<file alias="adsbVehicle.svg">src/FlightMap/Images/adsbVehicle.svg</file>
<file alias="vehicleArrowOutline.svg">src/FlightMap/Images/vehicleArrowOutline.svg</file>
<file alias="vehicleArrowOpaque.svg">src/FlightMap/Images/vehicleArrowOpaque.svg</file>
<file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file>
......
......@@ -55,6 +55,8 @@ iOSBuild {
count(APP_ERROR, 1) {
error("Error building .plist file. 'ForAppStore' builds are only possible through the official build system.")
}
QT += qml-private
CONFIG += qtquickcompiler
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOSForAppStore-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOSForAppStore-Info.plist
} else {
......@@ -82,6 +84,10 @@ QGC_ORG_DOMAIN = "org.qgroundcontrol"
QGC_APP_DESCRIPTION = "Open source ground control app provided by QGroundControl dev team"
QGC_APP_COPYRIGHT = "Copyright (C) 2017 QGroundControl Development Team. All rights reserved."
WindowsBuild {
QGC_INSTALLER_ICON = "WindowsQGC.ico"
QGC_INSTALLER_HEADER_BITMAP = "installheader.bmp"
}
# Load additional config flags from user_config.pri
exists(user_config.pri):infile(user_config.pri, CONFIG) {
......@@ -830,6 +836,7 @@ HEADERS+= \
src/FirmwarePlugin/CameraMetaData.h \
src/FirmwarePlugin/FirmwarePlugin.h \
src/FirmwarePlugin/FirmwarePluginManager.h \
src/Vehicle/ADSBVehicle.h \
src/Vehicle/MultiVehicleManager.h \
src/Vehicle/GPSRTKFactGroup.h \
src/Vehicle/Vehicle.h \
......@@ -855,6 +862,7 @@ SOURCES += \
src/FirmwarePlugin/CameraMetaData.cc \
src/FirmwarePlugin/FirmwarePlugin.cc \
src/FirmwarePlugin/FirmwarePluginManager.cc \
src/Vehicle/ADSBVehicle.cc \
src/Vehicle/MultiVehicleManager.cc \
src/Vehicle/GPSRTKFactGroup.cc \
src/Vehicle/Vehicle.cc \
......
......@@ -73,7 +73,7 @@ public:
QString missionFlightMode (void) const override { return QString("Auto"); }
QString rtlFlightMode (void) const override { return QString("RTL"); }
QString landFlightMode (void) const override { return QString("Land"); }
QString takeControlFlightMode (void) const override { return QString("Stablize"); }
QString takeControlFlightMode (void) const override { return QString("Loiter"); }
bool vehicleYawsToNextWaypointInMission (const Vehicle* vehicle) const final;
QString autoDisarmParameter (Vehicle* vehicle) final { Q_UNUSED(vehicle); return QStringLiteral("DISARM_DELAY"); }
void startMission (Vehicle* vehicle) override;
......
......@@ -43,6 +43,7 @@ QGCView {
property var _geoFenceController: _planMasterController.geoFenceController
property var _rallyPointController: _planMasterController.rallyPointController
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _videoReceiver: QGroundControl.videoManager.videoReceiver
property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property real _savedZoomLevel: 0
......@@ -331,7 +332,7 @@ QGCView {
QGCRadioButton {
exclusiveGroup: multiVehicleSelectorGroup
text: qsTr("Multi-Vehicle (WIP)")
text: qsTr("Multi-Vehicle")
color: mapPal.text
}
}
......@@ -339,7 +340,7 @@ QGCView {
FlightDisplayViewWidgets {
id: flightDisplayViewWidgets
z: _panel.z + 4
height: ScreenTools.availableHeight
height: ScreenTools.availableHeight - (singleMultiSelector.visible ? singleMultiSelector.height + _margins : 0)
anchors.left: parent.left
anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right
anchors.bottom: parent.bottom
......@@ -370,14 +371,14 @@ QGCView {
anchors.right: _flightVideo.right
height: ScreenTools.defaultFontPixelHeight * 2
width: height
visible: QGroundControl.videoManager.videoReceiver.videoRunning && QGroundControl.settingsManager.videoSettings.showRecControl.rawValue
visible: _videoReceiver && _videoReceiver.videoRunning && QGroundControl.settingsManager.videoSettings.showRecControl.rawValue
opacity: 0.75
Rectangle {
anchors.top: parent.top
anchors.bottom: parent.bottom
width: height
radius: QGroundControl.videoManager && QGroundControl.videoManager.videoReceiver && QGroundControl.videoManager.videoReceiver.recording ? 0 : height
radius: QGroundControl.videoManager && _videoReceiver && _videoReceiver.recording ? 0 : height
color: "red"
}
......@@ -394,21 +395,21 @@ QGCView {
MouseArea {
anchors.fill: parent
onClicked: QGroundControl.videoManager.videoReceiver && QGroundControl.videoManager.videoReceiver.recording ? QGroundControl.videoManager.videoReceiver.stopRecording() : QGroundControl.videoManager.videoReceiver.startRecording()
onClicked: _videoReceiver && _videoReceiver.recording ? _videoReceiver.stopRecording() : _videoReceiver.startRecording()
}
}
MultiVehicleList {
anchors.margins: _margins
anchors.top: singleMultiSelector.bottom
anchors.right: parent.right
anchors.bottom: parent.bottom
width: ScreenTools.defaultFontPixelWidth * 30
visible: !singleVehicleView.checked
z: _panel.z + 4
anchors.margins: _margins
anchors.top: singleMultiSelector.bottom
anchors.right: parent.right
anchors.bottom: parent.bottom
width: ScreenTools.defaultFontPixelWidth * 30
visible: !singleVehicleView.checked
z: _panel.z + 4
guidedActionsController: _guidedController
}
//-- Virtual Joystick
Loader {
id: virtualJoystickMultiTouch
......
......@@ -184,12 +184,28 @@ FlightMap {
delegate: VehicleMapItem {
vehicle: object
coordinate: object.coordinate
isSatellite: flightMap.isSatelliteMap
map: flightMap
size: _mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight
z: QGroundControl.zOrderVehicles
}
}
// Add ADSB vehicles to the map
MapItemView {
model: _activeVehicle ? _activeVehicle.adsbVehicles : 0
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
delegate: VehicleMapItem {
coordinate: object.coordinate
altitude: object.altitude
callsign: object.callsign
heading: object.heading
map: flightMap
z: QGroundControl.zOrderVehicles
}
}
// Add the mission item visuals to the map
Repeater {
model: _mainIsMap ? _missionController.visualItems : 0
......
......@@ -25,11 +25,13 @@ Item {
id: root
property double _ar: QGroundControl.settingsManager.videoSettings.aspectRatio.rawValue
property bool _showGrid: QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0
property var _videoReceiver: QGroundControl.videoManager.videoReceiver
Rectangle {
id: noVideo
anchors.fill: parent
color: Qt.rgba(0,0,0,0.75)
visible: !QGroundControl.videoManager.videoReceiver.videoRunning
visible: !(_videoReceiver && _videoReceiver.videoRunning)
QGCLabel {
text: qsTr("WAITING FOR VIDEO")
font.family: ScreenTools.demiboldFontFamily
......@@ -41,20 +43,20 @@ Item {
Rectangle {
anchors.fill: parent
color: "black"
visible: QGroundControl.videoManager.videoReceiver.videoRunning
visible: _videoReceiver && _videoReceiver.videoRunning
QGCVideoBackground {
id: videoContent
height: parent.height
width: _ar != 0.0 ? height * _ar : parent.width
anchors.centerIn: parent
receiver: QGroundControl.videoManager.videoReceiver
display: QGroundControl.videoManager.videoReceiver.videoSurface
visible: QGroundControl.videoManager.videoReceiver.videoRunning
receiver: _videoReceiver
display: _videoReceiver && _videoReceiver.videoSurface
visible: _videoReceiver && _videoReceiver.videoRunning
Connections {
target: QGroundControl.videoManager.videoReceiver
target: _videoReceiver
onImageFileChanged: {
videoContent.grabToImage(function(result) {
if (!result.saveToFile(QGroundControl.videoManager.videoReceiver.imageFile)) {
if (!result.saveToFile(_videoReceiver.imageFile)) {
console.error('Error capturing video frame');
}
});
......
......@@ -64,6 +64,7 @@ Item {
readonly property string orbitMessage: qsTr("Orbit the vehicle around the current location.")
readonly property string landAbortMessage: qsTr("Abort the landing sequence.")
readonly property string pauseMessage: qsTr("Pause the vehicle at it's current position.")
readonly property string mvPauseMessage: qsTr("Pause all vehicles at their current position.")
readonly property int actionRTL: 1
readonly property int actionLand: 2
......@@ -81,6 +82,8 @@ Item {
readonly property int actionResumeMission: 14
readonly property int actionResumeMissionReady: 15
readonly property int actionPause: 16
readonly property int actionMVPause: 17
readonly property int actionMVStartMission: 18
property bool showEmergenyStop: !_hideEmergenyStop && _activeVehicle && _vehicleArmed && _vehicleFlying
property bool showArm: _activeVehicle && !_vehicleArmed
......@@ -90,7 +93,7 @@ Item {
property bool showLand: _activeVehicle && _activeVehicle.guidedModeSupported && _vehicleArmed && !_activeVehicle.fixedWing && !_vehicleInLandMode
property bool showStartMission: _activeVehicle && _missionAvailable && !_missionActive && !_vehicleFlying
property bool showContinueMission: _activeVehicle && _missionAvailable && !_missionActive && _vehicleFlying && (_currentMissionIndex < missionController.visualItems.count - 1)
property bool showResumeMission: _activeVehicle && !_vehicleFlying && _missionAvailable && _resumeMissionIndex > 0 && (_resumeMissionIndex < missionController.visualItems.count - 2)
property bool showResumeMission: _activeVehicle && !_vehicleArmed && _vehicleWasFlying && _missionAvailable && _resumeMissionIndex > 0 && (_resumeMissionIndex < missionController.visualItems.count - 2)
property bool showPause: _activeVehicle && _vehicleArmed && _activeVehicle.pauseVehicleSupported && _vehicleFlying && !_vehiclePaused
property bool showChangeAlt: (_activeVehicle && _vehicleFlying) && _activeVehicle.guidedModeSupported && _vehicleArmed && !_missionActive
property bool showOrbit: !_hideOrbit && _activeVehicle && _vehicleFlying && _activeVehicle.orbitModeSupported && _vehicleArmed && !_missionActive
......@@ -114,6 +117,7 @@ Item {
property int _resumeMissionIndex: missionController.resumeMissionIndex
property bool _hideEmergenyStop: !QGroundControl.corePlugin.options.guidedBarShowEmergencyStop
property bool _hideOrbit: !QGroundControl.corePlugin.options.guidedBarShowOrbit
property bool _vehicleWasFlying: false
// This is a temporary hack to debug a problem with RTL and Pause being disabled at the wrong time
......@@ -128,7 +132,6 @@ Item {
Component.onCompleted: _outputState()
on_ActiveVehicleChanged: _outputState()
on_VehicleArmedChanged: _outputState()
on_VehicleFlyingChanged: _outputState()
on_VehicleInRTLModeChanged: _outputState()
on_VehiclePausedChanged: _outputState()
on__FlightModeChanged: _outputState()
......@@ -137,6 +140,15 @@ Item {
// End of hack
on_VehicleFlyingChanged: {
_outputState()
if (!_vehicleFlying) {
// We use _vehicleWasFLying to help trigger Resume Mission only if the vehicle actually flew and came back down.
// Otherwise it may trigger during the Start Mission sequence due to signal ordering or armed and resume mission index.
_vehicleWasFlying = true
}
}
property var _actionData
on_CurrentMissionIndexChanged: console.log("_currentMissionIndex", _currentMissionIndex)
......@@ -186,6 +198,11 @@ Item {
confirmDialog.message = startMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showStartMission })
break;
case actionMVStartMission:
confirmDialog.title = startMissionTitle
confirmDialog.message = startMissionMessage
confirmDialog.hideTrigger = true
break;
case actionContinueMission:
confirmDialog.title = continueMissionTitle
confirmDialog.message = continueMissionMessage
......@@ -242,6 +259,11 @@ Item {
confirmDialog.message = pauseMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showPause })
break;
case actionMVPause:
confirmDialog.title = pauseTitle
confirmDialog.message = mvPauseMessage
confirmDialog.hideTrigger = true
break;
default:
console.warn("Unknown actionCode", actionCode)
return
......@@ -265,12 +287,20 @@ Item {
missionController.resumeMission(missionController.resumeMissionIndex)
break
case actionResumeMissionReady:
_vehicleWasFlying = false
_activeVehicle.startMission()
break
case actionStartMission:
case actionContinueMission:
_activeVehicle.startMission()
break
case actionMVStartMission:
var rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (var i=0; i<rgVehicle.count; i++) {
var vehicle = rgVehicle.get(i)
vehicle.startMission()
}
break
case actionArm:
_activeVehicle.armed = true
break
......@@ -298,6 +328,13 @@ Item {
case actionPause:
_activeVehicle.pauseVehicle()
break
case actionMVPause:
var rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (var i=0; i<rgVehicle.count; i++) {
var vehicle = rgVehicle.get(i)
vehicle.pauseVehicle()
}
break
default:
console.warn(qsTr("Internal error: unknown actionCode"), actionCode)
break
......
......@@ -18,118 +18,163 @@ import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.FlightMap 1.0
QGCListView {
id: missionItemEditorListView
spacing: ScreenTools.defaultFontPixelHeight / 2
orientation: ListView.Vertical
model: QGroundControl.multiVehicleManager.vehicles
cacheBuffer: _cacheBuffer < 0 ? 0 : _cacheBuffer
clip: true
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _cacheBuffer: height * 2
property real _widgetHeight: ScreenTools.defaultFontPixelHeight * 3
delegate: Rectangle {
width: parent.width
height: innerColumn.y + innerColumn.height + _margin
color: qgcPal.missionItemEditor
opacity: 0.8
radius: _margin
property var _vehicle: object
property color _textColor: "black"
QGCPalette { id: qgcPal }
Row {
id: widgetLayout
anchors.margins: _margin
anchors.top: parent.top
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelWidth / 2
layoutDirection: Qt.RightToLeft
QGCCompassWidget {
size: _widgetHeight
vehicle: _vehicle
}
QGCAttitudeWidget {
size: _widgetHeight
vehicle: _vehicle
}
}
Item {
property var guidedActionsController
RowLayout {
anchors.top: widgetLayout.top
anchors.bottom: widgetLayout.bottom
anchors.left: parent.left
anchors.right: widgetLayout.left
spacing: ScreenTools.defaultFontPixelWidth / 2
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _widgetHeight: ScreenTools.defaultFontPixelHeight * 3
property color _textColor: "black"
property real _rectOpacity: 0.8
QGCLabel {
Layout.alignment: Qt.AlignTop
text: _vehicle.id
color: _textColor
}
QGCPalette { id: qgcPal }
FlightModeMenu {
font.pointSize: ScreenTools.largeFontPointSize
color: _textColor
activeVehicle: _vehicle
}
}
NoMouseThroughRectangle {
id: mvCommands
anchors.left: parent.left
anchors.right: parent.right
height: mvCommandsColumn.height + (_margin *2)
color: qgcPal.missionItemEditor
opacity: _rectOpacity
radius: _margin
Column {
id: innerColumn
id: mvCommandsColumn
anchors.margins: _margin
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.top: widgetLayout.bottom
spacing: _margin
Rectangle {
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
height: 5
color: "green"
text: qsTr("The following commands will be applied to all vehicles")
color: _textColor
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
spacing: _margin
QGCButton {
text: "Arm"
visible: !_vehicle.armed
onClicked: _vehicle.armed = true
text: "Pause"
onClicked: guidedActionsController.confirmAction(guidedActionsController.actionMVPause)
}
QGCButton {
text: "Start"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.missionFlightMode
onClicked: _vehicle.flightMode = _vehicle.missionFlightMode
text: "Start Mision"
onClicked: guidedActionsController.confirmAction(guidedActionsController.actionMVStartMission)
}
QGCButton {
text: "Stop"
visible: _vehicle.armed && _vehicle.pauseVehicleSupported
onClicked: _vehicle.pauseVehicle()
}
QGCButton {
text: "RTL"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.rtlFlightMode
onClicked: _vehicle.flightMode = _vehicle.rtlFlightMode
}
QGCButton {
text: "Take control"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.takeControlFlightMode
onClicked: _vehicle.flightMode = _vehicle.takeControlFlightMode
}
}
}
}
} // QGCListView
QGCListView {
id: missionItemEditorListView
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: _margin
anchors.top: mvCommands.bottom
anchors.bottom: parent.bottom
spacing: ScreenTools.defaultFontPixelHeight / 2
orientation: ListView.Vertical
model: QGroundControl.multiVehicleManager.vehicles
cacheBuffer: _cacheBuffer < 0 ? 0 : _cacheBuffer
clip: true
property real _cacheBuffer: height * 2
delegate: Rectangle {
width: parent.width
height: innerColumn.y + innerColumn.height + _margin
color: qgcPal.missionItemEditor
opacity: _rectOpacity
radius: _margin
property var _vehicle: object
ColumnLayout {
id: innerColumn
anchors.margins: _margin
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.left
spacing: _margin
RowLayout {
anchors.left: parent.left
anchors.right: parent.left
QGCLabel {
Layout.alignment: Qt.AlignTop
text: _vehicle.id
color: _textColor
}
ColumnLayout {
Layout.alignment: Qt.AlignCenter
spacing: _margin
FlightModeMenu {
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: ScreenTools.largeFontPointSize
color: _textColor
activeVehicle: _vehicle
}
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
text: _vehicle.armed ? qsTr("Armed") : qsTr("Disarmed")
color: _textColor
}
}
QGCCompassWidget {
size: _widgetHeight
vehicle: _vehicle
}
QGCAttitudeWidget {
size: _widgetHeight
vehicle: _vehicle
}
} // RowLayout
Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCButton {
text: "Arm"
visible: !_vehicle.armed
onClicked: _vehicle.armed = true
}
QGCButton {
text: "Start Mission"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.missionFlightMode
onClicked: _vehicle.startMission()
}
QGCButton {
text: "Pause"
visible: _vehicle.armed && _vehicle.pauseVehicleSupported
onClicked: _vehicle.pauseVehicle()
}
QGCButton {
text: "RTL"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.rtlFlightMode
onClicked: _vehicle.flightMode = _vehicle.rtlFlightMode
}
QGCButton {
text: "Take control"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.takeControlFlightMode