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
fd19b461
Commit
fd19b461
authored
Mar 26, 2020
by
DoinLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
cb88912e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
MavCmdInfoCommon.json
src/MissionManager/MavCmdInfoCommon.json
+2
-0
MissionCommandUIInfo.cc
src/MissionManager/MissionCommandUIInfo.cc
+17
-1
MissionCommandUIInfo.h
src/MissionManager/MissionCommandUIInfo.h
+4
-0
TakeoffMissionItem.cc
src/MissionManager/TakeoffMissionItem.cc
+3
-1
No files found.
src/MissionManager/MavCmdInfoCommon.json
View file @
fd19b461
...
@@ -172,6 +172,7 @@
...
@@ -172,6 +172,7 @@
"friendlyName"
:
"Takeoff"
,
"friendlyName"
:
"Takeoff"
,
"description"
:
"Launch from the ground and travel towards the specified takeoff position."
,
"description"
:
"Launch from the ground and travel towards the specified takeoff position."
,
"specifiesCoordinate"
:
true
,
"specifiesCoordinate"
:
true
,
"isTakeoffCommand"
:
true
,
"friendlyEdit"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"category"
:
"Basic"
,
"param1"
:
{
"param1"
:
{
...
@@ -290,6 +291,7 @@
...
@@ -290,6 +291,7 @@
"friendlyName"
:
"VTOL takeoff"
,
"friendlyName"
:
"VTOL takeoff"
,
"description"
:
"Hover straight up to specified altitude, transition to fixed-wing and fly to the specified takeoff location."
,
"description"
:
"Hover straight up to specified altitude, transition to fixed-wing and fly to the specified takeoff location."
,
"specifiesCoordinate"
:
true
,
"specifiesCoordinate"
:
true
,
"isTakeoffCommand"
:
true
,
"friendlyEdit"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Basic"
,
"category"
:
"Basic"
,
"param4"
:
{
"param4"
:
{
...
...
src/MissionManager/MissionCommandUIInfo.cc
View file @
fd19b461
...
@@ -38,6 +38,7 @@ const char* MissionCommandUIInfo::_standaloneCoordinateJsonKey = "standaloneCoo
...
@@ -38,6 +38,7 @@ const char* MissionCommandUIInfo::_standaloneCoordinateJsonKey = "standaloneCoo
const
char
*
MissionCommandUIInfo
::
_specifiesCoordinateJsonKey
=
"specifiesCoordinate"
;
const
char
*
MissionCommandUIInfo
::
_specifiesCoordinateJsonKey
=
"specifiesCoordinate"
;
const
char
*
MissionCommandUIInfo
::
_specifiesAltitudeOnlyJsonKey
=
"specifiesAltitudeOnly"
;
const
char
*
MissionCommandUIInfo
::
_specifiesAltitudeOnlyJsonKey
=
"specifiesAltitudeOnly"
;
const
char
*
MissionCommandUIInfo
::
_isLandCommandJsonKey
=
"isLandCommand"
;
const
char
*
MissionCommandUIInfo
::
_isLandCommandJsonKey
=
"isLandCommand"
;
const
char
*
MissionCommandUIInfo
::
_isTakeoffCommandJsonKey
=
"isTakeoffCommand"
;
const
char
*
MissionCommandUIInfo
::
_unitsJsonKey
=
"units"
;
const
char
*
MissionCommandUIInfo
::
_unitsJsonKey
=
"units"
;
const
char
*
MissionCommandUIInfo
::
_commentJsonKey
=
"comment"
;
const
char
*
MissionCommandUIInfo
::
_commentJsonKey
=
"comment"
;
const
char
*
MissionCommandUIInfo
::
_advancedCategory
=
"Advanced"
;
const
char
*
MissionCommandUIInfo
::
_advancedCategory
=
"Advanced"
;
...
@@ -174,6 +175,15 @@ bool MissionCommandUIInfo::isLandCommand(void) const
...
@@ -174,6 +175,15 @@ bool MissionCommandUIInfo::isLandCommand(void) const
}
}
}
}
bool
MissionCommandUIInfo
::
isTakeoffCommand
(
void
)
const
{
if
(
_infoMap
.
contains
(
_isTakeoffCommandJsonKey
))
{
return
_infoMap
[
_isTakeoffCommandJsonKey
].
toBool
();
}
else
{
return
false
;
}
}
void
MissionCommandUIInfo
::
_overrideInfo
(
MissionCommandUIInfo
*
uiInfo
)
void
MissionCommandUIInfo
::
_overrideInfo
(
MissionCommandUIInfo
*
uiInfo
)
{
{
// Override info values
// Override info values
...
@@ -209,7 +219,7 @@ bool MissionCommandUIInfo::loadJsonInfo(const QJsonObject& jsonObject, bool requ
...
@@ -209,7 +219,7 @@ bool MissionCommandUIInfo::loadJsonInfo(const QJsonObject& jsonObject, bool requ
QStringList
allKeys
;
QStringList
allKeys
;
allKeys
<<
_idJsonKey
<<
_rawNameJsonKey
<<
_friendlyNameJsonKey
<<
_descriptionJsonKey
<<
_standaloneCoordinateJsonKey
<<
_specifiesCoordinateJsonKey
allKeys
<<
_idJsonKey
<<
_rawNameJsonKey
<<
_friendlyNameJsonKey
<<
_descriptionJsonKey
<<
_standaloneCoordinateJsonKey
<<
_specifiesCoordinateJsonKey
<<
_friendlyEditJsonKey
<<
_param1JsonKey
<<
_param2JsonKey
<<
_param3JsonKey
<<
_param4JsonKey
<<
_param5JsonKey
<<
_param6JsonKey
<<
_param7JsonKey
<<
_friendlyEditJsonKey
<<
_param1JsonKey
<<
_param2JsonKey
<<
_param3JsonKey
<<
_param4JsonKey
<<
_param5JsonKey
<<
_param6JsonKey
<<
_param7JsonKey
<<
_paramRemoveJsonKey
<<
_categoryJsonKey
<<
_specifiesAltitudeOnlyJsonKey
<<
_isLandCommandJsonKey
;
<<
_paramRemoveJsonKey
<<
_categoryJsonKey
<<
_specifiesAltitudeOnlyJsonKey
<<
_isLandCommandJsonKey
<<
_isTakeoffCommandJsonKey
;
// Look for unknown keys in top level object
// Look for unknown keys in top level object
for
(
const
QString
&
key
:
jsonObject
.
keys
())
{
for
(
const
QString
&
key
:
jsonObject
.
keys
())
{
...
@@ -275,6 +285,9 @@ bool MissionCommandUIInfo::loadJsonInfo(const QJsonObject& jsonObject, bool requ
...
@@ -275,6 +285,9 @@ bool MissionCommandUIInfo::loadJsonInfo(const QJsonObject& jsonObject, bool requ
if
(
jsonObject
.
contains
(
_isLandCommandJsonKey
))
{
if
(
jsonObject
.
contains
(
_isLandCommandJsonKey
))
{
_infoMap
[
_isLandCommandJsonKey
]
=
jsonObject
.
value
(
_isLandCommandJsonKey
).
toBool
();
_infoMap
[
_isLandCommandJsonKey
]
=
jsonObject
.
value
(
_isLandCommandJsonKey
).
toBool
();
}
}
if
(
jsonObject
.
contains
(
_isTakeoffCommandJsonKey
))
{
_infoMap
[
_isTakeoffCommandJsonKey
]
=
jsonObject
.
value
(
_isTakeoffCommandJsonKey
).
toBool
();
}
if
(
jsonObject
.
contains
(
_friendlyEditJsonKey
))
{
if
(
jsonObject
.
contains
(
_friendlyEditJsonKey
))
{
_infoMap
[
_friendlyEditJsonKey
]
=
jsonObject
.
value
(
_friendlyEditJsonKey
).
toVariant
();
_infoMap
[
_friendlyEditJsonKey
]
=
jsonObject
.
value
(
_friendlyEditJsonKey
).
toVariant
();
}
}
...
@@ -305,6 +318,9 @@ bool MissionCommandUIInfo::loadJsonInfo(const QJsonObject& jsonObject, bool requ
...
@@ -305,6 +318,9 @@ bool MissionCommandUIInfo::loadJsonInfo(const QJsonObject& jsonObject, bool requ
if
(
!
_infoAvailable
(
_isLandCommandJsonKey
))
{
if
(
!
_infoAvailable
(
_isLandCommandJsonKey
))
{
_setInfoValue
(
_isLandCommandJsonKey
,
false
);
_setInfoValue
(
_isLandCommandJsonKey
,
false
);
}
}
if
(
!
_infoAvailable
(
_isTakeoffCommandJsonKey
))
{
_setInfoValue
(
_isTakeoffCommandJsonKey
,
false
);
}
if
(
!
_infoAvailable
(
_friendlyEditJsonKey
))
{
if
(
!
_infoAvailable
(
_friendlyEditJsonKey
))
{
_setInfoValue
(
_friendlyEditJsonKey
,
false
);
_setInfoValue
(
_friendlyEditJsonKey
,
false
);
}
}
...
...
src/MissionManager/MissionCommandUIInfo.h
View file @
fd19b461
...
@@ -96,6 +96,7 @@ private:
...
@@ -96,6 +96,7 @@ private:
/// specifiesCoordinate bool false true: Command specifies a lat/lon/alt coordinate
/// specifiesCoordinate bool false true: Command specifies a lat/lon/alt coordinate
/// specifiesAltitudeOnly bool false true: Command specifies an altitude only (no coordinate)
/// specifiesAltitudeOnly bool false true: Command specifies an altitude only (no coordinate)
/// standaloneCoordinate bool false true: Vehicle does not fly through coordinate associated with command (exampl: ROI)
/// standaloneCoordinate bool false true: Vehicle does not fly through coordinate associated with command (exampl: ROI)
/// isTakeoffCommand bool false true: Command specifies a takeoff command (TAEKOFF, VTOL_TAKEOFF, ...)
/// isLandCommand bool false true: Command specifies a land command (LAND, VTOL_LAND, ...)
/// isLandCommand bool false true: Command specifies a land command (LAND, VTOL_LAND, ...)
/// friendlyEdit bool false true: Command supports friendly editing dialog, false: Command supports 'Show all values" style editing only
/// friendlyEdit bool false true: Command supports friendly editing dialog, false: Command supports 'Show all values" style editing only
/// category string Advanced Category which this command belongs to
/// category string Advanced Category which this command belongs to
...
@@ -120,6 +121,7 @@ public:
...
@@ -120,6 +121,7 @@ public:
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
CONSTANT
)
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
CONSTANT
)
Q_PROPERTY
(
bool
specifiesAltitudeOnly
READ
specifiesAltitudeOnly
CONSTANT
)
Q_PROPERTY
(
bool
specifiesAltitudeOnly
READ
specifiesAltitudeOnly
CONSTANT
)
Q_PROPERTY
(
bool
isLandCommand
READ
isLandCommand
CONSTANT
)
Q_PROPERTY
(
bool
isLandCommand
READ
isLandCommand
CONSTANT
)
Q_PROPERTY
(
bool
isTakeoffCommand
READ
isTakeoffCommand
CONSTANT
)
Q_PROPERTY
(
int
command
READ
intCommand
CONSTANT
)
Q_PROPERTY
(
int
command
READ
intCommand
CONSTANT
)
MAV_CMD
command
(
void
)
const
{
return
_command
;
}
MAV_CMD
command
(
void
)
const
{
return
_command
;
}
...
@@ -134,6 +136,7 @@ public:
...
@@ -134,6 +136,7 @@ public:
bool
specifiesCoordinate
(
void
)
const
;
bool
specifiesCoordinate
(
void
)
const
;
bool
specifiesAltitudeOnly
(
void
)
const
;
bool
specifiesAltitudeOnly
(
void
)
const
;
bool
isLandCommand
(
void
)
const
;
bool
isLandCommand
(
void
)
const
;
bool
isTakeoffCommand
(
void
)
const
;
/// Load the data in the object from the specified json
/// Load the data in the object from the specified json
/// @param jsonObject Json object to load from
/// @param jsonObject Json object to load from
...
@@ -194,6 +197,7 @@ private:
...
@@ -194,6 +197,7 @@ private:
static
const
char
*
_specifiesCoordinateJsonKey
;
static
const
char
*
_specifiesCoordinateJsonKey
;
static
const
char
*
_specifiesAltitudeOnlyJsonKey
;
static
const
char
*
_specifiesAltitudeOnlyJsonKey
;
static
const
char
*
_isLandCommandJsonKey
;
static
const
char
*
_isLandCommandJsonKey
;
static
const
char
*
_isTakeoffCommandJsonKey
;
static
const
char
*
_unitsJsonKey
;
static
const
char
*
_unitsJsonKey
;
static
const
char
*
_commentJsonKey
;
static
const
char
*
_commentJsonKey
;
static
const
char
*
_advancedCategory
;
static
const
char
*
_advancedCategory
;
...
...
src/MissionManager/TakeoffMissionItem.cc
View file @
fd19b461
...
@@ -116,7 +116,9 @@ void TakeoffMissionItem::setCoordinate(const QGeoCoordinate& coordinate)
...
@@ -116,7 +116,9 @@ void TakeoffMissionItem::setCoordinate(const QGeoCoordinate& coordinate)
bool
TakeoffMissionItem
::
isTakeoffCommand
(
MAV_CMD
command
)
bool
TakeoffMissionItem
::
isTakeoffCommand
(
MAV_CMD
command
)
{
{
return
command
==
MAV_CMD_NAV_TAKEOFF
||
command
==
MAV_CMD_NAV_VTOL_TAKEOFF
;
const
MissionCommandUIInfo
*
uiInfo
=
qgcApp
()
->
toolbox
()
->
missionCommandTree
()
->
getUIInfo
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
offlineEditingVehicle
(),
command
);
return
uiInfo
?
uiInfo
->
isTakeoffCommand
()
:
false
;
}
}
void
TakeoffMissionItem
::
_initLaunchTakeoffAtSameLocation
(
void
)
void
TakeoffMissionItem
::
_initLaunchTakeoffAtSameLocation
(
void
)
...
...
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