QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CorridorScanComplexItem.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4
6#include "SettingsFact.h"
7#include "QGCMapPolyline.h"
8
9Q_DECLARE_LOGGING_CATEGORY(CorridorScanComplexItemLog)
10
12{
13 Q_OBJECT
14
15public:
18 CorridorScanComplexItem(PlanMasterController* masterController, bool flyView, const QString& kmlOrShpFile);
19
20 Q_PROPERTY(QGCMapPolyline* corridorPolyline READ corridorPolyline CONSTANT)
21 Q_PROPERTY(Fact* corridorWidth READ corridorWidth CONSTANT)
22
23 // Note1: These values are persisted to plan files so they cannot be changed with breaking plan file back compat
24 // Note2: rotateEntryPoint expects these values in this order
25 enum EntryPointLocation {
26 EntryPointDefaultOrder = 0, // Standard transect generation order
27 EntryPointStartSameEndOppositeSide = 1, // Start at same end, opposite side of center
28 EntryPointStartOppositeEndSameSide = 2, // Start at opposite end, same side
29 EntryPointStartOppositeEndOppositeSide = 3, // Start at opposite end, opposite side
30 };
31 Q_ENUM(EntryPointLocation)
32
33 Fact* corridorWidth (void) { return &_corridorWidthFact; }
34 QGCMapPolyline* corridorPolyline(void) { return &_corridorPolyline; }
35
36 Q_INVOKABLE void rotateEntryPoint(void);
37
38 // Overrides from TransectStyleComplexItem
39 QString patternName (void) const final { return name; }
40 void save (QJsonArray& planItems) final;
41 bool specifiesCoordinate (void) const final;
42 double timeBetweenShots (void) final;
43
44 // Overrides from ComplexMissionItem
45 bool load (const QJsonObject& complexObject, int sequenceNumber, QString& errorString) final;
46 QString mapVisualQML (void) const final { return QStringLiteral("CorridorScanMapVisual.qml"); }
47 QString presetsSettingsGroup(void) { return settingsGroup; }
48 void savePreset (const QString& name);
49 void loadPreset (const QString& name);
50
51 // Overrides from VisualMissionionItem
52 QString commandDescription (void) const final { return tr("Corridor Scan"); }
53 QString commandName (void) const final { return tr("Corridor Scan"); }
54 QString abbreviation (void) const final { return tr("C"); }
55 void setCoordinate (const QGeoCoordinate& coordinate) final;
56 ReadyForSaveState readyForSaveState (void) const final;
57 double additionalTimeDelay (void) const final { return 0; }
58
59 static const QString name;
60
61 static constexpr const char* settingsGroup = "CorridorScan";
62 static constexpr const char* corridorWidthName = "CorridorWidth";
63
64 static constexpr const char* jsonComplexItemTypeValue = "CorridorScan";
65
66private slots:
67 void _polylineDirtyChanged (bool dirty);
68 void _rebuildCorridorPolygon (void);
69 void _updateWizardMode (void);
70
71 // Overrides from TransectStyleComplexItem
72 void _rebuildTransectsPhase1 (void) final;
73 void _recalcCameraShots (void) final;
74
75private:
76 double _calcTransectSpacing (void) const;
77 int _calcTransectCount (void) const;
78 void _saveCommon (QJsonObject& complexObject);
79 bool _loadWorker (const QJsonObject& complexObject, int sequenceNumber, QString& errorString, bool forPresets);
80
81 QGCMapPolyline _corridorPolyline;
82 QList<QList<QGeoCoordinate>> _transectSegments;
83
84 EntryPointLocation _entryPointLocation;
85
86 QMap<QString, FactMetaData*> _metaDataMap;
87 SettingsFact _corridorWidthFact;
88
89 static constexpr const char* _jsonEntryPointKey = "EntryPoint";
90};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
QString errorString
double additionalTimeDelay(void) const final
QGCMapPolyline * corridorPolyline(void)
QString abbreviation(void) const final
QString mapVisualQML(void) const final
QString patternName(void) const final
QString commandName(void) const final
QString commandDescription(void) const final
A Fact is used to hold a single value within the system.
Definition Fact.h:19
Master controller for mission, fence, rally.
A SettingsFact is Fact which holds a QSettings value.