WimaServiceAreaData.cc 2.34 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 38
}

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

41
QString WimaServiceAreaData::type() const { return this->typeString; }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
42
/*!
43 44 45 46
 * \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
47 48
 *
 */
49 50 51 52 53
void WimaServiceAreaData::setDepot(const QGeoCoordinate &newCoordinate) {
  if (_depot != newCoordinate) {
    _depot = newCoordinate;
    emit depotChanged(_depot);
  }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
54 55
}

56 57 58
void WimaServiceAreaData::assign(const WimaServiceAreaData &other) {
  WimaAreaData::assign(other);
  setDepot(other.depot());
59 60
}

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

Valentin Platzgummer's avatar
Valentin Platzgummer committed
66 67 68
/*!
 * \class WimaAreaData::WimaServiceAreaData
 * \brief Class to store and exchange data of a \c WimaServiceArea Object.
69 70 71 72 73
 * 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
74 75 76
 *
 * \sa WimaServiceArea, WimaAreaData
 */