-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AirLoopHVACUnitarySystem set Method During XXX Operation - option #4905
AirLoopHVACUnitarySystem set Method During XXX Operation - option #4905
Conversation
…RateMethodDuringCooling, which can be avoided (keep returning optional even if always initialized)
@@ -130,7 +132,7 @@ namespace model { | |||
boost::optional<HVACComponent> supplementalHeatingCoil() const; | |||
|
|||
/** In EnergyPlus 8.3.0 and above this property maps to the EnergyPlus field "Cooling Supply Air Flow Rate Method" **/ | |||
boost::optional<std::string> supplyAirFlowRateMethodDuringCoolingOperation() const; | |||
std::string supplyAirFlowRateMethodDuringCoolingOperation() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could avoid this API break by keeping it as optional<string>
even though it'll always be set.
bool AirLoopHVACUnitarySystem::setSupplyAirFlowRateMethodDuringCoolingOperation(const std::string& supplyAirFlowRateMethodDuringCoolingOperation) { | ||
log_deprecation_and_throw_if_time_to_remove(BOOST_CURRENT_FUNCTION); | ||
return false; | ||
} | ||
|
||
void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateMethodDuringCoolingOperation() { | ||
log_deprecation_and_throw_if_time_to_remove(BOOST_CURRENT_FUNCTION); | ||
} | ||
|
||
void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateDuringCoolingOperation() { | ||
log_deprecation_and_throw_if_time_to_remove(BOOST_CURRENT_FUNCTION); | ||
} | ||
|
||
void AirLoopHVACUnitarySystem::resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation() { | ||
log_deprecation_and_throw_if_time_to_remove(BOOST_CURRENT_FUNCTION); | ||
} | ||
|
||
void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignCoolingSupplyAirFlowRate() { | ||
log_deprecation_and_throw_if_time_to_remove(BOOST_CURRENT_FUNCTION); | ||
} | ||
|
||
void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation() { | ||
log_deprecation_and_throw_if_time_to_remove(BOOST_CURRENT_FUNCTION); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these become no-op deprecated functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, replace with something like
DEPRECATED_AT_MSG(3, 7, 0, "Use setSupplyAirFlowRateDuringCoolingOperation instead.");
@@ -298,26 +299,23 @@ namespace model { | |||
|
|||
void resetSupplementalHeatingCoil(); | |||
|
|||
bool setSupplyAirFlowRateMethodDuringCoolingOperation(boost::optional<std::string> supplyAirFlowRateMethodDuringCoolingOperation); | |||
bool setSupplyAirFlowRateMethodDuringCoolingOperation(const std::string& supplyAirFlowRateMethodDuringCoolingOperation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Impl side is ugly. cleanup the use of unecessary optionals
bool AirLoopHVACUnitarySystem_Impl::hasCoolingCoil() const { | ||
return !isEmpty(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am NOT using it right now. But if we wanted to disallow calling setSupplyAirFlowRateXXXDuringCoolingOperation to the case where there IS a cooling coil, we'd use that
bool AirLoopHVACUnitarySystem_Impl::setCoolingCoil(const HVACComponent& coolingCoil) { | ||
const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName, coolingCoil.handle()); | ||
if (openstudio::istringEqual("None", supplyAirFlowRateMethodDuringCoolingOperation())) { | ||
autosizeSupplyAirFlowRateDuringCoolingOperation(); | ||
OS_ASSERT(setSupplyAirFlowRateMethodDuringCoolingOperation("SupplyAirFlowRate")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set Cooling Coil: set to SupplyAirFlowRate.
const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName, ""); | ||
OS_ASSERT(result); | ||
OS_ASSERT(setSupplyAirFlowRateMethodDuringCoolingOperation("None")); | ||
resetSupplyAirFlowRateDuringCoolingOperation(); | ||
resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); | ||
resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); | ||
resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResetCoolingCoil: set to None, clear out of the other fields.
I'm not sure whether we want to reset all fields at all times or not... Only ONE field will be used in the end, but it may be slightly annoying for people if they are testing things out.
bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRateDuringCoolingOperation(double supplyAirFlowRateDuringCoolingOperation) { | ||
const bool result = | ||
setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation, supplyAirFlowRateDuringCoolingOperation); | ||
OS_ASSERT(setSupplyAirFlowRateMethodDuringCoolingOperation("SupplyAirFlowRate")); | ||
// resetSupplyAirFlowRateDuringCoolingOperation(); | ||
resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); | ||
resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); | ||
resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For each of these setters, you set the field + the method, reset all fields (again, not sure we want to reset all)
@jmarrec Seems easier to update the idd Method fields with |
…itary-sys-opmethod2
@joseph-robertson I'm not sure I follow. Which fields do you want to set to None? |
@jmarrec Introduce
Then you wouldn't need that special code inside |
Yeah I think that makes sense. Up to you really. |
…itary-sys-opmethod2
AirLoopHVACUnitarySystem set Method During XXX Operation - option, 2
CI Results for 36a9a7d:
|
Pull request overview
Cleanup the DuringCooling API. One break, the return of supplyAirFlowRateMethodDuringCooling, which can be avoided (keep returning optional even if always initialized)
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.