#include "WimaVCorridor.h"

WimaVCorridor::WimaVCorridor(QObject *parent):
    WimaVCorridor(nullptr, parent)
{

}

WimaVCorridor::WimaVCorridor(WimaArea *other, QObject *parent):
  WimaArea      (other, parent)
  ,_serviceArea (nullptr)
  ,_opArea      (nullptr)
{
    this->setObjectName("Corridor");
}

void WimaVCorridor::setServiceArea(WimaServiceArea *serviceArea)
{
    if (serviceArea != nullptr){
        if(serviceArea != _serviceArea){
            _serviceArea = serviceArea;
            emit serviceAreaChanged(_serviceArea);
        }else {
            qWarning("WimaVCorridor::setServiceArea(): new serviceArea does not differ from old _serviceArea!");
        }

    }else {
        qWarning("WimaVCorridor::setServiceArea(): serviceArea == nullptr!");
    }
}

void WimaVCorridor::setOpArea(WimaGOperationArea *opArea)
{
    if (opArea != nullptr){
        if(&opArea != &_opArea){
            _opArea = opArea;
            emit opAreaChanged(_opArea);
        }else {
            qWarning("WimaVCorridor::setOpArea(): new opArea does not differ from old _opArea!");
        }

    }else {
        qWarning("WimaVCorridor::setOpArea(): opArea == nullptr!");
    }
}
