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
0b3b98cb
Commit
0b3b98cb
authored
Mar 23, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New toolbar and user model for plan view
parent
1147685e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
231 additions
and
91 deletions
+231
-91
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+5
-0
MissionItemStatus.qml
src/MissionEditor/MissionItemStatus.qml
+33
-90
PlanToolBar.qml
src/MissionEditor/PlanToolBar.qml
+172
-0
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+1
-0
MainWindowInner.qml
src/ui/MainWindowInner.qml
+19
-1
No files found.
qgroundcontrol.qrc
View file @
0b3b98cb
...
...
@@ -74,6 +74,7 @@
<file alias="QGroundControl/Controls/OfflineMapButton.qml">src/QmlControls/OfflineMapButton.qml</file>
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/PlanToolBar.qml">src/MissionEditor/PlanToolBar.qml</file>
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file>
...
...
src/MissionEditor/MissionEditor.qml
View file @
0b3b98cb
...
...
@@ -59,6 +59,11 @@ QGCView {
readonly
property
int
_layerRallyPoints
:
3
property
int
_editingLayer
:
_layerMission
Component.onCompleted
:
{
toolbar
.
missionController
=
Qt
.
binding
(
function
()
{
return
missionController
})
toolbar
.
currentMissionItem
=
Qt
.
binding
(
function
()
{
return
_currentMissionItem
})
}
onActiveVehiclePositionChanged
:
updateMapToVehiclePosition
()
Connections
{
...
...
src/MissionEditor/MissionItemStatus.qml
View file @
0b3b98cb
...
...
@@ -20,8 +20,8 @@ import QGroundControl.FactSystem 1.0
import
QGroundControl
.
FactControls
1.0
Rectangle
{
width
:
_expanded
?
expandedWidth
:
_collaps
edWidth
height
:
Math
.
max
(
valueGrid
.
height
,
valueMissionGrid
.
height
)
+
(
_margins
*
2
)
width
:
expand
edWidth
height
:
ScreenTools
.
defaultFontPixelHeight
*
7
radius
:
ScreenTools
.
defaultFontPixelWidth
*
0.5
color
:
qgcPal
.
window
opacity
:
0.80
...
...
@@ -34,9 +34,6 @@ Rectangle {
property
real
missionTime
///< Total mission time
property
real
missionMaxTelemetry
property
real
_collapsedWidth
:
valueGrid
.
width
+
(
_margins
*
2
)
property
bool
_expanded
:
true
property
bool
_statusValid
:
currentMissionItem
!=
undefined
property
bool
_missionValid
:
missionItems
!=
undefined
...
...
@@ -59,92 +56,38 @@ Rectangle {
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
MouseArea
{
anchors.fill
:
parent
onClicked
:
_expanded
=
!
_expanded
}
Row
{
anchors.fill
:
parent
anchors.margins
:
_margins
spacing
:
_margins
GridLayout
{
id
:
valueGrid
columns
:
2
rowSpacing
:
0
columnSpacing
:
_margins
anchors.verticalCenter
:
parent
.
verticalCenter
QGCLabel
{
text
:
qsTr
(
"
Selected waypoint
"
);
Layout.columnSpan
:
2
}
QGCLabel
{
text
:
qsTr
(
"
Distance:
"
)
}
QGCLabel
{
text
:
_distanceText
}
QGCLabel
{
text
:
qsTr
(
"
Alt diff:
"
)
}
QGCLabel
{
text
:
_altDifferenceText
}
QGCLabel
{
text
:
qsTr
(
"
Gradient:
"
)
}
QGCLabel
{
text
:
_gradientText
}
QGCLabel
{
text
:
qsTr
(
"
Azimuth:
"
)
}
QGCLabel
{
text
:
_azimuthText
}
}
QGCListView
{
id
:
statusListView
model
:
missionItems
highlightMoveDuration
:
250
anchors.leftMargin
:
_margins
anchors.rightMargin
:
_margins
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
orientation
:
ListView
.
Horizontal
spacing
:
0
visible
:
_expanded
width
:
parent
.
width
-
valueGrid
.
width
-
valueMissionGrid
.
width
-
(
_margins
*
2
)
clip
:
true
currentIndex
:
_currentMissionIndex
delegate
:
Item
{
height
:
statusListView
.
height
width
:
display
?
(
indicator
.
width
+
spacing
)
:
0
visible
:
display
property
real
availableHeight
:
height
-
indicator
.
height
property
bool
graphAbsolute
:
true
readonly
property
bool
display
:
object
.
specifiesCoordinate
&&
!
object
.
isStandaloneCoordinate
readonly
property
real
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
ScreenTools
.
smallFontPointRatio
MissionItemIndexLabel
{
id
:
indicator
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
availableHeight
-
(
availableHeight
*
object
.
altPercent
)
small
:
true
checked
:
object
.
isCurrentItem
label
:
object
.
abbreviation
visible
:
object
.
relativeAltitude
?
true
:
(
object
.
homePosition
||
graphAbsolute
)
}
QGCListView
{
id
:
statusListView
anchors.fill
:
parent
anchors.margins
:
_margins
model
:
missionItems
highlightMoveDuration
:
250
orientation
:
ListView
.
Horizontal
spacing
:
0
width
:
parent
.
width
-
valueGrid
.
width
-
valueMissionGrid
.
width
-
(
_margins
*
2
)
clip
:
true
currentIndex
:
_currentMissionIndex
delegate
:
Item
{
height
:
statusListView
.
height
width
:
display
?
(
indicator
.
width
+
spacing
)
:
0
visible
:
display
property
real
availableHeight
:
height
-
indicator
.
height
property
bool
graphAbsolute
:
true
readonly
property
bool
display
:
object
.
specifiesCoordinate
&&
!
object
.
isStandaloneCoordinate
readonly
property
real
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
ScreenTools
.
smallFontPointRatio
MissionItemIndexLabel
{
id
:
indicator
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
availableHeight
-
(
availableHeight
*
object
.
altPercent
)
small
:
true
checked
:
object
.
isCurrentItem
label
:
object
.
abbreviation
visible
:
object
.
relativeAltitude
?
true
:
(
object
.
homePosition
||
graphAbsolute
)
}
}
Grid
{
id
:
valueMissionGrid
columns
:
2
columnSpacing
:
_margins
anchors.verticalCenter
:
parent
.
verticalCenter
QGCLabel
{
text
:
qsTr
(
"
Total mission
"
)
}
QGCLabel
{
text
:
qsTr
(
"
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Distance:
"
)
}
QGCLabel
{
text
:
_missionDistanceText
}
QGCLabel
{
text
:
qsTr
(
"
Time:
"
)
}
QGCLabel
{
text
:
_missionTimeText
}
QGCLabel
{
text
:
qsTr
(
"
Max telem dist:
"
)
}
QGCLabel
{
text
:
_missionMaxTelemetryText
}
}
}
}
src/MissionEditor/PlanToolBar.qml
0 → 100644
View file @
0b3b98cb
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Palette
1.0
// Toolbar for Plan View
Rectangle
{
id
:
_root
height
:
ScreenTools
.
toolbarHeight
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
z
:
toolBar
.
z
+
1
color
:
qgcPal
.
window
visible
:
false
signal
showFlyView
property
var
missionController
property
var
currentMissionItem
///< Mission item to display status for
property
var
missionItems
:
missionController
.
visualItems
property
real
missionDistance
:
missionController
.
missionDistance
property
real
missionTime
:
missionController
.
missionTime
property
real
missionMaxTelemetry
:
missionController
.
missionMaxTelemetry
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_statusValid
:
currentMissionItem
!=
undefined
property
bool
_missionValid
:
missionItems
!=
undefined
property
real
_distance
:
_statusValid
?
currentMissionItem
.
distance
:
NaN
property
real
_altDifference
:
_statusValid
?
currentMissionItem
.
altDifference
:
NaN
property
real
_gradient
:
_statusValid
&&
currentMissionItem
.
distance
>
0
?
Math
.
atan
(
currentMissionItem
.
altDifference
/
currentMissionItem
.
distance
)
:
NaN
property
real
_gradientPercent
:
isNaN
(
_gradient
)
?
NaN
:
_gradient
*
100
property
real
_azimuth
:
_statusValid
?
currentMissionItem
.
azimuth
:
NaN
property
real
_missionDistance
:
_missionValid
?
missionDistance
:
NaN
property
real
_missionMaxTelemetry
:
_missionValid
?
missionMaxTelemetry
:
NaN
property
real
_missionTime
:
_missionValid
?
missionTime
:
NaN
property
string
_distanceText
:
isNaN
(
_distance
)
?
"
-.-
"
:
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_distance
).
toFixed
(
1
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
property
string
_altDifferenceText
:
isNaN
(
_altDifference
)
?
"
-.-
"
:
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_altDifference
).
toFixed
(
1
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
property
string
_gradientText
:
isNaN
(
_gradient
)
?
"
-.-
"
:
_gradientPercent
.
toFixed
(
0
)
+
"
%
"
property
string
_azimuthText
:
isNaN
(
_azimuth
)
?
"
-.-
"
:
Math
.
round
(
_azimuth
)
property
string
_missionDistanceText
:
isNaN
(
_missionDistance
)
?
"
-.-
"
:
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_missionDistance
).
toFixed
(
1
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
property
string
_missionTimeText
:
isNaN
(
_missionTime
)
?
"
-.-
"
:
Number
(
_missionTime
/
60
).
toFixed
(
1
)
+
"
min
"
property
string
_missionMaxTelemetryText
:
isNaN
(
_missionMaxTelemetry
)
?
"
-.-
"
:
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_missionMaxTelemetry
).
toFixed
(
1
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
QGCPalette
{
id
:
qgcPal
}
Row
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
2
QGCToolBarButton
{
id
:
settingsButton
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
source
:
"
/qmlimages/PaperPlane.svg
"
logo
:
true
checked
:
false
onClicked
:
{
checked
=
false
if
(
missionController
.
dirty
)
{
uploadPrompt
.
visible
=
true
}
else
{
showFlyView
()
}
}
MessageDialog
{
id
:
uploadPrompt
title
:
_activeVehicle
?
qsTr
(
"
Unsent changes
"
)
:
qsTr
(
"
Unsaved changes
"
)
text
:
qsTr
(
"
You have %1 changes to your mission. Are you sure you want to leave before you %2?
"
).
arg
(
_activeVehicle
?
qsTr
(
"
unsent
"
)
:
qsTr
(
"
unsaved
"
)).
arg
(
_activeVehicle
?
qsTr
(
"
send the missoin to the vehicle
"
)
:
qsTr
(
"
save the mission to a file
"
))
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
visible
=
false
onYes
:
{
visible
=
false
showFlyView
()
}
}
}
GridLayout
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
columns
:
4
rowSpacing
:
0
columnSpacing
:
_margins
QGCLabel
{
text
:
qsTr
(
"
Selected waypoint
"
)
Layout.columnSpan
:
4
font.pointSize
:
ScreenTools
.
smallFontPointSize
}
QGCLabel
{
text
:
qsTr
(
"
Distance:
"
)
}
QGCLabel
{
text
:
_distanceText
}
QGCLabel
{
text
:
qsTr
(
"
Gradient:
"
)
}
QGCLabel
{
text
:
_gradientText
}
QGCLabel
{
text
:
qsTr
(
"
Alt diff:
"
)
}
QGCLabel
{
text
:
_altDifferenceText
}
QGCLabel
{
text
:
qsTr
(
"
Azimuth:
"
)
}
QGCLabel
{
text
:
_azimuthText
}
}
GridLayout
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
columns
:
4
rowSpacing
:
0
columnSpacing
:
_margins
QGCLabel
{
text
:
qsTr
(
"
Total mission
"
)
Layout.columnSpan
:
4
font.pointSize
:
ScreenTools
.
smallFontPointSize
}
QGCLabel
{
text
:
qsTr
(
"
Distance:
"
)
}
QGCLabel
{
text
:
_missionDistanceText
}
QGCLabel
{
text
:
qsTr
(
"
Max telem dist:
"
)
}
QGCLabel
{
text
:
_missionMaxTelemetryText
}
QGCLabel
{
text
:
qsTr
(
"
Time:
"
)
}
QGCLabel
{
text
:
_missionTimeText
}
}
}
QGCButton
{
anchors.rightMargin
:
_margins
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
_activeVehicle
?
qsTr
(
"
Upload
"
)
:
qsTr
(
"
Save
"
)
visible
:
missionController
.
dirty
primary
:
true
onClicked
:
{
if
(
_activeVehicle
)
{
missionController
.
sendToVehicle
()
}
else
{
missionController
.
saveToSelectedFile
()
}
}
NumberAnimation
on
opacity
{
id
:
opacityAnimation
running
:
missionController
.
dirty
from
:
0.5
to
:
1.0
loops
:
Animation
.
Infinite
duration
:
2000
}
}
}
src/QmlControls/QGroundControl.Controls.qmldir
View file @
0b3b98cb
...
...
@@ -26,6 +26,7 @@ ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml
MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml
ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PlanToolBar 1.0 PlanToolBar.qml
RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml
RallyPointItemEditor 1.0 RallyPointItemEditor.qml
RCChannelMonitor 1.0 RCChannelMonitor.qml
...
...
src/ui/MainWindowInner.qml
View file @
0b3b98cb
...
...
@@ -93,7 +93,7 @@ Item {
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
hideAllViews
()
planViewLoader
.
visible
=
true
toolBar
.
checkPlanButton
()
planToolBar
.
visible
=
true
}
function
showFlyView
()
{
...
...
@@ -269,6 +269,20 @@ Item {
onShowAnalyzeView
:
mainWindow
.
showAnalyzeView
()
}
PlanToolBar
{
id
:
planToolBar
height
:
ScreenTools
.
toolbarHeight
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
z
:
toolBar
.
z
+
1
onShowFlyView
:
{
planToolBar
.
visible
=
false
mainWindow
.
showFlyView
()
}
}
Loader
{
id
:
settingsViewLoader
anchors.left
:
parent
.
left
...
...
@@ -292,12 +306,16 @@ Item {
anchors.top
:
toolBar
.
bottom
anchors.bottom
:
parent
.
bottom
visible
:
false
property
var
planToolBar
:
planToolBar
}
Loader
{
id
:
planViewLoader
anchors.fill
:
parent
visible
:
false
property
var
toolbar
:
planToolBar
}
FlightDisplayView
{
...
...
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