Commit c3fba6e8 authored by Patrick José Pereira's avatar Patrick José Pereira

JoystickThumbPad: Add center variable to control Y throttle behaviour

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent d20bd666
......@@ -11,15 +11,14 @@ Item {
property real xAxis: 0 ///< Value range [-1,1], negative values left stick, positive values right stick
property real yAxis: 0 ///< Value range [-1,1], negative values up stick, positive values down stick
property bool yAxisThrottle: false ///< true: yAxis used for throttle, range [1,0], positive value are stick up
property bool yAxisThrottleCentered: false ///< false: center yAxis in throttle for reverser and forward
property real xPositionDelta: 0 ///< Amount to move the control on x axis
property real yPositionDelta: 0 ///< Amount to move the control on y axis
property bool throttle: false
property real _centerXY: width / 2
property bool _processTouchPoints: false
property bool _stickCenteredOnce: false
property real stickPositionX: _centerXY
property real stickPositionY: yAxisThrottle ? height : _centerXY
property real stickPositionY: yAxisThrottleCentered ? _centerXY : height
QGCMapPalette { id: mapPal }
......@@ -50,7 +49,7 @@ Item {
// Center sticks
stickPositionX = _centerXY
if (!yAxisThrottle) {
if (yAxisThrottleCentered) {
stickPositionY = _centerXY
}
}
......@@ -86,7 +85,7 @@ Item {
QGCColoredImage {
color: lightColors ? "white" : "black"
visible: throttle
visible: yAxisThrottle
height: ScreenTools.defaultFontPixelHeight
width: height
sourceSize.height: height
......@@ -100,7 +99,7 @@ Item {
QGCColoredImage {
color: lightColors ? "white" : "black"
visible: throttle
visible: yAxisThrottle
height: ScreenTools.defaultFontPixelHeight
width: height
sourceSize.height: height
......@@ -114,7 +113,7 @@ Item {
QGCColoredImage {
color: lightColors ? "white" : "black"
visible: throttle
visible: yAxisThrottle
height: ScreenTools.defaultFontPixelHeight
width: height
sourceSize.height: height
......@@ -128,7 +127,7 @@ Item {
QGCColoredImage {
color: lightColors ? "white" : "black"
visible: throttle
visible: yAxisThrottle
height: ScreenTools.defaultFontPixelHeight
width: height
sourceSize.height: height
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment