Commit 19c3e2cb authored by Kelly Steich's avatar Kelly Steich

survey item coordinate now has altitude

formating
parent d9fa1118
......@@ -80,6 +80,7 @@ SurveyMissionItem::SurveyMissionItem(Vehicle* vehicle, QObject* parent)
connect(&_gridAngleFact, &Fact::valueChanged, this, &SurveyMissionItem::_generateGrid);
connect(&_turnaroundDistFact, &Fact::valueChanged, this, &SurveyMissionItem::_generateGrid);
connect(&_cameraTriggerDistanceFact, &Fact::valueChanged, this, &SurveyMissionItem::_generateGrid);
connect(&_gridAltitudeFact, &Fact::valueChanged, this, &SurveyMissionItem::_updateCoordinateAltitude);
connect(this, &SurveyMissionItem::cameraTriggerChanged, this, &SurveyMissionItem::_cameraTriggerChanged);
}
......@@ -397,11 +398,23 @@ void SurveyMissionItem::_generateGrid(void)
emit lastSequenceNumberChanged(lastSequenceNumber());
if (_gridPoints.count()) {
setCoordinate(_gridPoints.first().value<QGeoCoordinate>());
_setExitCoordinate(_gridPoints.last().value<QGeoCoordinate>());
QGeoCoordinate coordinate = _gridPoints.first().value<QGeoCoordinate>();
coordinate.setAltitude(_gridAltitudeFact.rawValue().toDouble());
setCoordinate(coordinate);
QGeoCoordinate exitCoordinate = _gridPoints.last().value<QGeoCoordinate>();
exitCoordinate.setAltitude(_gridAltitudeFact.rawValue().toDouble());
_setExitCoordinate(exitCoordinate);
}
}
void SurveyMissionItem::_updateCoordinateAltitude(void)
{
_coordinate.setAltitude(_gridAltitudeFact.rawValue().toDouble());
_exitCoordinate.setAltitude(_gridAltitudeFact.rawValue().toDouble());
emit coordinateChanged(_coordinate);
emit exitCoordinateChanged(_exitCoordinate);
}
QPointF SurveyMissionItem::_rotatePoint(const QPointF& point, const QPointF& origin, double angle)
{
QPointF rotated;
......
......@@ -104,6 +104,7 @@ private:
void _setExitCoordinate(const QGeoCoordinate& coordinate);
void _clearGrid(void);
void _generateGrid(void);
void _updateCoordinateAltitude(void);
void _gridGenerator(const QList<QPointF>& polygonPoints, QList<QPointF>& gridPoints);
QPointF _rotatePoint(const QPointF& point, const QPointF& origin, double angle);
void _intersectLinesWithRect(const QList<QLineF>& lineList, const QRectF& boundRect, QList<QLineF>& resultLines);
......
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