WimaCorridor.cc 1.13 KB
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "WimaCorridor.h"

const char* WimaCorridor::WimaCorridorName = "Corridor";



WimaCorridor::WimaCorridor(QObject *parent)
    : WimaArea (parent)
{
    init();
}

WimaCorridor::WimaCorridor(const WimaCorridor &other, QObject *parent)
    : WimaArea (other, parent)
{
    init();
}

19 20 21 22 23 24 25 26 27 28 29 30
/*!
 * \overload operator=()
 *
 * Calls the inherited operator WimaArea::operator=().
 */
WimaCorridor &WimaCorridor::operator=(const WimaCorridor &other)
{
    WimaArea::operator=(other);

    return *this;
}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
void WimaCorridor::saveToJson(QJsonObject &json)
{
    this->WimaArea::saveToJson(json);
    json[areaTypeName] = WimaCorridorName;
}

bool WimaCorridor::loadFromJson(const QJsonObject &json, QString &errorString)
{
    if ( this->WimaArea::loadFromJson(json, errorString)) {
        bool retVal = true;
        // code for loading here
        return retVal;
    } else {
        qWarning() << errorString;
        return false;
    }
}

void WimaCorridor::init()
{
    this->setObjectName(WimaCorridorName);
}


/*!
  \class WimaCorridor
  \brief Corridor (derived from \c WimaArea) connecting the \c WimaMeasurementArea and the \c WimaServiceArea.
*/