GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 24 / 0 / 24
Functions: 100.0% 1 / 0 / 1
Branches: 88.6% 39 / 0 / 44

src/energyplus/ForwardTranslator/ForwardTranslateSurfacePropertyLocalEnvironment.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/SurfacePropertyLocalEnvironment.hpp"
10
11 #include "../../model/PlanarSurface.hpp"
12
13 #include "../../model/SurfacePropertySurroundingSurfaces.hpp"
14 #include "../../model/SurfacePropertyGroundSurfaces.hpp"
15
16 //#include "../../model/OutdoorAirNode.hpp"
17 //#include "../../model/OutdoorAirNode_Impl.hpp"
18
19 #include <utilities/idd/SurfaceProperty_LocalEnvironment_FieldEnums.hxx>
20 #include <utilities/idd/IddEnums.hxx>
21
22 using namespace openstudio::model;
23
24 namespace openstudio {
25
26 namespace energyplus {
27
28 5 boost::optional<IdfObject> ForwardTranslator::translateSurfacePropertyLocalEnvironment(model::SurfacePropertyLocalEnvironment& modelObject) {
29
30 // Instantiate an IdfObject of the class to store the values,
31
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::SurfaceProperty_LocalEnvironment, modelObject);
32
33 // Exterior Surface Name: Optional Object
34
3/4
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
10 if (boost::optional<PlanarSurface> _exteriorSurface = modelObject.exteriorSurface()) {
35
3/4
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 6 taken 5 times.
✗ Branch 7 not taken.
10 if (boost::optional<IdfObject> _owo = translateAndMapModelObject(_exteriorSurface.get())) {
36
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
5 idfObject.setString(SurfaceProperty_LocalEnvironmentFields::ExteriorSurfaceName, _owo->nameString());
37 5 }
38 5 }
39
40 // External Shading Fraction Schedule Name: Optional Object
41
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 3 times.
10 if (boost::optional<Schedule> _externalShadingFractionSchedule = modelObject.externalShadingFractionSchedule()) {
42
3/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
4 if (boost::optional<IdfObject> _owo = translateAndMapModelObject(_externalShadingFractionSchedule.get())) {
43
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
2 idfObject.setString(SurfaceProperty_LocalEnvironmentFields::SunlitFractionScheduleName, _owo->nameString());
44 2 }
45 5 }
46
47 // Surrounding Surfaces Object Name: Optional Object
48
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 1 time.
10 if (boost::optional<SurfacePropertySurroundingSurfaces> sp_ = modelObject.surfacePropertySurroundingSurfaces()) {
49
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
8 if (boost::optional<IdfObject> _owo = translateAndMapModelObject(sp_.get())) {
50
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 idfObject.setString(SurfaceProperty_LocalEnvironmentFields::SurroundingSurfacesObjectName, _owo->nameString());
51 4 }
52 5 }
53
54 // Ground Surfaces Object Name: Optional Object
55
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 4 times.
10 if (boost::optional<SurfacePropertyGroundSurfaces> sp_ = modelObject.surfacePropertyGroundSurfaces()) {
56
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (boost::optional<IdfObject> _owo = translateAndMapModelObject(sp_.get())) {
57
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(SurfaceProperty_LocalEnvironmentFields::GroundSurfacesObjectName, _owo->nameString());
58 1 }
59 5 }
60
61 // Outdoor Air Node Name: Optional Object
62 // if (boost::optional<OutdoorAirNode> _outdoorAirNode = modelObject.outdoorAirNode()) {
63 // if (boost::optional<IdfObject> _owo = translateAndMapModelObject(_outdoorAirNode.get())) {
64 // idfObject.setString(SurfaceProperty_LocalEnvironmentFields::OutdoorAirNodeName, _owo->nameString());
65 // }
66 // }
67
68
1/1
✓ Branch 1 taken 5 times.
10 return idfObject;
69 5 } // End of translate function
70
71 } // end namespace energyplus
72 } // end namespace openstudio
73