From de1a08cb2cf334c4ac162db0964de792127ec07a Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 14 May 2020 15:55:19 +0200 Subject: [PATCH] Fix #2977 - Make VAVReheat Method consistent with IDD and other objects To avoid breaking API, keeping the old name but marking as OS_DEPRECATED --- ...nslateAirTerminalSingleDuctVAVNoReheat.cpp | 2 +- ...ranslateAirTerminalSingleDuctVAVReheat.cpp | 4 +-- ...ranslateAirTerminalSingleDuctVAVReheat.cpp | 2 +- src/model/AirTerminalSingleDuctVAVReheat.cpp | 28 +++++++++++++------ src/model/AirTerminalSingleDuctVAVReheat.hpp | 12 ++++++-- .../AirTerminalSingleDuctVAVReheat_Impl.hpp | 6 ++-- src/sdd/MapHVAC.cpp | 6 ++-- 7 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVNoReheat.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVNoReheat.cpp index 4b877117e31..c239623db74 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVNoReheat.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVNoReheat.cpp @@ -159,7 +159,7 @@ boost::optional ForwardTranslator::translateAirTerminalSingleDuctVAVN idfObject.setString(AirTerminal_SingleDuct_VAV_NoReheatFields::MaximumAirFlowRate,"Autosize"); } - // ZoneMinimumAirFlowMethod + // ZoneMinimumAirFlowInputMethod s = modelObject.zoneMinimumAirFlowInputMethod(); if( s ) { diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVReheat.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVReheat.cpp index caa6fa25a7a..c3994a86df3 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVReheat.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateAirTerminalSingleDuctVAVReheat.cpp @@ -161,8 +161,8 @@ boost::optional ForwardTranslator::translateAirTerminalSingleDuctVAVR idfObject.setString(AirTerminal_SingleDuct_VAV_ReheatFields::MaximumAirFlowRate,"Autosize"); } - // ZoneMinimumAirFlowMethod - s = modelObject.zoneMinimumAirFlowMethod(); + // ZoneMinimumAirFlowInputMethod + s = modelObject.zoneMinimumAirFlowInputMethod(); if( s ) { idfObject.setString(AirTerminal_SingleDuct_VAV_ReheatFields::ZoneMinimumAirFlowInputMethod,s.get()); diff --git a/src/energyplus/ReverseTranslator/ReverseTranslateAirTerminalSingleDuctVAVReheat.cpp b/src/energyplus/ReverseTranslator/ReverseTranslateAirTerminalSingleDuctVAVReheat.cpp index 6518cd89fad..51fd907b418 100644 --- a/src/energyplus/ReverseTranslator/ReverseTranslateAirTerminalSingleDuctVAVReheat.cpp +++ b/src/energyplus/ReverseTranslator/ReverseTranslateAirTerminalSingleDuctVAVReheat.cpp @@ -119,7 +119,7 @@ OptionalModelObject ReverseTranslator::translateAirTerminalSingleDuctVAVReheat( s = workspaceObject.getString(AirTerminal_SingleDuct_VAV_ReheatFields::ZoneMinimumAirFlowInputMethod); if( s ) { - airTerminal->setZoneMinimumAirFlowMethod(s.get()); + airTerminal->setZoneMinimumAirFlowInputMethod(s.get()); } // ConstantMinimumAirFlowFraction diff --git a/src/model/AirTerminalSingleDuctVAVReheat.cpp b/src/model/AirTerminalSingleDuctVAVReheat.cpp index 7ae8618aadb..656723c62a2 100644 --- a/src/model/AirTerminalSingleDuctVAVReheat.cpp +++ b/src/model/AirTerminalSingleDuctVAVReheat.cpp @@ -335,12 +335,12 @@ namespace detail{ return false; } - std::string AirTerminalSingleDuctVAVReheat_Impl::zoneMinimumAirFlowMethod() + std::string AirTerminalSingleDuctVAVReheat_Impl::zoneMinimumAirFlowInputMethod() { return this->getString(OS_AirTerminal_SingleDuct_VAV_ReheatFields::ZoneMinimumAirFlowInputMethod).get(); } - bool AirTerminalSingleDuctVAVReheat_Impl::setZoneMinimumAirFlowMethod( std::string value ) + bool AirTerminalSingleDuctVAVReheat_Impl::setZoneMinimumAirFlowInputMethod(const std::string& value) { if( istringEqual(value,"Constant") ) { @@ -483,7 +483,7 @@ namespace detail{ return this->getString(OS_AirTerminal_SingleDuct_VAV_ReheatFields::DamperHeatingAction).get(); } - bool AirTerminalSingleDuctVAVReheat_Impl::setDamperHeatingAction( std::string value ) + bool AirTerminalSingleDuctVAVReheat_Impl::setDamperHeatingAction(const std::string& value) { return setString(OS_AirTerminal_SingleDuct_VAV_ReheatFields::DamperHeatingAction,value);; } @@ -798,7 +798,7 @@ AirTerminalSingleDuctVAVReheat::AirTerminalSingleDuctVAVReheat( const Model& mod autosizeMaximumAirFlowRate(); - setZoneMinimumAirFlowMethod("Constant"); + setZoneMinimumAirFlowInputMethod("Constant"); setConstantMinimumAirFlowFraction(0.3); @@ -861,14 +861,26 @@ bool AirTerminalSingleDuctVAVReheat::isMaximumAirFlowRateAutosized() const return getImpl()->isMaximumAirFlowRateAutosized(); } +std::string AirTerminalSingleDuctVAVReheat::zoneMinimumAirFlowInputMethod() +{ + return getImpl()->zoneMinimumAirFlowInputMethod(); +} + std::string AirTerminalSingleDuctVAVReheat::zoneMinimumAirFlowMethod() { - return getImpl()->zoneMinimumAirFlowMethod(); + LOG(Warn,"zoneMinimumAirFlowMethod is deprecated, please use zoneMinimumAirFlowInputMethod"); + return zoneMinimumAirFlowInputMethod(); +} + +bool AirTerminalSingleDuctVAVReheat::setZoneMinimumAirFlowInputMethod(const std::string& value ) +{ + return getImpl()->setZoneMinimumAirFlowInputMethod(value); } -bool AirTerminalSingleDuctVAVReheat::setZoneMinimumAirFlowMethod( std::string value ) +bool AirTerminalSingleDuctVAVReheat::setZoneMinimumAirFlowMethod(const std::string& value ) { - return getImpl()->setZoneMinimumAirFlowMethod(value); + LOG(Warn,"setZoneMinimumAirFlowMethod is deprecated, please use setZoneMinimumAirFlowInputMethod"); + return setZoneMinimumAirFlowInputMethod(value); } boost::optional AirTerminalSingleDuctVAVReheat::constantMinimumAirFlowFraction() const @@ -968,7 +980,7 @@ std::string AirTerminalSingleDuctVAVReheat::damperHeatingAction() return getImpl()->damperHeatingAction(); } -bool AirTerminalSingleDuctVAVReheat::setDamperHeatingAction( std::string value ) +bool AirTerminalSingleDuctVAVReheat::setDamperHeatingAction(const std::string& value) { return getImpl()->setDamperHeatingAction(value); } diff --git a/src/model/AirTerminalSingleDuctVAVReheat.hpp b/src/model/AirTerminalSingleDuctVAVReheat.hpp index 31b12ccf280..fb602899174 100644 --- a/src/model/AirTerminalSingleDuctVAVReheat.hpp +++ b/src/model/AirTerminalSingleDuctVAVReheat.hpp @@ -34,6 +34,7 @@ #include "StraightComponent.hpp" #include "Connection.hpp" #include "ModelAPI.hpp" +#include "../utilities/core/Deprecated.hpp" namespace openstudio { @@ -84,12 +85,17 @@ class MODEL_API AirTerminalSingleDuctVAVReheat : public StraightComponent { bool isMaximumAirFlowRateAutosized() const; /** Returns the value of the MaximumAirFlowRate field. */ - std::string zoneMinimumAirFlowMethod(); + std::string zoneMinimumAirFlowInputMethod(); + /** deprecated **/ + OS_DEPRECATED std::string zoneMinimumAirFlowMethod(); /** Sets the value of the MaximumAirFlowRate field. * Options are FixedFlowRate and Scheduled. */ - bool setZoneMinimumAirFlowMethod( std::string value ); + bool setZoneMinimumAirFlowInputMethod(const std::string& value ); + /** deprecated **/ + OS_DEPRECATED bool setZoneMinimumAirFlowMethod(const std::string& value ); + /** Returns the value of the ConstantMinimumAirFlowFraction field. */ boost::optional constantMinimumAirFlowFraction() const; @@ -154,7 +160,7 @@ class MODEL_API AirTerminalSingleDuctVAVReheat : public StraightComponent { /** Sets the value of the DamperHeatingAction field. * Options are Normal and Reverse. */ - bool setDamperHeatingAction( std::string value ); + bool setDamperHeatingAction(const std::string& value); /** Returns the value of the MaximumFlowPerZoneFloorAreaDuringReheat field. */ boost::optional maximumFlowPerZoneFloorAreaDuringReheat(); diff --git a/src/model/AirTerminalSingleDuctVAVReheat_Impl.hpp b/src/model/AirTerminalSingleDuctVAVReheat_Impl.hpp index ebf452fee6c..777f8f935c5 100644 --- a/src/model/AirTerminalSingleDuctVAVReheat_Impl.hpp +++ b/src/model/AirTerminalSingleDuctVAVReheat_Impl.hpp @@ -97,9 +97,9 @@ namespace detail { bool isMaximumAirFlowRateAutosized() const; - std::string zoneMinimumAirFlowMethod(); + std::string zoneMinimumAirFlowInputMethod(); - bool setZoneMinimumAirFlowMethod( std::string value ); + bool setZoneMinimumAirFlowInputMethod(const std::string& value ); boost::optional constantMinimumAirFlowFraction() const; bool isConstantMinimumAirFlowFractionAutosized() const; @@ -135,7 +135,7 @@ namespace detail { std::string damperHeatingAction(); - bool setDamperHeatingAction( std::string value ); + bool setDamperHeatingAction(const std::string& value); boost::optional maximumFlowPerZoneFloorAreaDuringReheat(); diff --git a/src/sdd/MapHVAC.cpp b/src/sdd/MapHVAC.cpp index 58381f91d5d..093a8149e71 100644 --- a/src/sdd/MapHVAC.cpp +++ b/src/sdd/MapHVAC.cpp @@ -4990,17 +4990,17 @@ boost::optional ReverseTranslator::translateTrmlUnit(const p pugi::xml_node minAirFracSchRefElement = trmlUnitElement.child("MinAirFracSchRef"); if( boost::optional minAirFracSch = model.getModelObjectByName(minAirFracSchRefElement.text().as_string()) ) { - terminal.setZoneMinimumAirFlowMethod("Scheduled"); + terminal.setZoneMinimumAirFlowInputMethod("Scheduled"); terminal.setMinimumAirFlowFractionSchedule(minAirFracSch.get()); } else if( primaryAirFlowMin ) { - terminal.setZoneMinimumAirFlowMethod("FixedFlowRate"); + terminal.setZoneMinimumAirFlowInputMethod("FixedFlowRate"); terminal.setFixedMinimumAirFlowRate(primaryAirFlowMin.get()); } else { - terminal.setZoneMinimumAirFlowMethod("Constant"); + terminal.setZoneMinimumAirFlowInputMethod("Constant"); terminal.setConstantMinimumAirFlowFraction(0.2); }