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
8b938a34
Commit
8b938a34
authored
Feb 13, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy Fly view position to Plan
Also added Center to Mission support
parent
5a90520b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
21 deletions
+42
-21
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+3
-0
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+35
-21
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+4
-0
No files found.
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
8b938a34
...
...
@@ -44,6 +44,9 @@ FlightMap {
property
bool
_activeVehicleCoordinateValid
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
coordinateValid
:
false
property
var
activeVehicleCoordinate
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
coordinate
:
QtPositioning
.
coordinate
()
Component.onCompleted
:
QGroundControl
.
flightMapPosition
=
center
onCenterChanged
:
QGroundControl
.
flightMapPosition
=
center
onActiveVehicleCoordinateChanged
:
{
if
(
_followVehicle
&&
_activeVehicleCoordinateValid
&&
activeVehicleCoordinate
.
isValid
)
{
_initialMapPositionSet
=
true
...
...
src/MissionEditor/MissionEditor.qml
View file @
8b938a34
...
...
@@ -67,7 +67,6 @@ QGCView {
property
bool
_syncInProgress
:
_activeVehicle
?
_activeVehicle
.
missionManager
.
inProgress
:
false
Component.onCompleted
:
updateMapToVehiclePosition
()
onActiveVehiclePositionChanged
:
updateMapToVehiclePosition
()
Connections
{
...
...
@@ -106,29 +105,32 @@ QGCView {
return
lon
+
180.0
}
/// Fix the map viewport to the current mission items.
We don't fit the home position in this process.
/// Fix the map viewport to the current mission items.
function
fitViewportToMissionItems
()
{
var
missionItem
=
_missionItems
.
get
(
0
)
var
north
=
normalizeLat
(
missionItem
.
coordinate
.
latitude
)
var
south
=
north
var
east
=
normalizeLon
(
missionItem
.
coordinate
.
longitude
)
var
west
=
east
for
(
var
i
=
1
;
i
<
_missionItems
.
count
;
i
++
)
{
missionItem
=
_missionItems
.
get
(
i
)
if
(
missionItem
.
specifiesCoordinate
&&
!
missionItem
.
standaloneCoordinate
)
{
var
lat
=
normalizeLat
(
missionItem
.
coordinate
.
latitude
)
var
lon
=
normalizeLon
(
missionItem
.
coordinate
.
longitude
)
north
=
Math
.
max
(
north
,
lat
)
south
=
Math
.
min
(
south
,
lat
)
east
=
Math
.
max
(
east
,
lon
)
west
=
Math
.
min
(
west
,
lon
)
if
(
_missionItems
.
count
==
1
)
{
editorMap
.
center
=
_missionItems
.
get
(
0
).
coordinate
}
else
{
var
missionItem
=
_missionItems
.
get
(
0
)
var
north
=
normalizeLat
(
missionItem
.
coordinate
.
latitude
)
var
south
=
north
var
east
=
normalizeLon
(
missionItem
.
coordinate
.
longitude
)
var
west
=
east
for
(
var
i
=
1
;
i
<
_missionItems
.
count
;
i
++
)
{
missionItem
=
_missionItems
.
get
(
i
)
if
(
missionItem
.
specifiesCoordinate
&&
!
missionItem
.
standaloneCoordinate
)
{
var
lat
=
normalizeLat
(
missionItem
.
coordinate
.
latitude
)
var
lon
=
normalizeLon
(
missionItem
.
coordinate
.
longitude
)
north
=
Math
.
max
(
north
,
lat
)
south
=
Math
.
min
(
south
,
lat
)
east
=
Math
.
max
(
east
,
lon
)
west
=
Math
.
min
(
west
,
lon
)
}
}
editorMap
.
visibleRegion
=
QtPositioning
.
rectangle
(
QtPositioning
.
coordinate
(
north
-
90.0
,
west
-
180.0
),
QtPositioning
.
coordinate
(
south
-
90.0
,
east
-
180.0
))
}
editorMap
.
visibleRegion
=
QtPositioning
.
rectangle
(
QtPositioning
.
coordinate
(
north
-
90.0
,
west
-
180.0
),
QtPositioning
.
coordinate
(
south
-
90.0
,
east
-
180.0
))
}
MissionController
{
...
...
@@ -224,6 +226,9 @@ QGCView {
readonly
property
real
animationDuration
:
500
// Initial map position duplicates Fly view position
Component.onCompleted
:
editorMap
.
center
=
QGroundControl
.
flightMapPosition
Behavior
on
zoomLevel
{
NumberAnimation
{
duration
:
editorMap
.
animationDuration
...
...
@@ -474,6 +479,15 @@ QGCView {
}
}
QGCButton
{
text
:
"
Mission
"
onClicked
:
{
centerMapButton
.
hideDropDown
()
fitViewportToMissionItems
()
}
}
QGCButton
{
text
:
"
Vehicle
"
enabled
:
activeVehicle
&&
activeVehicle
.
latitude
!=
0
&&
activeVehicle
.
longitude
!=
0
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
8b938a34
...
...
@@ -76,6 +76,7 @@ public:
Q_PROPERTY
(
Fact
*
offlineEditingFirmwareType
READ
offlineEditingFirmwareType
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
lastKnownHomePosition
READ
lastKnownHomePosition
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
flightMapPosition
MEMBER
_flightMapPosition
NOTIFY
flightMapPositionChanged
)
Q_INVOKABLE
void
saveGlobalSetting
(
const
QString
&
key
,
const
QString
&
value
);
Q_INVOKABLE
QString
loadGlobalSetting
(
const
QString
&
key
,
const
QString
&
defaultValue
);
...
...
@@ -142,6 +143,7 @@ signals:
void
isMultiplexingEnabledChanged
(
bool
enabled
);
void
isVersionCheckEnabledChanged
(
bool
enabled
);
void
mavlinkSystemIDChanged
(
int
id
);
void
flightMapPositionChanged
(
QGeoCoordinate
flightMapPosition
);
private:
FlightMapSettings
*
_flightMapSettings
;
...
...
@@ -152,6 +154,8 @@ private:
bool
_virtualTabletJoystick
;
QGeoCoordinate
_flightMapPosition
;
SettingsFact
_offlineEditingFirmwareTypeFact
;
FactMetaData
_offlineEditingFirmwareTypeMetaData
;
...
...
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