boost::optional<ModelObject> PortList_Impl::lastModelObject() { std::vector<ModelObject> objects = modelObjects(); if( objects.size() > 0 ) { return OptionalModelObject(objects.back()); } else { return OptionalModelObject(); } }
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); } } } }
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); } } } }
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; }
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; }
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(); }
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; }