Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7eed1155
Commit
7eed1155
authored
Apr 17, 2019
by
lichenyuneec
Browse files
the battery and distance of structure scan always show 0
Change-Id: I80acc497ef8fc574f64b181a8d276c5b00d4e057
parent
0871b019
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
Try again
or
attach a new 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