GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 44 / 0 / 44
Functions: 100.0% 1 / 0 / 1
Branches: 90.4% 75 / 0 / 83

src/energyplus/ForwardTranslator/ForwardTranslateDefaultSubSurfaceConstructions.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 #include "../../model/Model.hpp"
8
9 #include "../../model/DefaultSubSurfaceConstructions.hpp"
10
11 #include "../../model/ConstructionBase.hpp"
12
13 #include <utilities/idd/SubSurfaceConstructionAssignments_FieldEnums.hxx>
14 #include <utilities/idd/IddEnums.hxx>
15
16 using namespace openstudio::model;
17
18 namespace openstudio {
19
20 namespace energyplus {
21
22 95 boost::optional<IdfObject> ForwardTranslator::translateDefaultSubSurfaceConstructions(model::DefaultSubSurfaceConstructions& modelObject) {
23
24 // Instantiate an IdfObject of the class to store the values
25
2/2
✓ Branch 1 taken 95 times.
✓ Branch 4 taken 95 times.
95 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::SubSurfaceConstructionAssignments, modelObject);
26
27 // Fixed Window Construction Name: Optional Object
28
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 82 times.
✓ Branch 4 taken 13 times.
190 if (boost::optional<ConstructionBase> fixedWindowConstruction_ = modelObject.fixedWindowConstruction()) {
29
3/4
✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
✓ Branch 6 taken 82 times.
✗ Branch 7 not taken.
164 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*fixedWindowConstruction_)) {
30
3/3
✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
✓ Branch 7 taken 82 times.
82 idfObject.setString(SubSurfaceConstructionAssignmentsFields::FixedWindowConstructionName, wo_->nameString());
31 82 }
32 95 }
33
34 // Operable Window Construction Name: Optional Object
35
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 81 times.
✓ Branch 4 taken 14 times.
190 if (boost::optional<ConstructionBase> operableWindowConstruction_ = modelObject.operableWindowConstruction()) {
36
3/4
✓ Branch 1 taken 81 times.
✓ Branch 4 taken 81 times.
✓ Branch 6 taken 81 times.
✗ Branch 7 not taken.
162 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*operableWindowConstruction_)) {
37
3/3
✓ Branch 1 taken 81 times.
✓ Branch 4 taken 81 times.
✓ Branch 7 taken 81 times.
81 idfObject.setString(SubSurfaceConstructionAssignmentsFields::OperableWindowConstructionName, wo_->nameString());
38 81 }
39 95 }
40
41 // Door Construction Name: Optional Object
42
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 72 times.
✓ Branch 4 taken 23 times.
190 if (boost::optional<ConstructionBase> doorConstruction_ = modelObject.doorConstruction()) {
43
3/4
✓ Branch 1 taken 72 times.
✓ Branch 4 taken 72 times.
✓ Branch 6 taken 72 times.
✗ Branch 7 not taken.
144 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*doorConstruction_)) {
44
3/3
✓ Branch 1 taken 72 times.
✓ Branch 4 taken 72 times.
✓ Branch 7 taken 72 times.
72 idfObject.setString(SubSurfaceConstructionAssignmentsFields::DoorConstructionName, wo_->nameString());
45 72 }
46 95 }
47
48 // Glass Door Construction Name: Optional Object
49
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 71 times.
✓ Branch 4 taken 24 times.
190 if (boost::optional<ConstructionBase> glassDoorConstruction_ = modelObject.glassDoorConstruction()) {
50
3/4
✓ Branch 1 taken 71 times.
✓ Branch 4 taken 71 times.
✓ Branch 6 taken 71 times.
✗ Branch 7 not taken.
142 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*glassDoorConstruction_)) {
51
3/3
✓ Branch 1 taken 71 times.
✓ Branch 4 taken 71 times.
✓ Branch 7 taken 71 times.
71 idfObject.setString(SubSurfaceConstructionAssignmentsFields::GlassDoorConstructionName, wo_->nameString());
52 71 }
53 95 }
54
55 // Overhead Door Construction Name: Optional Object
56
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 71 times.
✓ Branch 4 taken 24 times.
190 if (boost::optional<ConstructionBase> overheadDoorConstruction_ = modelObject.overheadDoorConstruction()) {
57
3/4
✓ Branch 1 taken 71 times.
✓ Branch 4 taken 71 times.
✓ Branch 6 taken 71 times.
✗ Branch 7 not taken.
142 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*overheadDoorConstruction_)) {
58
3/3
✓ Branch 1 taken 71 times.
✓ Branch 4 taken 71 times.
✓ Branch 7 taken 71 times.
71 idfObject.setString(SubSurfaceConstructionAssignmentsFields::OverheadDoorConstructionName, wo_->nameString());
59 71 }
60 95 }
61
62 // Skylight Construction Name: Optional Object
63
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 69 times.
✓ Branch 4 taken 26 times.
190 if (boost::optional<ConstructionBase> skylightConstruction_ = modelObject.skylightConstruction()) {
64
3/4
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 6 taken 69 times.
✗ Branch 7 not taken.
138 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*skylightConstruction_)) {
65
3/3
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 7 taken 69 times.
69 idfObject.setString(SubSurfaceConstructionAssignmentsFields::SkylightConstructionName, wo_->nameString());
66 69 }
67 95 }
68
69 // Tubular Daylight Dome Construction Name: Optional Object
70
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 69 times.
✓ Branch 4 taken 26 times.
190 if (boost::optional<ConstructionBase> tubularDaylightDomeConstruction_ = modelObject.tubularDaylightDomeConstruction()) {
71
3/4
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 6 taken 69 times.
✗ Branch 7 not taken.
138 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*tubularDaylightDomeConstruction_)) {
72
3/3
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 7 taken 69 times.
69 idfObject.setString(SubSurfaceConstructionAssignmentsFields::TubularDaylightDomeConstructionName, wo_->nameString());
73 69 }
74 95 }
75
76 // Tubular Daylight Diffuser Construction Name: Optional Object
77
3/3
✓ Branch 1 taken 95 times.
✓ Branch 3 taken 69 times.
✓ Branch 4 taken 26 times.
190 if (boost::optional<ConstructionBase> tubularDaylightDiffuserConstruction_ = modelObject.tubularDaylightDiffuserConstruction()) {
78
3/4
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 6 taken 69 times.
✗ Branch 7 not taken.
138 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*tubularDaylightDiffuserConstruction_)) {
79
3/3
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 7 taken 69 times.
69 idfObject.setString(SubSurfaceConstructionAssignmentsFields::TubularDaylightDiffuserConstructionName, wo_->nameString());
80 69 }
81 95 }
82
83
1/1
✓ Branch 1 taken 95 times.
190 return idfObject;
84 95 } // End of translate function
85
86 } // end namespace energyplus
87 } // end namespace openstudio
88