Commit eecef884 authored by Don Gagne's avatar Don Gagne

parent 0a205d71
......@@ -466,11 +466,16 @@ void CorridorScanComplexItem::_rebuildTransectsPhase2(void)
_complexDistance += _visualTransectPoints[i].value<QGeoCoordinate>().distanceTo(_visualTransectPoints[i+1].value<QGeoCoordinate>());
}
if (_cameraTriggerInTurnAroundFact.rawValue().toBool()) {
_cameraShots = qCeil(_complexDistance / _cameraCalc.adjustedFootprintFrontal()->rawValue().toDouble());
double triggerDistance = _cameraCalc.adjustedFootprintFrontal()->rawValue().toDouble();
if (triggerDistance == 0) {
_cameraShots = 0;
} else {
int singleTransectImageCount = qCeil(_corridorPolyline.length() / _cameraCalc.adjustedFootprintFrontal()->rawValue().toDouble());
_cameraShots = singleTransectImageCount * _transectCount();
if (_cameraTriggerInTurnAroundFact.rawValue().toBool()) {
_cameraShots = qCeil(_complexDistance / triggerDistance);
} else {
int singleTransectImageCount = qCeil(_corridorPolyline.length() / triggerDistance);
_cameraShots = singleTransectImageCount * _transectCount();
}
}
_coordinate = _visualTransectPoints.count() ? _visualTransectPoints.first().value<QGeoCoordinate>() : QGeoCoordinate();
......
......@@ -433,6 +433,12 @@ void StructureScanComplexItem::_rebuildFlightPolygon(void)
void StructureScanComplexItem::_recalcCameraShots(void)
{
double triggerDistance = _cameraCalc.adjustedFootprintSide()->rawValue().toDouble();
if (triggerDistance == 0) {
_setCameraShots(0);
return;
}
if (_flightPolygon.count() < 3) {
_setCameraShots(0);
return;
......@@ -450,7 +456,7 @@ void StructureScanComplexItem::_recalcCameraShots(void)
return;
}
int cameraShots = distance / _cameraCalc.adjustedFootprintSide()->rawValue().toDouble();
int cameraShots = distance / triggerDistance;
_setCameraShots(cameraShots * _layersFact.rawValue().toInt());
}
......
......@@ -1289,20 +1289,24 @@ void SurveyComplexItem::_rebuildTransectsPhase2(void)
_complexDistance += _visualTransectPoints[i].value<QGeoCoordinate>().distanceTo(_visualTransectPoints[i+1].value<QGeoCoordinate>());
}
if (_cameraTriggerInTurnAroundFact.rawValue().toBool()) {
_cameraShots = qCeil(_complexDistance / triggerDistance());
} else {
if (triggerDistance() == 0) {
_cameraShots = 0;
for (const QList<TransectStyleComplexItem::CoordInfo_t>& transect: _transects) {
QGeoCoordinate firstCameraCoord, lastCameraCoord;
if (_hasTurnaround()) {
firstCameraCoord = transect[1].coord;
lastCameraCoord = transect[transect.count() - 2].coord;
} else {
firstCameraCoord = transect.first().coord;
lastCameraCoord = transect.last().coord;
} else {
if (_cameraTriggerInTurnAroundFact.rawValue().toBool()) {
_cameraShots = qCeil(_complexDistance / triggerDistance());
} else {
_cameraShots = 0;
for (const QList<TransectStyleComplexItem::CoordInfo_t>& transect: _transects) {
QGeoCoordinate firstCameraCoord, lastCameraCoord;
if (_hasTurnaround()) {
firstCameraCoord = transect[1].coord;
lastCameraCoord = transect[transect.count() - 2].coord;
} else {
firstCameraCoord = transect.first().coord;
lastCameraCoord = transect.last().coord;
}
_cameraShots += qCeil(firstCameraCoord.distanceTo(lastCameraCoord) / triggerDistance());
}
_cameraShots += qCeil(firstCameraCoord.distanceTo(lastCameraCoord) / triggerDistance());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment