GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 16 / 0 / 16
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 20 / 0 / 20

src/energyplus/ForwardTranslator/ForwardTranslateConstruction.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 "../ForwardTranslator.hpp"
7
8 #include "../../model/Model.hpp"
9 #include "../../model/Construction.hpp"
10 #include "../../model/Construction_Impl.hpp"
11 #include "../../model/Material.hpp"
12 #include "../../model/Material_Impl.hpp"
13 #include "../../model/LifeCycleCost.hpp"
14 #include "../../model/ShadingControl.hpp"
15
16 #include <utilities/idd/Construction_FieldEnums.hxx>
17 #include "../../utilities/idd/IddEnums.hpp"
18 #include <utilities/idd/IddEnums.hxx>
19 #include <utilities/idd/IddFactory.hxx>
20
21 using namespace openstudio::model;
22
23 using namespace std;
24
25 namespace openstudio {
26
27 namespace energyplus {
28
29 530 boost::optional<IdfObject> ForwardTranslator::translateConstruction(Construction& modelObject) {
30
2/2
✓ Branch 1 taken 530 times.
✓ Branch 4 taken 530 times.
530 IdfObject construction(openstudio::IddObjectType::Construction);
31
1/1
✓ Branch 1 taken 530 times.
530 m_idfObjects.push_back(construction);
32
33
4/4
✓ Branch 1 taken 530 times.
✓ Branch 7 taken 4 times.
✓ Branch 11 taken 4 times.
✓ Branch 12 taken 530 times.
534 for (LifeCycleCost lifeCycleCost : modelObject.lifeCycleCosts()) {
34
1/1
✓ Branch 1 taken 4 times.
4 translateAndMapModelObject(lifeCycleCost);
35 534 }
36
37
3/3
✓ Branch 1 taken 530 times.
✓ Branch 4 taken 530 times.
✓ Branch 7 taken 530 times.
530 construction.setName(modelObject.name().get());
38
39
1/1
✓ Branch 1 taken 530 times.
530 MaterialVector layers = modelObject.layers();
40
41 530 unsigned fieldIndex = 1;
42
2/2
✓ Branch 1 taken 1105 times.
✓ Branch 2 taken 530 times.
1635 for (unsigned layerIndex = 0; layerIndex < layers.size(); ++layerIndex) {
43
1/1
✓ Branch 2 taken 1105 times.
1105 Material material = layers[layerIndex];
44
1/1
✓ Branch 1 taken 1105 times.
1105 translateAndMapModelObject(material);
45
3/3
✓ Branch 1 taken 1105 times.
✓ Branch 4 taken 1105 times.
✓ Branch 7 taken 1105 times.
1105 construction.setString(fieldIndex++, material.name().get());
46 1105 }
47
48
1/1
✓ Branch 1 taken 530 times.
1060 return boost::optional<IdfObject>(construction);
49 530 }
50
51 } // namespace energyplus
52
53 } // namespace openstudio
54