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
900ce1ee
Commit
900ce1ee
authored
Jun 19, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore mission bounding box, which was lost with master branch changes
parent
18120b0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
TransectStyleComplexItem.cc
src/MissionManager/TransectStyleComplexItem.cc
+27
-0
TransectStyleComplexItem.h
src/MissionManager/TransectStyleComplexItem.h
+12
-9
No files found.
src/MissionManager/TransectStyleComplexItem.cc
View file @
900ce1ee
...
...
@@ -362,13 +362,32 @@ void TransectStyleComplexItem::_rebuildTransects(void)
}
}
// Calc bounding cube
double
north
=
0.0
;
double
south
=
180.0
;
double
east
=
0.0
;
double
west
=
360.0
;
double
bottom
=
100000.
;
double
top
=
0.
;
// Generate the visuals transect representation
_visualTransectPoints
.
clear
();
foreach
(
const
QList
<
CoordInfo_t
>&
transect
,
_transects
)
{
foreach
(
const
CoordInfo_t
&
coordInfo
,
transect
)
{
_visualTransectPoints
.
append
(
QVariant
::
fromValue
(
coordInfo
.
coord
));
double
lat
=
coordInfo
.
coord
.
latitude
()
+
90.0
;
double
lon
=
coordInfo
.
coord
.
longitude
()
+
180.0
;
north
=
fmax
(
north
,
lat
);
south
=
fmin
(
south
,
lat
);
east
=
fmax
(
east
,
lon
);
west
=
fmin
(
west
,
lon
);
bottom
=
fmin
(
bottom
,
coordInfo
.
coord
.
altitude
());
top
=
fmax
(
top
,
coordInfo
.
coord
.
altitude
());
}
}
//-- Update bounding cube for airspace management control
_setBoundingCube
(
QGCGeoBoundingCube
(
QGeoCoordinate
(
north
-
90.0
,
west
-
180.0
,
bottom
),
QGeoCoordinate
(
south
-
90.0
,
east
-
180.0
,
top
)));
emit
visualTransectPointsChanged
();
_coordinate
=
_visualTransectPoints
.
count
()
?
_visualTransectPoints
.
first
().
value
<
QGeoCoordinate
>
()
:
QGeoCoordinate
();
...
...
@@ -382,6 +401,14 @@ void TransectStyleComplexItem::_rebuildTransects(void)
emit
timeBetweenShotsChanged
();
}
void
TransectStyleComplexItem
::
_setBoundingCube
(
QGCGeoBoundingCube
bc
)
{
if
(
bc
!=
_boundingCube
)
{
_boundingCube
=
bc
;
emit
boundingCubeChanged
();
}
}
void
TransectStyleComplexItem
::
_queryTransectsPathHeightInfo
(
void
)
{
_transectsPathHeightInfo
.
clear
();
...
...
src/MissionManager/TransectStyleComplexItem.h
View file @
900ce1ee
...
...
@@ -68,9 +68,10 @@ public:
// Overrides from ComplexMissionItem
int
lastSequenceNumber
(
void
)
const
final
;
QString
mapVisualQML
(
void
)
const
override
=
0
;
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
override
=
0
;
int
lastSequenceNumber
(
void
)
const
final
;
QString
mapVisualQML
(
void
)
const
override
=
0
;
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
override
=
0
;
QGCGeoBoundingCube
boundingCube
(
void
)
const
override
{
return
_boundingCube
;
}
double
complexDistance
(
void
)
const
final
{
return
_complexDistance
;
}
double
greatestDistanceTo
(
const
QGeoCoordinate
&
other
)
const
final
;
...
...
@@ -140,12 +141,14 @@ protected:
double
_triggerDistance
(
void
)
const
;
bool
_hasTurnaround
(
void
)
const
;
double
_turnaroundDistance
(
void
)
const
;
int
_sequenceNumber
;
bool
_dirty
;
QGeoCoordinate
_coordinate
;
QGeoCoordinate
_exitCoordinate
;
QGCMapPolygon
_surveyAreaPolygon
;
void
_setBoundingCube
(
QGCGeoBoundingCube
bc
);
int
_sequenceNumber
;
bool
_dirty
;
QGeoCoordinate
_coordinate
;
QGeoCoordinate
_exitCoordinate
;
QGCMapPolygon
_surveyAreaPolygon
;
QGCGeoBoundingCube
_boundingCube
;
enum
CoordType
{
CoordTypeInterior
,
...
...
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