void InspectorController::moveBranchForZoneReturn(model::ThermalZone & zone, const Handle & newPlenumHandle)
{
  model::Model model = zone.model();

  if(boost::optional<model::AirLoopHVACReturnPlenum> returnPlenum = model.getModelObject<model::AirLoopHVACReturnPlenum>(newPlenumHandle))
  {
    if( boost::optional<model::ThermalZone> plenumZone = returnPlenum->thermalZone() )
    {
      zone.setReturnPlenum(plenumZone.get());
    }
  }
  else if(boost::optional<model::ThermalZone> plenumZone = model.getModelObject<model::ThermalZone>(newPlenumHandle))
  {
    zone.setReturnPlenum(plenumZone.get());
  }
  else
  {
    zone.removeReturnPlenum();
  }

  // This updates the plenum chooser combo box
  // Need to process events first because HVAC scene needs to redraw to supply colors to combo box
  QApplication::instance()->processEvents();
  OS_ASSERT(m_inspectorView);
  m_inspectorView->update();
}
示例#2
0
bool SurfaceNetworkBuilder::linkInteriorSubSurface(model::ThermalZone zone, model::Space space, model::Surface surface, model::SubSurface subSurface,
  model::SubSurface adjacentSubSurface, model::Surface adjacentSurface, model::Space adjacentSpace, model::ThermalZone adjacentZone)
{
  LOG(Info, "Subsurfaces '" << subSurface.name().get() << "' and '" << adjacentSubSurface.name().get() << "' connect zone '"
    << zone.name().get() << "' to zone '" << adjacentZone.name().get() << "'");
  return true;
}
void InspectorController::removeBranchForZone(model::ThermalZone & zone)
{
  model::OptionalAirLoopHVAC airLoop = zone.airLoopHVAC();

  if( airLoop )
  {
    airLoop->removeBranchForZone(zone);
  }
}
void ThermalZonesController::setHeatingSchedule(model::ThermalZone & thermalZone, model::OptionalSchedule & schedule)
{
  model::OptionalThermostatSetpointDualSetpoint thermostat = thermalZone.thermostatSetpointDualSetpoint();

  if( thermostat )
  {
    if( schedule )
    {
      thermostat->setHeatingSchedule(schedule.get());
    }
    else
    {
      thermostat->resetHeatingSchedule();
    }
  }
}
void ThermalZonesController::setDehumidifyingSchedule(model::ThermalZone & thermalZone, model::OptionalSchedule & schedule)
{
  model::OptionalZoneControlHumidistat humidistat = thermalZone.zoneControlHumidistat();

  if( humidistat )
  {
    if( schedule )
    {
      humidistat->setDehumidifyingRelativeHumiditySetpointSchedule(schedule.get());
    }
    else
    {
      humidistat->resetDehumidifyingRelativeHumiditySetpointSchedule();
    }
  }
}
void InspectorController::addBranchForZone(model::ThermalZone & zone)
{
  model::OptionalHVACComponent hvacComponent = m_modelObject->optionalCast<model::HVACComponent>();

  model::OptionalAirLoopHVAC airLoop;

  if( hvacComponent )
  {
    airLoop = hvacComponent->airLoopHVAC();
  }

  if( airLoop )
  {
    model::Model model = zone.model();

    airLoop->addBranchForZone(zone,boost::none);
  }
}
示例#7
0
ZoneChooserItem::ZoneChooserItem(model::ThermalZone & zone, ZoneChooserView * parent)
    : QWidget(parent),
      m_zoneChooserView(parent),
      m_thermalZone(zone)
{
    QHBoxLayout * hLayout = new QHBoxLayout();

    m_checkBox = new QCheckBox();

    m_checkBox->setText(toQString(zone.name().get()));

    connect( m_checkBox, SIGNAL(clicked(bool)), this, SLOT(sendClickedSignal(bool)) );
    connect( this, SIGNAL(addZoneClicked(model::ThermalZone &)), m_zoneChooserView,SIGNAL(addZoneClicked(model::ThermalZone &)) );
    connect( this, SIGNAL(removeZoneClicked(model::ThermalZone &)), m_zoneChooserView,SIGNAL(removeZoneClicked(model::ThermalZone &)) );

    hLayout->addWidget(m_checkBox);

    setLayout(hLayout);

}
void ThermalZonesController::addComponentToZone(model::ThermalZone & zone, Handle & h)
{
  boost::optional<model::ZoneHVACComponent> libraryComp;

  model::Model library = OSAppBase::instance()->currentDocument()->componentLibrary();
  libraryComp = library.getModelObject<model::ZoneHVACComponent>(h);

  if( libraryComp )
  {
    std::vector<model::ModelObject> existingComps;
    existingComps = zone.equipment();

    std::vector<model::ZoneHVACComponent> exisitngHVACComps;

    for( auto it = existingComps.begin();
         it < existingComps.end();
         ++it )
    {
      if( boost::optional<model::ZoneHVACComponent> hvacComp = it->optionalCast<model::ZoneHVACComponent>() )
      {
        exisitngHVACComps.push_back(hvacComp.get());
      }
    }

    if( exisitngHVACComps.size() > 0 )
    {
      QMessageBox message(subTabView());
      
      message.setText("Sorry, only one piece of zone equipment is allowed at this time.");

      message.exec();

      return;
    }
  }

  bool wasSuccessful = false;

  if( libraryComp )
  {
    model::ZoneHVACComponent compClone = libraryComp->clone(model()).cast<model::ZoneHVACComponent>();
  
    bool added = compClone.addToThermalZone(zone);

    if( added )
    {
      wasSuccessful = true;
    }
    else
    {
      compClone.remove();
    }
  }

  if( ! wasSuccessful )
  {
    QMessageBox message(subTabView());
    
    message.setText("The selected component is not allowed at this location.");

    message.exec();
  }
}
示例#9
0
bool SurfaceNetworkBuilder::linkExteriorSubSurface(model::ThermalZone zone, model::Space space, model::Surface surface, model::SubSurface subSurface)
{
  LOG(Info, "Subsurface '" << subSurface.name().get() << "' connects zone '" << zone.name().get() << "' to the ambient");
  return true;
}