5#include <QtCore/QJsonArray>
6#include <QtCore/QLineF>
7#include <QtGui/QPolygonF>
26using GeoTransect = QList<QGeoCoordinate>;
27using GeoTransectGroup = QList<GeoTransect>;
28using GeoTransectGroups = QList<GeoTransectGroup>;
30constexpr int maxSplitSpacingAttempts = 8;
31constexpr double splitSpacingGrowthMargin = 1.01;
33void reverseGroupDirection(GeoTransectGroup& group)
35 std::reverse(group.begin(), group.end());
36 for (GeoTransect& transect : group) {
37 std::reverse(transect.begin(), transect.end());
41void reverseAllGroupDirections(GeoTransectGroups& groups)
43 for (GeoTransectGroup& group : groups) {
44 reverseGroupDirection(group);
49void optimizeGroupsForShortestDistance(
const QGeoCoordinate& distanceCoordinate, GeoTransectGroups& groups)
51 if (groups.isEmpty()) {
55 const GeoTransectGroup& firstGroup = groups.first();
56 const GeoTransectGroup& lastGroup = groups.last();
57 const double groupDistances[] = {
58 firstGroup.first().first().distanceTo(distanceCoordinate),
59 firstGroup.last().last().distanceTo(distanceCoordinate),
60 lastGroup.first().first().distanceTo(distanceCoordinate),
61 lastGroup.last().last().distanceTo(distanceCoordinate),
64 int shortestIndex = 0;
65 for (
int index = 1; index < 4; ++index) {
66 if (groupDistances[index] < groupDistances[shortestIndex]) {
67 shortestIndex = index;
71 if (shortestIndex > 1) {
72 std::reverse(groups.begin(), groups.end());
74 if (shortestIndex & 1) {
75 reverseAllGroupDirections(groups);
79qsizetype transectCount(
const QList<QList<QLineF>>& lineGroups)
82 for (
const QList<QLineF>& group : lineGroups) {
83 count += group.size();
88void joinLineFragments(QList<QList<QLineF>>& lineGroups)
90 for (QList<QLineF>& group : lineGroups) {
91 if (group.size() > 1) {
92 group = {QLineF(group.first().p1(), group.last().p2())};
101 , _metaDataMap (
FactMetaData::createMapFromJsonFile(QStringLiteral(
":/json/Survey.SettingsGroup.json"), this))
107 _editorQml =
"qrc:/qml/QGroundControl/PlanView/SurveyItemEditor.qml";
111 _flyAlternateTransectsFact.setRawValue(false);
116 _cameraCalc.distanceToSurface()->setRawValue(SettingsManager::instance()->appSettings()->defaultMissionItemAltitude()->rawValue());
132 if (!kmlOrShpFile.isEmpty()) {
141 QJsonObject saveObject;
143 _saveCommon(saveObject);
144 planItems.append(saveObject);
149 QJsonObject saveObject;
151 _saveCommon(saveObject);
155void SurveyComplexItem::_saveCommon(QJsonObject& saveObject)
162 saveObject[_jsonGridAngleKey] = _gridAngleFact.
rawValue().toDouble();
163 saveObject[_jsonFlyAlternateTransectsKey] = _flyAlternateTransectsFact.
rawValue().toBool();
164 saveObject[_jsonSplitConcavePolygonsKey] = _splitConcavePolygonsFact.
rawValue().toBool();
165 saveObject[_jsonEntryPointKey] = _entryPoint;
176 if (!_loadV4V5(presetObject, 0, errorString, 5,
true )) {
177 QGC::showAppMessage(tr(
"Internal Error: Preset load failed. Name: %1 Error: %2").arg(presetName).arg(errorString));
184 Q_UNUSED(prevAltitude);
191 QList<JsonParsing::KeyValidateInfo> versionKeyInfoList = {
199 if (version < 2 || version > 5) {
200 errorString = tr(
"Survey items do not support version %1").arg(version);
204 if (version == 4 || version == 5) {
205 if (!_loadV4V5(complexObject,
sequenceNumber, errorString, version,
false )) {
216 QJsonObject v3ComplexObject = complexObject;
235bool SurveyComplexItem::_loadV4V5(
const QJsonObject& complexObject,
int sequenceNumber, QString& errorString,
int version,
bool forPresets)
237 QList<JsonParsing::KeyValidateInfo> keyInfoList = {
240 { _jsonEntryPointKey, QJsonValue::Double,
true },
241 { _jsonGridAngleKey, QJsonValue::Double,
true },
242 { _jsonFlyAlternateTransectsKey, QJsonValue::Bool,
false },
246 JsonParsing::KeyValidateInfo jSplitPolygon = { _jsonSplitConcavePolygonsKey, QJsonValue::Bool,
true };
247 keyInfoList.append(jSplitPolygon);
257 errorString = tr(
"%1 does not support loading this complex mission item type: %2:%3").arg(
qgcApp()->applicationName()).arg(itemType).arg(complexType);
277 _gridAngleFact.setRawValue (complexObject[_jsonGridAngleKey].toDouble());
278 _flyAlternateTransectsFact.setRawValue (complexObject[_jsonFlyAlternateTransectsKey].toBool(
false));
281 _splitConcavePolygonsFact.setRawValue(complexObject[_jsonSplitConcavePolygonsKey].toBool(
false));
283 _entryPoint = complexObject[_jsonEntryPointKey].toInt();
290bool SurveyComplexItem::_loadV3(
const QJsonObject& complexObject,
int sequenceNumber, QString& errorString)
292 QList<JsonParsing::KeyValidateInfo> mainKeyInfoList = {
296 { _jsonV3GridObjectKey, QJsonValue::Object,
true },
297 { _jsonV3CameraObjectKey, QJsonValue::Object,
false },
298 { _jsonV3CameraTriggerDistanceKey, QJsonValue::Double,
true },
299 { _jsonV3ManualGridKey, QJsonValue::Bool,
true },
300 { _jsonV3FixedValueIsAltitudeKey, QJsonValue::Bool,
true },
301 { _jsonV3HoverAndCaptureKey, QJsonValue::Bool,
false },
302 { _jsonV3Refly90DegreesKey, QJsonValue::Bool,
false },
303 { _jsonV3CameraTriggerInTurnaroundKey, QJsonValue::Bool,
false },
312 errorString = tr(
"%1 does not support loading this complex mission item type: %2:%3").arg(
qgcApp()->applicationName()).arg(itemType).arg(complexType);
323 _splitConcavePolygonsFact.setRawValue(
false);
325 _cameraCalc.valueSetIsDistance()->setRawValue (complexObject[_jsonV3FixedValueIsAltitudeKey].toBool(
true));
328 bool manualGrid = complexObject[_jsonV3ManualGridKey].toBool(
true);
330 QList<JsonParsing::KeyValidateInfo> gridKeyInfoList = {
331 { _jsonV3GridAltitudeKey, QJsonValue::Double,
true },
332 { _jsonV3GridAltitudeRelativeKey, QJsonValue::Bool,
true },
333 { _jsonV3GridAngleKey, QJsonValue::Double,
true },
334 { _jsonV3GridSpacingKey, QJsonValue::Double,
true },
335 { _jsonEntryPointKey, QJsonValue::Double,
false },
336 { _jsonV3TurnaroundDistKey, QJsonValue::Double,
true },
338 QJsonObject gridObject = complexObject[_jsonV3GridObjectKey].toObject();
344 _gridAngleFact.setRawValue (gridObject[_jsonV3GridAngleKey].toDouble());
347 if (gridObject.contains(_jsonEntryPointKey)) {
348 _entryPoint = gridObject[_jsonEntryPointKey].toInt();
353 _cameraCalc.distanceToSurface()->setRawValue (gridObject[_jsonV3GridAltitudeKey].toDouble());
354 _cameraCalc.adjustedFootprintSide()->setRawValue (gridObject[_jsonV3GridSpacingKey].toDouble());
355 _cameraCalc.adjustedFootprintFrontal()->setRawValue (complexObject[_jsonV3CameraTriggerDistanceKey].toDouble());
360 if (!complexObject.contains(_jsonV3CameraObjectKey)) {
361 errorString = tr(
"%1 but %2 object is missing").arg(
"manualGrid = false").arg(
"camera");
366 QJsonObject cameraObject = complexObject[_jsonV3CameraObjectKey].toObject();
369 QString incorrectImageSideOverlap =
"imageSizeOverlap";
370 if (cameraObject.contains(incorrectImageSideOverlap)) {
371 cameraObject[_jsonV3SideOverlapKey] = cameraObject[incorrectImageSideOverlap];
372 cameraObject.remove(incorrectImageSideOverlap);
375 QList<JsonParsing::KeyValidateInfo> cameraKeyInfoList = {
376 { _jsonV3GroundResolutionKey, QJsonValue::Double,
true },
377 { _jsonV3FrontalOverlapKey, QJsonValue::Double,
true },
378 { _jsonV3SideOverlapKey, QJsonValue::Double,
true },
379 { _jsonV3CameraSensorWidthKey, QJsonValue::Double,
true },
380 { _jsonV3CameraSensorHeightKey, QJsonValue::Double,
true },
381 { _jsonV3CameraResolutionWidthKey, QJsonValue::Double,
true },
382 { _jsonV3CameraResolutionHeightKey, QJsonValue::Double,
true },
383 { _jsonV3CameraFocalLengthKey, QJsonValue::Double,
true },
384 { _jsonV3CameraNameKey, QJsonValue::String,
true },
385 { _jsonV3CameraOrientationLandscapeKey, QJsonValue::Bool,
true },
386 { _jsonV3CameraMinTriggerIntervalKey, QJsonValue::Double,
false },
393 _cameraCalc.landscape()->setRawValue (cameraObject[_jsonV3CameraOrientationLandscapeKey].toBool(
true));
394 _cameraCalc.frontalOverlap()->setRawValue (cameraObject[_jsonV3FrontalOverlapKey].toInt());
395 _cameraCalc.sideOverlap()->setRawValue (cameraObject[_jsonV3SideOverlapKey].toInt());
396 _cameraCalc.sensorWidth()->setRawValue (cameraObject[_jsonV3CameraSensorWidthKey].toDouble());
397 _cameraCalc.sensorHeight()->setRawValue (cameraObject[_jsonV3CameraSensorHeightKey].toDouble());
398 _cameraCalc.focalLength()->setRawValue (cameraObject[_jsonV3CameraFocalLengthKey].toDouble());
399 _cameraCalc.imageWidth()->setRawValue (cameraObject[_jsonV3CameraResolutionWidthKey].toInt());
400 _cameraCalc.imageHeight()->setRawValue (cameraObject[_jsonV3CameraResolutionHeightKey].toInt());
401 _cameraCalc.minTriggerInterval()->setRawValue (cameraObject[_jsonV3CameraMinTriggerIntervalKey].toDouble(0));
402 _cameraCalc.imageDensity()->setRawValue (cameraObject[_jsonV3GroundResolutionKey].toDouble());
403 _cameraCalc.fixedOrientation()->setRawValue (
false);
404 _cameraCalc._setCameraNameFromV3TransectLoad (cameraObject[_jsonV3CameraNameKey].
toString());
424QPointF SurveyComplexItem::_rotatePoint(
const QPointF& point,
const QPointF& origin,
double angle)
427 double radians = (M_PI / 180.0) * -angle;
429 rotated.setX(((point.x() - origin.x()) * cos(radians)) - ((point.y() - origin.y()) * sin(radians)) + origin.x());
430 rotated.setY(((point.x() - origin.x()) * sin(radians)) + ((point.y() - origin.y()) * cos(radians)) + origin.y());
435void SurveyComplexItem::_intersectLinesWithPolygon(
const QList<QLineF>& lineList,
const QPolygonF& polygon,
436 QList<QList<QLineF>>& resultLineGroups)
438 resultLineGroups.clear();
442 if (clippedLines.isEmpty()) {
447 resultLineGroups.append(clippedLines);
449 resultLineGroups.append({QLineF(clippedLines.first().p1(), clippedLines.last().p2())});
454double SurveyComplexItem::_clampGridAngle90(
double gridAngle)
472 _rebuildTransectsPhase1WorkerSinglePolygon(
false );
474 _rebuildTransectsPhase1WorkerSinglePolygon(
true );
478void SurveyComplexItem::_rebuildTransectsPhase1WorkerSinglePolygon(
bool refly)
497 QList<QPointF> polygonPoints;
499 qCDebug(SurveyComplexItemLog) <<
"_rebuildTransectsPhase1 Convert polygon to NED - _surveyAreaPolygon.count():tangentOrigin" <<
_surveyAreaPolygon.count() << tangentOrigin;
509 polygonPoints += QPointF(x, y);
510 qCDebug(SurveyComplexItemLog) <<
"_rebuildTransectsPhase1 vertex:x:y" << vertex << polygonPoints.last().x() << polygonPoints.last().y();
515 double gridAngle = _gridAngleFact.rawValue().toDouble();
516 double gridSpacing =
_cameraCalc.adjustedFootprintSide()->rawValue().toDouble();
520 qCDebug(SurveyComplexItemLog) <<
"_rebuildTransectsPhase1 Clamped grid angle" <<
gridAngle;
522 qCDebug(SurveyComplexItemLog) <<
"_rebuildTransectsPhase1 gridSpacing:gridAngle:refly" << gridSpacing <<
gridAngle << refly;
526 qCDebug(SurveyComplexItemLog) <<
"_rebuildTransectsPhase1 Polygon";
528 for (
int i=0; i<polygonPoints.count(); i++) {
529 qCDebug(SurveyComplexItemLog) <<
"Vertex" << polygonPoints[i];
530 polygon << polygonPoints[i];
532 polygon << polygonPoints[0];
533 QRectF boundingRect = polygon.boundingRect();
534 QPointF boundingCenter = boundingRect.center();
535 qCDebug(SurveyComplexItemLog) <<
"Bounding rect" << boundingRect.topLeft().x() << boundingRect.topLeft().y() << boundingRect.bottomRight().x() << boundingRect.bottomRight().y();
540 QList<QLineF> lineList;
547 const double diagonal = qSqrt(boundingRect.width() * boundingRect.width() + boundingRect.height() * boundingRect.height());
548 double maxWidth = diagonal * 1.5;
549 if (maxWidth <= 0.0) {
550 qCWarning(SurveyComplexItemLog) <<
"Degenerate polygon bounding rect (all vertices coincident or collinear), aborting transect rebuild";
554 const auto generateSweepLines = [
this, boundingCenter,
gridAngle, maxWidth](
double spacing) {
556 const double halfWidth = maxWidth / 2.0;
557 const double transectXMax = boundingCenter.x() + halfWidth;
558 for (
double transectX = boundingCenter.x() - halfWidth; transectX < transectXMax; transectX += spacing) {
559 const double transectYTop = boundingCenter.y() - halfWidth;
560 const double transectYBottom = boundingCenter.y() + halfWidth;
561 lines.append(QLineF(_rotatePoint(QPointF(transectX, transectYTop), boundingCenter,
gridAngle),
562 _rotatePoint(QPointF(transectX, transectYBottom), boundingCenter,
gridAngle)));
567 if (gridSpacing <= 0) {
569 qCWarning(SurveyComplexItemLog) <<
"Grid spacing" << gridSpacing <<
"is invalid, falling back to single center transect";
570 const double halfW = maxWidth / 2.0;
572 _rotatePoint(QPointF(boundingCenter.x(), boundingCenter.y() - halfW), boundingCenter,
gridAngle),
573 _rotatePoint(QPointF(boundingCenter.x(), boundingCenter.y() + halfW), boundingCenter,
gridAngle));
578 qCWarning(SurveyComplexItemLog) <<
"Transect spacing" << gridSpacing <<
"raised to" << diagonal /
maxTransectCount <<
"to limit transect count to" <<
maxTransectCount;
582 lineList = generateSweepLines(gridSpacing);
587 QList<QList<QLineF>> sweepLineGroups;
588 _intersectLinesWithPolygon(lineList, polygon, sweepLineGroups);
591 if (_splitConcavePolygonsFact.rawValue().toBool() && (gridSpacing > 0)) {
592 const double requestedGridSpacing = gridSpacing;
593 qsizetype splitTransectCount = transectCount(sweepLineGroups);
594 for (
int attempt = 0; (attempt < maxSplitSpacingAttempts) && (splitTransectCount >
maxTransectCount);
596 gridSpacing *= (
static_cast<double>(splitTransectCount) /
maxTransectCount) * splitSpacingGrowthMargin;
597 lineList = generateSweepLines(gridSpacing);
598 _intersectLinesWithPolygon(lineList, polygon, sweepLineGroups);
599 splitTransectCount = transectCount(sweepLineGroups);
601 if ((gridSpacing != requestedGridSpacing) && (splitTransectCount <=
maxTransectCount)) {
602 qCWarning(SurveyComplexItemLog) <<
"Transect spacing" << requestedGridSpacing <<
"raised to" << gridSpacing
610 if (transectCount(sweepLineGroups) < 2) {
612 QLineF firstLine = lineList.first();
613 QPointF lineCenter = firstLine.pointAt(0.5);
614 QPointF centerOffset = boundingCenter - lineCenter;
615 firstLine.translate(centerOffset);
617 lineList.append(firstLine);
618 _intersectLinesWithPolygon(lineList, polygon, sweepLineGroups);
622 qCWarning(SurveyComplexItemLog) <<
"Unable to limit split transect count to" <<
maxTransectCount
623 <<
"joining fragments instead";
624 joinLineFragments(sweepLineGroups);
628 GeoTransectGroups transectGroups;
629 transectGroups.reserve(sweepLineGroups.size());
630 for (
const QList<QLineF>& lineGroup : sweepLineGroups) {
631 GeoTransectGroup transectGroup;
632 transectGroup.reserve(lineGroup.size());
633 for (
const QLineF& line : lineGroup) {
634 QGeoCoordinate coord;
635 GeoTransect transect;
638 transect.append(coord);
640 transect.append(coord);
642 transectGroup.append(transect);
644 transectGroups.append(transectGroup);
647 if (transectGroups.isEmpty()) {
652 reverseAllGroupDirections(transectGroups);
655 std::reverse(transectGroups.begin(), transectGroups.end());
662 optimizeGroupsForShortestDistance(
_transects.last().last().coord, transectGroups);
665 if (_flyAlternateTransectsFact.rawValue().toBool()) {
666 GeoTransectGroups alternatingGroups;
667 for (
int i = 0; i < transectGroups.count(); i++) {
669 alternatingGroups.append(transectGroups[i]);
672 for (
int i = transectGroups.count() - 1; i > 0; i--) {
674 alternatingGroups.append(transectGroups[i]);
677 transectGroups = alternatingGroups;
681 for (qsizetype i = 1; i < transectGroups.count(); i += 2) {
682 reverseGroupDirection(transectGroups[i]);
687 GeoTransect transect;
692 QList<SweepFragment> sweepFragments;
693 for (
const GeoTransectGroup& group : transectGroups) {
694 for (qsizetype i = 0; i < group.count(); i++) {
695 sweepFragments.append({group[i], i == 0, i == group.count() - 1});
700 for (
const SweepFragment& sweepFragment : sweepFragments) {
701 const GeoTransect& transect = sweepFragment.transect;
702 QGeoCoordinate coord;
703 QList<TransectStyleComplexItem::CoordInfo_t> coordInfoTransect;
704 TransectStyleComplexItem::CoordInfo_t coordInfo;
707 coordInfoTransect.append(coordInfo);
709 coordInfoTransect.append(coordInfo);
713 double transectLength = transect[0].distanceTo(transect[1]);
714 double transectAzimuth = transect[0].azimuthTo(transect[1]);
716 int cInnerHoverPoints =
static_cast<int>(floor(transectLength /
triggerDistance()));
717 qCDebug(SurveyComplexItemLog) <<
"cInnerHoverPoints" << cInnerHoverPoints;
718 for (
int i=0; i<cInnerHoverPoints; i++) {
719 QGeoCoordinate hoverCoord = transect[0].atDistanceAndAzimuth(
triggerDistance() * (i + 1), transectAzimuth);
721 coordInfoTransect.insert(1 + i, hoverCoordInfo);
729 QGeoCoordinate turnaroundCoord;
732 if (sweepFragment.startsSweep) {
733 double azimuth = transect[0].azimuthTo(transect[1]);
735 turnaroundCoord.setAltitude(qQNaN());
736 TransectStyleComplexItem::CoordInfo_t turnaroundCoordInfo = {turnaroundCoord,
CoordTypeTurnaround};
737 coordInfoTransect.prepend(turnaroundCoordInfo);
740 if (sweepFragment.endsSweep) {
741 double azimuth = transect.last().azimuthTo(transect[transect.count() - 2]);
743 turnaroundCoord.setAltitude(qQNaN());
745 coordInfoTransect.append(coordInfo);
771 _cameraShots += missionItem->command() == MAV_CMD_IMAGE_START_CAPTURE ? 1 : 0;
774 bool waitingForTriggerStop =
false;
775 QGeoCoordinate distanceStartCoord;
776 QGeoCoordinate distanceEndCoord;
778 if (missionItem->command() == MAV_CMD_NAV_WAYPOINT) {
779 if (waitingForTriggerStop) {
780 distanceEndCoord = QGeoCoordinate(missionItem->param5(), missionItem->param6());
782 distanceStartCoord = QGeoCoordinate(missionItem->param5(), missionItem->param6());
784 }
else if (missionItem->command() == MAV_CMD_DO_SET_CAM_TRIGG_DIST) {
785 if (missionItem->param1() > 0) {
787 waitingForTriggerStop =
true;
790 waitingForTriggerStop =
false;
793 distanceStartCoord = QGeoCoordinate();
794 distanceEndCoord = QGeoCoordinate();
803 const auto isHoverImageCoord = [](
const TransectStyleComplexItem::CoordInfo_t& coordInfo) {
807 for (
const QList<TransectStyleComplexItem::CoordInfo_t>& transect:
_transects) {
809 _cameraShots += std::count_if(transect.cbegin(), transect.cend(), isHoverImageCoord);
814 QGeoCoordinate firstCameraCoord, lastCameraCoord;
815 for (
const TransectStyleComplexItem::CoordInfo_t& coordInfo : transect) {
817 firstCameraCoord = coordInfo.
coord;
819 lastCameraCoord = coordInfo.
coord;
857 double hoverTime = 0;
860 for (
const QList<TransectStyleComplexItem::CoordInfo_t>& transect:
_transects) {
868void SurveyComplexItem::_updateWizardMode(
void)
Geographic coordinate conversion utilities using GeographicLib.
#define QGC_LOGGING_CATEGORY(name, categoryStr)
static QString canonicalManualCameraName(void)
void _savePresetJson(const QString &name, QJsonObject &presetObject)
static constexpr const char * jsonComplexItemTypeKey
This mission item attribute specifies the type of the complex item.
QJsonObject _loadPresetJson(const QString &name)
void rawValueChanged(const QVariant &value)
QVariant rawValue() const
void valueChanged(const QVariant &value)
This signal is only meant for use by the QT property system. It should not be connected to by client ...
Master controller for mission, fence, rally.
bool traceMode(void) const
void traceModeChanged(bool traceMode)
void saveToJson(QJsonObject &json)
static constexpr const char * jsonPolygonKey
bool isValidChanged(void)
double timeBetweenShots(void) final
static constexpr const char * jsonComplexItemTypeValue
Q_INVOKABLE void rotateEntryPoint(void)
Fact * splitConcavePolygons(void)
void refly90DegreesChanged(bool refly90Degrees)
static constexpr const char * settingsGroup
ReadyForSaveState readyForSaveState(void) const final
static constexpr const char * splitConcavePolygonsName
double additionalTimeDelay(void) const final
static constexpr const char * gridAngleName
SurveyComplexItem(PlanMasterController *masterController, bool flyView, const QString &kmlOrShpFile)
bool load(const QJsonObject &complexObject, int sequenceNumber, QString &errorString) final
void applyPreviousAltitudeFrame(QGroundControlQmlGlobal::AltitudeFrame prevAltFrame, double prevAltitude) final
static constexpr const char * jsonV3ComplexItemTypeValue
void loadPreset(const QString &name)
void savePreset(const QString &name)
@ EntryLocationBottomRight
@ EntryLocationBottomLeft
void save(QJsonArray &planItems) final
static constexpr const char * flyAlternateTransectsName
virtual void _rebuildTransectsPhase1(void)=0
Rebuilds the _transects array.
QObject * _loadedMissionItemsParent
Parent for all items in _loadedMissionItems for simpler delete.
QList< QList< CoordInfo_t > > _transects
SettingsFact _refly90DegreesFact
bool hoverAndCaptureEnabled(void) const
QList< MissionItem * > _loadedMissionItems
Mission items loaded from plan file.
void _recalcComplexDistance(void)
void setSequenceNumber(int sequenceNumber) final
QGeoCoordinate coordinate(void) const final
bool _hasTurnaround(void) const
int sequenceNumber(void) const final
TransectStyleComplexItem(PlanMasterController *masterController, bool flyView, QString settignsGroup)
bool triggerCamera(void) const
static constexpr int maxTransectCount
Maximum number of transects allowed; spacing is raised to enforce this limit.
ReadyForSaveState readyForSaveState(void) const override
double _turnAroundDistance(void) const
bool _load(const QJsonObject &complexObject, bool forPresets, QString &errorString)
static constexpr int _hoverAndCaptureDelaySeconds
QGCMapPolygon _surveyAreaPolygon
Fact * turnAroundDistance(void)
static int _distanceTriggerImageCount(double transectLength, double triggerDistance)
SettingsFact _hoverAndCaptureFact
SettingsFact _cameraTriggerInTurnAroundFact
double triggerDistance(void) const
void cameraShotsChanged(void)
void _save(QJsonObject &saveObject)
void _rebuildTransects(void)
virtual void _recalcCameraShots(void)=0
SettingsFact _turnAroundDistanceFact
void setDirty(bool dirty) final
@ CoordTypeTurnaround
Turnaround extension waypoint.
@ CoordTypeSurveyExit
Waypoint at exit edge of survey polygon.
@ CoordTypeInteriorHoverTrigger
Interior waypoint for hover and capture trigger.
@ CoordTypeSurveyEntry
Waypoint at entry edge of survey polygon.
static constexpr const char * jsonTypeComplexItemValue
Item type is Complex Item.
QString _editorQml
Qml resource for editing item.
void setWizardMode(bool wizardMode)
Vehicle * _controllerVehicle
static constexpr const char * jsonTypeKey
Json file attribute which specifies the item type.
PlanMasterController * masterController(void)
double azimuth(void) const
QByteArray line(std::string_view command)
command as one CR/LF-terminated line.
constexpr const char * toString(HwVideoBufferPath path) noexcept
bool validateKeys(const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
Validates that all required keys are present and that listed keys have the expected type.
constexpr const char * jsonVersionKey
void convertGeoToNed(const QGeoCoordinate &coord, const QGeoCoordinate &origin, double &x, double &y, double &z)
void convertNedToGeo(double x, double y, double z, const QGeoCoordinate &origin, QGeoCoordinate &coord)
QList< QList< QLineF > > intersectLines(const QList< QLineF > &lines, const QPolygonF &polygon)
void showAppMessage(const QString &message, const QString &title)
Modal application message. Queued if the UI isn't ready yet.