9 changed files with 280 additions and 0 deletions
@ -0,0 +1,54 @@ |
|||||||
|
/*=====================================================================
|
||||||
|
|
||||||
|
QGroundControl Open Source Ground Control Station |
||||||
|
|
||||||
|
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
|
||||||
|
This file is part of the QGROUNDCONTROL project |
||||||
|
|
||||||
|
QGROUNDCONTROL is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
QGROUNDCONTROL is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
======================================================================*/ |
||||||
|
|
||||||
|
/// @file
|
||||||
|
/// @author Don Gagne <don@thegagnes.com>
|
||||||
|
|
||||||
|
#include "CoordinateVector.h" |
||||||
|
|
||||||
|
CoordinateVector::CoordinateVector(QObject* parent) |
||||||
|
: QObject(parent) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
CoordinateVector::CoordinateVector(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2, QObject* parent) |
||||||
|
: QObject(parent) |
||||||
|
, _coordinate1(coordinate1) |
||||||
|
, _coordinate2(coordinate2) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
CoordinateVector::~CoordinateVector() |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void CoordinateVector::setCoordinates(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2) |
||||||
|
{ |
||||||
|
_coordinate1 = coordinate1; |
||||||
|
_coordinate2 = coordinate2; |
||||||
|
emit coordinate1Changed(_coordinate1); |
||||||
|
emit coordinate2Changed(_coordinate2); |
||||||
|
} |
@ -0,0 +1,53 @@ |
|||||||
|
/*=====================================================================
|
||||||
|
|
||||||
|
QGroundControl Open Source Ground Control Station |
||||||
|
|
||||||
|
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
|
||||||
|
This file is part of the QGROUNDCONTROL project |
||||||
|
|
||||||
|
QGROUNDCONTROL is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
QGROUNDCONTROL is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
======================================================================*/ |
||||||
|
|
||||||
|
#ifndef CoordinateVector_H |
||||||
|
#define CoordinateVector_H |
||||||
|
|
||||||
|
#include <QObject> |
||||||
|
#include <QGeoCoordinate> |
||||||
|
|
||||||
|
class CoordinateVector : public QObject |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
|
||||||
|
public: |
||||||
|
CoordinateVector(QObject* parent = NULL); |
||||||
|
CoordinateVector(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2, QObject* parent = NULL); |
||||||
|
~CoordinateVector(); |
||||||
|
|
||||||
|
Q_PROPERTY(QGeoCoordinate coordinate1 MEMBER _coordinate1 NOTIFY coordinate1Changed) |
||||||
|
Q_PROPERTY(QGeoCoordinate coordinate2 MEMBER _coordinate2 NOTIFY coordinate2Changed) |
||||||
|
|
||||||
|
void setCoordinates(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2); |
||||||
|
|
||||||
|
signals: |
||||||
|
void coordinate1Changed(QGeoCoordinate coordinate); |
||||||
|
void coordinate2Changed(QGeoCoordinate coordinate); |
||||||
|
|
||||||
|
private: |
||||||
|
QGeoCoordinate _coordinate1; |
||||||
|
QGeoCoordinate _coordinate2; |
||||||
|
}; |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,51 @@ |
|||||||
|
/*=====================================================================
|
||||||
|
|
||||||
|
QGroundControl Open Source Ground Control Station |
||||||
|
|
||||||
|
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
|
||||||
|
This file is part of the QGROUNDCONTROL project |
||||||
|
|
||||||
|
QGROUNDCONTROL is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
QGROUNDCONTROL is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
======================================================================*/ |
||||||
|
|
||||||
|
/// @file
|
||||||
|
/// @author Don Gagne <don@thegagnes.com>
|
||||||
|
|
||||||
|
#include "QGCQGeoCoordinate.h" |
||||||
|
|
||||||
|
QGCQGeoCoordinate::QGCQGeoCoordinate(QObject* parent) |
||||||
|
: QObject(parent) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
QGCQGeoCoordinate::QGCQGeoCoordinate(const QGeoCoordinate& coordinate, QObject* parent) |
||||||
|
: QObject(parent) |
||||||
|
, _coordinate(coordinate) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
QGCQGeoCoordinate::~QGCQGeoCoordinate() |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void QGCQGeoCoordinate::setCoordinate(const QGeoCoordinate& coordinate) |
||||||
|
{ |
||||||
|
_coordinate = coordinate; |
||||||
|
emit coordinateChanged(_coordinate); |
||||||
|
} |
@ -0,0 +1,53 @@ |
|||||||
|
/*=====================================================================
|
||||||
|
|
||||||
|
QGroundControl Open Source Ground Control Station |
||||||
|
|
||||||
|
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
|
||||||
|
This file is part of the QGROUNDCONTROL project |
||||||
|
|
||||||
|
QGROUNDCONTROL is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
QGROUNDCONTROL is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
======================================================================*/ |
||||||
|
|
||||||
|
#ifndef QGCQGeoCoordinate_H |
||||||
|
#define QGCQGeoCoordinate_H |
||||||
|
|
||||||
|
#include <QObject> |
||||||
|
#include <QGeoCoordinate> |
||||||
|
|
||||||
|
|
||||||
|
/// This class wraps a QGeoCoordinate in a QObject so that it can be used from within a
|
||||||
|
/// QmlObjectListModel.
|
||||||
|
class QGCQGeoCoordinate : public QObject |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
|
||||||
|
public: |
||||||
|
QGCQGeoCoordinate(QObject* parent = NULL); |
||||||
|
QGCQGeoCoordinate(const QGeoCoordinate& coordinate, QObject* parent = NULL); |
||||||
|
~QGCQGeoCoordinate(); |
||||||
|
|
||||||
|
Q_PROPERTY(QGeoCoordinate coordinate MEMBER _coordinate NOTIFY coordinateChanged) |
||||||
|
|
||||||
|
void setCoordinate(const QGeoCoordinate& coordinate); |
||||||
|
|
||||||
|
signals: |
||||||
|
void coordinateChanged(QGeoCoordinate coordinate); |
||||||
|
|
||||||
|
private: |
||||||
|
QGeoCoordinate _coordinate; |
||||||
|
}; |
||||||
|
|
||||||
|
#endif |
Loading…
Reference in new issue