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
7eed1155
Commit
7eed1155
authored
Apr 17, 2019
by
lichenyuneec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the battery and distance of structure scan always show 0
Change-Id: I80acc497ef8fc574f64b181a8d276c5b00d4e057
parent
0871b019
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
10 deletions
+30
-10
StructureScanComplexItem.cc
src/MissionManager/StructureScanComplexItem.cc
+28
-8
StructureScanComplexItem.h
src/MissionManager/StructureScanComplexItem.h
+2
-2
No files found.
src/MissionManager/StructureScanComplexItem.cc
View file @
7eed1155
...
...
@@ -83,6 +83,8 @@ StructureScanComplexItem::StructureScanComplexItem(Vehicle* vehicle, bool flyVie
connect
(
&
_cameraCalc
,
&
CameraCalc
::
isManualCameraChanged
,
this
,
&
StructureScanComplexItem
::
_updateGimbalPitch
);
connect
(
&
_layersFact
,
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_recalcScanDistance
);
_recalcLayerInfo
();
if
(
!
kmlOrShpFile
.
isEmpty
())
{
...
...
@@ -93,14 +95,6 @@ StructureScanComplexItem::StructureScanComplexItem(Vehicle* vehicle, bool flyVie
setDirty
(
false
);
}
void
StructureScanComplexItem
::
_setScanDistance
(
double
scanDistance
)
{
if
(
!
qFuzzyCompare
(
_scanDistance
,
scanDistance
))
{
_scanDistance
=
scanDistance
;
emit
complexDistanceChanged
();
}
}
void
StructureScanComplexItem
::
_setCameraShots
(
int
cameraShots
)
{
if
(
_cameraShots
!=
cameraShots
)
{
...
...
@@ -519,6 +513,9 @@ void StructureScanComplexItem::_rebuildFlightPolygon(void)
}
else
{
_entryVertex
=
savedEntryVertex
;
}
_recalcScanDistance
();
emit
coordinateChanged
(
coordinate
());
emit
exitCoordinateChanged
(
exitCoordinate
());
}
...
...
@@ -598,3 +595,26 @@ void StructureScanComplexItem::_signalTopBottomAltChanged(void)
emit
topFlightAltChanged
();
emit
bottomFlightAltChanged
();
}
void
StructureScanComplexItem
::
_recalcScanDistance
()
{
double
scanDistance
=
0
;
QList
<
QGeoCoordinate
>
vertices
=
_flightPolygon
.
coordinateList
();
for
(
int
i
=
0
;
i
<
vertices
.
count
()
-
1
;
i
++
)
{
scanDistance
+=
vertices
[
i
].
distanceTo
(
vertices
[
i
+
1
]);
}
scanDistance
*=
_layersFact
.
rawValue
().
toInt
();
double
surfaceHeight
=
qMax
(
_structureHeightFact
.
rawValue
().
toDouble
()
-
_scanBottomAltFact
.
rawValue
().
toDouble
(),
0.0
);
scanDistance
+=
surfaceHeight
;
if
(
!
qFuzzyCompare
(
_scanDistance
,
scanDistance
))
{
_scanDistance
=
scanDistance
;
emit
complexDistanceChanged
();
}
qCDebug
(
MissionControllerLog
)
<<
"StructureScanComplexItem--_recalcScanDistance layers: "
<<
_layersFact
.
rawValue
().
toInt
()
<<
" structure height: "
<<
surfaceHeight
<<
" scanDistance: "
<<
_scanDistance
;
}
src/MissionManager/StructureScanComplexItem.h
View file @
7eed1155
...
...
@@ -125,11 +125,11 @@ private slots:
void
_recalcLayerInfo
(
void
);
void
_updateLastSequenceNumber
(
void
);
void
_updateGimbalPitch
(
void
);
void
_signalTopBottomAltChanged
(
void
);
void
_signalTopBottomAltChanged
(
void
);
void
_recalcScanDistance
(
void
);
private:
void
_setExitCoordinate
(
const
QGeoCoordinate
&
coordinate
);
void
_setScanDistance
(
double
scanDistance
);
void
_setCameraShots
(
int
cameraShots
);
double
_triggerDistance
(
void
)
const
;
...
...
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