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
0faac4c4
Commit
0faac4c4
authored
Feb 18, 2017
by
Don Gagne
Committed by
GitHub
Feb 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4574 from DonLakeFlyer/ComplexItemVisual
Complex item visual dynamically added to map
parents
929d4a02
205061e8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
116 additions
and
17 deletions
+116
-17
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-0
ComplexMissionItem.qml
src/MissionEditor/ComplexMissionItem.qml
+43
-0
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+4
-17
SurveyComplexItem.qml
src/MissionEditor/SurveyComplexItem.qml
+59
-0
ComplexMissionItem.h
src/MissionManager/ComplexMissionItem.h
+4
-0
FixedWingLandingComplexItem.h
src/MissionManager/FixedWingLandingComplexItem.h
+1
-0
SurveyMissionItem.h
src/MissionManager/SurveyMissionItem.h
+1
-0
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+2
-0
No files found.
qgroundcontrol.qrc
View file @
0faac4c4
...
...
@@ -41,6 +41,7 @@
<file alias="PX4FlowSensor.qml">src/VehicleSetup/PX4FlowSensor.qml</file>
<file alias="QGroundControl/Controls/AnalyzePage.qml">src/AnalyzeView/AnalyzePage.qml</file>
<file alias="QGroundControl/Controls/AppMessages.qml">src/QmlControls/AppMessages.qml</file>
<file alias="QGroundControl/Controls/ComplexMissionItem.qml">src/MissionEditor/ComplexMissionItem.qml</file>
<file alias="QGroundControl/Controls/ClickableColor.qml">src/QmlControls/ClickableColor.qml</file>
<file alias="QGroundControl/Controls/DropButton.qml">src/QmlControls/DropButton.qml</file>
<file alias="QGroundControl/Controls/ExclusiveGroupItem.qml">src/QmlControls/ExclusiveGroupItem.qml</file>
...
...
@@ -92,6 +93,7 @@
<file alias="QGroundControl/Controls/SignalStrength.qml">src/ui/toolbar/SignalStrength.qml</file>
<file alias="QGroundControl/Controls/SliderSwitch.qml">src/QmlControls/SliderSwitch.qml</file>
<file alias="QGroundControl/Controls/SubMenuButton.qml">src/QmlControls/SubMenuButton.qml</file>
<file alias="QGroundControl/Controls/SurveyComplexItem.qml">src/MissionEditor/SurveyComplexItem.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">src/QmlControls/ToolStrip.qml</file>
...
...
src/MissionEditor/ComplexMissionItem.qml
0 → 100644
View file @
0faac4c4
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtLocation
5.3
import
QtPositioning
5.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
/// Mission item edit control
Item
{
id
:
_root
property
var
map
///< Map control to place item in
property
var
_complexItem
Component.onCompleted
:
{
if
(
object
.
mapVisualQML
)
{
var
component
=
Qt
.
createComponent
(
object
.
mapVisualQML
)
if
(
component
.
status
===
Component
.
Error
)
{
console
.
log
(
"
Error loading Qml:
"
,
object
.
mapVisualQML
,
component
.
errorString
())
}
_complexItem
=
component
.
createObject
(
map
,
{
"
map
"
:
_root
.
map
})
}
}
Component
.
onDestruction
:
{
if
(
_complexItem
)
{
_complexItem
.
destroy
()
}
}
}
src/MissionEditor/MissionEditor.qml
View file @
0faac4c4
...
...
@@ -445,25 +445,12 @@ QGCView {
}
}
// Add the complex mission item polygon to the map
MapItemView
{
model
:
missionController
.
complexVisualItems
delegate
:
MapPolygon
{
color
:
'
green
'
path
:
object
.
polygonPath
opacity
:
0.5
}
}
// Add the complex mission item grid to the map
MapItemView
{
// Add the complex mission item to the map
Repeater
{
model
:
missionController
.
complexVisualItems
delegate
:
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
object
.
gridPoints
delegate
:
ComplexMissionItem
{
map
:
editorMap
}
}
...
...
src/MissionEditor/SurveyComplexItem.qml
0 → 100644
View file @
0faac4c4
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtLocation
5.3
import
QtPositioning
5.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
/// Survey Complex Mission Item visuals
Item
{
property
var
map
///< Map control to place item in
property
var
_polygon
property
var
_grid
Component.onCompleted
:
{
_polygon
=
polygonComponent
.
createObject
(
map
)
_grid
=
gridComponent
.
createObject
(
map
)
map
.
addMapItem
(
_polygon
)
map
.
addMapItem
(
_grid
)
}
Component.onDestruction
:
{
_polygon
.
destroy
()
_grid
.
destroy
()
}
// Survey area polygon
Component
{
id
:
polygonComponent
MapPolygon
{
color
:
"
green
"
opacity
:
0.5
path
:
object
.
polygonPath
}
}
// Survey grid lines
Component
{
id
:
gridComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
object
.
gridPoints
}
}
}
src/MissionManager/ComplexMissionItem.h
View file @
0faac4c4
...
...
@@ -21,6 +21,7 @@ public:
const
ComplexMissionItem
&
operator
=
(
const
ComplexMissionItem
&
other
);
Q_PROPERTY
(
QString
mapVisualQML
READ
mapVisualQML
CONSTANT
)
Q_PROPERTY
(
int
lastSequenceNumber
READ
lastSequenceNumber
NOTIFY
lastSequenceNumberChanged
)
Q_PROPERTY
(
double
complexDistance
READ
complexDistance
NOTIFY
complexDistanceChanged
)
...
...
@@ -52,6 +53,9 @@ public:
/// This mission item attribute specifies the type of the complex item.
static
const
char
*
jsonComplexItemTypeKey
;
/// @return The QML resource file which contains the control which visualizes the item on the map.
virtual
QString
mapVisualQML
(
void
)
const
=
0
;
signals:
void
lastSequenceNumberChanged
(
int
lastSequenceNumber
);
void
complexDistanceChanged
(
double
complexDistance
);
...
...
src/MissionManager/FixedWingLandingComplexItem.h
View file @
0faac4c4
...
...
@@ -32,6 +32,7 @@ public:
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
final
;
double
greatestDistanceTo
(
const
QGeoCoordinate
&
other
)
const
final
;
void
setCruiseSpeed
(
double
cruiseSpeed
)
final
;
QString
mapVisualQML
(
void
)
const
final
{
return
QString
();
}
// Overrides from VisualMissionItem
...
...
src/MissionManager/SurveyMissionItem.h
View file @
0faac4c4
...
...
@@ -83,6 +83,7 @@ public:
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
final
;
double
greatestDistanceTo
(
const
QGeoCoordinate
&
other
)
const
final
;
void
setCruiseSpeed
(
double
cruiseSpeed
)
final
;
QString
mapVisualQML
(
void
)
const
final
{
return
QStringLiteral
(
"SurveyComplexItem.qml"
);
}
// Overrides from VisualMissionItem
...
...
src/QmlControls/QGroundControl.Controls.qmldir
View file @
0faac4c4
...
...
@@ -3,6 +3,7 @@ Module QGroundControl.Controls
AnalyzePage 1.0 AnalyzePage.qml
AppMessages 1.0 AppMessages.qml
ClickableColor 1.0 ClickableColor.qml
ComplexMissionItem 1.0 ComplexMissionItem.qml
DropButton 1.0 DropButton.qml
DropPanel 1.0 DropPanel.qml
ExclusiveGroupItem 1.0 ExclusiveGroupItem.qml
...
...
@@ -50,6 +51,7 @@ SetupPage 1.0 SetupPage.qml
SignalStrength 1.0 SignalStrength.qml
SliderSwitch 1.0 SliderSwitch.qml
SubMenuButton 1.0 SubMenuButton.qml
SurveyComplexItem 1.0 SurveyComplexItem.qml
ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
...
...
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