#include "WimaVCorridor.h" const char* WimaVCorridor::wimaVCorridorName = "Corridor"; WimaVCorridor::WimaVCorridor() : WimaVCorridor(nullptr) { } WimaVCorridor::WimaVCorridor(QObject *parent) : WimaArea (parent) , _serviceArea (nullptr) , _opArea (nullptr) { this->setObjectName(wimaVCorridorName); } WimaVCorridor::WimaVCorridor(const WimaArea &other, QObject *parent) : WimaArea (other, parent) , _serviceArea (nullptr) , _opArea (nullptr) { this->setObjectName(wimaVCorridorName); } void WimaVCorridor::setServiceArea(WimaServiceArea &serviceArea) { if(&serviceArea != _serviceArea){ _serviceArea = &serviceArea; emit serviceAreaChanged(_serviceArea); }else { qWarning("WimaVCorridor::setServiceArea(): new serviceArea does not differ from old _serviceArea!"); } } void WimaVCorridor::setOpArea(WimaGOperationArea &opArea) { if(&opArea != _opArea){ _opArea = &opArea; emit opAreaChanged(_opArea); }else { qWarning("WimaVCorridor::setOpArea(): new opArea does not differ from old _opArea!"); } } void WimaVCorridor::saveToJson(QJsonObject &json) { this->WimaArea::saveToJson(json); json[areaTypeName] = wimaVCorridorName; } bool WimaVCorridor::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; } }