src/model/ZoneAirMassFlowConservation.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "ZoneAirMassFlowConservation.hpp" | ||
| 7 | #include "ZoneAirMassFlowConservation_Impl.hpp" | ||
| 8 | |||
| 9 | #include <utilities/idd/IddFactory.hxx> | ||
| 10 | #include <utilities/idd/OS_ZoneAirMassFlowConservation_FieldEnums.hxx> | ||
| 11 | |||
| 12 | #include "../utilities/core/Assert.hpp" | ||
| 13 | |||
| 14 | #include "../utilities/core/DeprecatedHelpers.hpp" | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | namespace model { | ||
| 18 | |||
| 19 | namespace detail { | ||
| 20 | |||
| 21 | 4 | ZoneAirMassFlowConservation_Impl::ZoneAirMassFlowConservation_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 22 | 4 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 23 |
4/6✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 13 not taken.
|
4 | OS_ASSERT(idfObject.iddObject().type() == ZoneAirMassFlowConservation::iddObjectType()); |
| 24 | 4 | } | |
| 25 | |||
| 26 | 1 | ZoneAirMassFlowConservation_Impl::ZoneAirMassFlowConservation_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 27 | 1 | bool keepHandle) | |
| 28 | 1 | : ModelObject_Impl(other, model, keepHandle) { | |
| 29 |
4/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
|
1 | OS_ASSERT(other.iddObject().type() == ZoneAirMassFlowConservation::iddObjectType()); |
| 30 | 1 | } | |
| 31 | |||
| 32 | 2 | ZoneAirMassFlowConservation_Impl::ZoneAirMassFlowConservation_Impl(const ZoneAirMassFlowConservation_Impl& other, Model_Impl* model, | |
| 33 | 2 | bool keepHandle) | |
| 34 | 2 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 35 | |||
| 36 | ✗ | const std::vector<std::string>& ZoneAirMassFlowConservation_Impl::outputVariableNames() const { | |
| 37 | static const std::vector<std::string> result{"Zone Infiltration Air Mass Flow Balance Status", | ||
| 38 | ✗ | "Zone Mass Balance Infiltration Air Mass Flow Rate"}; | |
| 39 | ✗ | return result; | |
| 40 | ✗ | } | |
| 41 | |||
| 42 | ✗ | IddObjectType ZoneAirMassFlowConservation_Impl::iddObjectType() const { | |
| 43 | ✗ | return ZoneAirMassFlowConservation::iddObjectType(); | |
| 44 | } | ||
| 45 | |||
| 46 | 5 | std::string ZoneAirMassFlowConservation_Impl::adjustZoneMixingandReturnForAirMassFlowBalance() const { | |
| 47 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<std::string> value = getString(OS_ZoneAirMassFlowConservationFields::AdjustZoneMixingandReturnForAirMassFlowBalance, true); |
| 48 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
|
5 | OS_ASSERT(value); |
| 49 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
10 | return value.get(); |
| 50 | 5 | } | |
| 51 | |||
| 52 | 5 | bool ZoneAirMassFlowConservation_Impl::isAdjustZoneMixingandReturnForAirMassFlowBalanceDefaulted() const { | |
| 53 | 5 | return isEmpty(OS_ZoneAirMassFlowConservationFields::AdjustZoneMixingandReturnForAirMassFlowBalance); | |
| 54 | } | ||
| 55 | |||
| 56 | 2 | std::string ZoneAirMassFlowConservation_Impl::infiltrationBalancingMethod() const { | |
| 57 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> value = getString(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingMethod, true); |
| 58 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 59 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | return value.get(); |
| 60 | 2 | } | |
| 61 | |||
| 62 | 2 | bool ZoneAirMassFlowConservation_Impl::isInfiltrationBalancingMethodDefaulted() const { | |
| 63 | 2 | return isEmpty(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingMethod); | |
| 64 | } | ||
| 65 | |||
| 66 | 2 | std::string ZoneAirMassFlowConservation_Impl::infiltrationBalancingZones() const { | |
| 67 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> value = getString(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingZones, true); |
| 68 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 69 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | return value.get(); |
| 70 | 2 | } | |
| 71 | |||
| 72 | 2 | bool ZoneAirMassFlowConservation_Impl::isInfiltrationBalancingZonesDefaulted() const { | |
| 73 | 2 | return isEmpty(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingZones); | |
| 74 | } | ||
| 75 | |||
| 76 | 2 | bool ZoneAirMassFlowConservation_Impl::setAdjustZoneMixingandReturnForAirMassFlowBalance( | |
| 77 | const std::string& adjustZoneMixingandReturnForAirMassFlowBalance) { | ||
| 78 | 2 | bool result = setString(OS_ZoneAirMassFlowConservationFields::AdjustZoneMixingandReturnForAirMassFlowBalance, | |
| 79 | adjustZoneMixingandReturnForAirMassFlowBalance); | ||
| 80 | 2 | return result; | |
| 81 | } | ||
| 82 | |||
| 83 | ✗ | void ZoneAirMassFlowConservation_Impl::resetAdjustZoneMixingandReturnForAirMassFlowBalance() { | |
| 84 | ✗ | bool result = setString(OS_ZoneAirMassFlowConservationFields::AdjustZoneMixingandReturnForAirMassFlowBalance, ""); | |
| 85 | ✗ | OS_ASSERT(result); | |
| 86 | ✗ | } | |
| 87 | |||
| 88 | 1 | bool ZoneAirMassFlowConservation_Impl::setInfiltrationBalancingMethod(const std::string& infiltrationBalancingMethod) { | |
| 89 | 1 | bool result = setString(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingMethod, infiltrationBalancingMethod); | |
| 90 | 1 | return result; | |
| 91 | } | ||
| 92 | |||
| 93 | ✗ | void ZoneAirMassFlowConservation_Impl::resetInfiltrationBalancingMethod() { | |
| 94 | ✗ | bool result = setString(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingMethod, ""); | |
| 95 | ✗ | OS_ASSERT(result); | |
| 96 | ✗ | } | |
| 97 | |||
| 98 | 1 | bool ZoneAirMassFlowConservation_Impl::setInfiltrationBalancingZones(const std::string& infiltrationBalancingZones) { | |
| 99 | 1 | bool result = setString(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingZones, infiltrationBalancingZones); | |
| 100 | 1 | return result; | |
| 101 | } | ||
| 102 | |||
| 103 | ✗ | void ZoneAirMassFlowConservation_Impl::resetInfiltrationBalancingZones() { | |
| 104 | ✗ | bool result = setString(OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingZones, ""); | |
| 105 | ✗ | OS_ASSERT(result); | |
| 106 | ✗ | } | |
| 107 | |||
| 108 | } // namespace detail | ||
| 109 | |||
| 110 | 8499 | IddObjectType ZoneAirMassFlowConservation::iddObjectType() { | |
| 111 |
1/1✓ Branch 1 taken 8499 times.
|
8499 | return {IddObjectType::OS_ZoneAirMassFlowConservation}; |
| 112 | } | ||
| 113 | |||
| 114 | ✗ | std::vector<std::string> ZoneAirMassFlowConservation::adjustZoneMixingandReturnForAirMassFlowBalanceValues() { | |
| 115 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), | |
| 116 | ✗ | OS_ZoneAirMassFlowConservationFields::AdjustZoneMixingandReturnForAirMassFlowBalance); | |
| 117 | } | ||
| 118 | |||
| 119 | ✗ | std::vector<std::string> ZoneAirMassFlowConservation::infiltrationBalancingMethodValues() { | |
| 120 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingMethod); | |
| 121 | } | ||
| 122 | |||
| 123 | ✗ | std::vector<std::string> ZoneAirMassFlowConservation::infiltrationBalancingZonesValues() { | |
| 124 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_ZoneAirMassFlowConservationFields::InfiltrationBalancingZones); | |
| 125 | } | ||
| 126 | |||
| 127 | 3 | std::string ZoneAirMassFlowConservation::adjustZoneMixingandReturnForAirMassFlowBalance() const { | |
| 128 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->adjustZoneMixingandReturnForAirMassFlowBalance(); |
| 129 | } | ||
| 130 | |||
| 131 | 2 | bool ZoneAirMassFlowConservation::isAdjustZoneMixingandReturnForAirMassFlowBalanceDefaulted() const { | |
| 132 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->isAdjustZoneMixingandReturnForAirMassFlowBalanceDefaulted(); |
| 133 | } | ||
| 134 | |||
| 135 | 2 | std::string ZoneAirMassFlowConservation::infiltrationBalancingMethod() const { | |
| 136 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->infiltrationBalancingMethod(); |
| 137 | } | ||
| 138 | |||
| 139 | 2 | bool ZoneAirMassFlowConservation::isInfiltrationBalancingMethodDefaulted() const { | |
| 140 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->isInfiltrationBalancingMethodDefaulted(); |
| 141 | } | ||
| 142 | |||
| 143 | 2 | std::string ZoneAirMassFlowConservation::infiltrationBalancingZones() const { | |
| 144 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->infiltrationBalancingZones(); |
| 145 | } | ||
| 146 | |||
| 147 | 2 | bool ZoneAirMassFlowConservation::isInfiltrationBalancingZonesDefaulted() const { | |
| 148 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->isInfiltrationBalancingZonesDefaulted(); |
| 149 | } | ||
| 150 | |||
| 151 | 1 | bool ZoneAirMassFlowConservation::setAdjustZoneMixingandReturnForAirMassFlowBalance( | |
| 152 | const std::string& adjustZoneMixingandReturnForAirMassFlowBalance) { | ||
| 153 |
1/1✓ Branch 3 taken 1 time.
|
2 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->setAdjustZoneMixingandReturnForAirMassFlowBalance( |
| 154 | 2 | adjustZoneMixingandReturnForAirMassFlowBalance); | |
| 155 | } | ||
| 156 | |||
| 157 | ✗ | void ZoneAirMassFlowConservation::resetAdjustZoneMixingandReturnForAirMassFlowBalance() { | |
| 158 | ✗ | getImpl<detail::ZoneAirMassFlowConservation_Impl>()->resetAdjustZoneMixingandReturnForAirMassFlowBalance(); | |
| 159 | ✗ | } | |
| 160 | |||
| 161 | 1 | bool ZoneAirMassFlowConservation::setInfiltrationBalancingMethod(const std::string& infiltrationBalancingMethod) { | |
| 162 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->setInfiltrationBalancingMethod(infiltrationBalancingMethod); |
| 163 | } | ||
| 164 | |||
| 165 | ✗ | void ZoneAirMassFlowConservation::resetInfiltrationBalancingMethod() { | |
| 166 | ✗ | getImpl<detail::ZoneAirMassFlowConservation_Impl>()->resetInfiltrationBalancingMethod(); | |
| 167 | ✗ | } | |
| 168 | |||
| 169 | 1 | bool ZoneAirMassFlowConservation::setInfiltrationBalancingZones(const std::string& infiltrationBalancingZones) { | |
| 170 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->setInfiltrationBalancingZones(infiltrationBalancingZones); |
| 171 | } | ||
| 172 | |||
| 173 | ✗ | void ZoneAirMassFlowConservation::resetInfiltrationBalancingZones() { | |
| 174 | ✗ | getImpl<detail::ZoneAirMassFlowConservation_Impl>()->resetInfiltrationBalancingZones(); | |
| 175 | ✗ | } | |
| 176 | |||
| 177 | /// @cond | ||
| 178 | 6 | ZoneAirMassFlowConservation::ZoneAirMassFlowConservation(std::shared_ptr<detail::ZoneAirMassFlowConservation_Impl> impl) | |
| 179 |
1/1✓ Branch 3 taken 6 times.
|
6 | : ModelObject(std::move(impl)) {} |
| 180 | 3 | ZoneAirMassFlowConservation::ZoneAirMassFlowConservation(Model& model) : ModelObject(ZoneAirMassFlowConservation::iddObjectType(), model) {} | |
| 181 | |||
| 182 | // DEPRECATED METHODS | ||
| 183 | |||
| 184 | 2 | bool ZoneAirMassFlowConservation::adjustZoneMixingForZoneAirMassFlowBalance() const { | |
| 185 | // TODO: DEPRECATED | ||
| 186 |
1/1✓ Branch 3 taken 2 times.
|
2 | std::string cur_choice = getImpl<detail::ZoneAirMassFlowConservation_Impl>()->adjustZoneMixingandReturnForAirMassFlowBalance(); |
| 187 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
|
10 | DEPRECATED_AT_MSG(3, 2, 0, "It captures two out of five possible choices, use adjustZoneMixingandReturnForAirMassFlowBalance instead."); |
| 188 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 1 time.
|
4 | if (openstudio::istringEqual("None", cur_choice)) { |
| 189 | 1 | return false; | |
| 190 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | } else if (openstudio::istringEqual("AdjustMixingOnly", cur_choice)) { |
| 191 | 1 | return true; | |
| 192 | } else { | ||
| 193 | ✗ | LOG(Warn, | |
| 194 | "ZoneAirMassFlowConservation: '" << cur_choice | ||
| 195 | << "' doesn't technically mean the same thing as the former 'Yes' (which would be 'AdjustMixingOnly')."); | ||
| 196 | ✗ | return true; | |
| 197 | } | ||
| 198 | 2 | } | |
| 199 | |||
| 200 | 3 | bool ZoneAirMassFlowConservation::isAdjustZoneMixingForZoneAirMassFlowBalanceDefaulted() const { | |
| 201 |
5/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
|
12 | DEPRECATED_AT_MSG(3, 2, 0, |
| 202 | "It captures two out of five possible choices, use isAdjustZoneMixingandReturnForAirMassFlowBalanceDefaulted instead."); | ||
| 203 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->isAdjustZoneMixingandReturnForAirMassFlowBalanceDefaulted(); |
| 204 | } | ||
| 205 | |||
| 206 | 1 | bool ZoneAirMassFlowConservation::setAdjustZoneMixingForZoneAirMassFlowBalance(bool adjustZoneMixingForZoneAirMassFlowBalance) { | |
| 207 |
5/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
|
4 | DEPRECATED_AT_MSG(3, 2, 0, "It captures two out of five possible choices, use setAdjustZoneMixingandReturnForAirMassFlowBalance instead."); |
| 208 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (adjustZoneMixingForZoneAirMassFlowBalance) { |
| 209 |
2/2✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
|
3 | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->setAdjustZoneMixingandReturnForAirMassFlowBalance("AdjustMixingOnly"); |
| 210 | } else { | ||
| 211 | ✗ | return getImpl<detail::ZoneAirMassFlowConservation_Impl>()->setAdjustZoneMixingandReturnForAirMassFlowBalance("None"); | |
| 212 | } | ||
| 213 | } | ||
| 214 | |||
| 215 | ✗ | void ZoneAirMassFlowConservation::resetAdjustZoneMixingForZoneAirMassFlowBalance() { | |
| 216 | ✗ | DEPRECATED_AT_MSG(3, 2, 0, "It captures two out of five possible choices, use resetAdjustZoneMixingandReturnForAirMassFlowBalance instead."); | |
| 217 | ✗ | getImpl<detail::ZoneAirMassFlowConservation_Impl>()->resetAdjustZoneMixingandReturnForAirMassFlowBalance(); | |
| 218 | ✗ | } | |
| 219 | |||
| 220 | /// @endcond | ||
| 221 | |||
| 222 | } // namespace model | ||
| 223 | } // namespace openstudio | ||
| 224 |