@ -29,11 +29,19 @@ Item {
property bool gotoEnabled: _activeVehicle && _activeVehicle . guidedMode && _activeVehicle . flying
property bool gotoEnabled: _activeVehicle && _activeVehicle . guidedMode && _activeVehicle . flying
property var qgcView
property var qgcView
property bool useLightColors
property bool useLightColors
property var missionController
property var _activeVehicle : QGroundControl . multiVehicleManager . activeVehicle
property var _activeVehicle : QGroundControl . multiVehicleManager . activeVehicle
property bool _isSatellite : _mainIsMap ? ( _flightMap ? _flightMap . isSatelliteMap : true ) : true
property bool _isSatellite : _mainIsMap ? ( _flightMap ? _flightMap . isSatelliteMap : true ) : true
property bool _lightWidgetBorders : _isSatellite
property bool _lightWidgetBorders : _isSatellite
/ / G u i d e d b a r p r o p e r t i e s
property bool _missionAvailable : missionController . containsItems
property bool _missionActive : _activeVehicle ? _activeVehicle . flightMode === _activeVehicle . missionFlightMode : false
property bool _missionInProgress : missionController . missionInProgress
property bool _showEmergenyStop : QGroundControl . corePlugin . options . guidedBarShowEmergencyStop
property bool _showOrbit : QGroundControl . corePlugin . options . guidedBarShowOrbit
readonly property real _margins : ScreenTools . defaultFontPixelHeight * 0.5
readonly property real _margins : ScreenTools . defaultFontPixelHeight * 0.5
QGCMapPalette { id: mapPal ; lightColors: useLightColors }
QGCMapPalette { id: mapPal ; lightColors: useLightColors }
@ -222,6 +230,8 @@ Item {
readonly property int confirmRetask: 9
readonly property int confirmRetask: 9
readonly property int confirmOrbit: 10
readonly property int confirmOrbit: 10
readonly property int confirmAbort: 11
readonly property int confirmAbort: 11
readonly property int confirmStartMission: 12
readonly property int confirmResumeMission: 13
property int confirmActionCode
property int confirmActionCode
property real _showMargin : _margins
property real _showMargin : _margins
@ -237,10 +247,11 @@ Item {
_activeVehicle . guidedModeLand ( )
_activeVehicle . guidedModeLand ( )
break ;
break ;
case confirmTakeoff:
case confirmTakeoff:
var altitude1 = altitudeSlider . getValue ( )
_activeVehicle . guidedModeTakeoff ( )
if ( ! isNaN ( altitude1 ) ) {
break ;
_activeVehicle . guidedModeTakeoff ( altitude1 )
case confirmResumeMission:
}
case confirmStartMission:
_activeVehicle . startMission ( )
break ;
break ;
case confirmArm:
case confirmArm:
_activeVehicle . armed = true
_activeVehicle . armed = true
@ -299,10 +310,14 @@ Item {
guidedModeConfirm . confirmText = qsTr ( "STOP ALL MOTORS!" )
guidedModeConfirm . confirmText = qsTr ( "STOP ALL MOTORS!" )
break ;
break ;
case confirmTakeoff:
case confirmTakeoff:
altitudeSlider . visible = true
altitudeSlider . setInitialValueMeters ( 3 )
guidedModeConfirm . confirmText = qsTr ( "takeoff" )
guidedModeConfirm . confirmText = qsTr ( "takeoff" )
break ;
break ;
case confirmStartMission:
guidedModeConfirm . confirmText = qsTr ( "start mission" )
break ;
case confirmResumeMission:
guidedModeConfirm . confirmText = qsTr ( "resume mission" )
break ;
case confirmLand:
case confirmLand:
guidedModeConfirm . confirmText = qsTr ( "land" )
guidedModeConfirm . confirmText = qsTr ( "land" )
break ;
break ;
@ -350,33 +365,58 @@ Item {
QGCButton {
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
pointSize: _guidedModeBar . _fontPointSize
text: ( _activeVehicle && _activeVehicle . armed ) ? ( _activeVehicle . flying ? qsTr ( "Emergency Stop" ) : qsTr ( "Disarm" ) ) : qsTr ( "Arm" )
text: qsTr ( "Emergency Stop" )
visible: _activeVehicle
visible: _showEmergenyStop && _activeVehicle && _activeVehicle . armed && _activeVehicle . flying
onClicked: _guidedModeBar . confirmAction ( _activeVehicle . armed ? ( _activeVehicle . flying ? _guidedModeBar . confirmEmergencyStop : _guidedModeBar . confirmDisarm ) : _guidedModeBar . confirmArm )
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmEmergencyStop )
}
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
text: qsTr ( "Disarm" )
visible: _activeVehicle && _activeVehicle . armed && ! _activeVehicle . flying
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmDisarm )
}
}
QGCButton {
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
pointSize: _guidedModeBar . _fontPointSize
text: qsTr ( "RTL" )
text: qsTr ( "RTL" )
visible: ( _activeVehicle && _activeVehicle . armed ) && _activeVehicle . guidedModeSupported && _activeVehicle . flying
visible: _activeVehicle && _activeVehicle . armed && _activeVehicle . guidedModeSupported && _activeVehicle . flying
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmHome )
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmHome )
}
}
QGCButton {
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
pointSize: _guidedModeBar . _fontPointSize
text: ( _activeVehicle && _activeVehicle . flying ) ? qsTr ( "Land" ) : qsTr ( "Takeoff" )
text: qsTr ( "Takeoff" )
visible: _activeVehicle && _activeVehicle . guidedModeSupported && _activeVehicle . armed
visible: _activeVehicle && _activeVehicle . guidedModeSupported && ! _activeVehicle . flying && ! _activeVehicle . fixedWing
onClicked: _guidedModeBar . confirmAction ( _activeVehicle . flying ? _guidedModeBar . confirmLand : _guidedModeBar . confirmTakeoff )
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmTakeoff )
}
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
text: qsTr ( "Land" )
visible: _activeVehicle && _activeVehicle . guidedModeSupported && _activeVehicle . armed && ! _activeVehicle . fixedWing
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmLand )
}
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
text: qsTr ( "Start Mission" )
visible: _activeVehicle && ! _activeVehicle . flying && _missionAvailable
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmStartMission )
}
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
text: qsTr ( "Resume Mission" )
visible: _activeVehicle && _activeVehicle . guidedModeSupported && ! _activeVehicle . flying && _missionAvailable && _missionInProgress
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmResumeMission )
}
}
QGCButton {
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
pointSize: _guidedModeBar . _fontPointSize
text: qsTr ( "Pause" )
text: _missionActive ? qsTr ( "Pause Mission" ) : qsTr ( "Pause" )
visible: ( _activeVehicle && _activeVehicle . armed ) && _activeVehicle . pauseVehicleSupported && _activeVehicle . flying
visible: _activeVehicle && _activeVehicle . armed && _activeVehicle . pauseVehicleSupported && _activeVehicle . flying
onClicked: {
onClicked: _activeVehicle . pauseVehicle ( )
guidedModeHideTimer . restart ( )
_activeVehicle . pauseVehicle ( )
}
}
}
QGCButton {
QGCButton {
@ -389,7 +429,7 @@ Item {
QGCButton {
QGCButton {
pointSize: _guidedModeBar . _fontPointSize
pointSize: _guidedModeBar . _fontPointSize
text: qsTr ( "Orbit" )
text: qsTr ( "Orbit" )
visible: ( _activeVehicle && _activeVehicle . flying ) && _activeVehicle . orbitModeSupported && _activeVehicle . armed
visible: _showOrbit && _activeVehicle && _activeVehicle . flying && _activeVehicle . orbitModeSupported && _activeVehicle . armed
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmOrbit )
onClicked: _guidedModeBar . confirmAction ( _guidedModeBar . confirmOrbit )
}
}