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
bde5c03d
Commit
bde5c03d
authored
Jan 03, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
733a6996
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
30 deletions
+39
-30
MissionController.cc
src/MissionManager/MissionController.cc
+26
-25
MissionController.h
src/MissionManager/MissionController.h
+8
-5
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+5
-0
No files found.
src/MissionManager/MissionController.cc
View file @
bde5c03d
...
...
@@ -29,6 +29,7 @@
#include "QGCQGeoCoordinate.h"
#include "PlanMasterController.h"
#include "KML.h"
#include "QGCCorePlugin.h"
#ifndef __mobile__
#include "MainWindow.h"
...
...
@@ -56,22 +57,22 @@ const char* MissionController::_jsonMavAutopilotKey = "MAV_AUTOPILOT";
const
int
MissionController
::
_missionFileVersion
=
2
;
MissionController
::
MissionController
(
PlanMasterController
*
masterController
,
QObject
*
parent
)
:
PlanElementController
(
masterController
,
parent
)
,
_missionManager
(
_managerVehicle
->
missionManager
(
))
,
_missionItemCount
(
0
)
,
_visualItems
(
nullptr
)
,
_
settingsItem
(
nullptr
)
,
_
firstItemsFromVehicle
(
false
)
,
_
itemsRequested
(
false
)
,
_
inRecalcSequence
(
false
)
,
_
surveyMissionItemName
(
tr
(
"Survey"
)
)
,
_
fwLandingMissionItemName
(
tr
(
"Fixed Wing Landing"
)
)
,
_
structureScanMissionItemName
(
tr
(
"Structure Scan"
)
)
,
_
corridorScanMissionItemName
(
tr
(
"Corridor Scan
"
))
,
_appSettings
(
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
())
,
_progressPct
(
0
)
,
_currentPlanViewIndex
(
-
1
)
,
_currentPlanViewItem
(
nullptr
)
:
PlanElementController
(
masterController
,
parent
)
,
patternFWLandingName
(
tr
(
"Fixed Wing Landing"
))
,
patternStructureScanName
(
tr
(
"Structure Scan"
)
)
,
patternCorridorScanName
(
tr
(
"Corridor Scan"
)
)
,
_
missionManager
(
_managerVehicle
->
missionManager
()
)
,
_
missionItemCount
(
0
)
,
_
visualItems
(
nullptr
)
,
_
settingsItem
(
nullptr
)
,
_
firstItemsFromVehicle
(
false
)
,
_
itemsRequested
(
false
)
,
_
inRecalcSequence
(
false
)
,
_
surveyMissionItemName
(
tr
(
"Survey
"
))
,
_appSettings
(
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
())
,
_progressPct
(
0
)
,
_currentPlanViewIndex
(
-
1
)
,
_currentPlanViewItem
(
nullptr
)
{
_resetMissionFlightStatus
();
managerVehicleChanged
(
_managerVehicle
);
...
...
@@ -414,11 +415,11 @@ int MissionController::insertComplexMissionItem(QString itemName, QGeoCoordinate
if
(
itemName
==
_surveyMissionItemName
)
{
newItem
=
new
SurveyComplexItem
(
_controllerVehicle
,
_flyView
,
QString
()
/* kmlFile */
,
_visualItems
/* parent */
);
newItem
->
setCoordinate
(
mapCenterCoordinate
);
}
else
if
(
itemName
==
_fwLandingMissionItem
Name
)
{
}
else
if
(
itemName
==
patternFWLanding
Name
)
{
newItem
=
new
FixedWingLandingComplexItem
(
_controllerVehicle
,
_flyView
,
_visualItems
/* parent */
);
}
else
if
(
itemName
==
_structureScanMissionItem
Name
)
{
}
else
if
(
itemName
==
patternStructureScan
Name
)
{
newItem
=
new
StructureScanComplexItem
(
_controllerVehicle
,
_flyView
,
QString
()
/* kmlFile */
,
_visualItems
/* parent */
);
}
else
if
(
itemName
==
_corridorScanMissionItem
Name
)
{
}
else
if
(
itemName
==
patternCorridorScan
Name
)
{
newItem
=
new
CorridorScanComplexItem
(
_controllerVehicle
,
_flyView
,
QString
()
/* kmlFile */
,
_visualItems
/* parent */
);
}
else
{
qWarning
()
<<
"Internal error: Unknown complex item:"
<<
itemName
;
...
...
@@ -434,9 +435,9 @@ int MissionController::insertComplexMissionItemFromKMLOrSHP(QString itemName, QS
if
(
itemName
==
_surveyMissionItemName
)
{
newItem
=
new
SurveyComplexItem
(
_controllerVehicle
,
_flyView
,
file
,
_visualItems
);
}
else
if
(
itemName
==
_structureScanMissionItem
Name
)
{
}
else
if
(
itemName
==
patternStructureScan
Name
)
{
newItem
=
new
StructureScanComplexItem
(
_controllerVehicle
,
_flyView
,
file
,
_visualItems
);
}
else
if
(
itemName
==
_corridorScanMissionItem
Name
)
{
}
else
if
(
itemName
==
patternCorridorScan
Name
)
{
newItem
=
new
CorridorScanComplexItem
(
_controllerVehicle
,
_flyView
,
file
,
_visualItems
);
}
else
{
qWarning
()
<<
"Internal error: Unknown complex item:"
<<
itemName
;
...
...
@@ -1951,15 +1952,15 @@ QStringList MissionController::complexMissionItemNames(void) const
QStringList
complexItems
;
complexItems
.
append
(
_surveyMissionItemName
);
complexItems
.
append
(
_corridorScanMissionItem
Name
);
complexItems
.
append
(
patternCorridorScan
Name
);
if
(
_controllerVehicle
->
fixedWing
())
{
complexItems
.
append
(
_fwLandingMissionItem
Name
);
complexItems
.
append
(
patternFWLanding
Name
);
}
if
(
_controllerVehicle
->
multiRotor
()
||
_controllerVehicle
->
vtol
())
{
complexItems
.
append
(
_structureScanMissionItem
Name
);
complexItems
.
append
(
patternStructureScan
Name
);
}
return
complexItems
;
return
qgcApp
()
->
toolbox
()
->
corePlugin
()
->
complexMissionItemNames
(
_controllerVehicle
,
complexItems
)
;
}
void
MissionController
::
resumeMission
(
int
resumeIndex
)
...
...
src/MissionManager/MissionController.h
View file @
bde5c03d
...
...
@@ -175,8 +175,8 @@ public:
VisualMissionItem
*
currentPlanViewItem
(
void
)
const
;
double
progressPct
(
void
)
const
{
return
_progressPct
;
}
QString
surveyComplexItemName
(
void
)
const
{
return
_surveyMissionItemName
;
}
QString
corridorScanComplexItemName
(
void
)
const
{
return
_corridorScanMissionItem
Name
;
}
QString
structureScanComplexItemName
(
void
)
const
{
return
_structureScanMissionItem
Name
;
}
QString
corridorScanComplexItemName
(
void
)
const
{
return
patternCorridorScan
Name
;
}
QString
structureScanComplexItemName
(
void
)
const
{
return
patternStructureScan
Name
;
}
int
missionItemCount
(
void
)
const
{
return
_missionItemCount
;
}
int
currentMissionIndex
(
void
)
const
;
...
...
@@ -194,6 +194,12 @@ public:
int
batteryChangePoint
(
void
)
const
{
return
_missionFlightStatus
.
batteryChangePoint
;
}
///< -1 for not supported, 0 for not needed
int
batteriesRequired
(
void
)
const
{
return
_missionFlightStatus
.
batteriesRequired
;
}
///< -1 for not supported
// These are the names shown in the UI for the pattern items. They are public so custom builds can remove the ones
// they don't want through the QGCCorePlugin::
QString
patternFWLandingName
;
QString
patternStructureScanName
;
QString
patternCorridorScanName
;
signals:
void
visualItemsChanged
(
void
);
void
waypointLinesChanged
(
void
);
...
...
@@ -285,9 +291,6 @@ private:
bool
_inRecalcSequence
;
MissionFlightStatus_t
_missionFlightStatus
;
QString
_surveyMissionItemName
;
QString
_fwLandingMissionItemName
;
QString
_structureScanMissionItemName
;
QString
_corridorScanMissionItemName
;
AppSettings
*
_appSettings
;
double
_progressPct
;
int
_currentPlanViewIndex
;
...
...
src/api/QGCCorePlugin.h
View file @
bde5c03d
...
...
@@ -139,6 +139,11 @@ public:
/// Custom builds must override to provide their own location.
virtual
QString
stableDownloadLocation
(
void
)
const
{
return
QString
(
"qgroundcontrol.com"
);
}
/// Returns the complex mission items to display in the Plan UI
/// @param complexMissionItemNames Default set of complex items
/// @return Complex items to be made available to user
virtual
QStringList
complexMissionItemNames
(
Vehicle
*
vehicle
,
const
QStringList
&
complexMissionItemNames
)
{
Q_UNUSED
(
vehicle
);
return
complexMissionItemNames
;
}
bool
showTouchAreas
(
void
)
const
{
return
_showTouchAreas
;
}
bool
showAdvancedUI
(
void
)
const
{
return
_showAdvancedUI
;
}
void
setShowTouchAreas
(
bool
show
);
...
...
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