GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 18 / 0 / 18
Functions: 100.0% 1 / 0 / 1
Branches: 90.3% 28 / 0 / 31

src/energyplus/ForwardTranslator/ForwardTranslateSpaceInfiltrationEffectiveLeakageArea.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/SpaceInfiltrationEffectiveLeakageArea.hpp"
10 #include "../../model/SpaceInfiltrationEffectiveLeakageArea_Impl.hpp"
11 #include "../../model/Space.hpp"
12 #include "../../model/Space_Impl.hpp"
13 #include "../../model/ThermalZone.hpp"
14 #include "../../model/ThermalZone_Impl.hpp"
15 #include "../../model/SpaceType.hpp"
16 #include "../../model/SpaceType_Impl.hpp"
17 #include "../../model/Schedule.hpp"
18 #include "../../model/Schedule_Impl.hpp"
19
20 #include <utilities/idd/ZoneInfiltration_EffectiveLeakageArea_FieldEnums.hxx>
21 #include "../../utilities/idd/IddEnums.hpp"
22 #include <utilities/idd/IddEnums.hxx>
23 #include <utilities/idd/IddFactory.hxx>
24
25 using namespace openstudio::model;
26
27 using namespace std;
28
29 namespace openstudio {
30
31 namespace energyplus {
32
33 14 boost::optional<IdfObject> ForwardTranslator::translateSpaceInfiltrationEffectiveLeakageArea(SpaceInfiltrationEffectiveLeakageArea& modelObject) {
34
35
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ZoneInfiltration_EffectiveLeakageArea, modelObject);
36
1/1
✓ Branch 1 taken 14 times.
14 IdfObject parentIdfObject = getSpaceLoadParent(modelObject, false); // We do not allow spaceType!
37
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 idfObject.setString(ZoneInfiltration_EffectiveLeakageAreaFields::ZoneorSpaceName, parentIdfObject.nameString());
38
39
1/1
✓ Branch 1 taken 14 times.
14 boost::optional<Schedule> schedule = modelObject.schedule();
40
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 13 times.
14 if (schedule) {
41
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 idfObject.setString(ZoneInfiltration_EffectiveLeakageAreaFields::ScheduleName, schedule->name().get());
42 }
43
44
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 OptionalDouble d = modelObject.effectiveAirLeakageArea();
45
1/2
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
14 if (d) {
46
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 idfObject.setDouble(ZoneInfiltration_EffectiveLeakageAreaFields::EffectiveAirLeakageArea, *d);
47 }
48
49
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 d = modelObject.stackCoefficient();
50
1/2
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
14 if (d) {
51
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 idfObject.setDouble(ZoneInfiltration_EffectiveLeakageAreaFields::StackCoefficient, *d);
52 }
53
54
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 d = modelObject.windCoefficient();
55
1/2
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
14 if (d) {
56
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 idfObject.setDouble(ZoneInfiltration_EffectiveLeakageAreaFields::WindCoefficient, *d);
57 }
58
59
1/1
✓ Branch 1 taken 14 times.
28 return idfObject;
60 14 }
61
62 } // namespace energyplus
63
64 } // namespace openstudio
65