@ -15,19 +15,21 @@ import QtLocation 5.3
@@ -15,19 +15,21 @@ import QtLocation 5.3
import QtPositioning 5.3
import QtQuick . Layouts 1.2
import QGroundControl 1.0
import QGroundControl . ScreenTools 1.0
import QGroundControl . Controls 1.0
import QGroundControl . Palette 1.0
import QGroundControl . Vehicle 1.0
import QGroundControl . FlightMap 1.0
import QGroundControl 1.0
import QGroundControl . ScreenTools 1.0
import QGroundControl . Controls 1.0
import QGroundControl . Palette 1.0
import QGroundControl . Vehicle 1.0
import QGroundControl . FlightMap 1.0
import QGroundControl . Airmap 1.0
Item {
id: _r oot
id: widgetR oot
property var qgcView
property bool useLightColors
property var missionController
property bool showValues: true
property var _activeVehicle : QGroundControl . multiVehicleManager . activeVehicle
property bool _isSatellite : _mainIsMap ? ( _flightMap ? _flightMap . isSatelliteMap : true ) : true
@ -51,28 +53,14 @@ Item {
@@ -51,28 +53,14 @@ Item {
if ( QGroundControl . corePlugin . options . instrumentWidget ) {
if ( QGroundControl . corePlugin . options . instrumentWidget . source . toString ( ) . length ) {
instrumentsLoader . source = QGroundControl . corePlugin . options . instrumentWidget . source
switch ( QGroundControl . corePlugin . options . instrumentWidget . widgetPosition ) {
case CustomInstrumentWidget.POS_TOP_RIGHT:
instrumentsLoader . state = "topMode"
break ;
case CustomInstrumentWidget.POS_BOTTOM_RIGHT:
instrumentsLoader . state = "bottomMode"
break ;
case CustomInstrumentWidget.POS_CENTER_RIGHT:
default:
instrumentsLoader . state = "centerMode"
break ;
}
} else {
/ / N o t e : W e c u r r e n t l y s h o w a l t e r n a t e i n s t r u m e n t s a l l t h e t i m e . T h i s i s a t r i a l c h a n g e f o r d a i l y b u i l d s .
/ / L e a v i n g n o n - a l t e r n a t e c o d e i n f o r n o w i n c a s e t h e t r i a l f a i l s .
var useAlternateInstruments = true / / Q G r o u n d C o n t r o l . s e t t i n g s M a n a g e r . a p p S e t t i n g s . v i r t u a l J o y s t i c k . v a l u e | | S c r e e n T o o l s . i s T i n y S c r e e n
if ( useAlternateInstruments ) {
instrumentsLoader . source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml"
instrumentsLoader . state = "topMode"
} else {
instrumentsLoader . source = "qrc:/qml/QGCInstrumentWidget.qml"
instrumentsLoader . state = QGroundControl . settingsManager . appSettings . showLargeCompass . value == 1 ? "centerMode" : "topMode"
}
}
} else {
@ -130,43 +118,30 @@ Item {
@@ -130,43 +118,30 @@ Item {
text: "The vehicle has failed a pre-arm check. In order to arm the vehicle, resolve the failure or disable the arming check via the Safety tab on the Vehicle Setup page."
}
}
/ / - - I n s t r u m e n t P a n e l
Loader {
id: instrumentsLoader
anchors.margins: ScreenTools . defaultFontPixelHeight / 2
Column {
id: instrumentsColumn
spacing: ScreenTools . defaultFontPixelHeight * 0.25
anchors.top: parent . top
anchors.topMargin: QGroundControl . corePlugin . options . instrumentWidget . widgetTopMargin + ( ScreenTools . defaultFontPixelHeight * 0.5 )
anchors.margins: ScreenTools . defaultFontPixelHeight * 0.5
anchors.right: parent . right
z: QGroundControl . zOrderWidgets
property var qgcView: _root . qgcView
property real maxHeight: parent . height - ( anchors . margins * 2 )
states: [
State {
name: "topMode"
AnchorChanges {
target: instrumentsLoader
anchors.verticalCenter: undefined
anchors.bottom: undefined
anchors.top: _root ? _root . top : undefined
}
} ,
State {
name: "centerMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.bottom: undefined
anchors.verticalCenter: _root ? _root . verticalCenter : undefined
}
} ,
State {
name: "bottomMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.verticalCenter: undefined
anchors.bottom: _root ? _root . bottom : undefined
}
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / A i r m a p A i r s p a c e C o n t r o l
AirspaceControl {
id: airspaceControl
width: getPreferredInstrumentWidth ( )
anchors.margins: ScreenTools . defaultFontPixelHeight * 0.5
onColapsedChanged: {
widgetRoot . showValues = colapsed
}
]
}
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - I n s t r u m e n t P a n e l
Loader {
id: instrumentsLoader
anchors.margins: ScreenTools . defaultFontPixelHeight * 0.5
property var qgcView: widgetRoot . qgcView
property real maxHeight: widgetRoot ? widgetRoot . height - instrumentsColumn . y - airspaceControl . height - ( ScreenTools . defaultFontPixelHeight * 4 ) : 0
}
}
}