WimaServiceAreaData.cc 2.45 KB
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2
#include "WimaServiceAreaData.h"

3 4
const char *WimaServiceAreaData::typeString = "WimaServiceAreaData";

Valentin Platzgummer's avatar
Valentin Platzgummer committed
5
WimaServiceAreaData::WimaServiceAreaData(QObject *parent)
6
    : WimaAreaData(parent) {}
Valentin Platzgummer's avatar
Valentin Platzgummer committed
7

8 9 10 11
WimaServiceAreaData::WimaServiceAreaData(const WimaServiceAreaData &other,
                                         QObject *parent)
    : WimaAreaData(parent) {
  *this = other;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
12 13
}

14 15 16 17
WimaServiceAreaData::WimaServiceAreaData(const WimaServiceArea &other,
                                         QObject *parent)
    : WimaAreaData(parent) {
  *this = other;
18 19
}

20 21 22 23 24
WimaServiceAreaData &WimaServiceAreaData::
operator=(const WimaServiceAreaData &otherData) {
  this->assign(otherData);
  this->setDepot(otherData.depot());
  return *this;
25 26
}

27 28 29 30 31
WimaServiceAreaData &WimaServiceAreaData::
operator=(const WimaServiceArea &otherArea) {
  this->assign(otherArea);
  this->setDepot(otherArea.depot());
  return *this;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
32 33
}

34 35 36 37
QString WimaServiceAreaData::mapVisualQML() const {
  return QStringLiteral("WimaServiceAreaDataVisual.qml");
}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
38 39 40 41 42
/*!
 * \fn const QGeoCoordinate &WimaServiceAreaData::takeOffPosition() const
 * Returns a constant reference to the takeOffPosition.
 *
 */
43
const QGeoCoordinate &WimaServiceAreaData::depot() const { return _depot; }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
44

45
QString WimaServiceAreaData::type() const { return this->typeString; }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
46
/*!
47 48 49 50
 * \fn void WimaServiceAreaData::setTakeOffPosition(const QGeoCoordinate
 * &newCoordinate) Sets the takeoff position to the \a newCoordinate and emits
 * the takeOffPositionChanged() signal, if newCoordinate differs from the member
 * value.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
51 52
 *
 */
53 54 55 56 57
void WimaServiceAreaData::setDepot(const QGeoCoordinate &newCoordinate) {
  if (_depot != newCoordinate) {
    _depot = newCoordinate;
    emit depotChanged(_depot);
  }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
58 59
}

60 61 62
void WimaServiceAreaData::assign(const WimaServiceAreaData &other) {
  WimaAreaData::assign(other);
  setDepot(other.depot());
63 64
}

65 66 67
void WimaServiceAreaData::assign(const WimaServiceArea &other) {
  WimaAreaData::assign(other);
  setDepot(other.depot());
68 69
}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
70 71 72
/*!
 * \class WimaAreaData::WimaServiceAreaData
 * \brief Class to store and exchange data of a \c WimaServiceArea Object.
73 74 75 76 77
 * Class to store and exchange data of a \c WimaServiceArea Object. In contrast
 * to \c WimaServiceArea this class does not provied any interface to a grafical
 * user interface, neiter it uses the QGC Fact System. It is designed to
 * exchange data between the \c WimaPlaner and the \c WimaController class. And
 * it is the derived from WimaAreaData.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
78 79 80
 *
 * \sa WimaServiceArea, WimaAreaData
 */