src/model/ClimateZones.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 "ClimateZones.hpp" | ||
| 7 | #include "ClimateZones_Impl.hpp" | ||
| 8 | #include "Model.hpp" | ||
| 9 | |||
| 10 | #include "Site.hpp" | ||
| 11 | #include "Site_Impl.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/OS_ClimateZones_FieldEnums.hxx> | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | #include "../utilities/core/Assert.hpp" | ||
| 17 | #include "../utilities/core/String.hpp" | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | namespace model { | ||
| 21 | |||
| 22 | namespace detail { | ||
| 23 | |||
| 24 | 41 | ClimateZones_Impl::ClimateZones_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 25 | 41 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 26 |
4/6✓ Branch 1 taken 41 times.
✓ Branch 4 taken 41 times.
✓ Branch 7 taken 41 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 41 times.
✗ Branch 13 not taken.
|
41 | OS_ASSERT(idfObject.iddObject().type() == ClimateZones::iddObjectType()); |
| 27 | 41 | } | |
| 28 | |||
| 29 | 31 | ClimateZones_Impl::ClimateZones_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 30 | 31 | : ModelObject_Impl(other, model, keepHandle) { | |
| 31 |
4/6✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
✓ Branch 7 taken 31 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 31 times.
✗ Branch 13 not taken.
|
31 | OS_ASSERT(other.iddObject().type() == ClimateZones::iddObjectType()); |
| 32 | 31 | } | |
| 33 | |||
| 34 | 47 | ClimateZones_Impl::ClimateZones_Impl(const ClimateZones_Impl& other, Model_Impl* model, bool keepHandle) | |
| 35 | 47 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 36 | |||
| 37 | 1 | boost::optional<Site> ClimateZones_Impl::site() const { | |
| 38 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return model().getOptionalUniqueModelObject<Site>(); |
| 39 | } | ||
| 40 | |||
| 41 | 16 | std::vector<ClimateZone> ClimateZones_Impl::climateZones() const { | |
| 42 |
1/1✓ Branch 1 taken 16 times.
|
16 | IdfExtensibleGroupVector egs = extensibleGroups(); |
| 43 | 16 | ClimateZoneVector result; | |
| 44 |
2/2✓ Branch 4 taken 11 times.
✓ Branch 5 taken 16 times.
|
27 | for (const IdfExtensibleGroup& eg : egs) { |
| 45 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | result.push_back(eg.cast<ClimateZone>()); |
| 46 | } | ||
| 47 | 32 | return result; | |
| 48 | 16 | } | |
| 49 | |||
| 50 | ✗ | ClimateZone ClimateZones_Impl::getClimateZone(unsigned index) const { | |
| 51 | ✗ | IdfExtensibleGroup eg = getExtensibleGroup(index); | |
| 52 | ✗ | if (eg.empty()) { | |
| 53 | ✗ | std::shared_ptr<ClimateZones_Impl> p; | |
| 54 | ✗ | return {p, numFields()}; | |
| 55 | ✗ | } | |
| 56 | ✗ | return eg.cast<ClimateZone>(); | |
| 57 | ✗ | } | |
| 58 | |||
| 59 | ✗ | ClimateZone ClimateZones_Impl::getClimateZone(const std::string& institution, unsigned year) const { | |
| 60 | ✗ | std::shared_ptr<ClimateZones_Impl> p; | |
| 61 | ✗ | ClimateZone result(p, numFields()); | |
| 62 | ✗ | ClimateZoneVector czs = climateZones(); | |
| 63 | ✗ | for (const ClimateZone& cz : czs) { | |
| 64 | ✗ | if (istringEqual(cz.institution(), institution) && (cz.year() == year)) { | |
| 65 | ✗ | result = cz; | |
| 66 | ✗ | break; | |
| 67 | } | ||
| 68 | } | ||
| 69 | ✗ | return result; | |
| 70 | ✗ | } | |
| 71 | |||
| 72 | 3 | std::vector<ClimateZone> ClimateZones_Impl::getClimateZones(const std::string& institution) const { | |
| 73 | 3 | ClimateZoneVector result; | |
| 74 |
1/1✓ Branch 1 taken 3 times.
|
3 | ClimateZoneVector czs = climateZones(); |
| 75 |
1/2✗ Branch 5 not taken.
✓ Branch 6 taken 3 times.
|
3 | for (const ClimateZone& cz : czs) { |
| 76 | ✗ | if (istringEqual(cz.institution(), institution)) { | |
| 77 | ✗ | result.push_back(cz); | |
| 78 | } | ||
| 79 | } | ||
| 80 | 6 | return result; | |
| 81 | 3 | } | |
| 82 | |||
| 83 | 1 | boost::optional<ParentObject> ClimateZones_Impl::parent() const { | |
| 84 | 1 | OptionalParentObject result; | |
| 85 |
1/1✓ Branch 1 taken 1 time.
|
1 | OptionalSite oSite = site(); |
| 86 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (oSite) { |
| 87 | ✗ | result = oSite->optionalCast<ParentObject>(); | |
| 88 | } | ||
| 89 | 2 | return result; | |
| 90 | 1 | } | |
| 91 | |||
| 92 | ✗ | const std::vector<std::string>& ClimateZones_Impl::outputVariableNames() const { | |
| 93 | ✗ | static const std::vector<std::string> result; | |
| 94 | ✗ | return result; | |
| 95 | } | ||
| 96 | |||
| 97 | ✗ | IddObjectType ClimateZones_Impl::iddObjectType() const { | |
| 98 | ✗ | return ClimateZones::iddObjectType(); | |
| 99 | } | ||
| 100 | |||
| 101 | 1 | bool ClimateZones_Impl::clear() { | |
| 102 |
1/1✓ Branch 1 taken 1 time.
|
1 | clearExtensibleGroups(); |
| 103 | 1 | return (numExtensibleGroups() == 0u); | |
| 104 | } | ||
| 105 | |||
| 106 | 3 | ClimateZone ClimateZones_Impl::setClimateZone(const std::string& institution, const std::string& value) { | |
| 107 | 3 | std::shared_ptr<ClimateZones_Impl> p; | |
| 108 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
|
3 | ClimateZone result(p, numFields()); |
| 109 | |||
| 110 |
1/1✓ Branch 1 taken 3 times.
|
3 | ClimateZoneVector candidates = getClimateZones(institution); |
| 111 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (candidates.size() > 1) { |
| 112 | ✗ | LOG(Warn, "Cannot set climate zone value for institutuion '" << institution << "', because there are " << candidates.size() | |
| 113 | << " such listings, not 1."); | ||
| 114 | ✗ | return result; | |
| 115 | } | ||
| 116 |
1/2✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
|
3 | if (candidates.empty()) { |
| 117 |
1/1✓ Branch 1 taken 3 times.
|
3 | return appendClimateZone(institution, value); |
| 118 | } | ||
| 119 | ✗ | bool ok = candidates[0].setValue(value); | |
| 120 | ✗ | if (ok) { | |
| 121 | ✗ | result = candidates[0]; | |
| 122 | } | ||
| 123 | ✗ | return result; | |
| 124 | 3 | } | |
| 125 | |||
| 126 | ✗ | ClimateZone ClimateZones_Impl::setClimateZone(const std::string& institution, unsigned year, const std::string& value) { | |
| 127 | ✗ | std::shared_ptr<ClimateZones_Impl> p; | |
| 128 | ✗ | ClimateZone result(p, numFields()); | |
| 129 | |||
| 130 | ✗ | ClimateZone candidate = getClimateZone(institution, year); | |
| 131 | ✗ | if (candidate.empty()) { | |
| 132 | ✗ | return appendClimateZone(institution, ClimateZones::getDefaultDocumentName(institution), year, value); | |
| 133 | } | ||
| 134 | ✗ | bool ok = candidate.setValue(value); | |
| 135 | ✗ | if (ok) { | |
| 136 | ✗ | result = candidate; | |
| 137 | } | ||
| 138 | ✗ | return result; | |
| 139 | ✗ | } | |
| 140 | |||
| 141 | ✗ | ClimateZone ClimateZones_Impl::appendClimateZone(const std::string& institution) { | |
| 142 | ✗ | return appendClimateZone(institution, ClimateZones::getDefaultDocumentName(institution), ClimateZones::getDefaultYear(institution), ""); | |
| 143 | } | ||
| 144 | |||
| 145 | 6 | ClimateZone ClimateZones_Impl::appendClimateZone(const std::string& institution, const std::string& value) { | |
| 146 |
2/2✓ Branch 2 taken 6 times.
✓ Branch 5 taken 6 times.
|
12 | return appendClimateZone(institution, ClimateZones::getDefaultDocumentName(institution), ClimateZones::getDefaultYear(institution), value); |
| 147 | } | ||
| 148 | |||
| 149 | ✗ | ClimateZone ClimateZones_Impl::appendClimateZone(const std::string& institution, unsigned year, const std::string& value) { | |
| 150 | ✗ | return appendClimateZone(institution, ClimateZones::getDefaultDocumentName(institution), year, value); | |
| 151 | } | ||
| 152 | |||
| 153 | 6 | ClimateZone ClimateZones_Impl::appendClimateZone(const std::string& institution, const std::string documentName, unsigned year, | |
| 154 | const std::string& value) { | ||
| 155 | 6 | StringVector values; | |
| 156 |
1/1✓ Branch 1 taken 6 times.
|
6 | values.push_back(institution); |
| 157 |
1/1✓ Branch 1 taken 6 times.
|
6 | values.push_back(documentName); |
| 158 |
1/1✓ Branch 1 taken 6 times.
|
6 | std::stringstream ss; |
| 159 |
1/1✓ Branch 1 taken 6 times.
|
6 | ss << year; |
| 160 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | values.push_back(ss.str()); |
| 161 |
1/1✓ Branch 1 taken 6 times.
|
6 | values.push_back(value); |
| 162 |
1/1✓ Branch 1 taken 6 times.
|
6 | IdfExtensibleGroup eg = pushExtensibleGroup(values); |
| 163 |
2/3✓ Branch 1 taken 6 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 6 times.
|
6 | if (eg.empty()) { |
| 164 | ✗ | std::shared_ptr<ClimateZones_Impl> p; | |
| 165 | ✗ | return {p, numFields()}; | |
| 166 | ✗ | } | |
| 167 |
1/1✓ Branch 1 taken 6 times.
|
6 | return eg.cast<ClimateZone>(); |
| 168 | 6 | } | |
| 169 | |||
| 170 | ✗ | bool ClimateZones_Impl::setParent(ParentObject& newParent) { | |
| 171 | ✗ | if (newParent.optionalCast<Site>() && (newParent.model() == model())) { | |
| 172 | ✗ | return true; | |
| 173 | } | ||
| 174 | ✗ | return false; | |
| 175 | } | ||
| 176 | |||
| 177 | 11 | unsigned ClimateZones_Impl::numClimateZones() const { | |
| 178 | 11 | return numExtensibleGroups(); | |
| 179 | } | ||
| 180 | |||
| 181 | } // namespace detail | ||
| 182 | |||
| 183 | // ClimateZone | ||
| 184 | |||
| 185 | 6 | std::string ClimateZone::institution() const { | |
| 186 |
2/4✓ Branch 1 taken 6 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 6 times.
✗ Branch 6 not taken.
|
6 | OS_ASSERT(!empty()); |
| 187 | 6 | std::string result; | |
| 188 |
1/1✓ Branch 1 taken 6 times.
|
6 | OptionalString os = getString(OS_ClimateZonesExtensibleFields::ClimateZoneInstitutionName, true); |
| 189 |
1/2✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
|
6 | if (os) { |
| 190 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result = *os; |
| 191 | } | ||
| 192 | 12 | return result; | |
| 193 | 6 | } | |
| 194 | |||
| 195 | 3 | std::string ClimateZone::documentName() const { | |
| 196 |
2/4✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 6 not taken.
|
3 | OS_ASSERT(!empty()); |
| 197 | 3 | std::string result; | |
| 198 |
1/1✓ Branch 1 taken 3 times.
|
3 | OptionalString os = getString(OS_ClimateZonesExtensibleFields::ClimateZoneDocumentName, true); |
| 199 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (os) { |
| 200 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | result = *os; |
| 201 | } | ||
| 202 | 6 | return result; | |
| 203 | 3 | } | |
| 204 | |||
| 205 | 3 | unsigned ClimateZone::year() const { | |
| 206 |
2/4✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 6 not taken.
|
3 | OS_ASSERT(!empty()); |
| 207 |
1/1✓ Branch 1 taken 3 times.
|
3 | OptionalUnsigned ou = getUnsigned(OS_ClimateZonesExtensibleFields::ClimateZoneDocumentYear, true); |
| 208 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!ou) { |
| 209 | ✗ | LOG_AND_THROW("Climate zone year is not yet set for the " << groupIndex() << "th ClimateZone."); | |
| 210 | } | ||
| 211 |
1/1✓ Branch 1 taken 3 times.
|
6 | return *ou; |
| 212 | } | ||
| 213 | |||
| 214 | 6 | std::string ClimateZone::value() const { | |
| 215 |
2/4✓ Branch 1 taken 6 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 6 times.
✗ Branch 6 not taken.
|
6 | OS_ASSERT(!empty()); |
| 216 | 6 | std::string result; | |
| 217 |
1/1✓ Branch 1 taken 6 times.
|
6 | OptionalString os = getString(OS_ClimateZonesExtensibleFields::ClimateZoneValue, true); |
| 218 |
1/2✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
|
6 | if (os) { |
| 219 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result = *os; |
| 220 | } | ||
| 221 | 12 | return result; | |
| 222 | 6 | } | |
| 223 | |||
| 224 | 2 | bool ClimateZone::setValue(const std::string& value) { | |
| 225 | 2 | return setString(OS_ClimateZonesExtensibleFields::ClimateZoneValue, value); | |
| 226 | } | ||
| 227 | |||
| 228 | ✗ | bool ClimateZone::setType(const std::string& institution, const std::string& documentName, unsigned year) { | |
| 229 | ✗ | bool result = setString(OS_ClimateZonesExtensibleFields::ClimateZoneInstitutionName, institution); | |
| 230 | ✗ | result = result && setString(OS_ClimateZonesExtensibleFields::ClimateZoneDocumentName, documentName); | |
| 231 | ✗ | result = result && setUnsigned(OS_ClimateZonesExtensibleFields::ClimateZoneDocumentYear, year); | |
| 232 | |||
| 233 | ✗ | return result; | |
| 234 | } | ||
| 235 | |||
| 236 | ✗ | bool ClimateZone::setTypeAndValue(const std::string& institution, const std::string& documentName, unsigned year, const std::string& value) { | |
| 237 | ✗ | bool result = setType(institution, documentName, year); | |
| 238 | ✗ | result = result && setString(OS_ClimateZonesExtensibleFields::ClimateZoneValue, value); | |
| 239 | |||
| 240 | ✗ | return result; | |
| 241 | } | ||
| 242 | |||
| 243 |
1/1✓ Branch 2 taken 20 times.
|
20 | ClimateZone::ClimateZone(std::shared_ptr<detail::ClimateZones_Impl> impl, unsigned index) : ModelExtensibleGroup(impl, index) {} |
| 244 | |||
| 245 | // ClimateZones | ||
| 246 | |||
| 247 | 21 | std::string ClimateZones::ashraeInstitutionName() { | |
| 248 |
3/4✓ Branch 0 taken 7 times.
✓ Branch 1 taken 14 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
|
21 | static const std::string result("ASHRAE"); |
| 249 | 21 | return result; | |
| 250 | } | ||
| 251 | |||
| 252 | 3 | std::string ClimateZones::ashraeDocumentName() { | |
| 253 |
3/7✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 3 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
|
9 | static const std::string result("ANSI/ASHRAE Standard 169"); |
| 254 | 3 | return result; | |
| 255 | } | ||
| 256 | |||
| 257 | 6 | unsigned ClimateZones::ashraeDefaultYear() { | |
| 258 | static const unsigned result(2006); | ||
| 259 | 6 | return result; | |
| 260 | } | ||
| 261 | |||
| 262 | 19 | std::string ClimateZones::cecInstitutionName() { | |
| 263 |
3/4✓ Branch 0 taken 7 times.
✓ Branch 1 taken 12 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
|
19 | static const std::string result("CEC"); |
| 264 | 19 | return result; | |
| 265 | } | ||
| 266 | |||
| 267 | 4 | std::string ClimateZones::cecDocumentName() { | |
| 268 |
4/7✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 3 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
|
10 | static const std::string result("California Climate Zone Descriptions"); |
| 269 | 4 | return result; | |
| 270 | } | ||
| 271 | |||
| 272 | 5 | unsigned ClimateZones::cecDefaultYear() { | |
| 273 | static const unsigned result(1995); | ||
| 274 | 5 | return result; | |
| 275 | } | ||
| 276 | |||
| 277 | 6 | std::string ClimateZones::getDefaultDocumentName(const std::string& institution) { | |
| 278 | 6 | std::string result; | |
| 279 |
4/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 3 times.
|
6 | if (istringEqual(institution, ClimateZones::ashraeInstitutionName())) { |
| 280 |
1/1✓ Branch 1 taken 3 times.
|
3 | result = ClimateZones::ashraeDocumentName(); |
| 281 | } | ||
| 282 |
4/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 3 times.
|
6 | if (istringEqual(institution, ClimateZones::cecInstitutionName())) { |
| 283 |
1/1✓ Branch 1 taken 3 times.
|
3 | result = ClimateZones::cecDocumentName(); |
| 284 | } | ||
| 285 | 6 | return result; | |
| 286 | ✗ | } | |
| 287 | |||
| 288 | 6 | unsigned ClimateZones::getDefaultYear(const std::string& institution) { | |
| 289 | 6 | unsigned result(0); | |
| 290 |
4/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 3 times.
|
6 | if (istringEqual(institution, ClimateZones::ashraeInstitutionName())) { |
| 291 | 3 | result = ClimateZones::ashraeDefaultYear(); | |
| 292 | } | ||
| 293 |
4/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 3 times.
|
6 | if (istringEqual(institution, ClimateZones::cecInstitutionName())) { |
| 294 | 3 | result = ClimateZones::cecDefaultYear(); | |
| 295 | } | ||
| 296 | 6 | return result; | |
| 297 | } | ||
| 298 | |||
| 299 | 2 | std::vector<std::string> ClimateZones::validClimateZoneValues(const std::string& institution, unsigned year) { | |
| 300 | 2 | StringVector result; | |
| 301 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 1 time.
|
2 | if (istringEqual(institution, ashraeInstitutionName())) { |
| 302 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (year == 2006) { |
| 303 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("1A"); |
| 304 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("1B"); |
| 305 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("2A"); |
| 306 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("2B"); |
| 307 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("3A"); |
| 308 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("3B"); |
| 309 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("3C"); |
| 310 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("4A"); |
| 311 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("4B"); |
| 312 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("4C"); |
| 313 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("5A"); |
| 314 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("5B"); |
| 315 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("5C"); |
| 316 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("6A"); |
| 317 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("6B"); |
| 318 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("7"); |
| 319 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("8"); |
| 320 | } | ||
| 321 | } | ||
| 322 | |||
| 323 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 1 time.
|
2 | if (istringEqual(institution, cecInstitutionName())) { |
| 324 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("1"); |
| 325 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("2"); |
| 326 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("3"); |
| 327 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("4"); |
| 328 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("5"); |
| 329 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("6"); |
| 330 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("7"); |
| 331 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("8"); |
| 332 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("9"); |
| 333 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("10"); |
| 334 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("11"); |
| 335 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("12"); |
| 336 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("13"); |
| 337 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("14"); |
| 338 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("15"); |
| 339 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.push_back("16"); |
| 340 | } | ||
| 341 | |||
| 342 | 2 | return result; | |
| 343 | ✗ | } | |
| 344 | |||
| 345 | 7930 | IddObjectType ClimateZones::iddObjectType() { | |
| 346 |
1/1✓ Branch 1 taken 7930 times.
|
7930 | IddObjectType result(IddObjectType::OS_ClimateZones); |
| 347 | 7930 | return result; | |
| 348 | } | ||
| 349 | |||
| 350 | ✗ | boost::optional<Site> ClimateZones::site() const { | |
| 351 | ✗ | return getImpl<detail::ClimateZones_Impl>()->site(); | |
| 352 | } | ||
| 353 | |||
| 354 | 13 | std::vector<ClimateZone> ClimateZones::climateZones() const { | |
| 355 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::ClimateZones_Impl>()->climateZones(); |
| 356 | } | ||
| 357 | |||
| 358 | ✗ | ClimateZone ClimateZones::getClimateZone(unsigned index) const { | |
| 359 | ✗ | return getImpl<detail::ClimateZones_Impl>()->getClimateZone(index); | |
| 360 | } | ||
| 361 | |||
| 362 | ✗ | ClimateZone ClimateZones::getClimateZone(const std::string& institution, unsigned year) const { | |
| 363 | ✗ | return getImpl<detail::ClimateZones_Impl>()->getClimateZone(institution, year); | |
| 364 | } | ||
| 365 | |||
| 366 | ✗ | std::vector<ClimateZone> ClimateZones::getClimateZones(const std::string& institution) const { | |
| 367 | ✗ | return getImpl<detail::ClimateZones_Impl>()->getClimateZones(institution); | |
| 368 | } | ||
| 369 | |||
| 370 | 1 | bool ClimateZones::clear() { | |
| 371 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::ClimateZones_Impl>()->clear(); |
| 372 | } | ||
| 373 | |||
| 374 | 3 | ClimateZone ClimateZones::setClimateZone(const std::string& institution, const std::string& value) { | |
| 375 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::ClimateZones_Impl>()->setClimateZone(institution, value); |
| 376 | } | ||
| 377 | |||
| 378 | ✗ | ClimateZone ClimateZones::setClimateZone(const std::string& institution, unsigned year, const std::string& value) { | |
| 379 | ✗ | return getImpl<detail::ClimateZones_Impl>()->setClimateZone(institution, year, value); | |
| 380 | } | ||
| 381 | |||
| 382 | ✗ | ClimateZone ClimateZones::appendClimateZone(const std::string& institution) { | |
| 383 | ✗ | return getImpl<detail::ClimateZones_Impl>()->appendClimateZone(institution); | |
| 384 | } | ||
| 385 | |||
| 386 | 3 | ClimateZone ClimateZones::appendClimateZone(const std::string& institution, const std::string& value) { | |
| 387 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::ClimateZones_Impl>()->appendClimateZone(institution, value); |
| 388 | } | ||
| 389 | |||
| 390 | ✗ | ClimateZone ClimateZones::appendClimateZone(const std::string& institution, unsigned year, const std::string& value) { | |
| 391 | ✗ | return getImpl<detail::ClimateZones_Impl>()->appendClimateZone(institution, year, value); | |
| 392 | } | ||
| 393 | |||
| 394 | ✗ | ClimateZone ClimateZones::appendClimateZone(const std::string& institution, const std::string documentName, unsigned year, | |
| 395 | const std::string& value) { | ||
| 396 | ✗ | return getImpl<detail::ClimateZones_Impl>()->appendClimateZone(institution, documentName, year, value); | |
| 397 | } | ||
| 398 | |||
| 399 | 11 | unsigned ClimateZones::numClimateZones() const { | |
| 400 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::ClimateZones_Impl>()->numClimateZones(); |
| 401 | } | ||
| 402 | |||
| 403 | /// @cond | ||
| 404 | 10 | ClimateZones::ClimateZones(Model& model) : ModelObject(ClimateZones::iddObjectType(), model) {} | |
| 405 | |||
| 406 |
1/1✓ Branch 3 taken 45 times.
|
45 | ClimateZones::ClimateZones(std::shared_ptr<detail::ClimateZones_Impl> impl) : ModelObject(std::move(impl)) {} |
| 407 | /// @endcond | ||
| 408 | |||
| 409 | } // namespace model | ||
| 410 | } // namespace openstudio | ||
| 411 |