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
69f27141
Commit
69f27141
authored
Sep 07, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First cut at Mission Editor
- Restructured a number of MissionItem properties as well
parent
ca234ed5
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
615 additions
and
436 deletions
+615
-436
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-1
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+4
-2
FlightMap.qml
src/FlightMap/FlightMap.qml
+3
-3
MissionItemIndicator.qml
src/FlightMap/MapItems/MissionItemIndicator.qml
+3
-3
qmldir
src/FlightMap/qmldir
+1
-1
MissionEditor.cc
src/MissionEditor/MissionEditor.cc
+5
-1
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+69
-49
MissionItem.cc
src/MissionItem.cc
+119
-102
MissionItem.h
src/MissionItem.h
+104
-118
MissionItemEditor.qml
src/QmlControls/MissionItemEditor.qml
+148
-0
MissionItemIndexLabel.qml
src/QmlControls/MissionItemIndexLabel.qml
+4
-3
MissionItemSummary.qml
src/QmlControls/MissionItemSummary.qml
+4
-2
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+1
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+1
-1
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+64
-72
HSIDisplay.cc
src/ui/HSIDisplay.cc
+5
-5
WaypointEditableView.cc
src/ui/WaypointEditableView.cc
+7
-7
WaypointList.cc
src/ui/WaypointList.cc
+27
-21
WaypointViewOnlyView.cc
src/ui/WaypointViewOnlyView.cc
+30
-30
QGCMapWidget.cc
src/ui/map/QGCMapWidget.cc
+5
-5
Waypoint2DIcon.cc
src/ui/map/Waypoint2DIcon.cc
+8
-9
Waypoint2DIcon.h
src/ui/map/Waypoint2DIcon.h
+1
-1
No files found.
qgroundcontrol.qrc
View file @
69f27141
...
...
@@ -100,6 +100,7 @@
<file alias="QGroundControl/Controls/ModeSwitchDisplay.qml">src/QmlControls/ModeSwitchDisplay.qml</file>
<file alias="QGroundControl/Controls/MissionItemIndexLabel.qml">src/QmlControls/MissionItemIndexLabel.qml</file>
<file alias="QGroundControl/Controls/MissionItemSummary.qml">src/QmlControls/MissionItemSummary.qml</file>
<file alias="QGroundControl/Controls/MissionItemEditor.qml">src/QmlControls/MissionItemEditor.qml</file>
<!-- Vehicle Setup -->
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
...
...
@@ -151,7 +152,7 @@
<file alias="QGroundControl/FlightMap/QGCWaypointEditor.qml">src/FlightMap/Widgets/QGCWaypointEditor.qml</file>
<!-- FlightMap MapQuickItems -->
<file alias="QGroundControl/FlightMap/Mission
MapItem.qml">src/FlightMap/MapItems/MissionMapItem
.qml</file>
<file alias="QGroundControl/FlightMap/Mission
ItemIndicator.qml">src/FlightMap/MapItems/MissionItemIndicator
.qml</file>
<file alias="QGroundControl/FlightMap/VehicleMapItem.qml">src/FlightMap/MapItems/VehicleMapItem.qml</file>
</qresource>
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
69f27141
...
...
@@ -95,8 +95,10 @@ Item {
model
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
missionItems
:
0
delegate
:
MissionMapItem
{
missionItem
:
object
MissionItemIndicator
{
label
:
object
.
sequenceNumber
isCurrentItem
:
object
.
isCurrentItem
coordinate
:
object
.
coordinate
}
}
...
...
src/FlightMap/FlightMap.qml
View file @
69f27141
...
...
@@ -76,13 +76,13 @@ Map {
Menu
{
id
:
mapTypeMenu
title
:
"
Map Type...
"
enabled
:
root
.
visible
enabled
:
_map
.
visible
ExclusiveGroup
{
id
:
currMapType
}
function
setCurrentMap
(
mapID
)
{
for
(
var
i
=
0
;
i
<
_map
.
supportedMapTypes
.
length
;
i
++
)
{
if
(
mapID
===
_map
.
supportedMapTypes
[
i
].
name
)
{
_map
.
activeMapType
=
_map
.
supportedMapTypes
[
i
]
multiVehicleManager
.
saveSetting
(
root
.
mapName
+
"
/currentMapType
"
,
mapID
);
multiVehicleManager
.
saveSetting
(
_map
.
mapName
+
"
/currentMapType
"
,
mapID
);
return
;
}
}
...
...
@@ -100,7 +100,7 @@ Map {
var
mapID
=
''
if
(
_map
.
supportedMapTypes
.
length
>
0
)
mapID
=
_map
.
activeMapType
.
name
;
mapID
=
multiVehicleManager
.
loadSetting
(
root
.
mapName
+
"
/currentMapType
"
,
mapID
);
mapID
=
multiVehicleManager
.
loadSetting
(
_map
.
mapName
+
"
/currentMapType
"
,
mapID
);
for
(
var
i
=
0
;
i
<
_map
.
supportedMapTypes
.
length
;
i
++
)
{
var
name
=
_map
.
supportedMapTypes
[
i
].
name
;
addMap
(
name
,
mapID
===
name
);
...
...
src/FlightMap/MapItems/Mission
MapItem
.qml
→
src/FlightMap/MapItems/Mission
ItemIndicator
.qml
View file @
69f27141
...
...
@@ -30,14 +30,14 @@ import QGroundControl.Vehicle 1.0
/// Marker for displaying a mission item on the map
MapQuickItem
{
property
var
missionItem
///< Mission Item object
property
alias
label
:
_label
.
label
property
alias
isCurrentItem
:
_label
.
isCurrentItem
anchorPoint.x
:
sourceItem
.
width
/
2
anchorPoint.y
:
sourceItem
.
height
/
2
coordinate
:
missionItem
.
coordinate
sourceItem
:
MissionItemIndexLabel
{
missionItemIndex
:
missionItem
.
id
id
:
_label
}
}
src/FlightMap/qmldir
View file @
69f27141
...
...
@@ -21,4 +21,4 @@ QGCWaypointEditor 1.0 QGCWaypointEditor.qml
# MapQuickItems
VehicleMapItem 1.0 VehicleMapItem.qml
Mission
MapItem 1.0 MissionMapItem
.qml
Mission
ItemIndicator 1.0 MissionItemIndicator
.qml
src/MissionEditor/MissionEditor.cc
View file @
69f27141
...
...
@@ -73,6 +73,10 @@ QString MissionEditor::loadSetting(const QString &name, const QString& defaultVa
void
MissionEditor
::
addMissionItem
(
QGeoCoordinate
coordinate
)
{
MissionItem
*
newItem
=
new
MissionItem
(
this
,
_missionItems
.
count
(),
coordinate
.
longitude
(),
coordinate
.
latitude
());
MissionItem
*
newItem
=
new
MissionItem
(
this
,
_missionItems
.
count
(),
coordinate
);
if
(
_missionItems
.
count
()
==
0
)
{
newItem
->
setCommand
(
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
);
}
qDebug
()
<<
"MissionItem"
<<
newItem
->
coordinate
();
_missionItems
.
append
(
newItem
);
}
src/MissionEditor/MissionEditor.qml
View file @
69f27141
...
...
@@ -21,10 +21,11 @@ This file is part of the QGROUNDCONTROL project
======================================================================*/
import
QtQuick
2.4
import
QtQuick
.
Controls
1.3
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.2
import
QtQuick
2.4
import
QtQuick
.
Controls
1.3
import
QtQuick
.
Dialogs
1.2
import
QtLocation
5.3
import
QtPositioning
5.3
import
QGroundControl
.
FlightMap
1.0
import
QGroundControl
.
ScreenTools
1.0
...
...
@@ -32,64 +33,83 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
Palette
1.0
/// Mission Editor
Item
{
id
:
root
// For some reason we can't have FlightMap as the top level control. If you do that it doesn't draw.
// So we have an Item at the top to work around that.
property
var
__qgcPal
:
QGCPalette
{
colorGroupEnabled
:
enabled
}
readonly
property
real
_defaultLatitude
:
37.803784
readonly
property
real
_defaultLongitude
:
-
122.462276
readonly
property
int
_decimalPlaces
:
7
property
var
_activeVehicle
:
multiVehicleManager
.
activeVehicle
FlightMap
{
id
:
editorMap
anchors.fill
:
parent
mapName
:
"
MissionEditor
"
latitude
:
_defaultLatitude
longitude
:
_defaultLongitude
readonly
property
real
_defaultLatitude
:
37.803784
readonly
property
real
_defaultLongitude
:
-
122.462276
QGCLabel
{
text
:
"
WIP: Non functional
"
;
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
}
FlightMap
{
id
:
editorMap
anchors.fill
:
parent
mapName
:
"
MissionEditor
"
latitude
:
parent
.
_defaultLatitude
longitude
:
parent
.
_defaultLongitude
MouseArea
{
anchors.fill
:
parent
onClicked
:
controller
.
addMissionItem
(
editorMap
.
mapItem
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
)))
onClicked
:
{
var
coordinate
=
editorMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
0
controller
.
addMissionItem
(
coordinate
)
}
}
}
Column
{
id
:
controlWidgets
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
left
anchors.bottom
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCButton
{
id
:
addMode
text
:
"
+
"
checkable
:
true
// Add the mission items to the map
MapItemView
{
model
:
controller
.
missionItems
delegate
:
MissionItemIndicator
{
label
:
object
.
sequenceNumber
isCurrentItem
:
object
.
isCurrentItem
coordinate
:
object
.
coordinate
Component.onCompleted
:
console
.
log
(
"
Indicator
"
,
object
.
coordinate
)
}
}
// Mission item list
ListView
{
id
:
missionItemSummaryList
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
parent
.
top
anchors.bottom
:
editorMap
.
mapWidgets
.
top
anchors.right
:
parent
.
right
width
:
ScreenTools
.
defaultFontPixelWidth
*
30
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
orientation
:
ListView
.
Vertical
model
:
controller
.
missionItems
property
real
_maxItemHeight
:
0
delegate
:
MissionItemEditor
{
missionItem
:
object
}
}
}
// Mission item list
ListView
{
id
:
missionItemSummaryList
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.bottom
:
parent
.
bottom
width
:
parent
.
width
height
:
ScreenTools
.
defaultFontPixelHeight
*
7
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
opacity
:
0.75
orientation
:
ListView
.
Horizontal
model
:
controller
.
missionItems
property
real
_maxItemHeight
:
0
delegate
:
MissionItemSummary
{
opacity
:
0.75
missionItem
:
object
Component.onCompleted
:
console
.
log
(
"
add
"
,
object
.
id
)
Column
{
id
:
controlWidgets
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
left
anchors.bottom
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCButton
{
id
:
addMode
text
:
"
+
"
checkable
:
true
}
}
}
}
src/MissionItem.cc
View file @
69f27141
This diff is collapsed.
Click to expand it.
src/MissionItem.h
View file @
69f27141
...
...
@@ -39,76 +39,84 @@ class MissionItem : public QObject
Q_OBJECT
public:
MissionItem
(
QObject
*
parent
=
0
,
quint16
id
=
0
,
double
x
=
0
.
0
,
double
y
=
0
.
0
,
double
z
=
0
.
0
,
double
param1
=
0
.
0
,
double
param2
=
0
.
0
,
double
param3
=
0
.
0
,
double
param4
=
0
.
0
,
bool
autocontinue
=
true
,
bool
current
=
false
,
int
frame
=
MAV_FRAME_GLOBAL
,
int
action
=
MAV_CMD_NAV_WAYPOINT
,
const
QString
&
description
=
QString
(
""
));
MissionItem
(
QObject
*
parent
=
0
,
int
sequenceNumber
=
0
,
QGeoCoordinate
coordiante
=
QGeoCoordinate
(),
double
param1
=
0
.
0
,
double
param2
=
0
.
0
,
double
param3
=
0
.
0
,
double
param4
=
0
.
0
,
bool
autocontinue
=
true
,
bool
isCurrentItem
=
false
,
int
frame
=
MAV_FRAME_GLOBAL
,
int
action
=
MAV_CMD_NAV_WAYPOINT
);
MissionItem
(
const
MissionItem
&
other
);
~
MissionItem
();
const
MissionItem
&
operator
=
(
const
MissionItem
&
other
);
Q_PROPERTY
(
bool
hasCoordinate
READ
hasCoordinate
NOTIFY
hasCoordinateChanged
)
Q_PROPERTY
(
QGeoCoordinate
coordinate
READ
coordinate
NOTIFY
coordinateChanged
)
Q_PROPERTY
(
QString
commandName
READ
commandName
NOTIFY
commandNameChanged
)
Q_PROPERTY
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
READ
command
WRITE
setCommand
NOTIFY
commandChanged
)
Q_PROPERTY
(
int
sequenceNumber
READ
sequenceNumber
WRITE
setSequenceNumber
NOTIFY
sequenceNumberChanged
)
Q_PROPERTY
(
bool
isCurrentItem
READ
isCurrentItem
WRITE
setIsCurrentItem
NOTIFY
isCurrentItemChanged
)
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
NOTIFY
specifiesCoordinateChanged
)
Q_PROPERTY
(
QGeoCoordinate
coordinate
READ
coordinate
WRITE
setCoordinate
NOTIFY
coordinateChanged
)
Q_PROPERTY
(
double
yaw
READ
yaw
WRITE
setYaw
NOTIFY
yawChanged
)
Q_PROPERTY
(
QStringList
commandNames
READ
commandNames
CONSTANT
)
Q_PROPERTY
(
QString
commandName
READ
commandName
NOTIFY
commandChanged
)
Q_PROPERTY
(
QStringList
valueLabels
READ
valueLabels
NOTIFY
commandChanged
)
Q_PROPERTY
(
QStringList
valueStrings
READ
valueStrings
NOTIFY
valueStringsChanged
)
Q_PROPERTY
(
int
commandByIndex
READ
commandByIndex
WRITE
setCommandByIndex
NOTIFY
commandChanged
)
Q_PROPERTY
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
READ
command
WRITE
setCommand
NOTIFY
commandChanged
)
// Property accesors
int
sequenceNumber
(
void
)
const
{
return
_sequenceNumber
;
}
void
setSequenceNumber
(
int
sequenceNumber
);
bool
isCurrentItem
(
void
)
const
{
return
_isCurrentItem
;
}
void
setIsCurrentItem
(
bool
isCurrentItem
);
Q_PROPERTY
(
double
longitude
READ
longitude
NOTIFY
longitudeChanged
)
Q_PROPERTY
(
double
latitude
READ
latitude
NOTIFY
latitudeChanged
)
Q_PROPERTY
(
double
altitude
READ
altitude
NOTIFY
altitudeChanged
)
Q_PROPERTY
(
quint16
id
READ
id
CONSTANT
)
bool
specifiesCoordinate
(
void
)
const
;
Q_PROPERTY
(
QStringList
valueLabels
READ
valueLabels
NOTIFY
commandChanged
)
Q_PROPERTY
(
QStringList
valueStrings
READ
valueStrings
NOTIFY
valueStringsChanged
)
QGeoCoordinate
coordinate
(
void
)
const
{
return
_coordinate
;
}
void
setCoordinate
(
const
QGeoCoordinate
&
coordinate
);
QStringList
commandNames
(
void
);
QString
commandName
(
void
);
double
latitude
()
{
return
_x
;
}
double
longitude
()
{
return
_y
;
}
double
altitude
()
{
return
_z
;
}
quint16
id
()
{
return
_id
;
}
int
commandByIndex
(
void
);
void
setCommandByIndex
(
int
index
);
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
(
void
)
{
return
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
)
getAction
();
};
void
setCommand
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
)
{
setAction
(
command
);
}
QStringList
valueLabels
(
void
);
QStringList
valueStrings
(
void
);
// C++ only methods
quint16
getId
()
const
{
return
_id
;
}
double
getX
()
const
{
return
_x
;
}
double
getY
()
const
{
return
_y
;
}
double
getZ
()
const
{
return
_z
;
}
double
getLatitude
()
const
{
return
_x
;
}
double
getLongitude
()
const
{
return
_y
;
}
double
getAltitude
()
const
{
return
_z
;
}
double
getYaw
()
const
{
return
_yaw
;
}
double
latitude
(
void
)
const
{
return
_coordinate
.
latitude
();
}
double
longitude
(
void
)
const
{
return
_coordinate
.
longitude
();
}
double
altitude
(
void
)
const
{
return
_coordinate
.
altitude
();
}
void
setLatitude
(
double
latitude
);
void
setLongitude
(
double
longitude
);
void
setAltitude
(
double
altitude
);
double
x
(
void
)
const
{
return
latitude
();
}
double
y
(
void
)
const
{
return
longitude
();
}
double
z
(
void
)
const
{
return
altitude
();
}
void
setX
(
double
x
);
void
setY
(
double
y
);
void
setZ
(
double
z
);
double
yaw
(
void
)
const
{
return
_yaw
;
}
void
setYaw
(
double
yaw
);
bool
getAutoContinue
()
const
{
return
_autocontinue
;
}
bool
getCurrent
()
const
{
return
_current
;
}
double
getLoiterOrbit
()
const
{
return
_orbit
;
}
...
...
@@ -128,16 +136,16 @@ public:
return
_orbit
;
}
double
getParam4
()
const
{
return
_yaw
;
return
yaw
()
;
}
double
getParam5
()
const
{
return
_x
;
return
latitude
()
;
}
double
getParam6
()
const
{
return
_y
;
return
longitude
()
;
}
double
getParam7
()
const
{
return
_z
;
return
altitude
()
;
}
int
getTurns
()
const
{
return
_param1
;
...
...
@@ -150,13 +158,6 @@ public:
int
getAction
()
const
{
return
_action
;
}
const
QString
&
getName
()
const
{
return
_name
;
}
const
QString
&
getDescription
()
const
{
return
_description
;
}
/** @brief Returns true if x, y, z contain reasonable navigation data */
bool
isNavigationType
();
...
...
@@ -166,47 +167,24 @@ public:
void
save
(
QTextStream
&
saveStream
);
bool
load
(
QTextStream
&
loadStream
);
bool
hasCoordinate
(
void
);
QGeoCoordinate
coordinate
(
void
);
QString
commandName
(
void
);
signals:
void
sequenceNumberChanged
(
int
sequenceNumber
);
void
specifiesCoordinateChanged
(
bool
specifiesCoordinate
);
void
isCurrentItemChanged
(
bool
isCurrentItem
);
void
coordinateChanged
(
const
QGeoCoordinate
&
coordinate
);
void
yawChanged
(
double
yaw
);
/** @brief Announces a change to the waypoint data */
void
changed
(
MissionItem
*
wp
);
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
(
void
)
{
return
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
)
getAction
();
};
void
setCommand
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
)
{
setAction
(
command
);
}
QStringList
valueLabels
(
void
);
QStringList
valueStrings
(
void
);
void
commandNameChanged
(
QString
type
);
void
commandChanged
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
);
void
valueLabelsChanged
(
QStringList
valueLabels
);
void
valueStringsChanged
(
QStringList
valueStrings
);
protected:
quint16
_id
;
double
_x
;
double
_y
;
double
_z
;
double
_yaw
;
int
_frame
;
int
_action
;
bool
_autocontinue
;
bool
_current
;
double
_orbit
;
double
_param1
;
double
_param2
;
int
_turns
;
QString
_name
;
QString
_description
;
quint64
_reachedTime
;
public:
void
setId
(
quint16
_id
);
void
setX
(
double
_x
);
void
setY
(
double
_y
);
void
setZ
(
double
_z
);
void
setLatitude
(
double
lat
);
void
setLongitude
(
double
lon
);
void
setAltitude
(
double
alt
);
/** @brief Yaw angle in COMPASS DEGREES: 0-360 */
void
setYaw
(
int
_yaw
);
/** @brief Yaw angle in COMPASS DEGREES: 0-360 */
void
setYaw
(
double
_yaw
);
/** @brief Set the waypoint action */
void
setAction
(
int
_action
);
void
setFrame
(
int
_frame
);
...
...
@@ -234,22 +212,30 @@ public:
emit
changed
(
this
);
}
signals:
/** @brief Announces a change to the waypoint data */
void
changed
(
MissionItem
*
wp
);
void
latitudeChanged
();
void
longitudeChanged
();
void
altitudeChanged
();
void
hasCoordinateChanged
(
bool
hasCoordinate
);
void
coordinateChanged
(
void
);
void
commandNameChanged
(
QString
type
);
void
commandChanged
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
);
void
valueLabelsChanged
(
QStringList
valueLabels
);
void
valueStringsChanged
(
QStringList
valueStrings
);
private:
QString
_oneDecimalString
(
double
value
);
private:
typedef
struct
{
MAV_CMD
command
;
const
char
*
name
;
}
MavCmd2Name_t
;
int
_sequenceNumber
;
QGeoCoordinate
_coordinate
;
double
_yaw
;
int
_frame
;
int
_action
;
bool
_autocontinue
;
bool
_isCurrentItem
;
double
_orbit
;
double
_param1
;
double
_param2
;
int
_turns
;
quint64
_reachedTime
;
static
const
int
_cMavCmd2Name
=
9
;
static
const
MavCmd2Name_t
_rgMavCmd2Name
[
_cMavCmd2Name
];
};
#endif
src/QmlControls/MissionItemEditor.qml
0 → 100644
View file @
69f27141
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
/// Mission item edit control
Rectangle
{
property
var
missionItem
width
:
_editFieldWidth
+
(
ScreenTools
.
defaultFontPixelWidth
*
10
)
height
:
_valueColumn
.
y
+
_valueColumn
.
height
+
(
radius
/
2
)
border.width
:
2
border.color
:
"
white
"
color
:
"
white
"
radius
:
ScreenTools
.
defaultFontPixelWidth
readonly
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
13
MissionItemIndexLabel
{
id
:
_label
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
isCurrentItem
:
missionItem
.
isCurrentItem
label
:
missionItem
.
sequenceNumber
}
QGCComboBox
{
id
:
_commandCombo
anchors.margins
:
parent
.
radius
/
2
anchors.left
:
parent
.
left
anchors.right
:
_label
.
left
anchors.top
:
parent
.
top
currentIndex
:
missionItem
.
commandByIndex
model
:
missionItem
.
commandNames
onActivated
:
missionItem
.
commandByIndex
=
index
}
Column
{
id
:
_coordinateColumn
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
visible
:
missionItem
.
specifiesCoordinate
}
QGCTextField
{
id
:
_latitudeField
anchors.margins
:
parent
.
radius
/
2
anchors.top
:
_commandCombo
.
bottom
anchors.right
:
parent
.
right
width
:
_editFieldWidth
text
:
missionItem
.
coordinate
.
latitude
visible
:
missionItem
.
specifiesCoordinate
onAccepted
:
missionItem
.
coordinate
.
latitude
=
text
}
QGCTextField
{
id
:
_longitudeField
anchors.margins
:
parent
.
radius
/
2
anchors.top
:
_latitudeField
.
bottom
anchors.right
:
parent
.
right
width
:
_editFieldWidth
text
:
missionItem
.
coordinate
.
longitude
visible
:
missionItem
.
specifiesCoordinate
onAccepted
:
missionItem
.
coordinate
.
longtitude
=
text
}
QGCTextField
{
id
:
_altitudeField
anchors.margins
:
parent
.
radius
/
2
anchors.top
:
_longitudeField
.
bottom
anchors.right
:
parent
.
right
width
:
_editFieldWidth
text
:
missionItem
.
coordinate
.
altitude
visible
:
missionItem
.
specifiesCoordinate
showUnits
:
true
unitsLabel
:
"
meters
"
onAccepted
:
missionItem
.
coordinate
.
altitude
=
text
}
QGCLabel
{
anchors.margins
:
parent
.
radius
/
2
anchors.left
:
parent
.
left
anchors.baseline
:
_latitudeField
.
baseline
color
:
"
black
"
text
:
"
Lat:
"
visible
:
missionItem
.
specifiesCoordinate
}
QGCLabel
{
anchors.margins
:
parent
.
radius
/
2
anchors.left
:
parent
.
left
anchors.baseline
:
_longitudeField
.
baseline
color
:
"
black
"
text
:
"
Long:
"
visible
:
missionItem
.
specifiesCoordinate
}
QGCLabel
{
anchors.margins
:
parent
.
radius
/
2
anchors.left
:
parent
.
left
anchors.baseline
:
_altitudeField
.
baseline
color
:
"
black
"
text
:
"
Alt:
"
visible
:
missionItem
.
specifiesCoordinate
}
Column
{
id
:
_valueColumn
anchors.margins
:
parent
.
radius
/
2
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
missionItem
.
specifiesCoordinate
?
_altitudeField
.
bottom
:
_commandCombo
.
bottom
Repeater
{
model
:
missionItem
.
valueLabels
QGCLabel
{
color
:
"
black
"
text
:
modelData
}
}
}
Column
{
anchors.margins
:
parent
.
radius
/
2
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
_valueColumn
.
top
Repeater
{
model
:
missionItem
.
valueStrings
QGCLabel
{
width
:
_valueColumn
.
width
color
:
"
black
"
text
:
modelData
horizontalAlignment
:
Text
.
AlignRight
}
}
}
}
src/QmlControls/MissionItemIndexLabel.qml
View file @
69f27141
...
...
@@ -5,20 +5,21 @@ import QtQuick.Controls.Styles 1.2
import
QGroundControl
.
ScreenTools
1.0
Rectangle
{
property
int
missionItemIndex
///< Index to show in label
property
alias
label
:
_label
.
text
property
bool
isCurrentItem
:
false
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
/
2
border.width
:
2
border.color
:
"
white
"
color
:
"
orange
"
color
:
isCurrentItem
?
"
green
"
:
"
orange
"
QGCLabel
{
id
:
_label
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
color
:
"
white
"
text
:
missionItemIndex
}
}
src/QmlControls/MissionItemSummary.qml
View file @
69f27141
...
...
@@ -7,7 +7,7 @@ import QGroundControl.Vehicle 1.0
/// Mission item summary display control
Rectangle
{
property
var
missionItem
///< Mission Item object
property
var
missionItem
///< Mission Item object
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
height
:
valueColumn
.
height
+
radius
...
...
@@ -17,9 +17,11 @@ Rectangle {
radius
:
ScreenTools
.
defaultFontPixelWidth
MissionItemIndexLabel
{
id
:
_indexLabel
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
missionItemIndex
:
missionItem
.
id
isCurrentItem
:
missionItem
.
isCurrentItem
label
:
missionItem
.
sequenceNumber
}
Column
{
...
...
src/QmlControls/QGroundControl.Controls.qmldir
View file @
69f27141
...
...
@@ -28,4 +28,5 @@ QGCViewMessage 1.0 QGCViewMessage.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
MissionItemSummary 1.0 MissionItemSummary.qml
MissionItemEditor 1.0 MissionItemEditor.qml