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
dcc5642d
Commit
dcc5642d
authored
Apr 05, 2017
by
Don Gagne
Committed by
GitHub
Apr 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4924 from DonLakeFlyer/PlanWaypointsOnlyMode
Add support for QGCOptions::waypointsOnlyMode
parents
7bf0dc2d
f52eceed
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
10 deletions
+74
-10
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+61
-7
PlanView.qml
src/PlanView/PlanView.qml
+9
-3
QGCOptions.h
src/api/QGCOptions.h
+4
-0
No files found.
src/PlanView/MissionItemEditor.qml
View file @
dcc5642d
...
...
@@ -2,7 +2,9 @@ import QtQuick 2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.4
import
QtQuick
.
Dialogs
1.2
import
QtQml
2.2
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
import
QGroundControl
.
Controls
1.0
...
...
@@ -24,7 +26,8 @@ Rectangle {
signal
clicked
signal
remove
signal
insert
signal
insertWaypoint
signal
insertComplexItem
(
string
complexItemName
)
property
bool
_currentItem
:
missionItem
.
isCurrentItem
property
color
_outerTextColor
:
_currentItem
?
qgcPal
.
primaryButtonText
:
qgcPal
.
text
...
...
@@ -35,6 +38,7 @@ Rectangle {
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_hamburgerSize
:
commandPicker
.
height
*
0.75
readonly
property
bool
_waypointsOnlyMode
:
QGroundControl
.
corePlugin
.
options
.
missionWaypointsOnly
QGCPalette
{
id
:
qgcPal
...
...
@@ -72,13 +76,13 @@ Rectangle {
QGCMouseArea
{
fillItem
:
hamburger
visible
:
hamburger
.
visible
onClicked
:
hamburger
Menu
.
popup
()
onClicked
:
_waypointsOnlyMode
?
waypointsOnlyMenu
.
popup
()
:
normal
Menu
.
popup
()
Menu
{
id
:
hamburger
Menu
id
:
normal
Menu
MenuItem
{
text
:
qsTr
(
"
Insert
"
)
text
:
qsTr
(
"
Insert
waypoint
"
)
onTriggered
:
insert
()
}
...
...
@@ -87,8 +91,25 @@ Rectangle {
onTriggered
:
remove
()
}
Menu
{
id
:
normalPatternMenu
title
:
qsTr
(
"
Insert pattern
"
)
Instantiator
{
model
:
missionController
.
complexMissionItemNames
onObjectAdded
:
normalPatternMenu
.
insertItem
(
index
,
object
)
onObjectRemoved
:
normalPatternMenu
.
removeItem
(
object
)
MenuItem
{
text
:
"
Change command...
"
text
:
modelData
onTriggered
:
insertComplexItem
(
modelData
)
}
}
}
MenuItem
{
text
:
qsTr
(
"
Change command...
"
)
onTriggered
:
commandPicker
.
clicked
()
}
...
...
@@ -116,6 +137,38 @@ Rectangle {
}
}
}
Menu
{
id
:
waypointsOnlyMenu
MenuItem
{
text
:
qsTr
(
"
Insert waypoint
"
)
onTriggered
:
insertWaypoint
()
}
MenuItem
{
text
:
qsTr
(
"
Delete
"
)
onTriggered
:
remove
()
}
Menu
{
id
:
waypointsOnlyPatternMenu
title
:
qsTr
(
"
Insert pattern
"
)
Instantiator
{
model
:
missionController
.
complexMissionItemNames
onObjectAdded
:
waypointsOnlyPatternMenu
.
insertItem
(
index
,
object
)
onObjectRemoved
:
waypointsOnlyPatternMenu
.
removeItem
(
object
)
MenuItem
{
text
:
modelData
onTriggered
:
insertComplexItem
(
modelData
)
}
}
}
}
}
QGCButton
{
...
...
@@ -125,7 +178,7 @@ Rectangle {
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
label
.
right
anchors.top
:
parent
.
top
visible
:
missionItem
.
isCurrentItem
&&
!
missionItem
.
rawEdit
&&
missionItem
.
isSimpleItem
visible
:
!
commandLabel
.
visible
text
:
missionItem
.
commandName
Component
{
...
...
@@ -140,8 +193,9 @@ Rectangle {
}
QGCLabel
{
id
:
commandLabel
anchors.fill
:
commandPicker
visible
:
!
missionItem
.
isCurrentItem
||
!
missionItem
.
isSimpleItem
visible
:
!
missionItem
.
isCurrentItem
||
!
missionItem
.
isSimpleItem
||
_waypointsOnlyMode
verticalAlignment
:
Text
.
AlignVCenter
text
:
missionItem
.
commandName
color
:
_outerTextColor
...
...
src/PlanView/PlanView.qml
View file @
dcc5642d
...
...
@@ -70,7 +70,11 @@ QGCView {
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
var
sequenceNumber
=
missionController
.
insertComplexMissionItem
(
complexItemName
,
coordinate
,
missionController
.
visualItems
.
count
)
insertComplexItem
(
complexItemName
,
coordinate
,
missionController
.
visualItems
.
count
)
}
function
insertComplexMissionItem
(
complexItemName
,
coordinate
,
index
)
{
var
sequenceNumber
=
missionController
.
insertComplexMissionItem
(
complexItemName
,
coordinate
,
index
)
setCurrentItem
(
sequenceNumber
)
}
...
...
@@ -747,10 +751,12 @@ QGCView {
if
(
removeIndex
>=
missionController
.
visualItems
.
count
)
{
removeIndex
--
}
setCurrentItem
(
removeIndex
)
_currentMissionIndex
=
-
1
rootQgcView
.
setCurrentItem
(
removeIndex
)
}
onInsert
:
insertSimpleMissionItem
(
editorMap
.
center
,
index
)
onInsertWaypoint
:
insertSimpleMissionItem
(
editorMap
.
center
,
index
)
onInsertComplexItem
:
insertComplexMissionItem
(
complexItemName
,
editorMap
.
center
,
index
)
}
}
// QGCListView
}
// Item - Mission Item editor
...
...
src/api/QGCOptions.h
View file @
dcc5642d
...
...
@@ -40,6 +40,7 @@ public:
Q_PROPERTY
(
QString
firmwareUpgradeSingleURL
READ
firmwareUpgradeSingleURL
CONSTANT
)
Q_PROPERTY
(
bool
guidedBarShowEmergencyStop
READ
guidedBarShowEmergencyStop
NOTIFY
guidedBarShowEmergencyStopChanged
)
Q_PROPERTY
(
bool
guidedBarShowOrbit
READ
guidedBarShowOrbit
NOTIFY
guidedBarShowOrbitChanged
)
Q_PROPERTY
(
bool
missionWaypointsOnly
READ
missionWaypointsOnly
NOTIFY
missionWaypointsOnlyChanged
)
/// Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)?
/// @return true if QGC should consolidate both menus into one.
...
...
@@ -73,6 +74,8 @@ public:
virtual
bool
guidedBarShowEmergencyStop
()
const
{
return
true
;
}
virtual
bool
guidedBarShowOrbit
()
const
{
return
true
;
}
virtual
bool
missionWaypointsOnly
()
const
{
return
false
;
}
///< true: Only allow waypoints and complex items in Plan
/// If returned QString in non-empty it means that firmware upgrade will run in a mode which only
/// supports downloading a single firmware file from the URL. It also supports custom install through
/// the Advanced options.
...
...
@@ -87,6 +90,7 @@ signals:
void
showFirmwareUpgradeChanged
(
bool
show
);
void
guidedBarShowEmergencyStopChanged
(
bool
show
);
void
guidedBarShowOrbitChanged
(
bool
show
);
void
missionWaypointsOnlyChanged
(
bool
missionWaypointsOnly
);
private:
CustomInstrumentWidget
*
_defaultInstrumentWidget
;
...
...
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