src/model/StandardsInformationMaterial.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 "StandardsInformationMaterial.hpp" | ||
| 7 | #include "StandardsInformationMaterial_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Model.hpp" | ||
| 10 | #include "Material.hpp" | ||
| 11 | #include "Material_Impl.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/OS_StandardsInformation_Material_FieldEnums.hxx> | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | #include "../utilities/core/Assert.hpp" | ||
| 17 | |||
| 18 | #include <model/embedded_files.hxx> | ||
| 19 | #include "../utilities/filetypes/StandardsJSON.hpp" | ||
| 20 | #include "../utilities/core/Json.hpp" | ||
| 21 | #include <json/json.h> | ||
| 22 | |||
| 23 | namespace openstudio { | ||
| 24 | namespace model { | ||
| 25 | |||
| 26 | namespace detail { | ||
| 27 | |||
| 28 | 461 | StandardsInformationMaterial_Impl::StandardsInformationMaterial_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 29 | 461 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 30 |
4/6✓ Branch 1 taken 461 times.
✓ Branch 4 taken 461 times.
✓ Branch 7 taken 461 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 461 times.
✗ Branch 13 not taken.
|
461 | OS_ASSERT(idfObject.iddObject().type() == StandardsInformationMaterial::iddObjectType()); |
| 31 | 461 | } | |
| 32 | |||
| 33 | 443 | StandardsInformationMaterial_Impl::StandardsInformationMaterial_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 34 | 443 | bool keepHandle) | |
| 35 | 443 | : ModelObject_Impl(other, model, keepHandle) { | |
| 36 |
4/6✓ Branch 1 taken 443 times.
✓ Branch 4 taken 443 times.
✓ Branch 7 taken 443 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 443 times.
✗ Branch 13 not taken.
|
443 | OS_ASSERT(other.iddObject().type() == StandardsInformationMaterial::iddObjectType()); |
| 37 | 443 | } | |
| 38 | |||
| 39 | 6 | StandardsInformationMaterial_Impl::StandardsInformationMaterial_Impl(const StandardsInformationMaterial_Impl& other, Model_Impl* model, | |
| 40 | 6 | bool keepHandle) | |
| 41 | 6 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 42 | |||
| 43 | 3 | boost::optional<ParentObject> StandardsInformationMaterial_Impl::parent() const { | |
| 44 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | return material(); |
| 45 | } | ||
| 46 | |||
| 47 | 2 | bool StandardsInformationMaterial_Impl::setParent(ParentObject& newParent) { | |
| 48 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return setPointer(OS_StandardsInformation_MaterialFields::MaterialName, newParent.handle()); |
| 49 | } | ||
| 50 | |||
| 51 | ✗ | const std::vector<std::string>& StandardsInformationMaterial_Impl::outputVariableNames() const { | |
| 52 | ✗ | static const std::vector<std::string> result; | |
| 53 | ✗ | return result; | |
| 54 | } | ||
| 55 | |||
| 56 | 14 | IddObjectType StandardsInformationMaterial_Impl::iddObjectType() const { | |
| 57 | 14 | return StandardsInformationMaterial::iddObjectType(); | |
| 58 | } | ||
| 59 | |||
| 60 | 3 | Material StandardsInformationMaterial_Impl::material() const { | |
| 61 | boost::optional<Material> result = | ||
| 62 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | getObject<StandardsInformationMaterial>().getModelObjectTarget<Material>(OS_StandardsInformation_MaterialFields::MaterialName); |
| 63 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(result); |
| 64 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | return result.get(); |
| 65 | 3 | } | |
| 66 | |||
| 67 | 30 | boost::optional<std::string> StandardsInformationMaterial_Impl::materialStandard() const { | |
| 68 | 30 | return getString(OS_StandardsInformation_MaterialFields::MaterialStandard, true, true); | |
| 69 | } | ||
| 70 | |||
| 71 | 21 | const Json::Value& StandardsInformationMaterial_Impl::getStandardsJSON() { | |
| 72 |
4/7✓ Branch 0 taken 2 times.
✓ Branch 1 taken 19 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
|
21 | const static Json::Value standards_json = parseStandardsJSON(); |
| 73 | 21 | return standards_json; | |
| 74 | } | ||
| 75 | |||
| 76 | 2 | Json::Value StandardsInformationMaterial_Impl::parseStandardsJSON() { | |
| 77 | // Embedded file path | ||
| 78 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string embedded_path = ":/Resources/standards/OpenStudio_Standards_materials_merged.json"; |
| 79 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string fileContent = ::openstudiomodel::embedded_files::getFileAsString(embedded_path); |
| 80 | |||
| 81 | // Create a StandardsJSON | ||
| 82 |
1/1✓ Branch 1 taken 2 times.
|
2 | StandardsJSON standard(fileContent); |
| 83 | |||
| 84 | // Now try to get the primaryKey | ||
| 85 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string primaryKey = "materials"; |
| 86 | |||
| 87 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<Json::Value> _standardsArr = standard.getPrimaryKey(primaryKey)) { |
| 88 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return _standardsArr.get(); |
| 89 | } else { | ||
| 90 | // This should never happen really, until we implement the ability to supply a custom StandardsJSON | ||
| 91 | ✗ | LOG(Error, "Cannot find the primaryKey '" << primaryKey << "' in the StandardsJSON"); | |
| 92 | ✗ | return {}; | |
| 93 | 2 | } | |
| 94 | 2 | } | |
| 95 | |||
| 96 | 3 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedMaterialStandards() const { | |
| 97 | 3 | std::vector<std::string> result; | |
| 98 | |||
| 99 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 100 | |||
| 101 | // an array of hashes (no nested levels) | ||
| 102 |
8/8✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 4059 times.
✓ Branch 13 taken 4059 times.
✓ Branch 16 taken 4062 times.
✓ Branch 18 taken 4059 times.
✓ Branch 19 taken 3 times.
|
4062 | for (const auto& v : getStandardsJSON()) { |
| 103 |
2/2✓ Branch 1 taken 4059 times.
✓ Branch 4 taken 4059 times.
|
4059 | const Json::Value _material = v["material_standard"]; |
| 104 |
3/3✓ Branch 1 taken 4059 times.
✓ Branch 3 taken 2703 times.
✓ Branch 4 taken 1356 times.
|
4059 | if (_material.isString()) { |
| 105 |
2/2✓ Branch 1 taken 2703 times.
✓ Branch 4 taken 2703 times.
|
2703 | result.push_back(_material.asString()); |
| 106 | } | ||
| 107 | 4059 | } | |
| 108 | |||
| 109 | // include values from model | ||
| 110 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 12 taken 3 times.
✓ Branch 13 taken 3 times.
|
6 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 111 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
|
3 | if (other.handle() == this->handle()) { |
| 112 | 3 | continue; | |
| 113 | } | ||
| 114 | |||
| 115 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 116 | ✗ | if (otherMaterialStandard) { | |
| 117 | ✗ | result.push_back(*otherMaterialStandard); | |
| 118 | } | ||
| 119 | 3 | } | |
| 120 | |||
| 121 | // remove current | ||
| 122 |
1/1✓ Branch 1 taken 3 times.
|
3 | IstringFind finder; |
| 123 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (materialStandard) { |
| 124 | ✗ | finder.addTarget(*materialStandard); | |
| 125 | |||
| 126 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 127 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 128 | } | ||
| 129 | |||
| 130 | // sort | ||
| 131 |
1/1✓ Branch 3 taken 3 times.
|
3 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 132 | |||
| 133 | // make unique | ||
| 134 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 135 |
1/1✓ Branch 3 taken 3 times.
|
3 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 136 |
1/1✓ Branch 2 taken 3 times.
|
6 | result.resize(std::distance(result.begin(), it)); |
| 137 | |||
| 138 | // add current to front | ||
| 139 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (materialStandard) { |
| 140 | ✗ | result.insert(result.begin(), *materialStandard); | |
| 141 | } | ||
| 142 | |||
| 143 | 6 | return result; | |
| 144 | 3 | } | |
| 145 | |||
| 146 | 2 | boost::optional<std::string> StandardsInformationMaterial_Impl::materialStandardSource() const { | |
| 147 | 2 | return getString(OS_StandardsInformation_MaterialFields::MaterialStandardSource, true, true); | |
| 148 | } | ||
| 149 | |||
| 150 | 1 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedMaterialStandardSources() const { | |
| 151 | 1 | std::vector<std::string> result; | |
| 152 | |||
| 153 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 154 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<std::string> materialStandardSource = this->materialStandardSource(); |
| 155 | |||
| 156 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | if (!materialStandard) { |
| 157 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (materialStandardSource) { |
| 158 | ✗ | result.push_back(*materialStandardSource); | |
| 159 | } | ||
| 160 | 1 | return result; | |
| 161 | } | ||
| 162 | |||
| 163 | ✗ | std::string thisMaterialStandard; | |
| 164 | |||
| 165 | ✗ | for (const auto& v : getStandardsJSON()) { | |
| 166 | // If materialStandard is initialized, then we have to match against it | ||
| 167 | ✗ | if (materialStandard.is_initialized()) { | |
| 168 | // It's fine to call asString directly here because it'll return an empty string | ||
| 169 | // if it's null, and therefore won't match against our material standard anyways | ||
| 170 | ✗ | thisMaterialStandard = v["material_standard"].asString(); | |
| 171 | ✗ | if (thisMaterialStandard != materialStandard.get()) { | |
| 172 | ✗ | continue; | |
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 176 | ✗ | const Json::Value _tmp = v["material_standard_source"]; | |
| 177 | ✗ | if (_tmp.isString()) { | |
| 178 | ✗ | result.push_back(_tmp.asString()); | |
| 179 | } | ||
| 180 | ✗ | } | |
| 181 | |||
| 182 | // include values from model | ||
| 183 | ✗ | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { | |
| 184 | ✗ | if (other.handle() == this->handle()) { | |
| 185 | ✗ | continue; | |
| 186 | } | ||
| 187 | |||
| 188 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 189 | |||
| 190 | ✗ | if (!otherMaterialStandard) { | |
| 191 | ✗ | continue; | |
| 192 | ✗ | } else if (*materialStandard != *otherMaterialStandard) { | |
| 193 | ✗ | continue; | |
| 194 | } | ||
| 195 | |||
| 196 | ✗ | boost::optional<std::string> otherMaterialStandardSource = other.materialStandardSource(); | |
| 197 | ✗ | if (otherMaterialStandardSource) { | |
| 198 | ✗ | result.push_back(*otherMaterialStandardSource); | |
| 199 | } | ||
| 200 | ✗ | } | |
| 201 | |||
| 202 | // remove current | ||
| 203 | ✗ | IstringFind finder; | |
| 204 | ✗ | if (materialStandardSource) { | |
| 205 | ✗ | finder.addTarget(*materialStandardSource); | |
| 206 | |||
| 207 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 208 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 209 | } | ||
| 210 | |||
| 211 | // sort | ||
| 212 | ✗ | std::sort(result.begin(), result.end(), IstringCompare()); | |
| 213 | |||
| 214 | // make unique | ||
| 215 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 216 | ✗ | auto it = std::unique(result.begin(), result.end(), IstringEqual()); | |
| 217 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 218 | |||
| 219 | // add current to front | ||
| 220 | ✗ | if (materialStandardSource) { | |
| 221 | ✗ | result.insert(result.begin(), *materialStandardSource); | |
| 222 | } | ||
| 223 | |||
| 224 | ✗ | return result; | |
| 225 | 1 | } | |
| 226 | |||
| 227 | 37 | boost::optional<std::string> StandardsInformationMaterial_Impl::standardsCategory() const { | |
| 228 | 37 | return getString(OS_StandardsInformation_MaterialFields::StandardsCategory, true, true); | |
| 229 | } | ||
| 230 | |||
| 231 | 2 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedStandardsCategories() const { | |
| 232 | 2 | std::vector<std::string> result; | |
| 233 | |||
| 234 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 235 | |||
| 236 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 237 | |||
| 238 | 2 | std::string thisMaterialStandard; | |
| 239 | |||
| 240 |
8/8✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2706 times.
✓ Branch 13 taken 2706 times.
✓ Branch 16 taken 2708 times.
✓ Branch 18 taken 2706 times.
✓ Branch 19 taken 2 times.
|
2708 | for (const auto& v : getStandardsJSON()) { |
| 241 | // If materialStandard is initialized, then we have to match against it | ||
| 242 |
1/2✓ Branch 1 taken 2706 times.
✗ Branch 2 not taken.
|
2706 | if (materialStandard.is_initialized()) { |
| 243 | // It's fine to call asString directly here because it'll return an empty string | ||
| 244 | // if it's null, and therefore won't match against our material standard anyways | ||
| 245 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 2706 times.
|
2706 | thisMaterialStandard = v["material_standard"].asString(); |
| 246 |
3/3✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 904 times.
✓ Branch 5 taken 1802 times.
|
2706 | if (thisMaterialStandard != materialStandard.get()) { |
| 247 | 904 | continue; | |
| 248 | } | ||
| 249 | } | ||
| 250 | |||
| 251 |
2/2✓ Branch 1 taken 1802 times.
✓ Branch 4 taken 1802 times.
|
1802 | const Json::Value _tmp = v["code_category"]; |
| 252 |
2/3✓ Branch 1 taken 1802 times.
✓ Branch 3 taken 1802 times.
✗ Branch 4 not taken.
|
1802 | if (_tmp.isString()) { |
| 253 |
2/2✓ Branch 1 taken 1802 times.
✓ Branch 4 taken 1802 times.
|
1802 | result.push_back(_tmp.asString()); |
| 254 | } | ||
| 255 | 1802 | } | |
| 256 | |||
| 257 | // include values from model | ||
| 258 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 12 taken 2 times.
✓ Branch 13 taken 2 times.
|
4 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 259 |
4/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
|
2 | if (other.handle() == this->handle()) { |
| 260 | 2 | continue; | |
| 261 | } | ||
| 262 | |||
| 263 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 264 | ✗ | if (materialStandard && otherMaterialStandard) { | |
| 265 | ✗ | if (*materialStandard != otherMaterialStandard) { | |
| 266 | ✗ | continue; | |
| 267 | } | ||
| 268 | ✗ | } else if (materialStandard || otherMaterialStandard) { | |
| 269 | ✗ | continue; | |
| 270 | } | ||
| 271 | |||
| 272 | ✗ | boost::optional<std::string> otherStandardsCategory = other.standardsCategory(); | |
| 273 | ✗ | if (otherStandardsCategory) { | |
| 274 | ✗ | result.push_back(*otherStandardsCategory); | |
| 275 | } | ||
| 276 | 2 | } | |
| 277 | |||
| 278 | // remove current | ||
| 279 |
1/1✓ Branch 1 taken 2 times.
|
2 | IstringFind finder; |
| 280 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (standardsCategory) { |
| 281 | ✗ | finder.addTarget(*standardsCategory); | |
| 282 | |||
| 283 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 284 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 285 | } | ||
| 286 | |||
| 287 | // sort | ||
| 288 |
1/1✓ Branch 3 taken 2 times.
|
2 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 289 | |||
| 290 | // make unique | ||
| 291 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 292 |
1/1✓ Branch 3 taken 2 times.
|
2 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 293 |
1/1✓ Branch 2 taken 2 times.
|
4 | result.resize(std::distance(result.begin(), it)); |
| 294 | |||
| 295 | // add current to front | ||
| 296 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (standardsCategory) { |
| 297 | ✗ | result.insert(result.begin(), *standardsCategory); | |
| 298 | } | ||
| 299 | |||
| 300 | 4 | return result; | |
| 301 | 2 | } | |
| 302 | |||
| 303 | 1 | bool StandardsInformationMaterial_Impl::isCompositeMaterial() const { | |
| 304 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 305 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (standardsCategory) { |
| 306 |
9/22✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 time.
✗ Branch 16 not taken.
✓ Branch 17 taken 1 time.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 time.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 time.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
|
7 | if (istringEqual("Composite", *standardsCategory) || istringEqual("Metal Framed Wall", *standardsCategory) |
| 307 |
12/26✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 9 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 time.
✓ Branch 15 taken 1 time.
✓ Branch 18 taken 1 time.
✓ Branch 20 taken 1 time.
✗ Branch 21 not taken.
✓ Branch 23 taken 1 time.
✗ Branch 24 not taken.
✓ Branch 25 taken 1 time.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 time.
✗ Branch 29 not taken.
✓ Branch 30 taken 1 time.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
|
6 | || istringEqual("Metal Framed Floor", *standardsCategory) || istringEqual("Metal Building Roof", *standardsCategory) |
| 308 |
12/26✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 9 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 time.
✓ Branch 15 taken 1 time.
✓ Branch 18 taken 1 time.
✓ Branch 20 taken 1 time.
✗ Branch 21 not taken.
✓ Branch 23 taken 1 time.
✗ Branch 24 not taken.
✓ Branch 25 taken 1 time.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 time.
✗ Branch 29 not taken.
✓ Branch 30 taken 1 time.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
|
6 | || istringEqual("Wood Framed Wall", *standardsCategory) || istringEqual("Wood Framed Floor", *standardsCategory) |
| 309 |
16/32✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
✓ Branch 15 taken 1 time.
✓ Branch 17 taken 1 time.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
✓ Branch 26 taken 1 time.
✗ Branch 28 not taken.
✓ Branch 29 taken 1 time.
✓ Branch 30 taken 1 time.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 time.
✗ Branch 34 not taken.
✓ Branch 35 taken 1 time.
✗ Branch 36 not taken.
✓ Branch 38 taken 1 time.
✗ Branch 39 not taken.
✓ Branch 40 taken 1 time.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
|
7 | || istringEqual("Wood Framed Attic Floor", *standardsCategory) || istringEqual("Wood Framed Rafter Roof", *standardsCategory)) { |
| 310 | ✗ | return true; | |
| 311 | } | ||
| 312 | } | ||
| 313 | |||
| 314 | 1 | return false; | |
| 315 | 1 | } | |
| 316 | |||
| 317 | 17 | boost::optional<std::string> StandardsInformationMaterial_Impl::standardsIdentifier() const { | |
| 318 | 17 | return getString(OS_StandardsInformation_MaterialFields::StandardsIdentifier, true, true); | |
| 319 | } | ||
| 320 | |||
| 321 | 2 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedStandardsIdentifiers() const { | |
| 322 | 2 | std::vector<std::string> result; | |
| 323 | |||
| 324 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 325 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 326 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> standardsIdentifier = this->standardsIdentifier(); |
| 327 | |||
| 328 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
|
2 | if (!standardsCategory) { |
| 329 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (standardsIdentifier) { |
| 330 | ✗ | result.push_back(*standardsIdentifier); | |
| 331 | } | ||
| 332 | 1 | return result; | |
| 333 | } | ||
| 334 | |||
| 335 | 1 | std::string thisMaterialStandard; | |
| 336 | 1 | std::string thisStandardsCategory; | |
| 337 | |||
| 338 |
8/8✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1353 times.
✓ Branch 13 taken 1353 times.
✓ Branch 16 taken 1354 times.
✓ Branch 18 taken 1353 times.
✓ Branch 19 taken 1 time.
|
1354 | for (const auto& v : getStandardsJSON()) { |
| 339 | // If materialStandard is initialized, then we have to match against it | ||
| 340 |
1/2✓ Branch 1 taken 1353 times.
✗ Branch 2 not taken.
|
1353 | if (materialStandard.is_initialized()) { |
| 341 |
2/2✓ Branch 1 taken 1353 times.
✓ Branch 4 taken 1353 times.
|
1353 | thisMaterialStandard = v["material_standard"].asString(); |
| 342 |
3/3✓ Branch 1 taken 1353 times.
✓ Branch 4 taken 452 times.
✓ Branch 5 taken 901 times.
|
1353 | if (thisMaterialStandard != materialStandard.get()) { |
| 343 | 1317 | continue; | |
| 344 | } | ||
| 345 | } | ||
| 346 | |||
| 347 | // If standardsCategory is initialized, then we have to match against it | ||
| 348 |
1/2✓ Branch 1 taken 901 times.
✗ Branch 2 not taken.
|
901 | if (standardsCategory.is_initialized()) { |
| 349 |
2/2✓ Branch 1 taken 901 times.
✓ Branch 4 taken 901 times.
|
901 | thisStandardsCategory = v["code_category"].asString(); |
| 350 |
3/3✓ Branch 1 taken 901 times.
✓ Branch 4 taken 865 times.
✓ Branch 5 taken 36 times.
|
901 | if (thisStandardsCategory != standardsCategory.get()) { |
| 351 | 865 | continue; | |
| 352 | } | ||
| 353 | } | ||
| 354 | |||
| 355 |
2/2✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
|
36 | const Json::Value _tmp = v["code_identifier"]; |
| 356 |
2/3✓ Branch 1 taken 36 times.
✓ Branch 3 taken 36 times.
✗ Branch 4 not taken.
|
36 | if (_tmp.isString()) { |
| 357 |
2/2✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
|
36 | result.push_back(_tmp.asString()); |
| 358 | } | ||
| 359 | 36 | } | |
| 360 | |||
| 361 | // include values from model | ||
| 362 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 12 taken 1 time.
✓ Branch 13 taken 1 time.
|
2 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 363 |
4/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 9 taken 1 time.
✗ Branch 10 not taken.
|
1 | if (other.handle() == this->handle()) { |
| 364 | 1 | continue; | |
| 365 | } | ||
| 366 | |||
| 367 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 368 | ✗ | if (materialStandard && otherMaterialStandard) { | |
| 369 | ✗ | if (*materialStandard != otherMaterialStandard) { | |
| 370 | ✗ | continue; | |
| 371 | } | ||
| 372 | ✗ | } else if (materialStandard || otherMaterialStandard) { | |
| 373 | ✗ | continue; | |
| 374 | } | ||
| 375 | |||
| 376 | ✗ | boost::optional<std::string> otherStandardsCategory = other.standardsCategory(); | |
| 377 | ✗ | if (!otherStandardsCategory) { | |
| 378 | ✗ | continue; | |
| 379 | ✗ | } else if (*standardsCategory != *otherStandardsCategory) { | |
| 380 | ✗ | continue; | |
| 381 | } | ||
| 382 | |||
| 383 | ✗ | boost::optional<std::string> otherStandardsIdentifier = other.standardsIdentifier(); | |
| 384 | ✗ | if (otherStandardsIdentifier) { | |
| 385 | ✗ | result.push_back(*otherStandardsIdentifier); | |
| 386 | } | ||
| 387 | 1 | } | |
| 388 | |||
| 389 | // remove current | ||
| 390 |
1/1✓ Branch 1 taken 1 time.
|
1 | IstringFind finder; |
| 391 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (standardsIdentifier) { |
| 392 | ✗ | finder.addTarget(*standardsIdentifier); | |
| 393 | |||
| 394 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 395 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 396 | } | ||
| 397 | |||
| 398 | // sort | ||
| 399 |
1/1✓ Branch 3 taken 1 time.
|
1 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 400 | |||
| 401 | // make unique | ||
| 402 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 403 |
1/1✓ Branch 3 taken 1 time.
|
1 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 404 |
1/1✓ Branch 2 taken 1 time.
|
2 | result.resize(std::distance(result.begin(), it)); |
| 405 | |||
| 406 | // add current to front | ||
| 407 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (standardsIdentifier) { |
| 408 | ✗ | result.insert(result.begin(), *standardsIdentifier); | |
| 409 | } | ||
| 410 | |||
| 411 | 1 | return result; | |
| 412 | 2 | } | |
| 413 | |||
| 414 | 17 | boost::optional<std::string> StandardsInformationMaterial_Impl::compositeFramingMaterial() const { | |
| 415 | 17 | return getString(OS_StandardsInformation_MaterialFields::CompositeFramingMaterial, true, true); | |
| 416 | } | ||
| 417 | |||
| 418 | 3 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedCompositeFramingMaterials() const { | |
| 419 | 3 | std::vector<std::string> result; | |
| 420 | |||
| 421 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 422 | |||
| 423 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 424 | |||
| 425 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> compositeFramingMaterial = this->compositeFramingMaterial(); |
| 426 | |||
| 427 | 3 | std::string thisMaterialStandard; | |
| 428 | 3 | std::string thisStandardsCategory; | |
| 429 | |||
| 430 |
8/8✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 4059 times.
✓ Branch 13 taken 4059 times.
✓ Branch 16 taken 4062 times.
✓ Branch 18 taken 4059 times.
✓ Branch 19 taken 3 times.
|
4062 | for (const auto& v : getStandardsJSON()) { |
| 431 | // If materialStandard is initialized, then we have to match against it | ||
| 432 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 2 taken 1353 times.
|
4059 | if (materialStandard.is_initialized()) { |
| 433 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 2706 times.
|
2706 | thisMaterialStandard = v["material_standard"].asString(); |
| 434 |
3/3✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 1805 times.
✓ Branch 5 taken 901 times.
|
2706 | if (thisMaterialStandard != materialStandard.get()) { |
| 435 | 1805 | continue; | |
| 436 | } | ||
| 437 | } | ||
| 438 | |||
| 439 | // If standardsCategory is initialized, then we have to match against it | ||
| 440 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2254 times.
|
2254 | if (standardsCategory.is_initialized()) { |
| 441 | ✗ | thisStandardsCategory = v["code_category"].asString(); | |
| 442 | ✗ | if (thisStandardsCategory != standardsCategory.get()) { | |
| 443 | ✗ | continue; | |
| 444 | } | ||
| 445 | } | ||
| 446 | |||
| 447 |
2/2✓ Branch 1 taken 2254 times.
✓ Branch 4 taken 2254 times.
|
2254 | const Json::Value _tmp = v["framing_material"]; |
| 448 |
3/3✓ Branch 1 taken 2254 times.
✓ Branch 3 taken 582 times.
✓ Branch 4 taken 1672 times.
|
2254 | if (_tmp.isString()) { |
| 449 |
2/2✓ Branch 1 taken 582 times.
✓ Branch 4 taken 582 times.
|
582 | result.push_back(_tmp.asString()); |
| 450 | } | ||
| 451 | 2254 | } | |
| 452 | |||
| 453 | // include values from model | ||
| 454 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 12 taken 3 times.
✓ Branch 13 taken 3 times.
|
6 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 455 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
|
3 | if (other.handle() == this->handle()) { |
| 456 | 3 | continue; | |
| 457 | } | ||
| 458 | |||
| 459 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 460 | ✗ | if (materialStandard && otherMaterialStandard) { | |
| 461 | ✗ | if (*materialStandard != otherMaterialStandard) { | |
| 462 | ✗ | continue; | |
| 463 | } | ||
| 464 | ✗ | } else if (materialStandard || otherMaterialStandard) { | |
| 465 | ✗ | continue; | |
| 466 | } | ||
| 467 | |||
| 468 | ✗ | boost::optional<std::string> otherStandardsCategory = other.standardsCategory(); | |
| 469 | ✗ | if (standardsCategory && otherStandardsCategory) { | |
| 470 | ✗ | if (*standardsCategory != otherStandardsCategory) { | |
| 471 | ✗ | continue; | |
| 472 | } | ||
| 473 | ✗ | } else if (standardsCategory || otherStandardsCategory) { | |
| 474 | ✗ | continue; | |
| 475 | } | ||
| 476 | |||
| 477 | ✗ | boost::optional<std::string> otherCompositeFramingMaterial = other.compositeFramingMaterial(); | |
| 478 | ✗ | if (otherCompositeFramingMaterial) { | |
| 479 | ✗ | result.push_back(*otherCompositeFramingMaterial); | |
| 480 | } | ||
| 481 | 3 | } | |
| 482 | |||
| 483 | // remove current | ||
| 484 |
1/1✓ Branch 1 taken 3 times.
|
3 | IstringFind finder; |
| 485 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingMaterial) { |
| 486 | ✗ | finder.addTarget(*compositeFramingMaterial); | |
| 487 | |||
| 488 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 489 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 490 | } | ||
| 491 | |||
| 492 | // sort | ||
| 493 |
1/1✓ Branch 3 taken 3 times.
|
3 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 494 | |||
| 495 | // make unique | ||
| 496 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 497 |
1/1✓ Branch 3 taken 3 times.
|
3 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 498 |
1/1✓ Branch 2 taken 3 times.
|
6 | result.resize(std::distance(result.begin(), it)); |
| 499 | |||
| 500 | // add current to front | ||
| 501 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingMaterial) { |
| 502 | ✗ | result.insert(result.begin(), *compositeFramingMaterial); | |
| 503 | } | ||
| 504 | |||
| 505 | 6 | return result; | |
| 506 | 3 | } | |
| 507 | |||
| 508 | 17 | boost::optional<std::string> StandardsInformationMaterial_Impl::compositeFramingConfiguration() const { | |
| 509 | 17 | return getString(OS_StandardsInformation_MaterialFields::CompositeFramingConfiguration, true, true); | |
| 510 | } | ||
| 511 | |||
| 512 | 3 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedCompositeFramingConfigurations() const { | |
| 513 | 3 | std::vector<std::string> result; | |
| 514 | |||
| 515 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 516 | |||
| 517 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 518 | |||
| 519 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> compositeFramingConfiguration = this->compositeFramingConfiguration(); |
| 520 | |||
| 521 | 3 | std::string thisMaterialStandard; | |
| 522 | 3 | std::string thisStandardsCategory; | |
| 523 | |||
| 524 |
8/8✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 4059 times.
✓ Branch 13 taken 4059 times.
✓ Branch 16 taken 4062 times.
✓ Branch 18 taken 4059 times.
✓ Branch 19 taken 3 times.
|
4062 | for (const auto& v : getStandardsJSON()) { |
| 525 | // If materialStandard is initialized, then we have to match against it | ||
| 526 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 2 taken 1353 times.
|
4059 | if (materialStandard.is_initialized()) { |
| 527 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 2706 times.
|
2706 | thisMaterialStandard = v["material_standard"].asString(); |
| 528 |
3/3✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 1805 times.
✓ Branch 5 taken 901 times.
|
2706 | if (thisMaterialStandard != materialStandard.get()) { |
| 529 | 1805 | continue; | |
| 530 | } | ||
| 531 | } | ||
| 532 | |||
| 533 | // If standardsCategory is initialized, then we have to match against it | ||
| 534 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2254 times.
|
2254 | if (standardsCategory.is_initialized()) { |
| 535 | ✗ | thisStandardsCategory = v["code_category"].asString(); | |
| 536 | ✗ | if (thisStandardsCategory != standardsCategory.get()) { | |
| 537 | ✗ | continue; | |
| 538 | } | ||
| 539 | } | ||
| 540 | |||
| 541 |
2/2✓ Branch 1 taken 2254 times.
✓ Branch 4 taken 2254 times.
|
2254 | const Json::Value _tmp = v["framing_configuration"]; |
| 542 |
3/3✓ Branch 1 taken 2254 times.
✓ Branch 3 taken 582 times.
✓ Branch 4 taken 1672 times.
|
2254 | if (_tmp.isString()) { |
| 543 |
2/2✓ Branch 1 taken 582 times.
✓ Branch 4 taken 582 times.
|
582 | result.push_back(_tmp.asString()); |
| 544 | } | ||
| 545 | 2254 | } | |
| 546 | |||
| 547 | // include values from model | ||
| 548 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 12 taken 3 times.
✓ Branch 13 taken 3 times.
|
6 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 549 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
|
3 | if (other.handle() == this->handle()) { |
| 550 | 3 | continue; | |
| 551 | } | ||
| 552 | |||
| 553 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 554 | ✗ | if (materialStandard && otherMaterialStandard) { | |
| 555 | ✗ | if (*materialStandard != otherMaterialStandard) { | |
| 556 | ✗ | continue; | |
| 557 | } | ||
| 558 | ✗ | } else if (materialStandard || otherMaterialStandard) { | |
| 559 | ✗ | continue; | |
| 560 | } | ||
| 561 | |||
| 562 | ✗ | boost::optional<std::string> otherStandardsCategory = other.standardsCategory(); | |
| 563 | ✗ | if (standardsCategory && otherStandardsCategory) { | |
| 564 | ✗ | if (*standardsCategory != otherStandardsCategory) { | |
| 565 | ✗ | continue; | |
| 566 | } | ||
| 567 | ✗ | } else if (standardsCategory || otherStandardsCategory) { | |
| 568 | ✗ | continue; | |
| 569 | } | ||
| 570 | |||
| 571 | ✗ | boost::optional<std::string> otherCompositeFramingConfiguration = other.compositeFramingConfiguration(); | |
| 572 | ✗ | if (otherCompositeFramingConfiguration) { | |
| 573 | ✗ | result.push_back(*otherCompositeFramingConfiguration); | |
| 574 | } | ||
| 575 | 3 | } | |
| 576 | |||
| 577 | // remove current | ||
| 578 |
1/1✓ Branch 1 taken 3 times.
|
3 | IstringFind finder; |
| 579 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingConfiguration) { |
| 580 | ✗ | finder.addTarget(*compositeFramingConfiguration); | |
| 581 | |||
| 582 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 583 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 584 | } | ||
| 585 | |||
| 586 | // sort | ||
| 587 |
1/1✓ Branch 3 taken 3 times.
|
3 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 588 | |||
| 589 | // make unique | ||
| 590 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 591 |
1/1✓ Branch 3 taken 3 times.
|
3 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 592 |
1/1✓ Branch 2 taken 3 times.
|
6 | result.resize(std::distance(result.begin(), it)); |
| 593 | |||
| 594 | // add current to front | ||
| 595 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingConfiguration) { |
| 596 | ✗ | result.insert(result.begin(), *compositeFramingConfiguration); | |
| 597 | } | ||
| 598 | |||
| 599 | 6 | return result; | |
| 600 | 3 | } | |
| 601 | |||
| 602 | 17 | boost::optional<std::string> StandardsInformationMaterial_Impl::compositeFramingDepth() const { | |
| 603 | 17 | return getString(OS_StandardsInformation_MaterialFields::CompositeFramingDepth, true, true); | |
| 604 | } | ||
| 605 | |||
| 606 | 3 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedCompositeFramingDepths() const { | |
| 607 | 3 | std::vector<std::string> result; | |
| 608 | |||
| 609 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 610 | |||
| 611 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 612 | |||
| 613 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> compositeFramingDepth = this->compositeFramingDepth(); |
| 614 | |||
| 615 | 3 | std::string thisMaterialStandard; | |
| 616 | 3 | std::string thisStandardsCategory; | |
| 617 | |||
| 618 |
8/8✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 4059 times.
✓ Branch 13 taken 4059 times.
✓ Branch 16 taken 4062 times.
✓ Branch 18 taken 4059 times.
✓ Branch 19 taken 3 times.
|
4062 | for (const auto& v : getStandardsJSON()) { |
| 619 | // If materialStandard is initialized, then we have to match against it | ||
| 620 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 2 taken 1353 times.
|
4059 | if (materialStandard.is_initialized()) { |
| 621 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 2706 times.
|
2706 | thisMaterialStandard = v["material_standard"].asString(); |
| 622 |
3/3✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 1805 times.
✓ Branch 5 taken 901 times.
|
2706 | if (thisMaterialStandard != materialStandard.get()) { |
| 623 | 1805 | continue; | |
| 624 | } | ||
| 625 | } | ||
| 626 | |||
| 627 | // If standardsCategory is initialized, then we have to match against it | ||
| 628 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2254 times.
|
2254 | if (standardsCategory.is_initialized()) { |
| 629 | ✗ | thisStandardsCategory = v["code_category"].asString(); | |
| 630 | ✗ | if (thisStandardsCategory != standardsCategory.get()) { | |
| 631 | ✗ | continue; | |
| 632 | } | ||
| 633 | } | ||
| 634 | |||
| 635 |
2/2✓ Branch 1 taken 2254 times.
✓ Branch 4 taken 2254 times.
|
2254 | const Json::Value _tmp = v["framing_depth"]; |
| 636 |
3/3✓ Branch 1 taken 2254 times.
✓ Branch 3 taken 582 times.
✓ Branch 4 taken 1672 times.
|
2254 | if (_tmp.isString()) { |
| 637 |
2/2✓ Branch 1 taken 582 times.
✓ Branch 4 taken 582 times.
|
582 | result.push_back(_tmp.asString()); |
| 638 | } | ||
| 639 | 2254 | } | |
| 640 | |||
| 641 | // include values from model | ||
| 642 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 12 taken 3 times.
✓ Branch 13 taken 3 times.
|
6 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 643 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
|
3 | if (other.handle() == this->handle()) { |
| 644 | 3 | continue; | |
| 645 | } | ||
| 646 | |||
| 647 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 648 | ✗ | if (materialStandard && otherMaterialStandard) { | |
| 649 | ✗ | if (*materialStandard != otherMaterialStandard) { | |
| 650 | ✗ | continue; | |
| 651 | } | ||
| 652 | ✗ | } else if (materialStandard || otherMaterialStandard) { | |
| 653 | ✗ | continue; | |
| 654 | } | ||
| 655 | |||
| 656 | ✗ | boost::optional<std::string> otherStandardsCategory = other.standardsCategory(); | |
| 657 | ✗ | if (standardsCategory && otherStandardsCategory) { | |
| 658 | ✗ | if (*standardsCategory != otherStandardsCategory) { | |
| 659 | ✗ | continue; | |
| 660 | } | ||
| 661 | ✗ | } else if (standardsCategory || otherStandardsCategory) { | |
| 662 | ✗ | continue; | |
| 663 | } | ||
| 664 | |||
| 665 | ✗ | boost::optional<std::string> otherCompositeFramingDepth = other.compositeFramingDepth(); | |
| 666 | ✗ | if (otherCompositeFramingDepth) { | |
| 667 | ✗ | result.push_back(*otherCompositeFramingDepth); | |
| 668 | } | ||
| 669 | 3 | } | |
| 670 | |||
| 671 | // remove current | ||
| 672 |
1/1✓ Branch 1 taken 3 times.
|
3 | IstringFind finder; |
| 673 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingDepth) { |
| 674 | ✗ | finder.addTarget(*compositeFramingDepth); | |
| 675 | |||
| 676 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 677 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 678 | } | ||
| 679 | |||
| 680 | // sort | ||
| 681 |
1/1✓ Branch 3 taken 3 times.
|
3 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 682 | |||
| 683 | // make unique | ||
| 684 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 685 |
1/1✓ Branch 3 taken 3 times.
|
3 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 686 |
1/1✓ Branch 2 taken 3 times.
|
6 | result.resize(std::distance(result.begin(), it)); |
| 687 | |||
| 688 | // add current to front | ||
| 689 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingDepth) { |
| 690 | ✗ | result.insert(result.begin(), *compositeFramingDepth); | |
| 691 | } | ||
| 692 | |||
| 693 | 6 | return result; | |
| 694 | 3 | } | |
| 695 | |||
| 696 | 17 | boost::optional<std::string> StandardsInformationMaterial_Impl::compositeFramingSize() const { | |
| 697 | 17 | return getString(OS_StandardsInformation_MaterialFields::CompositeFramingSize, true, true); | |
| 698 | } | ||
| 699 | |||
| 700 | 3 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedCompositeFramingSizes() const { | |
| 701 | 3 | std::vector<std::string> result; | |
| 702 | |||
| 703 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 704 | |||
| 705 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 706 | |||
| 707 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> compositeFramingSize = this->compositeFramingSize(); |
| 708 | |||
| 709 | 3 | std::string thisMaterialStandard; | |
| 710 | 3 | std::string thisStandardsCategory; | |
| 711 | |||
| 712 |
8/8✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 4059 times.
✓ Branch 13 taken 4059 times.
✓ Branch 16 taken 4062 times.
✓ Branch 18 taken 4059 times.
✓ Branch 19 taken 3 times.
|
4062 | for (const auto& v : getStandardsJSON()) { |
| 713 | // If materialStandard is initialized, then we have to match against it | ||
| 714 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 2 taken 1353 times.
|
4059 | if (materialStandard.is_initialized()) { |
| 715 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 2706 times.
|
2706 | thisMaterialStandard = v["material_standard"].asString(); |
| 716 |
3/3✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 1805 times.
✓ Branch 5 taken 901 times.
|
2706 | if (thisMaterialStandard != materialStandard.get()) { |
| 717 | 1805 | continue; | |
| 718 | } | ||
| 719 | } | ||
| 720 | |||
| 721 | // If standardsCategory is initialized, then we have to match against it | ||
| 722 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2254 times.
|
2254 | if (standardsCategory.is_initialized()) { |
| 723 | ✗ | thisStandardsCategory = v["code_category"].asString(); | |
| 724 | ✗ | if (thisStandardsCategory != standardsCategory.get()) { | |
| 725 | ✗ | continue; | |
| 726 | } | ||
| 727 | } | ||
| 728 | |||
| 729 |
2/2✓ Branch 1 taken 2254 times.
✓ Branch 4 taken 2254 times.
|
2254 | const Json::Value _tmp = v["framing_size"]; |
| 730 |
3/3✓ Branch 1 taken 2254 times.
✓ Branch 3 taken 582 times.
✓ Branch 4 taken 1672 times.
|
2254 | if (_tmp.isString()) { |
| 731 |
2/2✓ Branch 1 taken 582 times.
✓ Branch 4 taken 582 times.
|
582 | result.push_back(_tmp.asString()); |
| 732 | } | ||
| 733 | 2254 | } | |
| 734 | |||
| 735 | // include values from model | ||
| 736 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 12 taken 3 times.
✓ Branch 13 taken 3 times.
|
6 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 737 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
|
3 | if (other.handle() == this->handle()) { |
| 738 | 3 | continue; | |
| 739 | } | ||
| 740 | |||
| 741 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 742 | ✗ | if (materialStandard && otherMaterialStandard) { | |
| 743 | ✗ | if (*materialStandard != otherMaterialStandard) { | |
| 744 | ✗ | continue; | |
| 745 | } | ||
| 746 | ✗ | } else if (materialStandard || otherMaterialStandard) { | |
| 747 | ✗ | continue; | |
| 748 | } | ||
| 749 | |||
| 750 | ✗ | boost::optional<std::string> otherStandardsCategory = other.standardsCategory(); | |
| 751 | ✗ | if (standardsCategory && otherStandardsCategory) { | |
| 752 | ✗ | if (*standardsCategory != otherStandardsCategory) { | |
| 753 | ✗ | continue; | |
| 754 | } | ||
| 755 | ✗ | } else if (standardsCategory || otherStandardsCategory) { | |
| 756 | ✗ | continue; | |
| 757 | } | ||
| 758 | |||
| 759 | ✗ | boost::optional<std::string> otherCompositeFramingSize = other.compositeFramingSize(); | |
| 760 | ✗ | if (otherCompositeFramingSize) { | |
| 761 | ✗ | result.push_back(*otherCompositeFramingSize); | |
| 762 | } | ||
| 763 | 3 | } | |
| 764 | |||
| 765 | // remove current | ||
| 766 |
1/1✓ Branch 1 taken 3 times.
|
3 | IstringFind finder; |
| 767 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingSize) { |
| 768 | ✗ | finder.addTarget(*compositeFramingSize); | |
| 769 | |||
| 770 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 771 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 772 | } | ||
| 773 | |||
| 774 | // sort | ||
| 775 |
1/1✓ Branch 3 taken 3 times.
|
3 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 776 | |||
| 777 | // make unique | ||
| 778 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 779 |
1/1✓ Branch 3 taken 3 times.
|
3 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 780 |
1/1✓ Branch 2 taken 3 times.
|
6 | result.resize(std::distance(result.begin(), it)); |
| 781 | |||
| 782 | // add current to front | ||
| 783 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeFramingSize) { |
| 784 | ✗ | result.insert(result.begin(), *compositeFramingSize); | |
| 785 | } | ||
| 786 | |||
| 787 | 6 | return result; | |
| 788 | 3 | } | |
| 789 | |||
| 790 | 17 | boost::optional<std::string> StandardsInformationMaterial_Impl::compositeCavityInsulation() const { | |
| 791 | 17 | return getString(OS_StandardsInformation_MaterialFields::CompositeCavityInsulation, true, true); | |
| 792 | } | ||
| 793 | |||
| 794 | 3 | std::vector<std::string> StandardsInformationMaterial_Impl::suggestedCompositeCavityInsulations() const { | |
| 795 | 3 | std::vector<std::string> result; | |
| 796 | |||
| 797 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> materialStandard = this->materialStandard(); |
| 798 | |||
| 799 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> standardsCategory = this->standardsCategory(); |
| 800 | |||
| 801 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> compositeCavityInsulation = this->compositeCavityInsulation(); |
| 802 | |||
| 803 | 3 | std::string thisMaterialStandard; | |
| 804 | 3 | std::string thisStandardsCategory; | |
| 805 | |||
| 806 |
8/8✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 4059 times.
✓ Branch 13 taken 4059 times.
✓ Branch 16 taken 4062 times.
✓ Branch 18 taken 4059 times.
✓ Branch 19 taken 3 times.
|
4062 | for (const auto& v : getStandardsJSON()) { |
| 807 | // If materialStandard is initialized, then we have to match against it | ||
| 808 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 2 taken 1353 times.
|
4059 | if (materialStandard.is_initialized()) { |
| 809 |
2/2✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 2706 times.
|
2706 | thisMaterialStandard = v["material_standard"].asString(); |
| 810 |
3/3✓ Branch 1 taken 2706 times.
✓ Branch 4 taken 1805 times.
✓ Branch 5 taken 901 times.
|
2706 | if (thisMaterialStandard != materialStandard.get()) { |
| 811 | 1805 | continue; | |
| 812 | } | ||
| 813 | } | ||
| 814 | |||
| 815 | // If standardsCategory is initialized, then we have to match against it | ||
| 816 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2254 times.
|
2254 | if (standardsCategory.is_initialized()) { |
| 817 | ✗ | thisStandardsCategory = v["code_category"].asString(); | |
| 818 | ✗ | if (thisStandardsCategory != standardsCategory.get()) { | |
| 819 | ✗ | continue; | |
| 820 | } | ||
| 821 | } | ||
| 822 | |||
| 823 |
2/2✓ Branch 1 taken 2254 times.
✓ Branch 4 taken 2254 times.
|
2254 | const Json::Value _tmp = v["cavity_insulation"]; |
| 824 | // Note JM 2018-11-07: cavity_insulation is stored in the JSON as a number (a double), and not a string | ||
| 825 | // Json::Value.asString() will not work, so we get it as Double, then convert to a string | ||
| 826 |
3/3✓ Branch 1 taken 2254 times.
✓ Branch 3 taken 582 times.
✓ Branch 4 taken 1672 times.
|
2254 | if (_tmp.isDouble()) { |
| 827 |
3/3✓ Branch 1 taken 582 times.
✓ Branch 4 taken 582 times.
✓ Branch 7 taken 582 times.
|
582 | result.push_back(std::to_string(_tmp.asDouble())); |
| 828 | } | ||
| 829 | 2254 | } | |
| 830 | |||
| 831 | // include values from model | ||
| 832 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 12 taken 3 times.
✓ Branch 13 taken 3 times.
|
6 | for (const StandardsInformationMaterial& other : this->model().getConcreteModelObjects<StandardsInformationMaterial>()) { |
| 833 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
|
3 | if (other.handle() == this->handle()) { |
| 834 | 3 | continue; | |
| 835 | } | ||
| 836 | |||
| 837 | ✗ | boost::optional<std::string> otherMaterialStandard = other.materialStandard(); | |
| 838 | ✗ | if (materialStandard && otherMaterialStandard) { | |
| 839 | ✗ | if (*materialStandard != otherMaterialStandard) { | |
| 840 | ✗ | continue; | |
| 841 | } | ||
| 842 | ✗ | } else if (materialStandard || otherMaterialStandard) { | |
| 843 | ✗ | continue; | |
| 844 | } | ||
| 845 | |||
| 846 | ✗ | boost::optional<std::string> otherStandardsCategory = other.standardsCategory(); | |
| 847 | ✗ | if (standardsCategory && otherStandardsCategory) { | |
| 848 | ✗ | if (*standardsCategory != otherStandardsCategory) { | |
| 849 | ✗ | continue; | |
| 850 | } | ||
| 851 | ✗ | } else if (standardsCategory || otherStandardsCategory) { | |
| 852 | ✗ | continue; | |
| 853 | } | ||
| 854 | |||
| 855 | ✗ | boost::optional<std::string> otherCompositeCavityInsulation = other.compositeCavityInsulation(); | |
| 856 | ✗ | if (otherCompositeCavityInsulation) { | |
| 857 | ✗ | result.push_back(*otherCompositeCavityInsulation); | |
| 858 | } | ||
| 859 | 3 | } | |
| 860 | |||
| 861 | // remove current | ||
| 862 |
1/1✓ Branch 1 taken 3 times.
|
3 | IstringFind finder; |
| 863 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeCavityInsulation) { |
| 864 | ✗ | finder.addTarget(*compositeCavityInsulation); | |
| 865 | |||
| 866 | ✗ | auto it = std::remove_if(result.begin(), result.end(), finder); | |
| 867 | ✗ | result.resize(std::distance(result.begin(), it)); | |
| 868 | } | ||
| 869 | |||
| 870 | // sort | ||
| 871 |
1/1✓ Branch 3 taken 3 times.
|
3 | std::sort(result.begin(), result.end(), IstringCompare()); |
| 872 | |||
| 873 | // make unique | ||
| 874 | // DLM: have to sort before calling unique, unique only works on consecutive elements | ||
| 875 |
1/1✓ Branch 3 taken 3 times.
|
3 | auto it = std::unique(result.begin(), result.end(), IstringEqual()); |
| 876 |
1/1✓ Branch 2 taken 3 times.
|
6 | result.resize(std::distance(result.begin(), it)); |
| 877 | |||
| 878 | // add current to front | ||
| 879 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (compositeCavityInsulation) { |
| 880 | ✗ | result.insert(result.begin(), *compositeCavityInsulation); | |
| 881 | } | ||
| 882 | |||
| 883 | 6 | return result; | |
| 884 | 3 | } | |
| 885 | |||
| 886 | 3 | bool StandardsInformationMaterial_Impl::setMaterialStandard(const std::string& materialStandard) { | |
| 887 | 3 | bool result = setString(OS_StandardsInformation_MaterialFields::MaterialStandard, materialStandard); | |
| 888 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | OS_ASSERT(result); |
| 889 | 3 | return result; | |
| 890 | } | ||
| 891 | |||
| 892 | ✗ | void StandardsInformationMaterial_Impl::resetMaterialStandard() { | |
| 893 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::MaterialStandard, ""); | |
| 894 | ✗ | OS_ASSERT(result); | |
| 895 | ✗ | } | |
| 896 | |||
| 897 | ✗ | bool StandardsInformationMaterial_Impl::setMaterialStandardSource(const std::string& materialStandardSource) { | |
| 898 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::MaterialStandardSource, materialStandardSource); | |
| 899 | ✗ | OS_ASSERT(result); | |
| 900 | ✗ | return result; | |
| 901 | } | ||
| 902 | |||
| 903 | ✗ | void StandardsInformationMaterial_Impl::resetMaterialStandardSource() { | |
| 904 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::MaterialStandardSource, ""); | |
| 905 | ✗ | OS_ASSERT(result); | |
| 906 | ✗ | } | |
| 907 | |||
| 908 | 1 | bool StandardsInformationMaterial_Impl::setStandardsCategory(const std::string& standardsCategory) { | |
| 909 | 1 | bool result = setString(OS_StandardsInformation_MaterialFields::StandardsCategory, standardsCategory); | |
| 910 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 911 | |||
| 912 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | if (!isCompositeMaterial()) { |
| 913 | 1 | resetCompositeFramingMaterial(); | |
| 914 | 1 | resetCompositeFramingConfiguration(); | |
| 915 | 1 | resetCompositeFramingDepth(); | |
| 916 | 1 | resetCompositeFramingSize(); | |
| 917 | 1 | resetCompositeCavityInsulation(); | |
| 918 | } | ||
| 919 | 1 | return result; | |
| 920 | } | ||
| 921 | |||
| 922 | ✗ | void StandardsInformationMaterial_Impl::resetStandardsCategory() { | |
| 923 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::StandardsCategory, ""); | |
| 924 | ✗ | OS_ASSERT(result); | |
| 925 | ✗ | } | |
| 926 | |||
| 927 | ✗ | bool StandardsInformationMaterial_Impl::setStandardsIdentifier(const std::string& standardsIdentifier) { | |
| 928 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::StandardsIdentifier, standardsIdentifier); | |
| 929 | ✗ | OS_ASSERT(result); | |
| 930 | ✗ | return result; | |
| 931 | } | ||
| 932 | |||
| 933 | ✗ | void StandardsInformationMaterial_Impl::resetStandardsIdentifier() { | |
| 934 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::StandardsIdentifier, ""); | |
| 935 | ✗ | OS_ASSERT(result); | |
| 936 | ✗ | } | |
| 937 | |||
| 938 | ✗ | bool StandardsInformationMaterial_Impl::setCompositeFramingMaterial(const std::string& compositeFramingMaterial) { | |
| 939 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingMaterial, compositeFramingMaterial); | |
| 940 | ✗ | OS_ASSERT(result); | |
| 941 | ✗ | return result; | |
| 942 | } | ||
| 943 | |||
| 944 | 1 | void StandardsInformationMaterial_Impl::resetCompositeFramingMaterial() { | |
| 945 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingMaterial, ""); |
| 946 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 947 | 1 | } | |
| 948 | |||
| 949 | ✗ | bool StandardsInformationMaterial_Impl::setCompositeFramingConfiguration(const std::string& compositeFramingConfiguration) { | |
| 950 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingConfiguration, compositeFramingConfiguration); | |
| 951 | ✗ | OS_ASSERT(result); | |
| 952 | ✗ | return result; | |
| 953 | } | ||
| 954 | |||
| 955 | 1 | void StandardsInformationMaterial_Impl::resetCompositeFramingConfiguration() { | |
| 956 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingConfiguration, ""); |
| 957 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 958 | 1 | } | |
| 959 | |||
| 960 | ✗ | bool StandardsInformationMaterial_Impl::setCompositeFramingDepth(const std::string& compositeFramingDepth) { | |
| 961 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingDepth, compositeFramingDepth); | |
| 962 | ✗ | OS_ASSERT(result); | |
| 963 | ✗ | return result; | |
| 964 | } | ||
| 965 | |||
| 966 | 1 | void StandardsInformationMaterial_Impl::resetCompositeFramingDepth() { | |
| 967 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingDepth, ""); |
| 968 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 969 | 1 | } | |
| 970 | |||
| 971 | ✗ | bool StandardsInformationMaterial_Impl::setCompositeFramingSize(const std::string& compositeFramingSize) { | |
| 972 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingSize, compositeFramingSize); | |
| 973 | ✗ | OS_ASSERT(result); | |
| 974 | ✗ | return result; | |
| 975 | } | ||
| 976 | |||
| 977 | 1 | void StandardsInformationMaterial_Impl::resetCompositeFramingSize() { | |
| 978 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeFramingSize, ""); |
| 979 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 980 | 1 | } | |
| 981 | |||
| 982 | ✗ | bool StandardsInformationMaterial_Impl::setCompositeCavityInsulation(const std::string& compositeFramingInsulation) { | |
| 983 | ✗ | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeCavityInsulation, compositeFramingInsulation); | |
| 984 | ✗ | OS_ASSERT(result); | |
| 985 | ✗ | return result; | |
| 986 | } | ||
| 987 | |||
| 988 | 1 | void StandardsInformationMaterial_Impl::resetCompositeCavityInsulation() { | |
| 989 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_StandardsInformation_MaterialFields::CompositeCavityInsulation, ""); |
| 990 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 991 | 1 | } | |
| 992 | |||
| 993 | } // namespace detail | ||
| 994 | |||
| 995 | 18 | StandardsInformationMaterial::StandardsInformationMaterial(const Material& material) | |
| 996 |
3/3✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
✓ Branch 7 taken 18 times.
|
18 | : ModelObject(StandardsInformationMaterial::iddObjectType(), material.model()) { |
| 997 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 18 times.
✗ Branch 5 not taken.
|
18 | OS_ASSERT(getImpl<detail::StandardsInformationMaterial_Impl>()); |
| 998 |
2/2✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
|
18 | bool ok = setPointer(OS_StandardsInformation_MaterialFields::MaterialName, material.handle()); |
| 999 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 18 times.
✗ Branch 3 not taken.
|
18 | OS_ASSERT(ok); |
| 1000 | 18 | } | |
| 1001 | |||
| 1002 | 8698 | IddObjectType StandardsInformationMaterial::iddObjectType() { | |
| 1003 |
1/1✓ Branch 1 taken 8698 times.
|
8698 | return {IddObjectType::OS_StandardsInformation_Material}; |
| 1004 | } | ||
| 1005 | |||
| 1006 | ✗ | Material StandardsInformationMaterial::material() const { | |
| 1007 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->material(); | |
| 1008 | } | ||
| 1009 | |||
| 1010 | 7 | boost::optional<std::string> StandardsInformationMaterial::materialStandard() const { | |
| 1011 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::StandardsInformationMaterial_Impl>()->materialStandard(); |
| 1012 | } | ||
| 1013 | |||
| 1014 | 3 | std::vector<std::string> StandardsInformationMaterial::suggestedMaterialStandards() const { | |
| 1015 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedMaterialStandards(); |
| 1016 | } | ||
| 1017 | |||
| 1018 | 1 | boost::optional<std::string> StandardsInformationMaterial::materialStandardSource() const { | |
| 1019 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::StandardsInformationMaterial_Impl>()->materialStandardSource(); |
| 1020 | } | ||
| 1021 | |||
| 1022 | 1 | std::vector<std::string> StandardsInformationMaterial::suggestedMaterialStandardSources() const { | |
| 1023 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedMaterialStandardSources(); |
| 1024 | } | ||
| 1025 | |||
| 1026 | 17 | boost::optional<std::string> StandardsInformationMaterial::standardsCategory() const { | |
| 1027 |
1/1✓ Branch 3 taken 17 times.
|
17 | return getImpl<detail::StandardsInformationMaterial_Impl>()->standardsCategory(); |
| 1028 | } | ||
| 1029 | |||
| 1030 | 2 | std::vector<std::string> StandardsInformationMaterial::suggestedStandardsCategories() const { | |
| 1031 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedStandardsCategories(); |
| 1032 | } | ||
| 1033 | |||
| 1034 | ✗ | bool StandardsInformationMaterial::isCompositeMaterial() const { | |
| 1035 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->isCompositeMaterial(); | |
| 1036 | } | ||
| 1037 | |||
| 1038 | 15 | boost::optional<std::string> StandardsInformationMaterial::standardsIdentifier() const { | |
| 1039 |
1/1✓ Branch 3 taken 15 times.
|
15 | return getImpl<detail::StandardsInformationMaterial_Impl>()->standardsIdentifier(); |
| 1040 | } | ||
| 1041 | |||
| 1042 | 2 | std::vector<std::string> StandardsInformationMaterial::suggestedStandardsIdentifiers() const { | |
| 1043 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedStandardsIdentifiers(); |
| 1044 | } | ||
| 1045 | |||
| 1046 | 14 | boost::optional<std::string> StandardsInformationMaterial::compositeFramingMaterial() const { | |
| 1047 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::StandardsInformationMaterial_Impl>()->compositeFramingMaterial(); |
| 1048 | } | ||
| 1049 | |||
| 1050 | 3 | std::vector<std::string> StandardsInformationMaterial::suggestedCompositeFramingMaterials() const { | |
| 1051 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedCompositeFramingMaterials(); |
| 1052 | } | ||
| 1053 | |||
| 1054 | 14 | boost::optional<std::string> StandardsInformationMaterial::compositeFramingConfiguration() const { | |
| 1055 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::StandardsInformationMaterial_Impl>()->compositeFramingConfiguration(); |
| 1056 | } | ||
| 1057 | |||
| 1058 | 3 | std::vector<std::string> StandardsInformationMaterial::suggestedCompositeFramingConfigurations() const { | |
| 1059 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedCompositeFramingConfigurations(); |
| 1060 | } | ||
| 1061 | |||
| 1062 | 14 | boost::optional<std::string> StandardsInformationMaterial::compositeFramingDepth() const { | |
| 1063 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::StandardsInformationMaterial_Impl>()->compositeFramingDepth(); |
| 1064 | } | ||
| 1065 | |||
| 1066 | 3 | std::vector<std::string> StandardsInformationMaterial::suggestedCompositeFramingDepths() const { | |
| 1067 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedCompositeFramingDepths(); |
| 1068 | } | ||
| 1069 | |||
| 1070 | 14 | boost::optional<std::string> StandardsInformationMaterial::compositeFramingSize() const { | |
| 1071 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::StandardsInformationMaterial_Impl>()->compositeFramingSize(); |
| 1072 | } | ||
| 1073 | |||
| 1074 | 3 | std::vector<std::string> StandardsInformationMaterial::suggestedCompositeFramingSizes() const { | |
| 1075 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedCompositeFramingSizes(); |
| 1076 | } | ||
| 1077 | |||
| 1078 | 14 | boost::optional<std::string> StandardsInformationMaterial::compositeCavityInsulation() const { | |
| 1079 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::StandardsInformationMaterial_Impl>()->compositeCavityInsulation(); |
| 1080 | } | ||
| 1081 | |||
| 1082 | 3 | std::vector<std::string> StandardsInformationMaterial::suggestedCompositeCavityInsulations() const { | |
| 1083 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::StandardsInformationMaterial_Impl>()->suggestedCompositeCavityInsulations(); |
| 1084 | } | ||
| 1085 | |||
| 1086 | 3 | bool StandardsInformationMaterial::setMaterialStandard(const std::string& materialStandard) { | |
| 1087 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::StandardsInformationMaterial_Impl>()->setMaterialStandard(materialStandard); |
| 1088 | } | ||
| 1089 | |||
| 1090 | ✗ | void StandardsInformationMaterial::resetMaterialStandard() { | |
| 1091 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetMaterialStandard(); | |
| 1092 | ✗ | } | |
| 1093 | |||
| 1094 | ✗ | bool StandardsInformationMaterial::setMaterialStandardSource(const std::string& materialStandardSource) { | |
| 1095 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->setMaterialStandardSource(materialStandardSource); | |
| 1096 | } | ||
| 1097 | |||
| 1098 | ✗ | void StandardsInformationMaterial::resetMaterialStandardSource() { | |
| 1099 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetMaterialStandardSource(); | |
| 1100 | ✗ | } | |
| 1101 | |||
| 1102 | 1 | bool StandardsInformationMaterial::setStandardsCategory(const std::string& standardsCategory) { | |
| 1103 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::StandardsInformationMaterial_Impl>()->setStandardsCategory(standardsCategory); |
| 1104 | } | ||
| 1105 | |||
| 1106 | ✗ | void StandardsInformationMaterial::resetStandardsCategory() { | |
| 1107 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetStandardsCategory(); | |
| 1108 | ✗ | } | |
| 1109 | |||
| 1110 | ✗ | bool StandardsInformationMaterial::setStandardsIdentifier(const std::string& standardsIdentifier) { | |
| 1111 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->setStandardsIdentifier(standardsIdentifier); | |
| 1112 | } | ||
| 1113 | |||
| 1114 | ✗ | void StandardsInformationMaterial::resetStandardsIdentifier() { | |
| 1115 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetStandardsIdentifier(); | |
| 1116 | ✗ | } | |
| 1117 | |||
| 1118 | ✗ | bool StandardsInformationMaterial::setCompositeFramingMaterial(const std::string& compositeFramingMaterial) { | |
| 1119 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->setCompositeFramingMaterial(compositeFramingMaterial); | |
| 1120 | } | ||
| 1121 | |||
| 1122 | ✗ | void StandardsInformationMaterial::resetCompositeFramingMaterial() { | |
| 1123 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetCompositeFramingMaterial(); | |
| 1124 | ✗ | } | |
| 1125 | |||
| 1126 | ✗ | bool StandardsInformationMaterial::setCompositeFramingConfiguration(const std::string& compositeFramingConfiguration) { | |
| 1127 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->setCompositeFramingConfiguration(compositeFramingConfiguration); | |
| 1128 | } | ||
| 1129 | |||
| 1130 | ✗ | void StandardsInformationMaterial::resetCompositeFramingConfiguration() { | |
| 1131 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetCompositeFramingConfiguration(); | |
| 1132 | ✗ | } | |
| 1133 | |||
| 1134 | ✗ | bool StandardsInformationMaterial::setCompositeFramingDepth(const std::string& compositeFramingDepth) { | |
| 1135 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->setCompositeFramingDepth(compositeFramingDepth); | |
| 1136 | } | ||
| 1137 | |||
| 1138 | ✗ | void StandardsInformationMaterial::resetCompositeFramingDepth() { | |
| 1139 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetCompositeFramingDepth(); | |
| 1140 | ✗ | } | |
| 1141 | |||
| 1142 | ✗ | bool StandardsInformationMaterial::setCompositeFramingSize(const std::string& compositeFramingSize) { | |
| 1143 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->setCompositeFramingSize(compositeFramingSize); | |
| 1144 | } | ||
| 1145 | |||
| 1146 | ✗ | void StandardsInformationMaterial::resetCompositeFramingSize() { | |
| 1147 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetCompositeFramingSize(); | |
| 1148 | ✗ | } | |
| 1149 | |||
| 1150 | ✗ | bool StandardsInformationMaterial::setCompositeCavityInsulation(const std::string& compositeCavityInsulation) { | |
| 1151 | ✗ | return getImpl<detail::StandardsInformationMaterial_Impl>()->setCompositeCavityInsulation(compositeCavityInsulation); | |
| 1152 | } | ||
| 1153 | |||
| 1154 | ✗ | void StandardsInformationMaterial::resetCompositeCavityInsulation() { | |
| 1155 | ✗ | getImpl<detail::StandardsInformationMaterial_Impl>()->resetCompositeCavityInsulation(); | |
| 1156 | ✗ | } | |
| 1157 | |||
| 1158 | /// @cond | ||
| 1159 | 36 | StandardsInformationMaterial::StandardsInformationMaterial(std::shared_ptr<detail::StandardsInformationMaterial_Impl> impl) | |
| 1160 |
1/1✓ Branch 3 taken 36 times.
|
36 | : ModelObject(std::move(impl)) {} |
| 1161 | /// @endcond | ||
| 1162 | |||
| 1163 | } // namespace model | ||
| 1164 | } // namespace openstudio | ||
| 1165 |