@ -37,9 +37,8 @@ Item {
@@ -37,9 +37,8 @@ Item {
Component.onCompleted: start ( true /* flyView */ )
}
property alias guidedController: guidedActionsController
property bool activeVehicleJoystickEnabled: activeVehicle ? activeVehicle.joystickEnabled : false
property alias guidedController: guidedActionsController
property bool activeVehicleJoystickEnabled: activeVehicle ? activeVehicle.joystickEnabled : false
property var _missionController : planMasterController . missionController
property var _geoFenceController : planMasterController . geoFenceController
@ -49,7 +48,7 @@ Item {
@@ -49,7 +48,7 @@ Item {
property bool _useChecklist : QGroundControl . settingsManager . appSettings . useChecklist . rawValue
property real _savedZoomLevel : 0
property real _margins : ScreenTools . defaultFontPixelWidth / 2
property real _pipSize : flightVie w. width * 0.2
property real _pipSize : mainWindo w. width * 0.2
property alias _guidedController : guidedActionsController
property alias _altitudeSlider : altitudeSlider
@ -116,6 +115,20 @@ Item {
@@ -116,6 +115,20 @@ Item {
onResumeMissionUploadFail: guidedActionsController . confirmAction ( guidedActionsController . actionResumeMissionUploadFail )
}
Connections {
target: mainWindow
onArmVehicle: guidedController . confirmAction ( guidedController . actionArm )
onDisarmVehicle: {
if ( guidedController . showEmergenyStop ) {
guidedController . confirmAction ( guidedController . actionEmergencyStop )
} else {
guidedController . confirmAction ( guidedController . actionDisarm )
}
}
onVtolTransitionToFwdFlight: guidedController . confirmAction ( guidedController . actionVtolTransitionToFwdFlight )
onVtolTransitionToMRFlight: guidedController . confirmAction ( guidedController . actionVtolTransitionToMRFlight )
}
Component.onCompleted: {
setStates ( )
if ( QGroundControl . corePlugin . options . flyViewOverlay . toString ( ) . length ) {
@ -254,8 +267,8 @@ Item {
@@ -254,8 +267,8 @@ Item {
Window {
id: videoWindow
width: ! _mainIsMap ? _panel . width : _pipSize
height: ! _mainIsMap ? _panel . height : _pipSize * ( 9 / 16 )
width: ! _mainIsMap ? _mapAndVideo . width : _pipSize
height: ! _mainIsMap ? _mapAndVideo . height : _pipSize * ( 9 / 16 )
visible: false
Item {
@ -289,20 +302,18 @@ Item {
@@ -289,20 +302,18 @@ Item {
QGCMapPalette { id: mapPal ; lightColors: _mainIsMap ? _flightMap . isSatelliteMap : true }
Item {
id: _panel
id: _mapAndVideo
anchors.fill: parent
/ / - - M a p V i e w
/ / F o r w h a t e v e r r e a s o n , i f F l i g h t D i s p l a y V i e w M a p i s t h e _ p a n e l i t e m , c h a n g i n g
/ / w i d t h / h e i g h t h a s n o e f f e c t .
Item {
id: _flightMapContainer
z: _mainIsMap ? _panel . z + 1 : _panel . z + 2
anchors.left: _panel . left
anchors.bottom: _panel . bottom
z: _mainIsMap ? _mapAndVideo . z + 1 : _mapAndVideo . z + 2
anchors.left: _mapAndVideo . left
anchors.bottom: _mapAndVideo . bottom
visible: _mainIsMap || _isPipVisible && ! QGroundControl . videoManager . fullScreen
width: _mainIsMap ? _panel . width : _pipSize
height: _mainIsMap ? _panel . height : _pipSize * ( 9 / 16 )
width: _mainIsMap ? _mapAndVideo . width : _pipSize
height: _mainIsMap ? _mapAndVideo . height : _pipSize * ( 9 / 16 )
states: [
State {
name: "pipMode"
@ -333,11 +344,11 @@ Item {
@@ -333,11 +344,11 @@ Item {
/ / - - V i d e o V i e w
Item {
id: _flightVideo
z: _mainIsMap ? _panel . z + 2 : _panel . z + 1
width: ! _mainIsMap ? _panel . width : _pipSize
height: ! _mainIsMap ? _panel . height : _pipSize * ( 9 / 16 )
anchors.left: _panel . left
anchors.bottom: _panel . bottom
z: _mainIsMap ? _mapAndVideo . z + 2 : _mapAndVideo . z + 1
width: ! _mainIsMap ? _mapAndVideo . width : _pipSize
height: ! _mainIsMap ? _mapAndVideo . height : _pipSize * ( 9 / 16 )
anchors.left: _mapAndVideo . left
anchors.bottom: _mapAndVideo . bottom
visible: QGroundControl . videoManager . hasVideo && ( ! _mainIsMap || _isPipVisible )
onParentChanged: {
@ -345,10 +356,10 @@ Item {
@@ -345,10 +356,10 @@ Item {
* correct anchors .
* Such thing is not possible with ParentChange .
* /
if ( parent == _panel ) {
if ( parent == _mapAndVideo ) {
/ / D o a n c h o r s a g a i n a f t e r p o p u p
anchors . left = _panel . left
anchors . bottom = _panel . bottom
anchors . left = _mapAndVideo . left
anchors . bottom = _mapAndVideo . bottom
anchors . margins = ScreenTools . defaultFontPixelHeight
}
}
@ -412,7 +423,7 @@ Item {
@@ -412,7 +423,7 @@ Item {
}
ParentChange {
target: _flightVideo
parent: _panel
parent: _mapAndVideo
}
PropertyChanges {
target: _flightVideoPipControl
@ -440,8 +451,8 @@ Item {
@@ -440,8 +451,8 @@ Item {
z: _flightVideo . z + 3
width: _pipSize
height: _pipSize * ( 9 / 16 )
anchors.left: _panel . left
anchors.bottom: _panel . bottom
anchors.left: _mapAndVideo . left
anchors.bottom: _mapAndVideo . bottom
anchors.margins: ScreenTools . defaultFontPixelHeight
visible: QGroundControl . videoManager . hasVideo && ! QGroundControl . videoManager . fullScreen && _flightVideo . state != "popup"
isHidden: ! _isPipVisible
@ -470,7 +481,7 @@ Item {
@@ -470,7 +481,7 @@ Item {
anchors.right: parent . right
anchors.top: parent . top
spacing: ScreenTools . defaultFontPixelWidth
z: _panel . z + 4
z: _mapAndVideo . z + 4
visible: QGroundControl . multiVehicleManager . vehicles . count > 1
ExclusiveGroup { id: multiVehicleSelectorGroup }
@ -492,8 +503,8 @@ Item {
@@ -492,8 +503,8 @@ Item {
FlightDisplayViewWidgets {
id: flightDisplayViewWidgets
z: _panel . z + 4
height: ScreenTools . availableHeight - ( singleMultiSelector . visible ? singleMultiSelector . height + _margins : 0 )
z: _mapAndVideo . z + 4
height: availableHeight - ( singleMultiSelector . visible ? singleMultiSelector . height + _margins : 0 ) - ( ScreenTools . defaultFontPixelHeight * 0.5 )
anchors.left: parent . left
anchors.right: altitudeSlider . visible ? altitudeSlider.left : parent . right
anchors.bottom: parent . bottom
@ -508,7 +519,7 @@ Item {
@@ -508,7 +519,7 @@ Item {
id: flyViewOverlay
z: flightDisplayViewWidgets . z + 1
visible: ! QGroundControl . videoManager . fullScreen
height: ScreenTools . availableH eight
height: mainWindow . h eight
anchors.left: parent . left
anchors.right: altitudeSlider . visible ? altitudeSlider.left : parent . right
anchors.bottom: parent . bottom
@ -521,16 +532,16 @@ Item {
@@ -521,16 +532,16 @@ Item {
anchors.bottom: parent . bottom
width: ScreenTools . defaultFontPixelWidth * 30
visible: ! singleVehicleView . checked && ! QGroundControl . videoManager . fullScreen
z: _panel . z + 4
z: _mapAndVideo . z + 4
guidedActionsController: _guidedController
}
/ / - - V i r t u a l J o y s t i c k
Loader {
id: virtualJoystickMultiTouch
z: _panel . z + 5
z: _mapAndVideo . z + 5
width: parent . width - ( _flightVideoPipControl . width / 2 )
height: Math . min ( ScreenTools . availableH eight * 0.25 , ScreenTools . defaultFontPixelWidth * 16 )
height: Math . min ( mainWindow . h eight * 0.25 , ScreenTools . defaultFontPixelWidth * 16 )
visible: ( _virtualJoystick ? _virtualJoystick . value : false ) && ! QGroundControl . videoManager . fullScreen && ! ( activeVehicle ? activeVehicle.highLatencyLink : false )
anchors.bottom: _flightVideoPipControl . top
anchors.bottomMargin: ScreenTools . defaultFontPixelHeight * 2
@ -547,12 +558,12 @@ Item {
@@ -547,12 +558,12 @@ Item {
visible: ( activeVehicle ? activeVehicle.guidedModeSupported : true ) && ! QGroundControl . videoManager . fullScreen
id: toolStrip
anchors.leftMargin: isInstrumentRight ( ) ? ScreenTools.defaultFontPixelWidth : undefined
anchors.left: isInstrumentRight ( ) ? _panel . left : undefined
anchors.left: isInstrumentRight ( ) ? _mapAndVideo . left : undefined
anchors.rightMargin: isInstrumentRight ( ) ? undefined : ScreenTools . defaultFontPixelWidth
anchors.right: isInstrumentRight ( ) ? undefined : _panel . right
anchors.right: isInstrumentRight ( ) ? undefined : _mapAndVideo . right
anchors.topMargin: ScreenTools . toolbarHeight + ( _margins * 2 )
anchors.top: _panel . top
z: _panel . z + 4
anchors.top: _mapAndVideo . top
z: _mapAndVideo . z + 4
title: qsTr ( "Fly" )
maxHeight: ( _flightVideo . visible ? _flightVideo . y : parent . height ) - toolStrip . y
buttonVisible: [ _useChecklist , _guidedController . showTakeoff || ! _guidedController . showLand , _guidedController . showLand && ! _guidedController . showTakeoff , true , true , true ]