Commit ea04fc44 authored by Valentin Platzgummer's avatar Valentin Platzgummer

reset ref button addded to circular surveyy

parent a9d2e4c9
......@@ -151,6 +151,11 @@ Rectangle {
spacing: _margin
visible: transectsHeader.checked
QGCButton {
text: qsTr("Reset Reference")
onClicked: missionItem.resetReference();
}
QGCButton {
text: qsTr("Rotate Entry Point")
onClicked: missionItem.rotateEntryPoint();
......
......@@ -34,13 +34,17 @@ CircularSurveyComplexItem::CircularSurveyComplexItem(Vehicle *vehicle, bool flyV
}
void CircularSurveyComplexItem::resetReference()
{
setRefPoint(_surveyAreaPolygon.center());
}
void CircularSurveyComplexItem::setRefPoint(const QGeoCoordinate &refPt)
{
if (refPt != _referencePoint){
_referencePoint = refPt;
emit refPointChanged();
//qDebug() << _referencePoint.toString();
}
}
......
......@@ -24,6 +24,8 @@ public:
Q_PROPERTY(Fact* transectMinLength READ transectMinLength CONSTANT)
Q_PROPERTY(bool autoGenerated READ autoGenerated NOTIFY autoGeneratedChanged)
Q_INVOKABLE void resetReference(void);
// Property setters
void setRefPoint(const QGeoCoordinate &refPt);
// Set this to true if survey was automatically generated, prevents initialisation from gui.
......
......@@ -354,6 +354,8 @@ void WimaController::containerDataValidChanged(bool valid)
void WimaController::updateCurrentMissionItems()
{
if (_missionItems.count() < 0 || !_localPlanDataValid)
return;
int numberWaypoints = 30; // the number of waypoints currentMissionItems must not exceed
int overlapping = 2; // number of overlapping waypoints of consecutive mission phases
......
......@@ -100,6 +100,7 @@ void WimaPlaner::removeArea(int index)
if (_visualItems.count() == 0) {
// this branch is reached if all items are removed
// to guarentee proper behavior, _currentAreaIndex must be set to a invalid value, as on constructor init.
resetAllInteractive();
_currentAreaIndex = -1;
return;
}
......
......@@ -172,11 +172,19 @@ Item {
DragCoordinate {
map: _root.map
qgcView: _root.qgcView
z: QGroundControl.zOrderMapItems
z: QGroundControl.zOrderMapItems
checked: _missionItem.isCurrentItem
coordinate: _missionItem.refPoint
onCoordinateChanged: _missionItem.refPoint = coordinate
property var refPoint: _missionItem.refPoint
onCoordinateChanged: _missionItem.refPoint = coordinate
onRefPointChanged: {
if (refPoint !== coordinate) {
coordinate = refPoint
}
}
onClicked: _root.clicked(_missionItem.sequenceNumber)
}
}
......
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