GCC Code Coverage Report


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

src/energyplus/ForwardTranslator/ForwardTranslateSurfacePropertyGroundSurfaces.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/SurfacePropertyGroundSurfaces.hpp"
10 #include "../../model/Schedule.hpp"
11
12 #include "../../utilities/idf/IdfExtensibleGroup.hpp"
13
14 #include <utilities/idd/SurfaceProperty_GroundSurfaces_FieldEnums.hxx>
15 // #include "../../utilities/idd/IddEnums.hpp"
16 #include <utilities/idd/IddEnums.hxx>
17
18 using namespace openstudio::model;
19
20 namespace openstudio {
21
22 namespace energyplus {
23
24 1 boost::optional<IdfObject> ForwardTranslator::translateSurfacePropertyGroundSurfaces(model::SurfacePropertyGroundSurfaces& modelObject) {
25 1 boost::optional<IdfObject> result;
26
27 // Instantiate an IdfObject of the class to store the values
28
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::SurfaceProperty_GroundSurfaces, modelObject);
29
30
3/3
✓ Branch 1 taken 1 time.
✓ Branch 8 taken 5 times.
✓ Branch 9 taken 1 time.
6 for (const auto& group : modelObject.groundSurfaceGroups()) {
31
32
1/1
✓ Branch 1 taken 5 times.
5 IdfExtensibleGroup eg = idfObject.pushExtensibleGroup();
33
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 eg.setString(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceName, group.groundSurfaceName());
34
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 eg.setDouble(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceViewFactor, group.viewFactor());
35
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 3 times.
10 if (auto sch_ = group.temperatureSchedule()) {
36
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(sch_.get())) {
37
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
2 eg.setString(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceTemperatureScheduleName, _owo->nameString());
38 2 } // TODO: handle failure?
39 5 }
40
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
10 if (auto sch_ = group.reflectanceSchedule()) {
41
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
6 if (boost::optional<IdfObject> _owo = translateAndMapModelObject(sch_.get())) {
42
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 eg.setString(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceReflectanceScheduleName, _owo->nameString());
43 3 } // TODO: handle failure?
44 5 }
45 6 }
46
47
1/1
✓ Branch 1 taken 1 time.
2 return idfObject;
48 1 } // End of translate function
49
50 } // end namespace energyplus
51 } // end namespace openstudio
52