src/model/DesignSpecificationZoneAirDistribution.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 "DesignSpecificationZoneAirDistribution.hpp" | ||
| 7 | #include "DesignSpecificationZoneAirDistribution_Impl.hpp" | ||
| 8 | #include "Schedule.hpp" | ||
| 9 | #include "Schedule_Impl.hpp" | ||
| 10 | #include "ScheduleTypeLimits.hpp" | ||
| 11 | #include "ScheduleTypeRegistry.hpp" | ||
| 12 | #include <utilities/idd/OS_DesignSpecification_ZoneAirDistribution_FieldEnums.hxx> | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | #include "../utilities/units/Unit.hpp" | ||
| 15 | #include "../utilities/core/Assert.hpp" | ||
| 16 | |||
| 17 | namespace openstudio { | ||
| 18 | namespace model { | ||
| 19 | |||
| 20 | namespace detail { | ||
| 21 | |||
| 22 | 1 | DesignSpecificationZoneAirDistribution_Impl::DesignSpecificationZoneAirDistribution_Impl(const IdfObject& idfObject, Model_Impl* model, | |
| 23 | 1 | bool keepHandle) | |
| 24 | 1 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 25 |
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(idfObject.iddObject().type() == DesignSpecificationZoneAirDistribution::iddObjectType()); |
| 26 | 1 | } | |
| 27 | |||
| 28 | ✗ | DesignSpecificationZoneAirDistribution_Impl::DesignSpecificationZoneAirDistribution_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 29 | ✗ | Model_Impl* model, bool keepHandle) | |
| 30 | ✗ | : ModelObject_Impl(other, model, keepHandle) { | |
| 31 | ✗ | OS_ASSERT(other.iddObject().type() == DesignSpecificationZoneAirDistribution::iddObjectType()); | |
| 32 | ✗ | } | |
| 33 | |||
| 34 | ✗ | DesignSpecificationZoneAirDistribution_Impl::DesignSpecificationZoneAirDistribution_Impl(const DesignSpecificationZoneAirDistribution_Impl& other, | |
| 35 | ✗ | Model_Impl* model, bool keepHandle) | |
| 36 | ✗ | : ModelObject_Impl(other, model, keepHandle) {} | |
| 37 | |||
| 38 | ✗ | const std::vector<std::string>& DesignSpecificationZoneAirDistribution_Impl::outputVariableNames() const { | |
| 39 | ✗ | static const std::vector<std::string> result; | |
| 40 | ✗ | return result; | |
| 41 | } | ||
| 42 | |||
| 43 | ✗ | IddObjectType DesignSpecificationZoneAirDistribution_Impl::iddObjectType() const { | |
| 44 | ✗ | return DesignSpecificationZoneAirDistribution::iddObjectType(); | |
| 45 | } | ||
| 46 | |||
| 47 | ✗ | std::vector<ScheduleTypeKey> DesignSpecificationZoneAirDistribution_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 48 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 49 | ✗ | UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 50 | ✗ | UnsignedVector::const_iterator b(fieldIndices.begin()); | |
| 51 | ✗ | UnsignedVector::const_iterator e(fieldIndices.end()); | |
| 52 | ✗ | if (std::find(b, e, OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessSchedule) != e) { | |
| 53 | ✗ | result.push_back(ScheduleTypeKey("DesignSpecificationZoneAirDistribution", "Zone Air Distribution Effectiveness Schedule")); | |
| 54 | } | ||
| 55 | ✗ | return result; | |
| 56 | ✗ | } | |
| 57 | |||
| 58 | ✗ | double DesignSpecificationZoneAirDistribution_Impl::zoneAirDistributionEffectivenessinCoolingMode() const { | |
| 59 | boost::optional<double> value = | ||
| 60 | ✗ | getDouble(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinCoolingMode, true); | |
| 61 | ✗ | OS_ASSERT(value); | |
| 62 | ✗ | return value.get(); | |
| 63 | } | ||
| 64 | |||
| 65 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::isZoneAirDistributionEffectivenessinCoolingModeDefaulted() const { | |
| 66 | ✗ | return isEmpty(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinCoolingMode); | |
| 67 | } | ||
| 68 | |||
| 69 | ✗ | double DesignSpecificationZoneAirDistribution_Impl::zoneAirDistributionEffectivenessinHeatingMode() const { | |
| 70 | boost::optional<double> value = | ||
| 71 | ✗ | getDouble(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinHeatingMode, true); | |
| 72 | ✗ | OS_ASSERT(value); | |
| 73 | ✗ | return value.get(); | |
| 74 | } | ||
| 75 | |||
| 76 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::isZoneAirDistributionEffectivenessinHeatingModeDefaulted() const { | |
| 77 | ✗ | return isEmpty(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinHeatingMode); | |
| 78 | } | ||
| 79 | |||
| 80 | ✗ | boost::optional<Schedule> DesignSpecificationZoneAirDistribution_Impl::zoneAirDistributionEffectivenessSchedule() const { | |
| 81 | ✗ | return getObject<ModelObject>().getModelObjectTarget<Schedule>( | |
| 82 | ✗ | OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessSchedule); | |
| 83 | } | ||
| 84 | |||
| 85 | ✗ | double DesignSpecificationZoneAirDistribution_Impl::zoneSecondaryRecirculationFraction() const { | |
| 86 | ✗ | boost::optional<double> value = getDouble(OS_DesignSpecification_ZoneAirDistributionFields::ZoneSecondaryRecirculationFraction, true); | |
| 87 | ✗ | OS_ASSERT(value); | |
| 88 | ✗ | return value.get(); | |
| 89 | } | ||
| 90 | |||
| 91 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::isZoneSecondaryRecirculationFractionDefaulted() const { | |
| 92 | ✗ | return isEmpty(OS_DesignSpecification_ZoneAirDistributionFields::ZoneSecondaryRecirculationFraction); | |
| 93 | } | ||
| 94 | |||
| 95 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::setZoneAirDistributionEffectivenessinCoolingMode( | |
| 96 | double zoneAirDistributionEffectivenessinCoolingMode) { | ||
| 97 | ✗ | bool result = setDouble(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinCoolingMode, | |
| 98 | zoneAirDistributionEffectivenessinCoolingMode); | ||
| 99 | ✗ | return result; | |
| 100 | } | ||
| 101 | |||
| 102 | ✗ | void DesignSpecificationZoneAirDistribution_Impl::resetZoneAirDistributionEffectivenessinCoolingMode() { | |
| 103 | ✗ | bool result = setString(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinCoolingMode, ""); | |
| 104 | ✗ | OS_ASSERT(result); | |
| 105 | ✗ | } | |
| 106 | |||
| 107 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::setZoneAirDistributionEffectivenessinHeatingMode( | |
| 108 | double zoneAirDistributionEffectivenessinHeatingMode) { | ||
| 109 | ✗ | bool result = setDouble(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinHeatingMode, | |
| 110 | zoneAirDistributionEffectivenessinHeatingMode); | ||
| 111 | ✗ | return result; | |
| 112 | } | ||
| 113 | |||
| 114 | ✗ | void DesignSpecificationZoneAirDistribution_Impl::resetZoneAirDistributionEffectivenessinHeatingMode() { | |
| 115 | ✗ | bool result = setString(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessinHeatingMode, ""); | |
| 116 | ✗ | OS_ASSERT(result); | |
| 117 | ✗ | } | |
| 118 | |||
| 119 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::setZoneAirDistributionEffectivenessSchedule(Schedule& schedule) { | |
| 120 | ✗ | bool result = setSchedule(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessSchedule, | |
| 121 | "DesignSpecificationZoneAirDistribution", "Zone Air Distribution Effectiveness Schedule", schedule); | ||
| 122 | ✗ | return result; | |
| 123 | } | ||
| 124 | |||
| 125 | ✗ | void DesignSpecificationZoneAirDistribution_Impl::resetZoneAirDistributionEffectivenessSchedule() { | |
| 126 | ✗ | bool result = setString(OS_DesignSpecification_ZoneAirDistributionFields::ZoneAirDistributionEffectivenessSchedule, ""); | |
| 127 | ✗ | OS_ASSERT(result); | |
| 128 | ✗ | } | |
| 129 | |||
| 130 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::setZoneSecondaryRecirculationFraction(double zoneSecondaryRecirculationFraction) { | |
| 131 | bool result = | ||
| 132 | ✗ | setDouble(OS_DesignSpecification_ZoneAirDistributionFields::ZoneSecondaryRecirculationFraction, zoneSecondaryRecirculationFraction); | |
| 133 | ✗ | return result; | |
| 134 | } | ||
| 135 | |||
| 136 | ✗ | void DesignSpecificationZoneAirDistribution_Impl::resetZoneSecondaryRecirculationFraction() { | |
| 137 | ✗ | bool result = setString(OS_DesignSpecification_ZoneAirDistributionFields::ZoneSecondaryRecirculationFraction, ""); | |
| 138 | ✗ | OS_ASSERT(result); | |
| 139 | ✗ | } | |
| 140 | |||
| 141 | ✗ | boost::optional<ModelObject> DesignSpecificationZoneAirDistribution_Impl::zoneAirDistributionEffectivenessScheduleAsModelObject() const { | |
| 142 | ✗ | OptionalModelObject result; | |
| 143 | ✗ | OptionalSchedule intermediate = zoneAirDistributionEffectivenessSchedule(); | |
| 144 | ✗ | if (intermediate) { | |
| 145 | ✗ | result = *intermediate; | |
| 146 | } | ||
| 147 | ✗ | return result; | |
| 148 | ✗ | } | |
| 149 | |||
| 150 | ✗ | bool DesignSpecificationZoneAirDistribution_Impl::setZoneAirDistributionEffectivenessScheduleAsModelObject( | |
| 151 | const boost::optional<ModelObject>& modelObject) { | ||
| 152 | ✗ | if (modelObject) { | |
| 153 | ✗ | OptionalSchedule intermediate = modelObject->optionalCast<Schedule>(); | |
| 154 | ✗ | if (intermediate) { | |
| 155 | ✗ | Schedule schedule(*intermediate); | |
| 156 | ✗ | return setZoneAirDistributionEffectivenessSchedule(schedule); | |
| 157 | ✗ | } else { | |
| 158 | ✗ | return false; | |
| 159 | } | ||
| 160 | ✗ | } else { | |
| 161 | ✗ | resetZoneAirDistributionEffectivenessSchedule(); | |
| 162 | } | ||
| 163 | ✗ | return true; | |
| 164 | } | ||
| 165 | |||
| 166 | } // namespace detail | ||
| 167 | |||
| 168 | 1 | DesignSpecificationZoneAirDistribution::DesignSpecificationZoneAirDistribution(const Model& model) | |
| 169 | 1 | : ModelObject(DesignSpecificationZoneAirDistribution::iddObjectType(), model) { | |
| 170 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
|
1 | OS_ASSERT(getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()); |
| 171 | 1 | } | |
| 172 | |||
| 173 | 7731 | IddObjectType DesignSpecificationZoneAirDistribution::iddObjectType() { | |
| 174 |
1/1✓ Branch 1 taken 7731 times.
|
7731 | return {IddObjectType::OS_DesignSpecification_ZoneAirDistribution}; |
| 175 | } | ||
| 176 | |||
| 177 | ✗ | double DesignSpecificationZoneAirDistribution::zoneAirDistributionEffectivenessinCoolingMode() const { | |
| 178 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->zoneAirDistributionEffectivenessinCoolingMode(); | |
| 179 | } | ||
| 180 | |||
| 181 | ✗ | bool DesignSpecificationZoneAirDistribution::isZoneAirDistributionEffectivenessinCoolingModeDefaulted() const { | |
| 182 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->isZoneAirDistributionEffectivenessinCoolingModeDefaulted(); | |
| 183 | } | ||
| 184 | |||
| 185 | ✗ | double DesignSpecificationZoneAirDistribution::zoneAirDistributionEffectivenessinHeatingMode() const { | |
| 186 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->zoneAirDistributionEffectivenessinHeatingMode(); | |
| 187 | } | ||
| 188 | |||
| 189 | ✗ | bool DesignSpecificationZoneAirDistribution::isZoneAirDistributionEffectivenessinHeatingModeDefaulted() const { | |
| 190 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->isZoneAirDistributionEffectivenessinHeatingModeDefaulted(); | |
| 191 | } | ||
| 192 | |||
| 193 | ✗ | boost::optional<Schedule> DesignSpecificationZoneAirDistribution::zoneAirDistributionEffectivenessSchedule() const { | |
| 194 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->zoneAirDistributionEffectivenessSchedule(); | |
| 195 | } | ||
| 196 | |||
| 197 | ✗ | double DesignSpecificationZoneAirDistribution::zoneSecondaryRecirculationFraction() const { | |
| 198 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->zoneSecondaryRecirculationFraction(); | |
| 199 | } | ||
| 200 | |||
| 201 | ✗ | bool DesignSpecificationZoneAirDistribution::isZoneSecondaryRecirculationFractionDefaulted() const { | |
| 202 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->isZoneSecondaryRecirculationFractionDefaulted(); | |
| 203 | } | ||
| 204 | |||
| 205 | bool | ||
| 206 | ✗ | DesignSpecificationZoneAirDistribution::setZoneAirDistributionEffectivenessinCoolingMode(double zoneAirDistributionEffectivenessinCoolingMode) { | |
| 207 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->setZoneAirDistributionEffectivenessinCoolingMode( | |
| 208 | ✗ | zoneAirDistributionEffectivenessinCoolingMode); | |
| 209 | } | ||
| 210 | |||
| 211 | ✗ | void DesignSpecificationZoneAirDistribution::resetZoneAirDistributionEffectivenessinCoolingMode() { | |
| 212 | ✗ | getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->resetZoneAirDistributionEffectivenessinCoolingMode(); | |
| 213 | ✗ | } | |
| 214 | |||
| 215 | bool | ||
| 216 | ✗ | DesignSpecificationZoneAirDistribution::setZoneAirDistributionEffectivenessinHeatingMode(double zoneAirDistributionEffectivenessinHeatingMode) { | |
| 217 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->setZoneAirDistributionEffectivenessinHeatingMode( | |
| 218 | ✗ | zoneAirDistributionEffectivenessinHeatingMode); | |
| 219 | } | ||
| 220 | |||
| 221 | ✗ | void DesignSpecificationZoneAirDistribution::resetZoneAirDistributionEffectivenessinHeatingMode() { | |
| 222 | ✗ | getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->resetZoneAirDistributionEffectivenessinHeatingMode(); | |
| 223 | ✗ | } | |
| 224 | |||
| 225 | ✗ | bool DesignSpecificationZoneAirDistribution::setZoneAirDistributionEffectivenessSchedule(Schedule& schedule) { | |
| 226 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->setZoneAirDistributionEffectivenessSchedule(schedule); | |
| 227 | } | ||
| 228 | |||
| 229 | ✗ | void DesignSpecificationZoneAirDistribution::resetZoneAirDistributionEffectivenessSchedule() { | |
| 230 | ✗ | getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->resetZoneAirDistributionEffectivenessSchedule(); | |
| 231 | ✗ | } | |
| 232 | |||
| 233 | ✗ | bool DesignSpecificationZoneAirDistribution::setZoneSecondaryRecirculationFraction(double zoneSecondaryRecirculationFraction) { | |
| 234 | ✗ | return getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->setZoneSecondaryRecirculationFraction(zoneSecondaryRecirculationFraction); | |
| 235 | } | ||
| 236 | |||
| 237 | ✗ | void DesignSpecificationZoneAirDistribution::resetZoneSecondaryRecirculationFraction() { | |
| 238 | ✗ | getImpl<detail::DesignSpecificationZoneAirDistribution_Impl>()->resetZoneSecondaryRecirculationFraction(); | |
| 239 | ✗ | } | |
| 240 | |||
| 241 | /// @cond | ||
| 242 | ✗ | DesignSpecificationZoneAirDistribution::DesignSpecificationZoneAirDistribution( | |
| 243 | ✗ | std::shared_ptr<detail::DesignSpecificationZoneAirDistribution_Impl> impl) | |
| 244 | ✗ | : ModelObject(std::move(impl)) {} | |
| 245 | /// @endcond | ||
| 246 | |||
| 247 | } // namespace model | ||
| 248 | } // namespace openstudio | ||
| 249 |