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
c58d1781
Commit
c58d1781
authored
Dec 03, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2341 from DonLakeFlyer/MissionItemCategories
Add mission item categories
parents
0581a1de
62acc335
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
773 additions
and
358 deletions
+773
-358
qgroundcontrol.pro
qgroundcontrol.pro
+2
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+1
-0
MavCmdInfo.json
src/MissionManager/MavCmdInfo.json
+19
-1
MissionCommands.cc
src/MissionManager/MissionCommands.cc
+258
-0
MissionCommands.h
src/MissionManager/MissionCommands.h
+178
-0
MissionItem.cc
src/MissionManager/MissionItem.cc
+65
-225
MissionItem.h
src/MissionManager/MissionItem.h
+4
-48
QGCApplication.cc
src/QGCApplication.cc
+8
-5
QGCToolbox.cc
src/QGCToolbox.cc
+38
-33
QGCToolbox.h
src/QGCToolbox.h
+26
-23
MissionCommandDialog.qml
src/QmlControls/MissionCommandDialog.qml
+134
-0
MissionItemEditor.qml
src/QmlControls/MissionItemEditor.qml
+21
-11
QGCView.qml
src/QmlControls/QGCView.qml
+1
-1
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+1
-0
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+5
-4
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+11
-7
No files found.
qgroundcontrol.pro
View file @
c58d1781
...
...
@@ -247,6 +247,7 @@ HEADERS += \
src
/
Joystick
/
JoystickManager
.
h
\
src
/
LogCompressor
.
h
\
src
/
MG
.
h
\
src
/
MissionManager
/
MissionCommands
.
h
\
src
/
MissionManager
/
MissionController
.
h
\
src
/
MissionManager
/
MissionItem
.
h
\
src
/
MissionManager
/
MissionManager
.
h
\
...
...
@@ -367,6 +368,7 @@ SOURCES += \
src
/
Joystick
/
JoystickManager
.
cc
\
src
/
LogCompressor
.
cc
\
src
/
main
.
cc
\
src
/
MissionManager
/
MissionCommands
.
cc
\
src
/
MissionManager
/
MissionController
.
cc
\
src
/
MissionManager
/
MissionItem
.
cc
\
src
/
MissionManager
/
MissionManager
.
cc
\
...
...
qgroundcontrol.qrc
View file @
c58d1781
...
...
@@ -45,6 +45,7 @@
<file alias="QGroundControl/Controls/MainToolBarIndicators.qml">src/ui/toolbar/MainToolBarIndicators.qml</file>
<file alias="QGroundControl/Controls/MissionItemEditor.qml">src/QmlControls/MissionItemEditor.qml</file>
<file alias="QGroundControl/Controls/MissionItemIndexLabel.qml">src/QmlControls/MissionItemIndexLabel.qml</file>
<file alias="QGroundControl/Controls/MissionCommandDialog.qml">src/QmlControls/MissionCommandDialog.qml</file>
<file alias="QGroundControl/Controls/ModeSwitchDisplay.qml">src/QmlControls/ModeSwitchDisplay.qml</file>
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
...
...
src/MissionEditor/MissionEditor.qml
View file @
c58d1781
...
...
@@ -403,6 +403,7 @@ QGCView {
width
:
parent
.
width
readOnly
:
object
.
sequenceNumber
==
0
visible
:
!
readOnly
||
object
.
homePositionValid
qgcView
:
_root
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
...
...
src/MissionManager/MavCmdInfo.json
View file @
c58d1781
...
...
@@ -19,6 +19,7 @@
"description"
:
"Travel to a position in 3D space."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param1"
:
{
"label"
:
"Hold:"
,
"units"
:
"seconds"
,
...
...
@@ -33,6 +34,7 @@
"description"
:
"Travel to a position and Loiter around the specified radius indefinitely."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param3"
:
{
"label"
:
"Radius:"
,
"units"
:
"meters"
,
...
...
@@ -47,6 +49,7 @@
"description"
:
"Travel to a position and Loiter around the specified radius for a number of turns."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param1"
:
{
"label"
:
"Turns:"
,
"default"
:
1
,
...
...
@@ -66,6 +69,7 @@
"description"
:
"Travel to a position and Loiter around the specified radius for an amount of time."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param1"
:
{
"label"
:
"Hold:"
,
"units"
:
"seconds"
,
...
...
@@ -84,7 +88,8 @@
"rawName"
:
"MAV_CMD_NAV_RETURN_TO_LAUNCH"
,
"friendlyName"
:
"Return Home"
,
"description"
:
"Send the vehicle back to the home position."
,
"friendlyEdit"
:
true
"friendlyEdit"
:
true
,
"category"
:
"Basic"
},
{
"id"
:
21
,
...
...
@@ -93,6 +98,7 @@
"description"
:
"Land vehicle at the specified location."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param1"
:
{
"label"
:
"Abort Alt:"
,
"units"
:
"meters"
,
...
...
@@ -113,6 +119,7 @@
"description"
:
"Take off from the ground and travel towards the specified position."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param1"
:
{
"label"
:
"Pitch:"
,
"units"
:
"degreesConvert"
,
...
...
@@ -138,6 +145,7 @@
"description"
:
"Sets the region of interest for cameras."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Camera"
,
"param1"
:
{
"label"
:
"Mode:"
,
"enumStrings"
:
"None,Next waypoint,Mission item,Location,ROI item"
,
...
...
@@ -176,6 +184,7 @@
"friendlyName"
:
"Delay"
,
"description"
:
"Delay the mission for the number of seconds."
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param1"
:
{
"label"
:
"Hold:"
,
"units"
:
"seconds"
,
...
...
@@ -188,6 +197,7 @@
"rawName"
:
"MAV_CMD_CONDITION_CHANGE_ALT"
,
"description"
:
"Delay the mission until the specified altitide is reached."
,
"friendlyName"
:
"Wait for altitude"
,
"category"
:
"Conditionals"
,
"param1"
:
{
"label"
:
"Rate:"
,
"units"
:
"m/s"
,
...
...
@@ -206,6 +216,7 @@
"rawName"
:
"MAV_CMD_CONDITION_DISTANCE"
,
"description"
:
"Delay the mission until within the specified distance of the next waypoint."
,
"friendlyName"
:
"Wait for distance"
,
"category"
:
"Conditionals"
,
"param1"
:
{
"label"
:
"Distance:"
,
"units"
:
"meters"
,
...
...
@@ -218,6 +229,7 @@
"rawName"
:
"MAV_CMD_CONDITION_YAW"
,
"friendlyName"
:
"Wait for Heading"
,
"description"
:
"Delay the mission until the specified heading is reached."
,
"category"
:
"Conditionals"
,
"param1"
:
{
"label"
:
"Heading:"
,
"units"
:
"degrees"
,
...
...
@@ -250,6 +262,7 @@
"friendlyName"
:
"Jump to item"
,
"description"
:
"Mission will continue at the specified item."
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"param1"
:
{
"label"
:
"Item #:"
,
"default"
:
1
,
...
...
@@ -380,6 +393,7 @@
"description"
:
"Sets the region of interest for cameras."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Camera"
,
"param1"
:
{
"label"
:
"Mode:"
,
"enumStrings"
:
"None,Next waypoint,Mission item,Location,ROI item"
,
...
...
@@ -403,6 +417,7 @@
"rawName"
:
"MAV_CMD_DO_DIGICAM_CONFIGURE"
,
"friendlyName"
:
"Camera config"
,
"description"
:
"Configure onboard camera controller."
,
"category"
:
"Camera"
,
"param1"
:
{
"label"
:
"Mode:"
,
"default"
:
0
,
...
...
@@ -446,6 +461,7 @@
"friendlyName"
:
"Camera control"
,
"rawName"
:
"MAV_CMD_DO_DIGICAM_CONTROL"
,
"description"
:
"Control onboard camera."
,
"category"
:
"Camera"
,
"param1"
:
{
"label"
:
"Session:"
,
"default"
:
0
,
...
...
@@ -483,6 +499,7 @@
"rawName"
:
"MAV_CMD_DO_MOUNT_CONTROL"
,
"friendlyName"
:
"Mount config"
,
"description"
:
"Control antenna mount or camera."
,
"category"
:
"Camera"
,
"param1"
:
{
"label"
:
"Lat/Pitch:"
,
"default"
:
0
,
...
...
@@ -511,6 +528,7 @@
"rawName"
:
"MAV_CMD_DO_SET_CAM_TRIGG_DIST"
,
"friendlyName"
:
"Camera trigger distance"
,
"description"
:
"Set camera trigger distance."
,
"category"
:
"Camera"
,
"param1"
:
{
"label"
:
"Distance:"
,
"default"
:
25
,
...
...
src/MissionManager/MissionCommands.cc
0 → 100644
View file @
c58d1781
This diff is collapsed.
Click to expand it.
src/MissionManager/MissionCommands.h
0 → 100644
View file @
c58d1781
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef MissionCommands_H
#define MissionCommands_H
#include "QGCToolbox.h"
#include "QGCMAVLink.h"
#include "QGCLoggingCategory.h"
#include "QmlObjectListModel.h"
#include "MavlinkQmlSingleton.h"
#include <QObject>
#include <QString>
#include <QJsonObject>
#include <QJsonValue>
Q_DECLARE_LOGGING_CATEGORY
(
MissionCommandsLog
)
class
MissionCommands
;
class
MavCmdParamInfo
:
public
QObject
{
Q_OBJECT
public:
MavCmdParamInfo
(
QObject
*
parent
=
NULL
)
:
QObject
(
parent
)
{
}
Q_PROPERTY
(
int
decimalPlaces
READ
decimalPlaces
CONSTANT
)
Q_PROPERTY
(
double
defaultValue
READ
defaultValue
CONSTANT
)
Q_PROPERTY
(
QStringList
enumStrings
READ
enumStrings
CONSTANT
)
Q_PROPERTY
(
QVariantList
enumValues
READ
enumValues
CONSTANT
)
Q_PROPERTY
(
QString
label
READ
label
CONSTANT
)
Q_PROPERTY
(
int
param
READ
param
CONSTANT
)
Q_PROPERTY
(
QString
units
READ
units
CONSTANT
)
int
decimalPlaces
(
void
)
const
{
return
_decimalPlaces
;
}
double
defaultValue
(
void
)
const
{
return
_defaultValue
;
}
QStringList
enumStrings
(
void
)
const
{
return
_enumStrings
;
}
QVariantList
enumValues
(
void
)
const
{
return
_enumValues
;
}
QString
label
(
void
)
const
{
return
_label
;
}
int
param
(
void
)
const
{
return
_param
;
}
QString
units
(
void
)
const
{
return
_units
;
}
private:
int
_decimalPlaces
;
double
_defaultValue
;
QStringList
_enumStrings
;
QVariantList
_enumValues
;
QString
_label
;
int
_param
;
QString
_units
;
friend
class
MissionCommands
;
};
class
MavCmdInfo
:
public
QObject
{
Q_OBJECT
public:
MavCmdInfo
(
QObject
*
parent
=
NULL
)
:
QObject
(
parent
)
{
}
Q_PROPERTY
(
QString
category
READ
category
CONSTANT
)
Q_PROPERTY
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
READ
command
CONSTANT
)
Q_PROPERTY
(
QString
description
READ
description
CONSTANT
)
Q_PROPERTY
(
bool
friendlyEdit
READ
friendlyEdit
CONSTANT
)
Q_PROPERTY
(
QString
friendlyName
READ
friendlyName
CONSTANT
)
Q_PROPERTY
(
QString
rawName
READ
rawName
CONSTANT
)
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
CONSTANT
)
QString
category
(
void
)
const
{
return
_category
;
}
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
(
void
)
const
{
return
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
)
_command
;
}
QString
description
(
void
)
const
{
return
_description
;
}
bool
friendlyEdit
(
void
)
const
{
return
_friendlyEdit
;
}
QString
friendlyName
(
void
)
const
{
return
_friendlyName
;
}
QString
rawName
(
void
)
const
{
return
_rawName
;
}
bool
specifiesCoordinate
(
void
)
const
{
return
_specifiesCoordinate
;
}
const
QMap
<
int
,
MavCmdParamInfo
*>&
paramInfoMap
(
void
)
const
{
return
_paramInfoMap
;
}
private:
QString
_category
;
MAV_CMD
_command
;
QString
_description
;
bool
_friendlyEdit
;
QString
_friendlyName
;
QMap
<
int
,
MavCmdParamInfo
*>
_paramInfoMap
;
QString
_rawName
;
bool
_specifiesCoordinate
;
friend
class
MissionCommands
;
};
class
MissionCommands
:
public
QGCTool
{
Q_OBJECT
public:
MissionCommands
(
QGCApplication
*
app
);
Q_PROPERTY
(
QStringList
categories
READ
categories
CONSTANT
)
Q_PROPERTY
(
const
QmlObjectListModel
*
commands
READ
commands
CONSTANT
)
Q_INVOKABLE
QString
categoryFromCommand
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
)
{
return
_mavCmdInfoMap
[(
MAV_CMD
)
command
]
->
category
();
}
Q_INVOKABLE
const
QVariant
getCommandsForCategory
(
const
QString
&
category
)
const
{
return
QVariant
::
fromValue
(
_categoryToMavCmdInfoListMap
[
category
]);
}
const
QStringList
categories
(
void
)
const
{
return
_categories
;
}
const
QmlObjectListModel
*
commands
(
void
)
const
{
return
&
_commandList
;
}
const
QMap
<
MAV_CMD
,
MavCmdInfo
*>&
commandInfoMap
(
void
)
const
{
return
_mavCmdInfoMap
;
};
static
const
QString
_degreesUnits
;
static
const
QString
_degreesConvertUnits
;
signals:
private:
void
_loadMavCmdInfoJson
(
void
);
void
_setupMetaData
(
void
);
bool
_validateKeyTypes
(
QJsonObject
&
jsonObject
,
const
QStringList
&
keys
,
const
QList
<
QJsonValue
::
Type
>&
types
);
private:
QStringList
_categories
;
QMap
<
QString
,
QmlObjectListModel
*>
_categoryToMavCmdInfoListMap
;
QmlObjectListModel
_commandList
;
QMap
<
MAV_CMD
,
MavCmdInfo
*>
_mavCmdInfoMap
;
static
const
QString
_categoryJsonKey
;
static
const
QString
_decimalPlacesJsonKey
;
static
const
QString
_defaultJsonKey
;
static
const
QString
_descriptionJsonKey
;
static
const
QString
_enumStringsJsonKey
;
static
const
QString
_enumValuesJsonKey
;
static
const
QString
_friendlyNameJsonKey
;
static
const
QString
_friendlyEditJsonKey
;
static
const
QString
_idJsonKey
;
static
const
QString
_labelJsonKey
;
static
const
QString
_mavCmdInfoJsonKey
;
static
const
QString
_param1JsonKey
;
static
const
QString
_param2JsonKey
;
static
const
QString
_param3JsonKey
;
static
const
QString
_param4JsonKey
;
static
const
QString
_paramJsonKeyFormat
;
static
const
QString
_rawNameJsonKey
;
static
const
QString
_specifiesCoordinateJsonKey
;
static
const
QString
_unitsJsonKey
;
static
const
QString
_versionJsonKey
;
};
#endif
src/MissionManager/MissionItem.cc
View file @
c58d1781
This diff is collapsed.
Click to expand it.
src/MissionManager/MissionItem.h
View file @
c58d1781
...
...
@@ -29,8 +29,6 @@
#include <QtQml>
#include <QTextStream>
#include <QGeoCoordinate>
#include <QJsonObject>
#include <QJsonValue>
#include "QGCMAVLink.h"
#include "QGC.h"
...
...
@@ -39,6 +37,7 @@
#include "Fact.h"
#include "QGCLoggingCategory.h"
#include "QmlObjectListModel.h"
#include "MissionCommands.h"
Q_DECLARE_LOGGING_CATEGORY
(
MissionItemLog
)
...
...
@@ -70,6 +69,7 @@ public:
const
MissionItem
&
operator
=
(
const
MissionItem
&
other
);
Q_PROPERTY
(
double
azimuth
READ
azimuth
WRITE
setAzimuth
NOTIFY
azimuthChanged
)
///< Azimuth to previous waypoint
Q_PROPERTY
(
QString
category
READ
category
NOTIFY
commandChanged
)
Q_PROPERTY
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
READ
command
WRITE
setCommand
NOTIFY
commandChanged
)
Q_PROPERTY
(
QString
commandDescription
READ
commandDescription
NOTIFY
commandChanged
)
Q_PROPERTY
(
QString
commandName
READ
commandName
NOTIFY
commandChanged
)
...
...
@@ -97,6 +97,7 @@ public:
// Property accesors
double
azimuth
(
void
)
const
{
return
_azimuth
;
}
QString
category
(
void
)
const
;
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
(
void
)
const
{
return
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
)
_commandFact
.
cookedValue
().
toInt
();
};
QString
commandDescription
(
void
)
const
;
QString
commandName
(
void
)
const
;
...
...
@@ -206,34 +207,12 @@ private slots:
private:
void
_clearParamMetaData
(
void
);
void
_connectSignals
(
void
);
bool
_loadMavCmdInfoJson
(
void
);
void
_setupMetaData
(
void
);
bool
_validateKeyTypes
(
QJsonObject
&
jsonObject
,
const
QStringList
&
keys
,
const
QList
<
QJsonValue
::
Type
>&
types
);
static
QVariant
_degreesToRadians
(
const
QVariant
&
degrees
);
static
QVariant
_radiansToDegrees
(
const
QVariant
&
radians
);
private:
typedef
struct
{
double
defaultValue
;
int
decimalPlaces
;
QStringList
enumStrings
;
QVariantList
enumValues
;
QString
label
;
int
param
;
QString
units
;
}
ParamInfo_t
;
typedef
struct
{
MAV_CMD
command
;
QString
description
;
bool
friendlyEdit
;
QString
friendlyName
;
QMap
<
int
,
ParamInfo_t
>
paramInfoMap
;
QString
rawName
;
bool
specifiesCoordinate
;
}
MavCmdInfo_t
;
bool
_rawEdit
;
bool
_dirty
;
int
_sequenceNumber
;
...
...
@@ -279,30 +258,7 @@ private:
bool
_syncingHeadingDegreesAndParam4
;
///< true: already in a sync signal, prevents signal loop
bool
_syncingSupportedCommandAndCommand
;
///< true: already in a sync signal, prevents signal loop
static
QMap
<
MAV_CMD
,
MavCmdInfo_t
>
_mavCmdInfoMap
;
static
const
QString
_decimalPlacesJsonKey
;
static
const
QString
_defaultJsonKey
;
static
const
QString
_descriptionJsonKey
;
static
const
QString
_enumStringsJsonKey
;
static
const
QString
_enumValuesJsonKey
;
static
const
QString
_friendlyNameJsonKey
;
static
const
QString
_friendlyEditJsonKey
;
static
const
QString
_idJsonKey
;
static
const
QString
_labelJsonKey
;
static
const
QString
_mavCmdInfoJsonKey
;
static
const
QString
_param1JsonKey
;
static
const
QString
_param2JsonKey
;
static
const
QString
_param3JsonKey
;
static
const
QString
_param4JsonKey
;
static
const
QString
_paramJsonKeyFormat
;
static
const
QString
_rawNameJsonKey
;
static
const
QString
_specifiesCoordinateJsonKey
;
static
const
QString
_unitsJsonKey
;
static
const
QString
_versionJsonKey
;
static
const
QString
_degreesUnits
;
static
const
QString
_degreesConvertUnits
;
const
QMap
<
MAV_CMD
,
MavCmdInfo
*>&
_mavCmdInfoMap
;
};
QDebug
operator
<<
(
QDebug
dbg
,
const
MissionItem
&
missionItem
);
...
...
src/QGCApplication.cc
View file @
c58d1781
...
...
@@ -88,6 +88,7 @@
#include "CoordinateVector.h"
#include "MainToolBarController.h"
#include "MissionController.h"
#include "MissionCommands.h"
#include "FlightDisplayViewController.h"
#include "VideoSurface.h"
#include "VideoReceiver.h"
...
...
@@ -338,6 +339,13 @@ void QGCApplication::_initCommon(void)
qmlRegisterType
<
QGCPalette
>
(
"QGroundControl.Palette"
,
1
,
0
,
"QGCPalette"
);
qmlRegisterType
<
QGCMapPalette
>
(
"QGroundControl.Palette"
,
1
,
0
,
"QGCMapPalette"
);
qmlRegisterUncreatableType
<
CoordinateVector
>
(
"QGroundControl"
,
1
,
0
,
"CoordinateVector"
,
"Reference only"
);
qmlRegisterUncreatableType
<
MissionCommands
>
(
"QGroundControl"
,
1
,
0
,
"MissionCommands"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCQGeoCoordinate
>
(
"QGroundControl"
,
1
,
0
,
"QGCQGeoCoordinate"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QmlObjectListModel
>
(
"QGroundControl"
,
1
,
0
,
"QmlObjectListModel"
,
"Reference only"
);
qmlRegisterUncreatableType
<
VideoReceiver
>
(
"QGroundControl"
,
1
,
0
,
"VideoReceiver"
,
"Reference only"
);
qmlRegisterUncreatableType
<
VideoSurface
>
(
"QGroundControl"
,
1
,
0
,
"VideoSurface"
,
"Reference only"
);
qmlRegisterUncreatableType
<
AutoPilotPlugin
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"AutoPilotPlugin"
,
"Reference only"
);
qmlRegisterUncreatableType
<
VehicleComponent
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"VehicleComponent"
,
"Reference only"
);
qmlRegisterUncreatableType
<
Vehicle
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"Vehicle"
,
"Reference only"
);
...
...
@@ -345,11 +353,6 @@ void QGCApplication::_initCommon(void)
qmlRegisterUncreatableType
<
MissionManager
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"MissionManager"
,
"Reference only"
);
qmlRegisterUncreatableType
<
JoystickManager
>
(
"QGroundControl.JoystickManager"
,
1
,
0
,
"JoystickManager"
,
"Reference only"
);
qmlRegisterUncreatableType
<
Joystick
>
(
"QGroundControl.JoystickManager"
,
1
,
0
,
"Joystick"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QmlObjectListModel
>
(
"QGroundControl"
,
1
,
0
,
"QmlObjectListModel"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCQGeoCoordinate
>
(
"QGroundControl"
,
1
,
0
,
"QGCQGeoCoordinate"
,
"Reference only"
);
qmlRegisterUncreatableType
<
CoordinateVector
>
(
"QGroundControl"
,
1
,
0
,
"CoordinateVector"
,
"Reference only"
);
qmlRegisterUncreatableType
<
VideoSurface
>
(
"QGroundControl"
,
1
,
0
,
"VideoSurface"
,
"Reference only"
);
qmlRegisterUncreatableType
<
VideoReceiver
>
(
"QGroundControl"
,
1
,
0
,
"VideoReceiver"
,
"Reference only"
);
qmlRegisterType
<
ParameterEditorController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ParameterEditorController"
);
qmlRegisterType
<
FlightModesComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FlightModesComponentController"
);
...
...
src/QGCToolbox.cc
View file @
c58d1781
...
...
@@ -21,73 +21,78 @@
======================================================================*/
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
#include "AutoPilotPluginManager.h"
#include "FactSystem.h"
#include "FirmwarePluginManager.h"
#include "FlightMapSettings.h"
#include "GAudioOutput.h"
#include "HomePositionManager.h"
#include "FirmwarePluginManager.h"
#include "MultiVehicleManager.h"
#include "JoystickManager.h"
#include "
GAudioOutput
.h"
#include "
AutoPilotPluginManager
.h"
#include "
UASMessageHandler
.h"
#include "
FactSystem
.h"
#include "
LinkManager
.h"
#include "
MAVLinkProtocol
.h"
#include "
MissionCommands
.h"
#include "
MultiVehicleManager
.h"
#include "QGCImageProvider.h"
#include "UASMessageHandler.h"
QGCToolbox
::
QGCToolbox
(
QGCApplication
*
app
)
:
_
firmwarePluginManager
(
NULL
)
:
_
audioOutput
(
NULL
)
,
_autopilotPluginManager
(
NULL
)
,
_linkManager
(
NULL
)
,
_multiVehicleManager
(
NULL
)
,
_mavlinkProtocol
(
NULL
)
,
_factSystem
(
NULL
)
,
_firmwarePluginManager
(
NULL
)
,
_flightMapSettings
(
NULL
)
,
_homePositionManager
(
NULL
)
,
_imageProvider
(
NULL
)
,
_joystickManager
(
NULL
)
,
_audioOutput
(
NULL
)
,
_linkManager
(
NULL
)
,
_mavlinkProtocol
(
NULL
)
,
_missionCommands
(
NULL
)
,
_multiVehicleManager
(
NULL
)
,
_uasMessageHandler
(
NULL
)
,
_factSystem
(
NULL
)
,
_imageProvider
(
NULL
)
{
_
firmwarePluginManager
=
new
FirmwarePluginManager
(
app
);
_
audioOutput
=
new
GAudioOutput
(
app
);
_autopilotPluginManager
=
new
AutoPilotPluginManager
(
app
);
_factSystem
=
new
FactSystem
(
app
);
_firmwarePluginManager
=
new
FirmwarePluginManager
(
app
);
_flightMapSettings
=
new
FlightMapSettings
(
app
);
_homePositionManager
=
new
HomePositionManager
(
app
);
_factSystem
=
new
FactSystem
(
app
);
_imageProvider
=
new
QGCImageProvider
(
app
);
_joystickManager
=
new
JoystickManager
(
app
);
_linkManager
=
new
LinkManager
(
app
);
_multiVehicleManager
=
new
MultiVehicleManager
(
app
);
_mavlinkProtocol
=
new
MAVLinkProtocol
(
app
);
_
joystickManager
=
new
JoystickManager
(
app
);
_
audioOutput
=
new
GAudioOutput
(
app
);
_
missionCommands
=
new
MissionCommands
(
app
);
_
multiVehicleManager
=
new
MultiVehicleManager
(
app
);
_uasMessageHandler
=
new
UASMessageHandler
(
app
);
_imageProvider
=
new
QGCImageProvider
(
app
);
_
firmwarePluginManager
->
setToolbox
(
this
);
_
audioOutput
->
setToolbox
(
this
);
_autopilotPluginManager
->
setToolbox
(
this
);
_factSystem
->
setToolbox
(
this
);
_firmwarePluginManager
->
setToolbox
(
this
);
_flightMapSettings
->
setToolbox
(
this
);
_homePositionManager
->
setToolbox
(
this
);
_factSystem
->
setToolbox
(
this
);
_imageProvider
->
setToolbox
(
this
);
_joystickManager
->
setToolbox
(
this
);
_linkManager
->
setToolbox
(
this
);
_multiVehicleManager
->
setToolbox
(
this
);
_mavlinkProtocol
->
setToolbox
(
this
);
_
joystickManager
->
setToolbox
(
this
);
_
audioOutput
->
setToolbox
(
this
);
_
missionCommands
->
setToolbox
(
this
);
_
multiVehicleManager
->
setToolbox
(
this
);
_uasMessageHandler
->
setToolbox
(
this
);
_imageProvider
->
setToolbox
(
this
);
}
QGCToolbox
::~
QGCToolbox
()
{
delete
_
firmwarePluginManager
;
delete
_
audioOutput
;
delete
_autopilotPluginManager
;
delete
_linkManager
;
delete
_multiVehicleManager
;
delete
_mavlinkProtocol
;
delete
_factSystem
;
delete
_firmwarePluginManager
;
delete
_flightMapSettings
;
delete
_homePositionManager
;
delete
_joystickManager
;
delete
_audioOutput
;
delete
_linkManager
;
delete
_mavlinkProtocol
;
delete
_missionCommands
;
delete
_multiVehicleManager
;
delete
_uasMessageHandler
;
delete
_factSystem
;
}
QGCTool
::
QGCTool
(
QGCApplication
*
app
)
...
...
src/QGCToolbox.h
View file @
c58d1781
...
...
@@ -26,19 +26,20 @@
#include <QObject>
class
QGCApplication
;
class
AutoPilotPluginManager
;
class
FactSystem
;
class
FirmwarePluginManager
;
class
FlightMapSettings
;
class
GAudioOutput
;
class
HomePositionManager
;
class
JoystickManager
;
class
LinkManager
;
class
MAVLinkProtocol
;
class
MissionCommands
;
class
MultiVehicleManager
;
class
JoystickManager
;
class
UASMessageHandler
;
class
HomePositionManager
;
class
FlightMapSettings
;
class
GAudioOutput
;
class
FirmwarePluginManager
;
class
AutoPilotPluginManager
;
class
FactSystem
;
class
QGCApplication
;
class
QGCImageProvider
;
class
UASMessageHandler
;
/// This is used to manage all of our top level services/tools
class
QGCToolbox
{
...
...
@@ -47,31 +48,33 @@ public:
QGCToolbox
(
QGCApplication
*
app
);
~
QGCToolbox
();
AutoPilotPluginManager
*
autopilotPluginManager
(
void
)
{
return
_autopilotPluginManager
;
}
FirmwarePluginManager
*
firmwarePluginManager
(
void
)
{
return
_firmwarePluginManager
;
}
FlightMapSettings
*
flightMapSettings
(
void
)
{
return
_flightMapSettings
;
}
GAudioOutput
*
audioOutput
(
void
)
{
return
_audioOutput
;
}
HomePositionManager
*
homePositionManager
(
void
)
{
return
_homePositionManager
;
}
JoystickManager
*
joystickManager
(
void
)
{
return
_joystickManager
;
}
LinkManager
*
linkManager
(
void
)
{
return
_linkManager
;
}
MAVLinkProtocol
*
mavlinkProtocol
(
void
)
{
return
_mavlinkProtocol
;
}
MissionCommands
*
missionCommands
(
void
)
{
return
_missionCommands
;
}
MultiVehicleManager
*
multiVehicleManager
(
void
)
{
return
_multiVehicleManager
;
}
JoystickManager
*
joystickManager
(
void
)
{
return
_joystickManager
;
}
UASMessageHandler
*
uasMessageHandler
(
void
)
{
return
_uasMessageHandler
;
}
HomePositionManager
*
homePositionManager
(
void
)
{
return
_homePositionManager
;
}
FlightMapSettings
*
flightMapSettings
(
void
)
{
return
_flightMapSettings
;
}
GAudioOutput
*
audioOutput
(
void
)
{
return
_audioOutput
;
}
FirmwarePluginManager
*
firmwarePluginManager
(
void
)
{
return
_firmwarePluginManager
;
}
AutoPilotPluginManager
*
autopilotPluginManager
(
void
)
{
return
_autopilotPluginManager
;
}
QGCImageProvider
*
imageProvider
()
{
return
_imageProvider
;
}
UASMessageHandler
*
uasMessageHandler
(
void
)
{
return
_uasMessageHandler
;
}
private:
FirmwarePluginManager
*
_firmwarePluginManager
;
GAudioOutput
*
_audioOutput
;
AutoPilotPluginManager
*
_autopilotPluginManager
;
LinkManager
*
_linkManager
;
MultiVehicleManager
*
_multiVehicleManager
;
MAVLinkProtocol
*
_mavlinkProtocol
;
FactSystem
*
_factSystem
;
FirmwarePluginManager
*
_firmwarePluginManager
;
FlightMapSettings
*
_flightMapSettings
;
HomePositionManager
*
_homePositionManager
;
QGCImageProvider
*
_imageProvider
;
JoystickManager
*
_joystickManager
;
GAudioOutput
*
_audioOutput
;
LinkManager
*
_linkManager
;
MAVLinkProtocol
*
_mavlinkProtocol
;
MissionCommands
*
_missionCommands
;
MultiVehicleManager
*
_multiVehicleManager
;
UASMessageHandler
*
_uasMessageHandler
;
FactSystem
*
_factSystem
;
QGCImageProvider
*
_imageProvider
;
};
/// This is the base class for all tools
...
...
src/QmlControls/MissionCommandDialog.qml
0 → 100644
View file @
c58d1781
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import
QtQuick
2.5
import
QtQuick
.
Controls
1.4
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
QGCViewDialog
{
property
var
missionItem
QGCPalette
{
id
:
qgcPal
}
QGCLabel
{
id
:
categoryLabel
anchors.baseline
:
categoryCombo
.
baseline
text
:
"
Category:
"
}
QGCComboBox
{
id
:
categoryCombo
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
categoryLabel
.
right
anchors.right
:
parent
.
right
model
:
QGroundControl
.
missionCommands
.
categories
function
categorySelected
(
category
)
{
commandList
.
model
=
QGroundControl
.
missionCommands
.
getCommandsForCategory
(
category
)
console
.
log
(
"
changing model
"
,
category
)
}
Component.onCompleted
:
{
var
category
=
missionItem
.
category
currentIndex
=
find
(
category
)
categorySelected
(
category
)
}
onActivated
:
categorySelected
(
textAt
(
index
))
}
ListView
{
id
:
commandList
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
categoryCombo
.
bottom
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
orientation
:
ListView
.
Vertical
onModelChanged
:
{
var
currentCategory
=
categoryCombo
.
currentText
currentIndex
=
-
1
if
(
missionItem
.
category
==
currentCategory
)
{
var
commandList
=
QGroundControl
.
missionCommands
.
getCommandsForCategory
(
currentCategory
)
for
(
var
i
=
0
;
i
<
commandList
.
count
;
i
++
)
{
if
(
commandList
.
get
(
i
).
command
==
missionItem
.
command
)
{
currentIndex
=
i
break
}
}
}
}
highlight
:
Rectangle
{
color
:
qgcPal
.
buttonHighlight
}
delegate
:
Rectangle
{
width
:
parent
.
width
height
:
commandColumn
.
height
+
ScreenTools
.
defaultFontPixelSize
color
:
currentItem
?
qgcPal
.
buttonHighlight
:
qgcPal
.
button
property
var
mavCmdInfo
:
object
property
bool
currentItem
:
commandList
.
currentItem
==
this
property
var
textColor
:
currentItem
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
Column
{
id
:
commandColumn
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
QGCLabel
{
text
:
mavCmdInfo
.
friendlyName
color
:
textColor
}
QGCLabel
{
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
mavCmdInfo
.
description
wrapMode
:
Text
.
WordWrap
color
:
textColor
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
missionItem
.
command
=
mavCmdInfo
.
command
accept
()
}
}
}
}
// ListView
}
// QGCViewDialog
src/QmlControls/MissionItemEditor.qml
View file @
c58d1781
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
...
...
@@ -15,6 +16,7 @@ Rectangle {
property
var
missionItem
///< MissionItem associated with this editor
property
bool
readOnly
///< true: read only view, false: full editing view
property
var
qgcView
///< QGCView control used for showing dialogs
signal
clicked
signal
remove
...
...
@@ -56,8 +58,8 @@ Rectangle {
Image
{
id
:
rawEdit
anchors.
leftMargin
:
ScreenTools
.
defaultFontPixelWidth
*
8
anchors.
left
:
label
.
right
anchors.
rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.
right
:
parent
.
right
anchors.verticalCenter
:
commandPicker
.
verticalCenter
width
:
commandPicker
.
height
height
:
commandPicker
.
height
...
...
@@ -70,16 +72,24 @@ Rectangle {
}
}
FactComboBox
{
id
:
commandPicker
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
rawEdit
.
right
anchors.right
:
parent
.
right
indexModel
:
false
fact
:
missionItem
.
supportedCommand
visible
:
missionItem
.
sequenceNumber
!=
0
&&
missionItem
.
isCurrentItem
&&
!
missionItem
.
rawEdit
QGCButton
{
id
:
commandPicker
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
*
2
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
label
.
right
anchors.right
:
rawEdit
.
left
visible
:
missionItem
.
sequenceNumber
!=
0
&&
missionItem
.
isCurrentItem
&&
!
missionItem
.
rawEdit
text
:
missionItem
.
commandName
Component
{
id
:
commandDialog
MissionCommandDialog
{
missionItem
:
_root
.
missionItem
}
}
on
Activated
:
missionItem
.
commandByIndex
=
index
on
Clicked
:
qgcView
.
showDialog
(
commandDialog
,
"
Select Mission Command
"
,
40
,
StandardButton
.
Cancel
)
}
Rectangle
{
...
...
src/QmlControls/QGCView.qml
View file @
c58d1781
...
...
@@ -306,7 +306,7 @@ FactPanel {
QGCButton
{
id
:
__rejectButton
anchors.right
:
__acceptButton
.
lef
t
anchors.right
:
__acceptButton
.
visible
?
__acceptButton
.
left
:
parent
.
righ
t
anchors.bottom
:
parent
.
bottom
onClicked
:
__dialogComponentLoader
.
item
.
reject
()
...
...
src/QmlControls/QGroundControl.Controls.qmldir
View file @
c58d1781
...
...
@@ -6,6 +6,7 @@ ExclusiveGroupItem 1.0 ExclusiveGroupItem.qml
IndicatorButton 1.0 IndicatorButton.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml
MainToolBar 1.0 MainToolBar.qml
MissionCommandDialog 1.0 MissionCommandDialog.qml
MissionItemEditor 1.0 MissionItemEditor.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml
...
...
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
c58d1781
...
...
@@ -29,16 +29,17 @@
#include <QSettings>
static
const
char
*
kQmlGlobalKeyName
=
"QGCQml"
;
static
const
char
*
kQmlGlobalKeyName
=
"QGCQml"
;
const
char
*
QGroundControlQmlGlobal
::
_virtualTabletJoystickKey
=
"VirtualTabletJoystick"
;
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QGCToolbox
*
toolbox
,
QObject
*
parent
)
:
QObject
(
parent
)
,
_multiVehicleManager
(
toolbox
->
multiVehicleManager
())
,
_linkManager
(
toolbox
->
linkManager
())
,
_homePositionManager
(
toolbox
->
homePositionManager
())
,
_flightMapSettings
(
toolbox
->
flightMapSettings
())
,
_homePositionManager
(
toolbox
->
homePositionManager
())
,
_linkManager
(
toolbox
->
linkManager
())
,
_missionCommands
(
toolbox
->
missionCommands
())
,
_multiVehicleManager
(
toolbox
->
multiVehicleManager
())
,
_virtualTabletJoystick
(
false
)
{
QSettings
settings
;
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
c58d1781
...
...
@@ -34,6 +34,7 @@
#include "LinkManager.h"
#include "HomePositionManager.h"
#include "FlightMapSettings.h"
#include "MissionCommands.h"
#ifdef QT_DEBUG
#include "MockLink.h"
...
...
@@ -48,10 +49,11 @@ class QGroundControlQmlGlobal : public QObject
public:
QGroundControlQmlGlobal
(
QGCToolbox
*
toolbox
,
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
FlightMapSettings
*
flightMapSettings
READ
flightMapSettings
CONSTANT
)
Q_PROPERTY
(
HomePositionManager
*
homePositionManager
READ
homePositionManager
CONSTANT
)
Q_PROPERTY
(
LinkManager
*
linkManager
READ
linkManager
CONSTANT
)
Q_PROPERTY
(
MissionCommands
*
missionCommands
READ
missionCommands
CONSTANT
)
Q_PROPERTY
(
MultiVehicleManager
*
multiVehicleManager
READ
multiVehicleManager
CONSTANT
)
Q_PROPERTY
(
HomePositionManager
*
homePositionManager
READ
homePositionManager
CONSTANT
)
Q_PROPERTY
(
FlightMapSettings
*
flightMapSettings
READ
flightMapSettings
CONSTANT
)
Q_PROPERTY
(
qreal
zOrderTopMost
READ
zOrderTopMost
CONSTANT
)
///< z order for top most items, toolbar, main window sub view
Q_PROPERTY
(
qreal
zOrderWidgets
READ
zOrderWidgets
CONSTANT
)
///< z order value to widgets, for example: zoom controls, hud widgetss
...
...
@@ -85,10 +87,11 @@ public:
// Property accesors
FlightMapSettings
*
flightMapSettings
()
{
return
_flightMapSettings
;
}
HomePositionManager
*
homePositionManager
()
{
return
_homePositionManager
;
}
LinkManager
*
linkManager
()
{
return
_linkManager
;
}
MissionCommands
*
missionCommands
()
{
return
_missionCommands
;
}
MultiVehicleManager
*
multiVehicleManager
()
{
return
_multiVehicleManager
;
}
HomePositionManager
*
homePositionManager
()
{
return
_homePositionManager
;
}
FlightMapSettings
*
flightMapSettings
()
{
return
_flightMapSettings
;
}
qreal
zOrderTopMost
()
{
return
1000
;
}
qreal
zOrderWidgets
()
{
return
100
;
}
...
...
@@ -133,10 +136,11 @@ private:
void
_startMockLink
(
MockConfiguration
*
mockConfig
);
#endif
MultiVehicleManager
*
_multiVehicleManager
;
LinkManager
*
_linkManager
;
HomePositionManager
*
_homePositionManager
;
FlightMapSettings
*
_flightMapSettings
;
HomePositionManager
*
_homePositionManager
;
LinkManager
*
_linkManager
;
MissionCommands
*
_missionCommands
;
MultiVehicleManager
*
_multiVehicleManager
;
bool
_virtualTabletJoystick
;
...
...
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