src/model/AirflowNetworkLeakageRatio.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 "AirflowNetworkLeakageRatio.hpp" | ||
| 7 | #include "AirflowNetworkLeakageRatio_Impl.hpp" | ||
| 8 | |||
| 9 | #include <utilities/idd/IddEnums.hxx> | ||
| 10 | #include <utilities/idd/OS_AirflowNetworkLeakageRatio_FieldEnums.hxx> | ||
| 11 | |||
| 12 | #include "../utilities/units/Unit.hpp" | ||
| 13 | |||
| 14 | #include "../utilities/core/Assert.hpp" | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | namespace model { | ||
| 18 | |||
| 19 | namespace detail { | ||
| 20 | |||
| 21 | ✗ | AirflowNetworkLeakageRatio_Impl::AirflowNetworkLeakageRatio_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 22 | ✗ | : AirflowNetworkComponent_Impl(idfObject, model, keepHandle) { | |
| 23 | ✗ | OS_ASSERT(idfObject.iddObject().type() == AirflowNetworkLeakageRatio::iddObjectType()); | |
| 24 | ✗ | } | |
| 25 | |||
| 26 | ✗ | AirflowNetworkLeakageRatio_Impl::AirflowNetworkLeakageRatio_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 27 | ✗ | bool keepHandle) | |
| 28 | ✗ | : AirflowNetworkComponent_Impl(other, model, keepHandle) { | |
| 29 | ✗ | OS_ASSERT(other.iddObject().type() == AirflowNetworkLeakageRatio::iddObjectType()); | |
| 30 | ✗ | } | |
| 31 | |||
| 32 | ✗ | AirflowNetworkLeakageRatio_Impl::AirflowNetworkLeakageRatio_Impl(const AirflowNetworkLeakageRatio_Impl& other, Model_Impl* model, bool keepHandle) | |
| 33 | ✗ | : AirflowNetworkComponent_Impl(other, model, keepHandle) {} | |
| 34 | |||
| 35 | ✗ | const std::vector<std::string>& AirflowNetworkLeakageRatio_Impl::outputVariableNames() const { | |
| 36 | ✗ | static const std::vector<std::string> result; | |
| 37 | ✗ | return result; | |
| 38 | } | ||
| 39 | |||
| 40 | ✗ | IddObjectType AirflowNetworkLeakageRatio_Impl::iddObjectType() const { | |
| 41 | ✗ | return AirflowNetworkLeakageRatio::iddObjectType(); | |
| 42 | } | ||
| 43 | |||
| 44 | ✗ | boost::optional<double> AirflowNetworkLeakageRatio_Impl::effectiveLeakageRatio() const { | |
| 45 | ✗ | return getDouble(OS_AirflowNetworkLeakageRatioFields::EffectiveLeakageRatio, true); | |
| 46 | } | ||
| 47 | |||
| 48 | ✗ | double AirflowNetworkLeakageRatio_Impl::maximumFlowRate() const { | |
| 49 | ✗ | boost::optional<double> value = getDouble(OS_AirflowNetworkLeakageRatioFields::MaximumFlowRate, true); | |
| 50 | ✗ | OS_ASSERT(value); | |
| 51 | ✗ | return value.get(); | |
| 52 | } | ||
| 53 | |||
| 54 | ✗ | double AirflowNetworkLeakageRatio_Impl::referencePressureDifference() const { | |
| 55 | ✗ | boost::optional<double> value = getDouble(OS_AirflowNetworkLeakageRatioFields::ReferencePressureDifference, true); | |
| 56 | ✗ | OS_ASSERT(value); | |
| 57 | ✗ | return value.get(); | |
| 58 | } | ||
| 59 | |||
| 60 | ✗ | double AirflowNetworkLeakageRatio_Impl::airMassFlowExponent() const { | |
| 61 | ✗ | boost::optional<double> value = getDouble(OS_AirflowNetworkLeakageRatioFields::AirMassFlowExponent, true); | |
| 62 | ✗ | OS_ASSERT(value); | |
| 63 | ✗ | return value.get(); | |
| 64 | } | ||
| 65 | |||
| 66 | ✗ | bool AirflowNetworkLeakageRatio_Impl::isAirMassFlowExponentDefaulted() const { | |
| 67 | ✗ | return isEmpty(OS_AirflowNetworkLeakageRatioFields::AirMassFlowExponent); | |
| 68 | } | ||
| 69 | |||
| 70 | ✗ | bool AirflowNetworkLeakageRatio_Impl::setEffectiveLeakageRatio(double effectiveLeakageRatio) { | |
| 71 | ✗ | bool result = setDouble(OS_AirflowNetworkLeakageRatioFields::EffectiveLeakageRatio, effectiveLeakageRatio); | |
| 72 | ✗ | return result; | |
| 73 | } | ||
| 74 | |||
| 75 | ✗ | void AirflowNetworkLeakageRatio_Impl::resetEffectiveLeakageRatio() { | |
| 76 | ✗ | bool result = setString(OS_AirflowNetworkLeakageRatioFields::EffectiveLeakageRatio, ""); | |
| 77 | ✗ | OS_ASSERT(result); | |
| 78 | ✗ | } | |
| 79 | |||
| 80 | ✗ | bool AirflowNetworkLeakageRatio_Impl::setMaximumFlowRate(double maximumFlowRate) { | |
| 81 | ✗ | bool result = setDouble(OS_AirflowNetworkLeakageRatioFields::MaximumFlowRate, maximumFlowRate); | |
| 82 | ✗ | return result; | |
| 83 | } | ||
| 84 | |||
| 85 | ✗ | bool AirflowNetworkLeakageRatio_Impl::setReferencePressureDifference(double referencePressureDifference) { | |
| 86 | ✗ | bool result = setDouble(OS_AirflowNetworkLeakageRatioFields::ReferencePressureDifference, referencePressureDifference); | |
| 87 | ✗ | return result; | |
| 88 | } | ||
| 89 | |||
| 90 | ✗ | bool AirflowNetworkLeakageRatio_Impl::setAirMassFlowExponent(double airMassFlowExponent) { | |
| 91 | ✗ | bool result = setDouble(OS_AirflowNetworkLeakageRatioFields::AirMassFlowExponent, airMassFlowExponent); | |
| 92 | ✗ | return result; | |
| 93 | } | ||
| 94 | |||
| 95 | ✗ | void AirflowNetworkLeakageRatio_Impl::resetAirMassFlowExponent() { | |
| 96 | ✗ | bool result = setString(OS_AirflowNetworkLeakageRatioFields::AirMassFlowExponent, ""); | |
| 97 | ✗ | OS_ASSERT(result); | |
| 98 | ✗ | } | |
| 99 | |||
| 100 | } // namespace detail | ||
| 101 | |||
| 102 | ✗ | AirflowNetworkLeakageRatio::AirflowNetworkLeakageRatio(const Model& model) | |
| 103 | ✗ | : AirflowNetworkComponent(AirflowNetworkLeakageRatio::iddObjectType(), model) { | |
| 104 | ✗ | OS_ASSERT(getImpl<detail::AirflowNetworkLeakageRatio_Impl>()); | |
| 105 | |||
| 106 | // TODO: Appropriately handle the following required object-list fields. | ||
| 107 | ✗ | bool ok = true; | |
| 108 | // ok = setMaximumFlowRate(); | ||
| 109 | ✗ | OS_ASSERT(ok); | |
| 110 | // ok = setReferencePressureDifference(); | ||
| 111 | ✗ | OS_ASSERT(ok); | |
| 112 | ✗ | } | |
| 113 | |||
| 114 | 8631 | IddObjectType AirflowNetworkLeakageRatio::iddObjectType() { | |
| 115 |
1/1✓ Branch 1 taken 8631 times.
|
8631 | return {IddObjectType::OS_AirflowNetworkLeakageRatio}; |
| 116 | } | ||
| 117 | |||
| 118 | ✗ | boost::optional<double> AirflowNetworkLeakageRatio::effectiveLeakageRatio() const { | |
| 119 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->effectiveLeakageRatio(); | |
| 120 | } | ||
| 121 | |||
| 122 | ✗ | double AirflowNetworkLeakageRatio::maximumFlowRate() const { | |
| 123 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->maximumFlowRate(); | |
| 124 | } | ||
| 125 | |||
| 126 | ✗ | double AirflowNetworkLeakageRatio::referencePressureDifference() const { | |
| 127 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->referencePressureDifference(); | |
| 128 | } | ||
| 129 | |||
| 130 | ✗ | double AirflowNetworkLeakageRatio::airMassFlowExponent() const { | |
| 131 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->airMassFlowExponent(); | |
| 132 | } | ||
| 133 | |||
| 134 | ✗ | bool AirflowNetworkLeakageRatio::isAirMassFlowExponentDefaulted() const { | |
| 135 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->isAirMassFlowExponentDefaulted(); | |
| 136 | } | ||
| 137 | |||
| 138 | ✗ | bool AirflowNetworkLeakageRatio::setEffectiveLeakageRatio(double effectiveLeakageRatio) { | |
| 139 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->setEffectiveLeakageRatio(effectiveLeakageRatio); | |
| 140 | } | ||
| 141 | |||
| 142 | ✗ | void AirflowNetworkLeakageRatio::resetEffectiveLeakageRatio() { | |
| 143 | ✗ | getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->resetEffectiveLeakageRatio(); | |
| 144 | ✗ | } | |
| 145 | |||
| 146 | ✗ | bool AirflowNetworkLeakageRatio::setMaximumFlowRate(double maximumFlowRate) { | |
| 147 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->setMaximumFlowRate(maximumFlowRate); | |
| 148 | } | ||
| 149 | |||
| 150 | ✗ | bool AirflowNetworkLeakageRatio::setReferencePressureDifference(double referencePressureDifference) { | |
| 151 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->setReferencePressureDifference(referencePressureDifference); | |
| 152 | } | ||
| 153 | |||
| 154 | ✗ | bool AirflowNetworkLeakageRatio::setAirMassFlowExponent(double airMassFlowExponent) { | |
| 155 | ✗ | return getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->setAirMassFlowExponent(airMassFlowExponent); | |
| 156 | } | ||
| 157 | |||
| 158 | ✗ | void AirflowNetworkLeakageRatio::resetAirMassFlowExponent() { | |
| 159 | ✗ | getImpl<detail::AirflowNetworkLeakageRatio_Impl>()->resetAirMassFlowExponent(); | |
| 160 | ✗ | } | |
| 161 | |||
| 162 | /// @cond | ||
| 163 | ✗ | AirflowNetworkLeakageRatio::AirflowNetworkLeakageRatio(std::shared_ptr<detail::AirflowNetworkLeakageRatio_Impl> impl) | |
| 164 | ✗ | : AirflowNetworkComponent(impl) {} | |
| 165 | /// @endcond | ||
| 166 | |||
| 167 | } // namespace model | ||
| 168 | } // namespace openstudio | ||
| 169 |