Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
1723a2d2
Commit
1723a2d2
authored
Mar 24, 2017
by
Don Gagne
Committed by
GitHub
Mar 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4845 from DonLakeFlyer/ClickToSetNewMissionItem
Fly: Click to set new mission item
parents
34b4f681
161607d8
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
44 additions
and
559 deletions
+44
-559
qgroundcontrol.qrc
qgroundcontrol.qrc
+0
-2
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+6
-1
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+1
-1
FWLandingPatternMapVisual.qml
src/MissionEditor/FWLandingPatternMapVisual.qml
+6
-2
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+7
-2
MissionItemMapVisual.qml
src/MissionEditor/MissionItemMapVisual.qml
+4
-1
MissionSettingsMapVisual.qml
src/MissionEditor/MissionSettingsMapVisual.qml
+6
-2
SimpleItemMapVisual.qml
src/MissionEditor/SimpleItemMapVisual.qml
+5
-2
SurveyMapVisual.qml
src/MissionEditor/SurveyMapVisual.qml
+8
-8
MissionController.cc
src/MissionManager/MissionController.cc
+1
-0
MultiVehicleView.qml
src/MultiVehicle/MultiVehicleView.qml
+0
-268
GuidedBar.qml
src/QmlControls/GuidedBar.qml
+0
-269
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+0
-1
No files found.
qgroundcontrol.qrc
View file @
1723a2d2
...
...
@@ -40,7 +40,6 @@
<file alias="MixersComponent.qml">src/AutoPilotPlugins/Common/MixersComponent.qml</file>
<file alias="MockLink.qml">src/ui/preferences/MockLink.qml</file>
<file alias="MockLinkSettings.qml">src/ui/preferences/MockLinkSettings.qml</file>
<file alias="MultiVehicleView.qml">src/MultiVehicle/MultiVehicleView.qml</file>
<file alias="MotorComponent.qml">src/AutoPilotPlugins/Common/MotorComponent.qml</file>
<file alias="OfflineMap.qml">src/QtLocationPlugin/QMLControl/OfflineMap.qml</file>
<file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file>
...
...
@@ -58,7 +57,6 @@
<file alias="QGroundControl/Controls/FWLandingPatternMapVisual.qml">src/MissionEditor/FWLandingPatternMapVisual.qml</file>
<file alias="QGroundControl/Controls/GeoFenceEditor.qml">src/MissionEditor/GeoFenceEditor.qml</file>
<file alias="QGroundControl/Controls/GeoFenceMapVisuals.qml">src/MissionEditor/GeoFenceMapVisuals.qml</file>
<file alias="QGroundControl/Controls/GuidedBar.qml">src/QmlControls/GuidedBar.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/JoystickThumbPad.qml">src/QmlControls/JoystickThumbPad.qml</file>
<file alias="QGroundControl/Controls/MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
1723a2d2
...
...
@@ -257,7 +257,12 @@ FlightMap {
model
:
_mainIsMap
?
missionController
.
visualItems
:
0
delegate
:
MissionItemMapVisual
{
map
:
flightMap
map
:
flightMap
onClicked
:
{
_retaskSequence
=
object
.
sequenceNumber
flightWidgets
.
guidedModeBar
.
confirmAction
(
parent
.
flightWidgets
.
guidedModeBar
.
confirmRetask
)
}
}
}
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
1723a2d2
...
...
@@ -318,7 +318,7 @@ Item {
guidedModeConfirm
.
confirmText
=
qsTr
(
"
move vehicle
"
)
break
;
case
confirmRetask
:
guidedModeConfirm
.
confirmText
=
qsTr
(
"
active waypoint change
"
)
guidedModeConfirm
.
confirmText
=
qsTr
(
"
activ
at
e waypoint change
"
)
break
;
case
confirmOrbit
:
guidedModeConfirm
.
confirmText
=
qsTr
(
"
enter orbit mode
"
)
...
...
src/MissionEditor/FWLandingPatternMapVisual.qml
View file @
1723a2d2
...
...
@@ -20,8 +20,12 @@ import QGroundControl.FlightMap 1.0
/// Fixed Wing Landing Pattern map visuals
Item
{
id
:
_root
property
var
map
///< Map control to place item in
signal
clicked
(
int
sequenceNumber
)
property
var
_missionItem
:
object
property
var
_itemVisuals
:
[
]
property
var
_mouseArea
...
...
@@ -208,7 +212,7 @@ Item {
label
:
"
Loiter
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
setCurrentItem
(
_missionItem
.
sequenceNumber
)
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
...
...
@@ -243,7 +247,7 @@ Item {
label
:
"
Land
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
setCurrentItem
(
_missionItem
.
sequenceNumber
)
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
...
...
src/MissionEditor/MissionEditor.qml
View file @
1723a2d2
...
...
@@ -49,7 +49,7 @@ QGCView {
property
var
activeVehiclePosition
:
_activeVehicle
?
_activeVehicle
.
coordinate
:
QtPositioning
.
coordinate
()
property
bool
_lightWidgetBorders
:
editorMap
.
isSatelliteMap
property
bool
_addWaypointOnClick
:
false
property
bool
_singleComplexItem
:
missionController
.
complexMissionItemNames
.
length
==
1
property
bool
_singleComplexItem
:
missionController
.
complexMissionItemNames
.
length
==
=
1
/// The controller which should be called for load/save, send to/from vehicle calls
property
var
_syncDropDownController
:
missionController
...
...
@@ -459,7 +459,8 @@ QGCView {
model
:
missionController
.
visualItems
delegate
:
MissionItemMapVisual
{
map
:
editorMap
map
:
editorMap
onClicked
:
setCurrentItem
(
sequenceNumber
)
}
}
...
...
@@ -702,6 +703,10 @@ QGCView {
property
bool
_showZoom
:
!
ScreenTools
.
isMobile
property
bool
mySingleComplexItem
:
_singleComplexItem
onMySingleComplexItemChanged
:
console
.
log
(
model
[
1
].
dropPanelComponent
)
model
:
[
{
name
:
"
Waypoint
"
,
...
...
src/MissionEditor/MissionItemMapVisual.qml
View file @
1723a2d2
...
...
@@ -17,12 +17,14 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
Controls
1.0
/// Mission item
edit contro
l
/// Mission item
map visua
l
Item
{
id
:
_root
property
var
map
///< Map control to place item in
signal
clicked
(
int
sequenceNumber
)
property
var
_visualItem
Component.onCompleted
:
{
...
...
@@ -32,6 +34,7 @@ Item {
console
.
log
(
"
Error loading Qml:
"
,
object
.
mapVisualQML
,
component
.
errorString
())
}
_visualItem
=
component
.
createObject
(
map
,
{
"
map
"
:
_root
.
map
})
_visualItem
.
clicked
.
connect
(
_root
.
clicked
)
}
}
...
...
src/MissionEditor/MissionSettingsMapVisual.qml
View file @
1723a2d2
...
...
@@ -20,8 +20,12 @@ import QGroundControl.FlightMap 1.0
/// Mission Settings map visuals
Item
{
id
:
_root
property
var
map
///< Map control to place item in
signal
clicked
(
int
sequenceNumber
)
property
var
_missionItem
:
object
property
var
_itemVisual
property
var
_dragArea
...
...
@@ -103,7 +107,7 @@ Item {
z
:
QGroundControl
.
zOrderMapItems
missionItem
:
_missionItem
onClicked
:
setCurrentItem
(
_missionItem
.
sequenceNumber
)
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
// These are the non-coordinate child mission items attached to this item
Row
{
...
...
@@ -119,7 +123,7 @@ Item {
z
:
2
specifiesCoordinate
:
false
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
onClicked
:
_root
.
Clicked
(
object
.
sequenceNumber
)
}
}
}
...
...
src/MissionEditor/SimpleItemMapVisual.qml
View file @
1723a2d2
...
...
@@ -20,6 +20,7 @@ import QGroundControl.FlightMap 1.0
/// Simple Mission Item visuals
Item
{
id
:
_root
property
var
map
///< Map control to place item in
property
var
_missionItem
:
object
...
...
@@ -28,6 +29,8 @@ Item {
property
bool
_itemVisualShowing
:
false
property
bool
_dragAreaShowing
:
false
signal
clicked
(
int
sequenceNumber
)
function
hideItemVisuals
()
{
if
(
_itemVisualShowing
)
{
_itemVisual
.
destroy
()
...
...
@@ -104,7 +107,7 @@ Item {
missionItem
:
_missionItem
sequenceNumber
:
_missionItem
.
sequenceNumber
onClicked
:
setCurrentItem
(
_missionItem
.
sequenceNumber
)
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
// These are the non-coordinate child mission items attached to this item
Row
{
...
...
@@ -120,7 +123,7 @@ Item {
checked
:
object
.
isCurrentItem
specifiesCoordinate
:
false
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
onClicked
:
_root
.
clicked
(
object
.
sequenceNumber
)
}
}
}
...
...
src/MissionEditor/SurveyMapVisual.qml
View file @
1723a2d2
...
...
@@ -20,6 +20,8 @@ import QGroundControl.FlightMap 1.0
/// Survey Complex Mission Item visuals
Item
{
id
:
_root
property
var
map
///< Map control to place item in
property
var
_missionItem
:
object
...
...
@@ -30,6 +32,8 @@ Item {
property
var
_dragHandles
property
var
_splitHandles
signal
clicked
(
int
sequenceNumber
)
function
_addVisualElements
()
{
_polygon
=
polygonComponent
.
createObject
(
map
)
_grid
=
gridComponent
.
createObject
(
map
)
...
...
@@ -148,13 +152,11 @@ Item {
coordinate
:
_missionItem
.
coordinate
visible
:
_missionItem
.
exitCoordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
sequenceNumber
label
:
"
Entry
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
setCurrentItem
(
_missionItem
.
sequenceNumber
)
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
...
...
@@ -170,13 +172,11 @@ Item {
coordinate
:
_missionItem
.
exitCoordinate
visible
:
_missionItem
.
exitCoordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
lastSequenceNumber
label
:
"
Exit
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
setCurrentItem
(
_missionItem
.
sequenceNumber
)
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
...
...
src/MissionManager/MissionController.cc
View file @
1723a2d2
...
...
@@ -1321,6 +1321,7 @@ void MissionController::_activeVehicleSet(void)
connect
(
_activeVehicle
,
&
Vehicle
::
homePositionChanged
,
this
,
&
MissionController
::
_activeVehicleHomePositionChanged
);
connect
(
_activeVehicle
,
&
Vehicle
::
defaultCruiseSpeedChanged
,
this
,
&
MissionController
::
_recalcMissionFlightStatus
);
connect
(
_activeVehicle
,
&
Vehicle
::
defaultHoverSpeedChanged
,
this
,
&
MissionController
::
_recalcMissionFlightStatus
);
connect
(
_activeVehicle
,
&
Vehicle
::
vehicleTypeChanged
,
this
,
&
MissionController
::
complexMissionItemNamesChanged
);
if
(
_activeVehicle
->
parameterManager
()
->
parametersReady
()
&&
!
syncInProgress
())
{
// We are switching between two previously existing vehicles. We have to manually ask for the items from the Vehicle.
...
...
src/MultiVehicle/MultiVehicleView.qml
deleted
100644 → 0
View file @
34b4f681
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
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
.
Controllers
1.0
import
QGroundControl
.
FactSystem
1.0
/// Multi-Vehicle View
QGCView
{
id
:
qgcView
viewPanel
:
panel
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
property
var
_fileDialogController
readonly
property
string
_loadingText
:
qsTr
(
"
Loading...
"
)
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
QGCViewPanel
{
id
:
panel
anchors.fill
:
parent
Rectangle
{
anchors.fill
:
parent
color
:
qgcPal
.
window
QGCFlickable
{
anchors.fill
:
parent
contentHeight
:
vehicleColumn
.
height
flickableDirection
:
Flickable
.
VerticalFlick
clip
:
true
Column
{
id
:
vehicleColumn
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
spacing
:
_margins
QGCLabel
{
text
:
qsTr
(
"
All Vehicles
"
)
}
Repeater
{
model
:
QGroundControl
.
multiVehicleManager
.
vehicles
Column
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
MissionController
{
id
:
missionController
Component.onCompleted
:
startStaticActiveVehicle
(
object
)
property
bool
missionAvailable
:
visualItems
&&
visualItems
.
count
>
1
function
loadFromSelectedFile
()
{
if
(
ScreenTools
.
isMobile
)
{
_fileDialogController
=
missionController
qgcView
.
showDialog
(
mobileFilePicker
,
qsTr
(
"
Select Mission File
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
)
}
else
{
missionController
.
loadFromFilePicker
()
missionController
.
sendToVehicle
()
}
}
}
// MissionController
GeoFenceController
{
id
:
geoFenceController
Component.onCompleted
:
startStaticActiveVehicle
(
object
)
property
bool
fenceAvailable
:
fenceSupported
&&
(
circleSupported
||
polygonSupported
)
function
loadFromSelectedFile
()
{
if
(
ScreenTools
.
isMobile
)
{
_fileDialogController
=
geoFenceController
qgcView
.
showDialog
(
mobileFilePicker
,
qsTr
(
"
Select Fence File
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
)
}
else
{
geoFenceController
.
loadFromFilePicker
()
geoFenceController
.
sendToVehicle
()
}
}
}
// GeoFenceController
RallyPointController
{
id
:
rallyPointController
Component.onCompleted
:
startStaticActiveVehicle
(
object
)
property
bool
pointsAvailable
:
rallyPointsSupported
&&
points
.
count
function
loadFromSelectedFile
()
{
if
(
ScreenTools
.
isMobile
)
{
_fileDialogController
=
rallyPointController
qgcView
.
showDialog
(
mobileFilePicker
,
qsTr
(
"
Select Rally Point File
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
)
}
else
{
rallyPointController
.
loadFromFilePicker
()
rallyPointController
.
sendToVehicle
()
}
}
}
// RallyPointController
QGCLabel
{
text
:
"
Vehicle #
"
+
object
.
id
}
Rectangle
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
vehicleDisplayColumn
.
height
+
(
_margins
*
2
)
color
:
qgcPal
.
windowShade
Column
{
id
:
vehicleDisplayColumn
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
Row
{
id
:
indicatorRow
spacing
:
_margins
visible
:
!
object
.
connectionLost
Rectangle
{
width
:
missionLabel
.
contentWidth
+
_margins
height
:
ScreenTools
.
defaultFontPixelHeight
+
_margins
radius
:
height
/
4
color
:
missionController
.
missionAvailable
?
"
green
"
:
qgcPal
.
window
border.width
:
1
border.color
:
qgcPal
.
text
QGCLabel
{
id
:
missionLabel
anchors.margins
:
_margins
/
2
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
text
:
missionController
.
syncInProgress
?
_loadingText
:
qsTr
(
"
Mission
"
)
}
MouseArea
{
anchors.fill
:
parent
enabled
:
!
missionController
.
syncInProgress
onClicked
:
missionController
.
loadFromSelectedFile
()
}
}
Rectangle
{
width
:
fenceLabel
.
contentWidth
+
_margins
height
:
ScreenTools
.
defaultFontPixelHeight
+
_margins
radius
:
height
/
4
color
:
geoFenceController
.
fenceAvailable
?
"
green
"
:
qgcPal
.
window
border.width
:
1
border.color
:
qgcPal
.
text
QGCLabel
{
id
:
fenceLabel
anchors.margins
:
_margins
/
2
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
text
:
geoFenceController
.
syncInProgress
?
_loadingText
:
qsTr
(
"
Fence
"
)
}
MouseArea
{
anchors.fill
:
parent
enabled
:
!
geoFenceController
.
syncInProgress
onClicked
:
geoFenceController
.
loadFromSelectedFile
()
}
}
Rectangle
{
width
:
rallyLabel
.
contentWidth
+
_margins
height
:
ScreenTools
.
defaultFontPixelHeight
+
_margins
radius
:
height
/
4
color
:
rallyPointController
.
pointsAvailable
?
"
green
"
:
qgcPal
.
window
border.width
:
1
border.color
:
qgcPal
.
text
QGCLabel
{
id
:
rallyLabel
anchors.margins
:
_margins
/
2
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
text
:
rallyPointController
.
syncInProgress
?
_loadingText
:
qsTr
(
"
Rally
"
)
}
MouseArea
{
anchors.fill
:
parent
enabled
:
!
rallyPointController
.
syncInProgress
onClicked
:
rallyPointController
.
loadFromSelectedFile
()
}
}
FlightModeDropdown
{
activeVehicle
:
object
}
GuidedBar
{
activeVehicle
:
object
}
}
// Row - contents display
Flow
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
layoutDirection
:
Qt
.
LeftToRight
spacing
:
_margins
Repeater
{
model
:
[
"
battery.voltage
"
,
"
battery.percentRemaining
"
,
"
altitudeRelative
"
,
"
altitudeAMSL
"
,
"
groundSpeed
"
,
"
heading
"
]
Column
{
property
Fact
fact
:
object
.
getFact
(
modelData
)
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
fact
.
shortDescription
}
Row
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
//spacing: ScreenTools.defaultFontPixelWidth
QGCLabel
{
text
:
fact
.
enumOrValueString
}
QGCLabel
{
text
:
fact
.
units
}
}
}
}
// Repeater - Small
}
// Flow
}
// Column
}
// Rectangle - contents display
}
// Column - layout for vehicle
}
// Repeater - vehicle repeater
}
// Column
}
// QGCFlickable
}
// Rectangle - View background
}
// QGCViewPanel
Component
{
id
:
mobileFilePicker
QGCMobileFileDialog
{
openDialog
:
true
fileExtension
:
_fileDialogController
.
fileExtension
onFilenameReturned
:
{
_fileDialogController
.
loadFromFile
(
filename
)
_fileDialogController
.
sendToVehicle
()
}
}
}
}
// QGCView
src/QmlControls/GuidedBar.qml
deleted
100644 → 0
View file @
34b4f681
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.3
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
//-- Guided mode bar
Rectangle
{
id
:
guidedModeBar
width
:
guidedModeColumn
.
width
+
(
_margins
*
2
)
height
:
guidedModeColumn
.
height
+
(
_margins
*
2
)
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
color
:
backgroundColor
property
var
activeVehicle
///< Vehicle to show guided bar for
property
real
fontPointSize
:
ScreenTools
.
defaultFontPointSize
///< point size for fonts in control
property
color
backgroundColor
:
qgcPal
.
windowShadeDark
///< Background color for bar
// Values for _confirmActionCode
readonly
property
int
confirmHome
:
1
readonly
property
int
confirmLand
:
2
readonly
property
int
confirmTakeoff
:
3
readonly
property
int
confirmArm
:
4
readonly
property
int
confirmDisarm
:
5
readonly
property
int
confirmEmergencyStop
:
6
readonly
property
int
confirmChangeAlt
:
7
readonly
property
int
confirmGoTo
:
8
readonly
property
int
confirmRetask
:
9
readonly
property
int
confirmOrbit
:
10
property
int
_confirmActionCode
property
real
_showMargin
:
_margins
property
real
_hideMargin
:
_margins
-
guidedModeBar
.
height
property
real
_barMargin
:
_showMargin
property
bool
_showConfirm
:
false
property
string
_confirmText
property
bool
_showAltitude
:
false
property
real
_confirmAltitude
function
actionConfirmed
(
altitude
)
{
_showConfirm
=
false
switch
(
_confirmActionCode
)
{
case
confirmHome
:
activeVehicle
.
guidedModeRTL
()
break
;
case
confirmLand
:
activeVehicle
.
guidedModeLand
()
break
;
case
confirmTakeoff
:
activeVehicle
.
guidedModeTakeoff
(
altitude
)
break
;
case
confirmArm
:
activeVehicle
.
armed
=
true
break
;
case
confirmDisarm
:
activeVehicle
.
armed
=
false
break
;
case
confirmEmergencyStop
:
activeVehicle
.
emergencyStop
()
break
;
case
confirmChangeAlt
:
activeVehicle
.
guidedModeChangeAltitude
(
altitude
)
break
;
case
confirmGoTo
:
activeVehicle
.
guidedModeGotoLocation
(
_flightMap
.
_gotoHereCoordinate
)
break
;
case
confirmRetask
:
activeVehicle
.
setCurrentMissionSequence
(
_flightMap
.
_retaskSequence
)
break
;
case
confirmOrbit
:
//-- All parameters controlled by RC
activeVehicle
.
guidedModeOrbit
()
//-- Center on current flight map position and orbit with a 50m radius (velocity/direction controlled by the RC)
//activeVehicle.guidedModeOrbit(QGroundControl.flightMapPosition, 50.0)
break
;
default
:
console
.
warn
(
qsTr
(
"
Internal error: unknown _confirmActionCode
"
),
_confirmActionCode
)
}
}
function
actionRejected
()
{
_showConfirm
=
false
/*
altitudeSlider.visible = false
_flightMap._gotoHereCoordinate = QtPositioning.coordinate()
guidedModeHideTimer.restart()
*/
}
function
confirmAction
(
actionCode
)
{
//guidedModeHideTimer.stop()
_confirmActionCode
=
actionCode
_showAltitude
=
false
switch
(
_confirmActionCode
)
{
case
confirmArm
:
_confirmText
=
qsTr
(
"
Arm vehicle?
"
)
break
;
case
confirmDisarm
:
_confirmText
=
qsTr
(
"
Disarm vehicle?
"
)
break
;
case
confirmEmergencyStop
:
_confirmText
=
qsTr
(
"
STOP ALL MOTORS?
"
)
break
;
case
confirmTakeoff
:
_showAltitude
=
true
setInitialValueMeters
(
3
)
_confirmText
=
qsTr
(
"
Takeoff vehicle?
"
)
break
;
case
confirmLand
:
_confirmText
=
qsTr
(
"
Land vehicle?
"
)
break
;
case
confirmHome
:
_confirmText
=
qsTr
(
"
Return to land?
"
)
break
;
case
confirmChangeAlt
:
_showAltitude
=
true
setInitialValueAppSettingsDistanceUnits
(
activeVehicle
.
altitudeRelative
.
value
)
_confirmText
=
qsTr
(
"
Change altitude?
"
)
break
;
case
confirmGoTo
:
_confirmText
=
qsTr
(
"
Move vehicle?
"
)
break
;
case
confirmRetask
:
_confirmText
=
qsTr
(
"
Change active waypoint?
"
)
break
;
case
confirmOrbit
:
_confirmText
=
qsTr
(
"
Enter orbit mode?
"
)
break
;
}
_showConfirm
=
true
}
function
setInitialValueMeters
(
meters
)
{
_confirmAltitude
=
QGroundControl
.
metersToAppSettingsDistanceUnits
(
meters
)
}
function
setInitialValueAppSettingsDistanceUnits
(
height
)
{
_confirmAltitude
=
height
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
Column
{
id
:
guidedModeColumn
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_margins
/*
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
color: _lightWidgetBorders ? qgcPal.mapWidgetBorderDark : qgcPal.mapWidgetBorderLight
text: "Click in map to move vehicle"
visible: gotoEnabled
}*/
Row
{
spacing
:
_margins
*
2
visible
:
!
_showConfirm
QGCButton
{
pointSize
:
fontPointSize
text
:
(
activeVehicle
&&
activeVehicle
.
armed
)
?
(
activeVehicle
.
flying
?
qsTr
(
"
Emergency Stop
"
)
:
qsTr
(
"
Disarm
"
))
:
qsTr
(
"
Arm
"
)
visible
:
activeVehicle
onClicked
:
confirmAction
(
activeVehicle
.
armed
?
(
activeVehicle
.
flying
?
confirmEmergencyStop
:
confirmDisarm
)
:
confirmArm
)
}
QGCButton
{
pointSize
:
fontPointSize
text
:
qsTr
(
"
RTL
"
)
visible
:
(
activeVehicle
&&
activeVehicle
.
armed
)
&&
activeVehicle
.
guidedModeSupported
&&
activeVehicle
.
flying
onClicked
:
confirmAction
(
confirmHome
)
}
QGCButton
{
pointSize
:
fontPointSize
text
:
(
activeVehicle
&&
activeVehicle
.
flying
)
?
qsTr
(
"
Land
"
):
qsTr
(
"
Takeoff
"
)
visible
:
activeVehicle
&&
activeVehicle
.
guidedModeSupported
&&
activeVehicle
.
armed
onClicked
:
confirmAction
(
activeVehicle
.
flying
?
confirmLand
:
confirmTakeoff
)
}
QGCButton
{
pointSize
:
fontPointSize
text
:
qsTr
(
"
Pause
"
)
visible
:
(
activeVehicle
&&
activeVehicle
.
armed
)
&&
activeVehicle
.
pauseVehicleSupported
&&
activeVehicle
.
flying
onClicked
:
{
guidedModeHideTimer
.
restart
()
activeVehicle
.
pauseVehicle
()
}
}
QGCButton
{
pointSize
:
fontPointSize
text
:
qsTr
(
"
Change Altitude
"
)
visible
:
(
activeVehicle
&&
activeVehicle
.
flying
)
&&
activeVehicle
.
guidedModeSupported
&&
activeVehicle
.
armed
onClicked
:
confirmAction
(
confirmChangeAlt
)
}
QGCButton
{
pointSize
:
fontPointSize
text
:
qsTr
(
"
Orbit
"
)
visible
:
(
activeVehicle
&&
activeVehicle
.
flying
)
&&
activeVehicle
.
orbitModeSupported
&&
activeVehicle
.
armed
onClicked
:
confirmAction
(
confirmOrbit
)
}
}
// Row
Column
{
visible
:
_showConfirm
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
_confirmText
}
Row
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
ScreenTools
.
defaultFontPixelWidth
Row
{
visible
:
_showAltitude
QGCLabel
{
text
:
qsTr
(
"
Alt (rel)
"
)
}
QGCLabel
{
text
:
QGroundControl
.
appSettingsDistanceUnitsString
}
QGCTextField
{
id
:
altField
text
:
_confirmAltitude
.
toFixed
(
1
)
}
}
QGCButton
{
text
:
qsTr
(
"
Yes
"
)
onClicked
:
{
var
value
=
parseFloat
(
altField
.
text
)
if
(
isNaN
(
value
))
{
actionRejected
()
}
else
{
actionConfirmed
(
QGroundControl
.
appSettingsDistanceUnitsToMeters
(
value
))
}
}
}
QGCButton
{
text
:
qsTr
(
"
No
"
)
onClicked
:
actionRejected
()
}
}
}
// Column
}
// Column
}
// Rectangle - Guided mode buttons
src/QmlControls/QGroundControl.Controls.qmldir
View file @
1723a2d2
...
...
@@ -12,7 +12,6 @@ FlightModeDropdown 1.0 FlightModeDropdown.qml
FlightModeMenu 1.0 FlightModeMenu.qml
GeoFenceEditor 1.0 GeoFenceEditor.qml
GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml
GuidedBar 1.0 GuidedBar.qml
IndicatorButton 1.0 IndicatorButton.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml
MainToolBar 1.0 MainToolBar.qml
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment