Пример #1
0
boost::optional<ModelObject> PortList_Impl::lastModelObject()
{
  std::vector<ModelObject> objects = modelObjects();
  if( objects.size() > 0 )
  {
    return OptionalModelObject(objects.back());
  }
  else
  {
    return OptionalModelObject();
  }
}
Пример #2
0
  void CoilHeatingDXMultiSpeed_Impl::removeAllStages() {
    auto modelObjectList = stageDataList();
    if( modelObjectList ) {
      auto const modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          auto const modelObject = elem.optionalCast<CoilHeatingDXMultiSpeedStageData>();
          if (modelObject) {
            modelObjectList->removeModelObject(elem);
          }
      }
    }
  }
  void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::removeAllSpeeds() {
    auto modelObjectList = speedDataList();
    if( modelObjectList ) {
      auto const modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          auto const modelObject = elem.optionalCast<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData>();
          if (modelObject) {
            modelObjectList->removeModelObject(elem);
          }
      }
    }
  }
Пример #4
0
  void CentralHeatPumpSystem_Impl::removeAllModules() {
    auto modelObjectList = chillerHeaterModuleList();
    if( modelObjectList ) {
      auto const modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          auto const modelObject = elem.optionalCast<CentralHeatPumpSystemModule>();
          if (modelObject) {
            modelObjectList->removeModelObject(elem);
          }
      }
    }
  }
Пример #5
0
  std::vector<CoilHeatingDXMultiSpeedStageData> CoilHeatingDXMultiSpeed_Impl::stages() const {
    std::vector<CoilHeatingDXMultiSpeedStageData> result;
    auto const modelObjectList = stageDataList();
    if( modelObjectList ) {
      auto const modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          auto const modelObject = elem.optionalCast<CoilHeatingDXMultiSpeedStageData>();
          if (modelObject) {
            result.push_back(modelObject.get());
          }
      }
    }
    return result;
  }
  std::vector<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::speeds() const {
    std::vector<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData> result;
    auto const modelObjectList = speedDataList();
    if( modelObjectList ) {
      auto const modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          auto const modelObject = elem.optionalCast<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData>();
          if (modelObject) {
            result.push_back(modelObject.get());
          }
      }
    }
    return result;
  }
Пример #7
0
  std::vector<CentralHeatPumpSystemModule> CentralHeatPumpSystem_Impl::modules() const {
    std::vector<CentralHeatPumpSystemModule> result;
    auto const modelObjectList = chillerHeaterModuleList();
    if( modelObjectList ) {
      auto const modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          auto const modelObject = elem.optionalCast<CentralHeatPumpSystemModule>();
          if (modelObject) {
            result.push_back(modelObject.get());
          }
      }
    }
    return result;
  }
Пример #8
0
unsigned PortList_Impl::airLoopHVACPort()
{
  std::vector<ModelObject> objects = modelObjects();

  for( const auto & elem : objects )
  {
    if( boost::optional<HVACComponent> hvacComponent = elem.optionalCast<HVACComponent>() )
    {
      if( hvacComponent->airLoopHVAC() )
      {
        return portIndexForModelObject(hvacComponent.get());
      } 
    }
  }

  return nextPortIndex();
}
Пример #9
0
boost::optional<ModelObject> PortList_Impl::airLoopHVACModelObject()
{
  boost::optional<ModelObject> result;

  std::vector<ModelObject> objects = modelObjects();

  for( const auto & elem : objects )
  {
    if( boost::optional<HVACComponent> hvacComponent = elem.optionalCast<HVACComponent>() )
    {
      if( hvacComponent->airLoopHVAC() )
      {
        result = hvacComponent;
      } 
    }
  }

  return result;
}