diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc
index 8337a07..de86f8a 100644
--- a/qgroundcontrol.qrc
+++ b/qgroundcontrol.qrc
@@ -88,11 +88,13 @@
src/FactSystem/FactControls/FactPanel.qml
src/FactSystem/FactControls/FactTextField.qml
src/FactSystem/FactControls/qmldir
+
+ src/FlightDisplay/qmldir
src/FlightDisplay/FlightDisplayView.qml
src/FlightDisplay/FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewVideo.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
- src/FlightDisplay/qmldir
+ src/FlightDisplay/VirtualJoystick.qml
src/FlightMap/qmldir
src/FlightMap/FlightMap.qml
diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml
index 764b89c..8a7c397 100644
--- a/src/FlightDisplay/FlightDisplayView.qml
+++ b/src/FlightDisplay/FlightDisplayView.qml
@@ -231,58 +231,25 @@ QGCView {
anchors.left: parent.left
anchors.bottom: parent.bottom
height: availableHeight
+ asynchronous: true
+ visible: status == Loader.Ready
+
property bool isBackgroundDark: root.isBackgroundDark
property var qgcView: root
}
//-- Virtual Joystick
- Item {
+ Loader {
id: multiTouchItem
z: _panel.z + 5
width: parent.width - (_flightVideoPipControl.width / 2)
- height: thumbAreaHeight
+ height: Math.min(parent.height * 0.25, ScreenTools.defaultFontPixelWidth * 16)
visible: QGroundControl.virtualTabletJoystick
anchors.bottom: _flightVideoPipControl.top
anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 2
anchors.horizontalCenter: parent.horizontalCenter
-
- readonly property real thumbAreaHeight: Math.min(parent.height * 0.25, ScreenTools.defaultFontPixelWidth * 16)
-
- QGCMapPalette { id: mapPal; lightColors: !isBackgroundDark }
-
- Timer {
- interval: 40 // 25Hz, same as real joystick rate
- running: QGroundControl.virtualTabletJoystick && _activeVehicle
- repeat: true
- onTriggered: {
- if (_activeVehicle) {
- _activeVehicle.virtualTabletJoystickValue(rightStick.xAxis, rightStick.yAxis, leftStick.xAxis, leftStick.yAxis)
- }
- }
- }
-
- JoystickThumbPad {
- id: leftStick
- anchors.leftMargin: xPositionDelta
- anchors.bottomMargin: -yPositionDelta
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- width: parent.thumbAreaHeight
- height: parent.thumbAreaHeight
- yAxisThrottle: true
- lightColors: !isBackgroundDark
- }
-
- JoystickThumbPad {
- id: rightStick
- anchors.rightMargin: -xPositionDelta
- anchors.bottomMargin: -yPositionDelta
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- width: parent.thumbAreaHeight
- height: parent.thumbAreaHeight
- lightColors: !isBackgroundDark
- }
+ source: "qrc:/qml/VirtualJoystick.qml"
+ active: QGroundControl.virtualTabletJoystick
}
}
}
diff --git a/src/FlightDisplay/VirtualJoystick.qml b/src/FlightDisplay/VirtualJoystick.qml
new file mode 100644
index 0000000..bad2fbc
--- /dev/null
+++ b/src/FlightDisplay/VirtualJoystick.qml
@@ -0,0 +1,68 @@
+/*=====================================================================
+
+QGroundControl Open Source Ground Control Station
+
+(c) 2009, 2015 QGROUNDCONTROL PROJECT
+
+This file is part of the QGROUNDCONTROL project
+
+ QGROUNDCONTROL is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ QGROUNDCONTROL is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with QGROUNDCONTROL. If not, see .
+
+======================================================================*/
+
+import QtQuick 2.5
+
+import QGroundControl 1.0
+import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls 1.0
+import QGroundControl.Palette 1.0
+import QGroundControl.Vehicle 1.0
+
+Item {
+ QGCMapPalette { id: mapPal; lightColors: !isBackgroundDark }
+
+ Timer {
+ interval: 40 // 25Hz, same as real joystick rate
+ running: QGroundControl.virtualTabletJoystick && _activeVehicle
+ repeat: true
+ onTriggered: {
+ if (_activeVehicle) {
+ _activeVehicle.virtualTabletJoystickValue(rightStick.xAxis, rightStick.yAxis, leftStick.xAxis, leftStick.yAxis)
+ }
+ }
+ }
+
+ JoystickThumbPad {
+ id: leftStick
+ anchors.leftMargin: xPositionDelta
+ anchors.bottomMargin: -yPositionDelta
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ width: parent.height
+ height: parent.height
+ yAxisThrottle: true
+ lightColors: !isBackgroundDark
+ }
+
+ JoystickThumbPad {
+ id: rightStick
+ anchors.rightMargin: -xPositionDelta
+ anchors.bottomMargin: -yPositionDelta
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ width: parent.height
+ height: parent.height
+ lightColors: !isBackgroundDark
+ }
+}