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
ef29f8c1
Commit
ef29f8c1
authored
Mar 07, 2020
by
DoinLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
294f086d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
4 deletions
+47
-4
ChangeLog.md
ChangeLog.md
+6
-0
MissionController.cc
src/MissionManager/MissionController.cc
+16
-0
MissionController.h
src/MissionManager/MissionController.h
+8
-2
PlanView.qml
src/PlanView/PlanView.qml
+1
-1
PlanView.SettingsGroup.json
src/Settings/PlanView.SettingsGroup.json
+6
-0
PlanViewSettings.cc
src/Settings/PlanViewSettings.cc
+1
-0
PlanViewSettings.h
src/Settings/PlanViewSettings.h
+1
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+8
-1
No files found.
ChangeLog.md
View file @
ef29f8c1
...
...
@@ -6,6 +6,12 @@ Note: This file only contains high level features or important fixes.
### 4.0.3 - Not yet released
### 4.0.3 - Not yet released
*
Plan: Add setting for takeoff item not required
*
Plan: Takeoff item must be added prior to allowing other item types to enable
### 4.0.2 - Stable
*
Fix Mavlink V2 protocol negotation based on capability bits
...
...
src/MissionManager/MissionController.cc
View file @
ef29f8c1
...
...
@@ -31,6 +31,7 @@
#include "KML.h"
#include "QGCCorePlugin.h"
#include "TakeoffMissionItem.h"
#include "PlanViewSettings.h"
#define UPDATE_TIMEOUT 5000 ///< How often we check for bounding box changes
...
...
@@ -59,6 +60,7 @@ const QString MissionController::patternCorridorScanName (QT_TRANSLATE_NOOP("
MissionController
::
MissionController
(
PlanMasterController
*
masterController
,
QObject
*
parent
)
:
PlanElementController
(
masterController
,
parent
)
,
_planViewSettings
(
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
planViewSettings
())
,
_missionManager
(
_managerVehicle
->
missionManager
())
,
_missionItemCount
(
0
)
,
_visualItems
(
nullptr
)
...
...
@@ -77,6 +79,8 @@ MissionController::MissionController(PlanMasterController* masterController, QOb
managerVehicleChanged
(
_managerVehicle
);
_updateTimer
.
setSingleShot
(
true
);
connect
(
&
_updateTimer
,
&
QTimer
::
timeout
,
this
,
&
MissionController
::
_updateTimeout
);
connect
(
_planViewSettings
->
takeoffItemNotRequired
(),
&
Fact
::
rawValueChanged
,
this
,
&
MissionController
::
_takeoffItemNotRequiredChanged
);
}
MissionController
::~
MissionController
()
...
...
@@ -2301,6 +2305,7 @@ void MissionController::setCurrentPlanViewSeqNum(int sequenceNumber, bool force)
_currentPlanViewItem
=
nullptr
;
_currentPlanViewSeqNum
=
-
1
;
_currentPlanViewVIIndex
=
-
1
;
_onlyInsertTakeoffValid
=
!
_planViewSettings
->
takeoffItemNotRequired
()
->
rawValue
().
toBool
()
&&
_visualItems
->
count
()
==
1
;
// First item must be takeoff
_isInsertTakeoffValid
=
true
;
_isInsertLandValid
=
true
;
_isROIActive
=
false
;
...
...
@@ -2430,10 +2435,15 @@ void MissionController::setCurrentPlanViewSeqNum(int sequenceNumber, bool force)
}
}
// These are not valid when only takeoff is allowed
_isInsertLandValid
=
_isInsertLandValid
&&
!
_onlyInsertTakeoffValid
;
_flyThroughCommandsAllowed
=
_flyThroughCommandsAllowed
&&
!
_onlyInsertTakeoffValid
;
emit
currentPlanViewSeqNumChanged
();
emit
currentPlanViewVIIndexChanged
();
emit
currentPlanViewItemChanged
();
emit
splitSegmentChanged
();
emit
onlyInsertTakeoffValidChanged
();
emit
isInsertTakeoffValidChanged
();
emit
isInsertLandValidChanged
();
emit
isROIActiveChanged
();
...
...
@@ -2531,3 +2541,9 @@ bool MissionController::isEmpty(void) const
{
return
_visualItems
->
count
()
<=
1
;
}
void
MissionController
::
_takeoffItemNotRequiredChanged
(
void
)
{
// Force a recalc of allowed bits
setCurrentPlanViewSeqNum
(
_currentPlanViewSeqNum
,
true
/* force */
);
}
src/MissionManager/MissionController.h
View file @
ef29f8c1
...
...
@@ -28,6 +28,7 @@ class SimpleMissionItem;
class
ComplexMissionItem
;
class
MissionSettingsItem
;
class
QDomDocument
;
class
PlanViewSettings
;
Q_DECLARE_LOGGING_CATEGORY
(
MissionControllerLog
)
...
...
@@ -95,6 +96,7 @@ public:
Q_PROPERTY
(
QString
surveyComplexItemName
READ
surveyComplexItemName
CONSTANT
)
Q_PROPERTY
(
QString
corridorScanComplexItemName
READ
corridorScanComplexItemName
CONSTANT
)
Q_PROPERTY
(
QString
structureScanComplexItemName
READ
structureScanComplexItemName
CONSTANT
)
Q_PROPERTY
(
bool
onlyInsertTakeoffValid
MEMBER
_onlyInsertTakeoffValid
NOTIFY
onlyInsertTakeoffValidChanged
)
Q_PROPERTY
(
bool
isInsertTakeoffValid
MEMBER
_isInsertTakeoffValid
NOTIFY
isInsertTakeoffValidChanged
)
Q_PROPERTY
(
bool
isInsertLandValid
MEMBER
_isInsertLandValid
NOTIFY
isInsertLandValidChanged
)
Q_PROPERTY
(
bool
isROIActive
MEMBER
_isROIActive
NOTIFY
isROIActiveChanged
)
...
...
@@ -264,6 +266,7 @@ signals:
void
currentPlanViewItemChanged
(
void
);
void
missionBoundingCubeChanged
(
void
);
void
missionItemCountChanged
(
int
missionItemCount
);
void
onlyInsertTakeoffValidChanged
(
void
);
void
isInsertTakeoffValidChanged
(
void
);
void
isInsertLandValidChanged
(
void
);
void
isROIActiveChanged
(
void
);
...
...
@@ -286,6 +289,7 @@ private slots:
void
_updateTimeout
(
void
);
void
_complexBoundingBoxChanged
(
void
);
void
_recalcAll
(
void
);
void
_takeoffItemNotRequiredChanged
(
void
);
private:
void
_init
(
void
);
...
...
@@ -329,6 +333,7 @@ private:
CoordinateVector
*
_createCoordinateVectorWorker
(
VisualItemPair
&
pair
);
private:
PlanViewSettings
*
_planViewSettings
=
nullptr
;
MissionManager
*
_missionManager
;
int
_missionItemCount
;
QmlObjectListModel
*
_visualItems
;
...
...
@@ -352,10 +357,11 @@ private:
QGeoCoordinate
_takeoffCoordinate
;
QGeoCoordinate
_previousCoordinate
;
CoordinateVector
*
_splitSegment
;
bool
_onlyInsertTakeoffValid
=
true
;
bool
_isInsertTakeoffValid
=
true
;
bool
_isInsertLandValid
=
tru
e
;
bool
_isInsertLandValid
=
fals
e
;
bool
_isROIActive
=
false
;
bool
_flyThroughCommandsAllowed
=
tru
e
;
bool
_flyThroughCommandsAllowed
=
fals
e
;
bool
_isROIBeginCurrentItem
=
false
;
static
const
char
*
_settingsGroup
;
...
...
src/PlanView/PlanView.qml
View file @
ef29f8c1
...
...
@@ -617,7 +617,7 @@ Item {
{
name
:
_missionController
.
isROIActive
?
qsTr
(
"
Cancel ROI
"
)
:
qsTr
(
"
ROI
"
),
iconSource
:
"
/qmlimages/MapAddMission.svg
"
,
buttonEnabled
:
true
,
buttonEnabled
:
!
_missionController
.
onlyInsertTakeoffValid
,
buttonVisible
:
_isMissionLayer
&&
_planMasterController
.
controllerVehicle
.
roiModeSupported
,
toggle
:
!
_missionController
.
isROIActive
},
...
...
src/Settings/PlanView.SettingsGroup.json
View file @
ef29f8c1
...
...
@@ -16,5 +16,11 @@
"shortDescription"
:
"Show/Hide the mission item status display"
,
"type"
:
"bool"
,
"defaultValue"
:
false
},
{
"name"
:
"takeoffItemNotRequired"
,
"shortDescription"
:
"Allow missions to not require a takeoff item"
,
"type"
:
"bool"
,
"defaultValue"
:
false
}
]
src/Settings/PlanViewSettings.cc
View file @
ef29f8c1
...
...
@@ -20,3 +20,4 @@ DECLARE_SETTINGGROUP(PlanView, "PlanView")
DECLARE_SETTINGSFACT
(
PlanViewSettings
,
displayPresetsTabFirst
)
DECLARE_SETTINGSFACT
(
PlanViewSettings
,
aboveTerrainWarning
)
DECLARE_SETTINGSFACT
(
PlanViewSettings
,
showMissionItemStatus
)
DECLARE_SETTINGSFACT
(
PlanViewSettings
,
takeoffItemNotRequired
)
src/Settings/PlanViewSettings.h
View file @
ef29f8c1
...
...
@@ -23,4 +23,5 @@ public:
DEFINE_SETTINGFACT
(
displayPresetsTabFirst
)
DEFINE_SETTINGFACT
(
aboveTerrainWarning
)
DEFINE_SETTINGFACT
(
showMissionItemStatus
)
DEFINE_SETTINGFACT
(
takeoffItemNotRequired
)
};
src/ui/preferences/GeneralSettings.qml
View file @
ef29f8c1
...
...
@@ -43,6 +43,7 @@ Rectangle {
property
Fact
_followTarget
:
QGroundControl
.
settingsManager
.
appSettings
.
followTarget
property
real
_panelWidth
:
_root
.
width
*
_internalWidthRatio
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
property
var
_planViewSettings
:
QGroundControl
.
settingsManager
.
planViewSettings
property
string
_videoSource
:
QGroundControl
.
settingsManager
.
videoSettings
.
videoSource
.
value
property
bool
_isGst
:
QGroundControl
.
videoManager
.
isGStreamer
...
...
@@ -595,7 +596,7 @@ Rectangle {
QGCLabel
{
id
:
planViewSectionLabel
text
:
qsTr
(
"
Plan View
"
)
visible
:
QGroundControl
.
settingsManager
.
planViewSettings
.
visible
visible
:
_
planViewSettings
.
visible
}
Rectangle
{
Layout.preferredHeight
:
planViewCol
.
height
+
(
_margins
*
2
)
...
...
@@ -621,6 +622,12 @@ Rectangle {
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
defaultMissionItemAltitude
}
}
FactCheckBox
{
text
:
qsTr
(
"
Missions Do Not Require Takeoff Item
"
)
fact
:
_planViewSettings
.
takeoffItemNotRequired
visible
:
_planViewSettings
.
takeoffItemNotRequired
.
visible
}
}
}
...
...
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