WimaServiceAreaData.cc 1.73 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#include "WimaServiceAreaData.h"

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

WimaServiceAreaData::WimaServiceAreaData(QObject *parent)
    : WimaAreaData(parent) {}

WimaServiceAreaData::WimaServiceAreaData(const WimaServiceAreaData &other,
                                         QObject *parent)
    : WimaAreaData(other, parent), _depot(other._depot) {}

WimaServiceAreaData::WimaServiceAreaData(const WimaServiceArea &other,
                                         QObject *parent)
    : WimaAreaData(other, parent), _depot(other.depot()) {}

WimaServiceAreaData &WimaServiceAreaData::
operator=(const WimaServiceAreaData &otherData) {
  WimaAreaData::operator=(otherData);
  this->setDepot(otherData.depot());
  return *this;
}

WimaServiceAreaData &WimaServiceAreaData::
operator=(const WimaServiceArea &otherArea) {
  WimaAreaData::operator=(otherArea);
  this->setDepot(otherArea.depot());
  return *this;
}

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

/*!
 * \fn const QGeoCoordinate &WimaServiceAreaData::takeOffPosition() const
 * Returns a constant reference to the takeOffPosition.
 *
 */
const QGeoCoordinate &WimaServiceAreaData::depot() const { return _depot; }

QString WimaServiceAreaData::type() const { return this->typeString; }
/*!
 * \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.
 *
 */
void WimaServiceAreaData::setDepot(const QGeoCoordinate &newCoordinate) {
  if (_depot != newCoordinate) {
    _depot = newCoordinate;
    emit depotChanged(_depot);
  }
}