Unverified Commit 61521f11 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8101 from DonLakeFlyer/CancelROI

Plan: Cancel ROI, ROI visual indication
parents b0a3f600 d6a50b07
......@@ -2,10 +2,12 @@
Note: This file only contains high level features or important fixes.
## 3.6
## 4.0
### 3.6.0 - Daily Build
### 4.0.0 - Daily Build
* Plan: ROI button will switch to Cancel ROI at appropriate times
* Plan: When ROI is selected the flight path lines which are affected by the ROI will change color
* ADSB: Added support for connecting to SBS server. Adds support for ADSB data from USB SDR Dongle running 'dump1090 --net' for example.
* Toolbar: Scrollable left/right on small screens like phones
* Plan View: New create plan UI for initial plan creation
......
......@@ -17,11 +17,11 @@ import QGroundControl.Palette 1.0
/// The MissionLineView control is used to add lines between mission items
MapItemView {
property bool showSpecialVisual: false
delegate: MapPolyline {
line.width: 3
line.color: "#be781c" // Hack, can't get palette to work in here
line.color: object && showSpecialVisual && object.specialVisual ? "green" : "#be781c" // Hack, can't get palette to work in here
z: QGroundControl.zOrderWaypointLines
path: object && object.coordinate1.isValid && object.coordinate2.isValid ? [ object.coordinate1, object.coordinate2 ] : []
path: object && object.coordinate1.isValid && object.coordinate2.isValid ? [ object.coordinate1, object.coordinate2 ] : []
}
}
......@@ -24,5 +24,5 @@ void CorridorScanPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord)
VisualMissionItem* takeoffItem = _missionController->insertTakeoffItem(mapCenterCoord, -1);
_missionController->insertComplexMissionItem(MissionController::patternCorridorScanName, mapCenterCoord, -1);
_missionController->insertLandItem(mapCenterCoord, -1);
_missionController->setCurrentPlanViewIndex(takeoffItem->sequenceNumber(), true);
_missionController->setCurrentPlanViewSeqNum(takeoffItem->sequenceNumber(), true);
}
This diff is collapsed.
......@@ -77,7 +77,8 @@ public:
Q_PROPERTY(int missionItemCount READ missionItemCount NOTIFY missionItemCountChanged) ///< True mission item command count (only valid in Fly View)
Q_PROPERTY(int currentMissionIndex READ currentMissionIndex NOTIFY currentMissionIndexChanged)
Q_PROPERTY(int resumeMissionIndex READ resumeMissionIndex NOTIFY resumeMissionIndexChanged) ///< Returns the item index two which a mission should be resumed. -1 indicates resume mission not available.
Q_PROPERTY(int currentPlanViewIndex READ currentPlanViewIndex NOTIFY currentPlanViewIndexChanged)
Q_PROPERTY(int currentPlanViewSeqNum READ currentPlanViewSeqNum NOTIFY currentPlanViewSeqNumChanged)
Q_PROPERTY(int currentPlanViewVIIndex READ currentPlanViewVIIndex NOTIFY currentPlanViewVIIndexChanged)
Q_PROPERTY(VisualMissionItem* currentPlanViewItem READ currentPlanViewItem NOTIFY currentPlanViewItemChanged)
Q_PROPERTY(double missionDistance READ missionDistance NOTIFY missionDistanceChanged)
Q_PROPERTY(double missionTime READ missionTime NOTIFY missionTimeChanged)
......@@ -94,9 +95,11 @@ public:
Q_PROPERTY(QString structureScanComplexItemName READ structureScanComplexItemName CONSTANT)
Q_PROPERTY(bool isInsertTakeoffValid MEMBER _isInsertTakeoffValid NOTIFY isInsertTakeoffValidChanged)
Q_PROPERTY(bool isInsertLandValid MEMBER _isInsertLandValid NOTIFY isInsertLandValidChanged)
Q_PROPERTY(bool isROIActive MEMBER _isROIActive NOTIFY isROIActiveChanged)
Q_PROPERTY(bool isROIBeginCurrentItem MEMBER _isROIBeginCurrentItem NOTIFY isROIBeginCurrentItemChanged)
Q_PROPERTY(bool flyThroughCommandsAllowed MEMBER _flyThroughCommandsAllowed NOTIFY flyThroughCommandsAllowedChanged)
Q_INVOKABLE void removeMissionItem(int index);
Q_INVOKABLE void removeMissionItem(int viIndex);
/// Add a new simple mission item to the list
/// @param coordinate: Coordinate for item
......@@ -126,6 +129,12 @@ public:
/// @return Newly created item
Q_INVOKABLE VisualMissionItem* insertROIMissionItem(QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem = false);
/// Add a new Cancel ROI mission item to the list
/// @param visualItemIndex: index to insert at, -1 for end of list
/// @param makeCurrentItem: true: Make this item the current item
/// @return Newly created item
Q_INVOKABLE VisualMissionItem* insertCancelROIMissionItem(int visualItemIndex, bool makeCurrentItem = false);
/// Add a new complex mission item to the list
/// @param itemName: Name of complex item to create (from complexMissionItemNames)
/// @param mapCenterCoordinate: coordinate for current center of map
......@@ -150,10 +159,7 @@ public:
/// Sets a new current mission item (PlanView).
/// @param sequenceNumber - index for new item, -1 to clear current item
Q_INVOKABLE void setCurrentPlanViewIndex(int sequenceNumber, bool force);
/// Returns the index of this item in the visual item list
Q_INVOKABLE int visualItemIndexFromSequenceNumber(int sequenceNumber) const;
Q_INVOKABLE void setCurrentPlanViewSeqNum(int sequenceNumber, bool force);
/// Determines if the mission has all data needed to be saved or sent to the vehicle.
/// IMPORTANT NOTE: The return value is a VisualMissionItem::ReadForSaveState value. It is an int here to work around
......@@ -196,7 +202,7 @@ public:
QVariantList waypointPath (void) { return _waypointPath; }
QStringList complexMissionItemNames (void) const;
QGeoCoordinate plannedHomePosition (void) const;
VisualMissionItem* currentPlanViewItem (void) const;
VisualMissionItem* currentPlanViewItem (void) const { return _currentPlanViewItem; }
double progressPct (void) const { return _progressPct; }
QString surveyComplexItemName (void) const { return patternSurveyName; }
QString corridorScanComplexItemName (void) const { return patternCorridorScanName; }
......@@ -206,7 +212,8 @@ public:
int missionItemCount (void) const { return _missionItemCount; }
int currentMissionIndex (void) const;
int resumeMissionIndex (void) const;
int currentPlanViewIndex (void) const;
int currentPlanViewSeqNum (void) const { return _currentPlanViewSeqNum; }
int currentPlanViewVIIndex (void) const { return _currentPlanViewVIIndex; }
double missionDistance (void) const { return _missionFlightStatus.totalDistance; }
double missionTime (void) const { return _missionFlightStatus.totalTime; }
......@@ -249,12 +256,15 @@ signals:
void plannedHomePositionChanged (QGeoCoordinate plannedHomePosition);
void progressPctChanged (double progressPct);
void currentMissionIndexChanged (int currentMissionIndex);
void currentPlanViewIndexChanged (void);
void currentPlanViewSeqNumChanged (void);
void currentPlanViewVIIndexChanged (void);
void currentPlanViewItemChanged (void);
void missionBoundingCubeChanged (void);
void missionItemCountChanged (int missionItemCount);
void isInsertTakeoffValidChanged (void);
void isInsertLandValidChanged (void);
void isROIActiveChanged (void);
void isROIBeginCurrentItemChanged (void);
void flyThroughCommandsAllowedChanged (void);
private slots:
......@@ -278,6 +288,7 @@ private:
void _recalcSequence(void);
void _recalcChildItems(void);
void _recalcAllWithCoordinate(const QGeoCoordinate& coordinate);
void _recalcROISpecialVisuals(void);
void _initAllVisualItems(void);
void _deinitAllVisualItems(void);
void _initVisualItem(VisualMissionItem* item);
......@@ -309,6 +320,8 @@ private:
VisualMissionItem* _insertSimpleMissionItemWorker(QGeoCoordinate coordinate, MAV_CMD command, int visualItemIndex, bool makeCurrentItem);
void _insertComplexMissionItemWorker(const QGeoCoordinate& mapCenterCoordinate, ComplexMissionItem* complexItem, int visualItemIndex, bool makeCurrentItem);
void _warnIfTerrainFrameUsed(void);
bool _isROIBeginItem(SimpleMissionItem* simpleItem);
bool _isROICancelItem(SimpleMissionItem* simpleItem);
private:
MissionManager* _missionManager;
......@@ -325,7 +338,8 @@ private:
MissionFlightStatus_t _missionFlightStatus;
AppSettings* _appSettings;
double _progressPct;
int _currentPlanViewIndex;
int _currentPlanViewSeqNum;
int _currentPlanViewVIIndex;
VisualMissionItem* _currentPlanViewItem;
QTimer _updateTimer;
QGCGeoBoundingCube _travelBoundingCube;
......@@ -333,7 +347,9 @@ private:
CoordinateVector* _splitSegment;
bool _isInsertTakeoffValid = true;
bool _isInsertLandValid = true;
bool _isROIActive = false;
bool _flyThroughCommandsAllowed = true;
bool _isROIBeginCurrentItem = false;
static const char* _settingsGroup;
......
......@@ -24,5 +24,5 @@ void StructureScanPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord)
VisualMissionItem* takeoffItem = _missionController->insertTakeoffItem(mapCenterCoord, -1);
_missionController->insertComplexMissionItem(MissionController::patternStructureScanName, mapCenterCoord, -1)->setWizardMode(true);
_missionController->insertLandItem(mapCenterCoord, -1);
_missionController->setCurrentPlanViewIndex(takeoffItem->sequenceNumber(), true);
_missionController->setCurrentPlanViewSeqNum(takeoffItem->sequenceNumber(), true);
}
......@@ -25,5 +25,5 @@ void SurveyPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord)
VisualMissionItem* takeoffItem = _missionController->insertTakeoffItem(mapCenterCoord, -1);
_missionController->insertComplexMissionItem(MissionController::patternSurveyName, mapCenterCoord, -1);
_missionController->insertLandItem(mapCenterCoord, -1);
_missionController->setCurrentPlanViewIndex(takeoffItem->sequenceNumber(), true);
_missionController->setCurrentPlanViewSeqNum(takeoffItem->sequenceNumber(), true);
}
......@@ -30,8 +30,6 @@ Rectangle {
signal clicked
signal remove
signal insertWaypoint
signal insertComplexItem(string complexItemName)
signal selectNextNotReadyItem
property var _masterController: masterController
......
......@@ -60,7 +60,7 @@ Rectangle {
orientation: ListView.Horizontal
spacing: 0
clip: true
currentIndex: _missionController.currentPlanViewIndex
currentIndex: _missionController.currentPlanViewSeqNum
onCountChanged: {
var calcLength = (statusListView.count + 1) * (statusListView.count ? statusListView.contentItem.children[0].width : 1)
......
This diff is collapsed.
......@@ -44,3 +44,11 @@ void CoordinateVector::setCoordinate2(const QGeoCoordinate &coordinate)
emit coordinate2Changed(_coordinate2);
}
}
void CoordinateVector::setSpecialVisual(bool specialVisual)
{
if (_specialVisual != specialVisual) {
_specialVisual = specialVisual;
emit specialVisualChanged(specialVisual);
}
}
......@@ -21,25 +21,30 @@ public:
CoordinateVector(QObject* parent = nullptr);
CoordinateVector(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2, QObject* parent = nullptr);
Q_PROPERTY(QGeoCoordinate coordinate1 MEMBER _coordinate1 NOTIFY coordinate1Changed)
Q_PROPERTY(QGeoCoordinate coordinate2 MEMBER _coordinate2 NOTIFY coordinate2Changed)
Q_PROPERTY(QGeoCoordinate coordinate1 MEMBER _coordinate1 NOTIFY coordinate1Changed)
Q_PROPERTY(QGeoCoordinate coordinate2 MEMBER _coordinate2 NOTIFY coordinate2Changed)
Q_PROPERTY(bool specialVisual READ specialVisual WRITE setSpecialVisual NOTIFY specialVisualChanged)
QGeoCoordinate coordinate1(void) const { return _coordinate1; }
QGeoCoordinate coordinate2(void) const { return _coordinate2; }
QGeoCoordinate coordinate1(void) const { return _coordinate1; }
QGeoCoordinate coordinate2(void) const { return _coordinate2; }
bool specialVisual(void) const { return _specialVisual; }
void setCoordinates(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2);
void setSpecialVisual(bool specialVisual);
public slots:
void setCoordinate1(const QGeoCoordinate& coordinate);
void setCoordinate2(const QGeoCoordinate& coordinate);
signals:
void coordinate1Changed(QGeoCoordinate coordinate);
void coordinate2Changed(QGeoCoordinate coordinate);
void coordinate1Changed (QGeoCoordinate coordinate);
void coordinate2Changed (QGeoCoordinate coordinate);
void specialVisualChanged (bool specialVisual);
private:
QGeoCoordinate _coordinate1;
QGeoCoordinate _coordinate2;
bool _specialVisual = false;
};
#endif
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