GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 14 / 0 / 14
Functions: 100.0% 1 / 0 / 1
Branches: 86.4% 19 / 0 / 22

src/energyplus/ForwardTranslator/ForwardTranslateSurfacePropertyIncidentSolarMultiplier.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/SurfacePropertyIncidentSolarMultiplier.hpp"
10
11 #include "../../model/SubSurface.hpp"
12 #include "../../model/SubSurface_Impl.hpp"
13
14 #include "../../model/Schedule.hpp"
15 #include "../../model/Schedule_Impl.hpp"
16
17 #include <utilities/idd/SurfaceProperty_IncidentSolarMultiplier_FieldEnums.hxx>
18 // #include "../../utilities/idd/IddEnums.hpp"
19 #include <utilities/idd/IddEnums.hxx>
20
21 using namespace openstudio::model;
22
23 namespace openstudio {
24
25 namespace energyplus {
26
27 boost::optional<IdfObject>
28 1 ForwardTranslator::translateSurfacePropertyIncidentSolarMultiplier(model::SurfacePropertyIncidentSolarMultiplier& modelObject) {
29
30 // Instantiate an IdfObject of the class to store the values
31
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::SurfaceProperty_IncidentSolarMultiplier, modelObject);
32
33 // Surface Name: Required Object
34
1/1
✓ Branch 1 taken 1 time.
1 SubSurface subSurface = modelObject.subSurface();
35
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<IdfObject> _owo = translateAndMapModelObject(subSurface)) {
36
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(SurfaceProperty_IncidentSolarMultiplierFields::SurfaceName, _owo->nameString());
37 1 }
38
39 // Incident Solar Multiplier: Optional Double
40
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(SurfaceProperty_IncidentSolarMultiplierFields::IncidentSolarMultiplier, modelObject.incidentSolarMultiplier());
41
42 // Incident Solar Multiplier Schedule Name: Optional Object
43
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<Schedule> _incidentSolarMultiplierSchedule = modelObject.incidentSolarMultiplierSchedule()) {
44
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(_incidentSolarMultiplierSchedule.get())) {
45
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(SurfaceProperty_IncidentSolarMultiplierFields::IncidentSolarMultiplierScheduleName, _owo->nameString());
46 1 }
47 1 }
48
49
1/1
✓ Branch 1 taken 1 time.
2 return idfObject;
50 1 } // End of translate function
51
52 } // end namespace energyplus
53 } // end namespace openstudio
54