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
5ad945af
Commit
5ad945af
authored
Nov 14, 2019
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
34e49eab
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
182 additions
and
171 deletions
+182
-171
GuidedActionsController.qml
src/FlightDisplay/GuidedActionsController.qml
+1
-1
CorridorScanPlanCreator.cc
src/MissionManager/CorridorScanPlanCreator.cc
+2
-10
MissionController.cc
src/MissionManager/MissionController.cc
+154
-121
MissionController.h
src/MissionManager/MissionController.h
+11
-0
StructureScanPlanCreator.cc
src/MissionManager/StructureScanPlanCreator.cc
+1
-9
SurveyPlanCreator.cc
src/MissionManager/SurveyPlanCreator.cc
+2
-10
PlanView.qml
src/PlanView/PlanView.qml
+11
-20
No files found.
src/FlightDisplay/GuidedActionsController.qml
View file @
5ad945af
...
...
@@ -36,7 +36,7 @@ Item {
readonly
property
string
emergencyStopTitle
:
qsTr
(
"
EMERGENCY STOP
"
)
readonly
property
string
armTitle
:
qsTr
(
"
Arm
"
)
readonly
property
string
disarmTitle
:
qsTr
(
"
Disarm
"
)
readonly
property
string
rtlTitle
:
qsTr
(
"
R
TL
"
)
readonly
property
string
rtlTitle
:
qsTr
(
"
R
eturn
"
)
readonly
property
string
takeoffTitle
:
qsTr
(
"
Takeoff
"
)
readonly
property
string
landTitle
:
qsTr
(
"
Land
"
)
readonly
property
string
startMissionTitle
:
qsTr
(
"
Start Mission
"
)
...
...
src/MissionManager/CorridorScanPlanCreator.cc
View file @
5ad945af
...
...
@@ -22,15 +22,7 @@ void CorridorScanPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord)
{
_planMasterController
->
removeAll
();
VisualMissionItem
*
takeoffItem
=
_missionController
->
insertTakeoffItem
(
mapCenterCoord
,
-
1
);
takeoffItem
->
setWizardMode
(
true
);
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternCorridorScanName
,
mapCenterCoord
,
-
1
)
->
setWizardMode
(
true
);
if
(
_planMasterController
->
managerVehicle
()
->
fixedWing
())
{
FixedWingLandingComplexItem
*
landingItem
=
qobject_cast
<
FixedWingLandingComplexItem
*>
(
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternFWLandingName
,
mapCenterCoord
,
-
1
));
landingItem
->
setWizardMode
(
true
);
landingItem
->
setLoiterDragAngleOnly
(
true
);
}
else
{
MissionSettingsItem
*
settingsItem
=
_missionController
->
visualItems
()
->
value
<
MissionSettingsItem
*>
(
0
);
settingsItem
->
setMissionEndRTL
(
true
);
}
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternCorridorScanName
,
mapCenterCoord
,
-
1
);
_missionController
->
insertLandItem
(
mapCenterCoord
,
-
1
);
_missionController
->
setCurrentPlanViewIndex
(
takeoffItem
->
sequenceNumber
(),
true
);
}
src/MissionManager/MissionController.cc
View file @
5ad945af
This diff is collapsed.
Click to expand it.
src/MissionManager/MissionController.h
View file @
5ad945af
...
...
@@ -93,6 +93,7 @@ public:
Q_PROPERTY
(
QString
corridorScanComplexItemName
READ
corridorScanComplexItemName
CONSTANT
)
Q_PROPERTY
(
QString
structureScanComplexItemName
READ
structureScanComplexItemName
CONSTANT
)
Q_PROPERTY
(
bool
isInsertTakeoffValid
MEMBER
_isInsertTakeoffValid
NOTIFY
isInsertTakeoffValidChanged
)
///< true: Takeoff tool should be enabled
Q_PROPERTY
(
bool
isInsertLandValid
MEMBER
_isInsertLandValid
NOTIFY
isInsertLandValidChanged
)
///< true: Land tool should be enabled
Q_INVOKABLE
void
removeMissionItem
(
int
index
);
...
...
@@ -110,6 +111,13 @@ public:
/// @return Newly created item
Q_INVOKABLE
VisualMissionItem
*
insertTakeoffItem
(
QGeoCoordinate
coordinate
,
int
visualItemIndex
,
bool
makeCurrentItem
=
false
);
/// Add a new land item to the list
/// @param coordinate: Coordinate for item
/// @param visualItemIndex: index to insert at, -1 for end of list
/// @param makeCurrentItem: true: Make this item the current item
/// @return Newly created item
Q_INVOKABLE
VisualMissionItem
*
insertLandItem
(
QGeoCoordinate
coordinate
,
int
visualItemIndex
,
bool
makeCurrentItem
=
false
);
/// Add a new ROI mission item to the list
/// @param coordinate: Coordinate for item
/// @param visualItemIndex: index to insert at, -1 for end of list
...
...
@@ -245,6 +253,7 @@ signals:
void
missionBoundingCubeChanged
(
void
);
void
missionItemCountChanged
(
int
missionItemCount
);
void
isInsertTakeoffValidChanged
(
void
);
void
isInsertLandValidChanged
(
void
);
private
slots
:
void
_newMissionItemsAvailableFromVehicle
(
bool
removeAllRequested
);
...
...
@@ -296,6 +305,7 @@ private:
void
_initLoadedVisualItems
(
QmlObjectListModel
*
loadedVisualItems
);
CoordinateVector
*
_addWaypointLineSegment
(
CoordVectHashTable
&
prevItemPairHashTable
,
VisualItemPair
&
pair
);
void
_addTimeDistance
(
bool
vtolInHover
,
double
hoverTime
,
double
cruiseTime
,
double
extraTime
,
double
distance
,
int
seqNum
);
VisualMissionItem
*
_insertSimpleMissionItemWorker
(
QGeoCoordinate
coordinate
,
MAV_CMD
command
,
int
visualItemIndex
,
bool
makeCurrentItem
);
void
_insertComplexMissionItemWorker
(
ComplexMissionItem
*
complexItem
,
int
visualItemIndex
,
bool
makeCurrentItem
);
void
_warnIfTerrainFrameUsed
(
void
);
...
...
@@ -321,6 +331,7 @@ private:
QGeoCoordinate
_takeoffCoordinate
;
CoordinateVector
*
_splitSegment
;
bool
_isInsertTakeoffValid
=
true
;
bool
_isInsertLandValid
=
true
;
static
const
char
*
_settingsGroup
;
...
...
src/MissionManager/StructureScanPlanCreator.cc
View file @
5ad945af
...
...
@@ -22,15 +22,7 @@ void StructureScanPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord)
{
_planMasterController
->
removeAll
();
VisualMissionItem
*
takeoffItem
=
_missionController
->
insertTakeoffItem
(
mapCenterCoord
,
-
1
);
takeoffItem
->
setWizardMode
(
true
);
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternStructureScanName
,
mapCenterCoord
,
-
1
)
->
setWizardMode
(
true
);
if
(
_planMasterController
->
managerVehicle
()
->
fixedWing
())
{
FixedWingLandingComplexItem
*
landingItem
=
qobject_cast
<
FixedWingLandingComplexItem
*>
(
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternFWLandingName
,
mapCenterCoord
,
-
1
));
landingItem
->
setWizardMode
(
true
);
landingItem
->
setLoiterDragAngleOnly
(
true
);
}
else
{
MissionSettingsItem
*
settingsItem
=
_missionController
->
visualItems
()
->
value
<
MissionSettingsItem
*>
(
0
);
settingsItem
->
setMissionEndRTL
(
true
);
}
_missionController
->
insertLandItem
(
mapCenterCoord
,
-
1
);
_missionController
->
setCurrentPlanViewIndex
(
takeoffItem
->
sequenceNumber
(),
true
);
}
src/MissionManager/SurveyPlanCreator.cc
View file @
5ad945af
...
...
@@ -23,15 +23,7 @@ void SurveyPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord)
{
_planMasterController
->
removeAll
();
VisualMissionItem
*
takeoffItem
=
_missionController
->
insertTakeoffItem
(
mapCenterCoord
,
-
1
);
takeoffItem
->
setWizardMode
(
true
);
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternSurveyName
,
mapCenterCoord
,
-
1
)
->
setWizardMode
(
true
);
if
(
_planMasterController
->
managerVehicle
()
->
fixedWing
())
{
FixedWingLandingComplexItem
*
landingItem
=
qobject_cast
<
FixedWingLandingComplexItem
*>
(
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternFWLandingName
,
mapCenterCoord
,
-
1
));
landingItem
->
setWizardMode
(
true
);
landingItem
->
setLoiterDragAngleOnly
(
true
);
}
else
{
MissionSettingsItem
*
settingsItem
=
_missionController
->
visualItems
()
->
value
<
MissionSettingsItem
*>
(
0
);
settingsItem
->
setMissionEndRTL
(
true
);
}
_missionController
->
insertComplexMissionItem
(
MissionController
::
patternSurveyName
,
mapCenterCoord
,
-
1
);
_missionController
->
insertLandItem
(
mapCenterCoord
,
-
1
);
_missionController
->
setCurrentPlanViewIndex
(
takeoffItem
->
sequenceNumber
(),
true
);
}
src/PlanView/PlanView.qml
View file @
5ad945af
...
...
@@ -629,7 +629,8 @@ Item {
readonly
property
int
waypointButtonIndex
:
3
readonly
property
int
roiButtonIndex
:
4
readonly
property
int
patternButtonIndex
:
5
readonly
property
int
centerButtonIndex
:
6
readonly
property
int
landButtonIndex
:
6
readonly
property
int
centerButtonIndex
:
7
property
bool
_isRally
:
_editingLayer
==
_layerRallyPoints
...
...
@@ -677,6 +678,12 @@ Item {
buttonVisible
:
!
_isRally
,
dropPanelComponent
:
_singleComplexItem
?
undefined
:
patternDropPanel
},
{
name
:
_planMasterController
.
controllerVehicle
.
fixedWing
?
qsTr
(
"
Land
"
)
:
qsTr
(
"
Return
"
),
iconSource
:
"
/res/rtl.svg
"
,
buttonEnabled
:
_missionController
.
isInsertLandValid
,
buttonVisible
:
_editingLayer
==
_layerMission
},
{
name
:
qsTr
(
"
Center
"
),
iconSource
:
"
/qmlimages/MapCenter.svg
"
,
...
...
@@ -714,6 +721,9 @@ Item {
addComplexItem
(
_missionController
.
complexMissionItemNames
[
0
])
}
break
case
landButtonIndex
:
_missionController
.
insertLandItem
(
mapCenter
(),
_missionController
.
currentMissionIndex
,
true
/* makeCurrentItem */
)
break
}
}
}
...
...
@@ -1027,25 +1037,6 @@ Item {
}
}
}
Rectangle
{
width
:
parent
.
width
*
0.8
height
:
1
color
:
qgcPal
.
text
opacity
:
0.5
Layout.fillWidth
:
true
Layout.columnSpan
:
2
}
QGCButton
{
text
:
qsTr
(
"
Load KML/SHP...
"
)
Layout.fillWidth
:
true
enabled
:
!
_planMasterController
.
syncInProgress
onClicked
:
{
_planMasterController
.
loadShapeFromSelectedFile
()
dropPanel
.
hide
()
}
}
}
// Column
}
...
...
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