GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 75.4% 49 / 0 / 65
Functions: 100.0% 1 / 0 / 1
Branches: 46.7% 64 / 0 / 137

src/energyplus/ReverseTranslator/ReverseTranslateCoilCoolingDXCurveFitPerformance.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 "../ReverseTranslator.hpp"
7
8 #include "../../model/CoilCoolingDXCurveFitPerformance.hpp"
9 #include "../../model/CoilCoolingDXCurveFitPerformance_Impl.hpp"
10
11 #include "../../model/Schedule.hpp"
12 #include "../../model/Schedule_Impl.hpp"
13 #include "../../model/CoilCoolingDXCurveFitOperatingMode.hpp"
14 #include "../../model/CoilCoolingDXCurveFitOperatingMode_Impl.hpp"
15
16 #include <utilities/idd/Coil_Cooling_DX_CurveFit_Performance_FieldEnums.hxx>
17 #include "../../utilities/idd/IddEnums.hpp"
18 #include <utilities/idd/IddEnums.hxx>
19
20 #include "../../utilities/core/Assert.hpp"
21
22 using namespace openstudio::model;
23
24 namespace openstudio {
25
26 namespace energyplus {
27
28 2 OptionalModelObject ReverseTranslator::translateCoilCoolingDXCurveFitPerformance(const WorkspaceObject& workspaceObject) {
29
4/5
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
2 if (workspaceObject.iddObject().type() != IddObjectType::Coil_Cooling_DX_CurveFit_Performance) {
30 ✗ LOG(Error, "WorkspaceObject is not IddObjectType: CoilCoolingDXCurveFitPerformance");
31 ✗ return boost::none;
32 }
33
34 2 OptionalString s;
35 2 OptionalDouble d;
36 2 OptionalWorkspaceObject target;
37
38 2 boost::optional<CoilCoolingDXCurveFitOperatingMode> baseOperatingMode;
39
2/3
✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
4 if ((target = workspaceObject.getTarget(openstudio::Coil_Cooling_DX_CurveFit_PerformanceFields::BaseOperatingMode))) {
40
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target);
41
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (modelObject) {
42
3/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
4 if (modelObject->optionalCast<CoilCoolingDXCurveFitOperatingMode>()) {
43
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
2 baseOperatingMode = modelObject->cast<CoilCoolingDXCurveFitOperatingMode>();
44 }
45 }
46 2 }
47
48
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 openstudio::model::CoilCoolingDXCurveFitPerformance performance(m_model, *baseOperatingMode);
49
50
1/1
✓ Branch 1 taken 2 times.
2 s = workspaceObject.name();
51
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
52
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setName(*s);
53 }
54
55
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Coil_Cooling_DX_CurveFit_PerformanceFields::CrankcaseHeaterCapacity);
56
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (d) {
57
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setCrankcaseHeaterCapacity(*d);
58 }
59
60
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Coil_Cooling_DX_CurveFit_PerformanceFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation);
61
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (d) {
62
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setMinimumOutdoorDryBulbTemperatureforCompressorOperation(*d);
63 }
64
65
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Coil_Cooling_DX_CurveFit_PerformanceFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation);
66
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (d) {
67
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(*d);
68 }
69
70
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Coil_Cooling_DX_CurveFit_PerformanceFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation);
71
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (d) {
72
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(*d);
73 }
74
75
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Coil_Cooling_DX_CurveFit_PerformanceFields::UnitInternalStaticAirPressure);
76
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (d) {
77
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setUnitInternalStaticAirPressure(*d);
78 }
79
80
1/1
✓ Branch 1 taken 2 times.
2 s = workspaceObject.getString(Coil_Cooling_DX_CurveFit_PerformanceFields::CapacityControlMethod);
81
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
82
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setCapacityControlMethod(*s);
83 }
84
85
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Coil_Cooling_DX_CurveFit_PerformanceFields::EvaporativeCondenserBasinHeaterCapacity);
86
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (d) {
87
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setEvaporativeCondenserBasinHeaterCapacity(*d);
88 }
89
90
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Coil_Cooling_DX_CurveFit_PerformanceFields::EvaporativeCondenserBasinHeaterSetpointTemperature);
91
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (d) {
92
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setEvaporativeCondenserBasinHeaterSetpointTemperature(*d);
93 }
94
95 4 if ((target =
96
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 workspaceObject.getTarget(openstudio::Coil_Cooling_DX_CurveFit_PerformanceFields::EvaporativeCondenserBasinHeaterOperatingScheduleName))) {
97 ✗ OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target);
98 ✗ if (modelObject && modelObject->optionalCast<Schedule>()) {
99 ✗ auto schedule = modelObject->cast<Schedule>();
100 ✗ performance.setEvaporativeCondenserBasinHeaterOperatingSchedule(schedule);
101 ✗ }
102 ✗ }
103
104
1/1
✓ Branch 1 taken 2 times.
2 s = workspaceObject.getString(Coil_Cooling_DX_CurveFit_PerformanceFields::CompressorFuelType);
105
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
106
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performance.setCompressorFuelType(*s);
107 }
108
109
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((target = workspaceObject.getTarget(openstudio::Coil_Cooling_DX_CurveFit_PerformanceFields::AlternativeOperatingMode1))) {
110 ✗ OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target);
111 ✗ if (modelObject && modelObject->optionalCast<CoilCoolingDXCurveFitOperatingMode>()) {
112 ✗ performance.setAlternativeOperatingMode1(modelObject->cast<CoilCoolingDXCurveFitOperatingMode>());
113 }
114 ✗ }
115
116
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((target = workspaceObject.getTarget(openstudio::Coil_Cooling_DX_CurveFit_PerformanceFields::AlternativeOperatingMode2))) {
117 ✗ OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target);
118 ✗ if (modelObject && modelObject->optionalCast<CoilCoolingDXCurveFitOperatingMode>()) {
119 ✗ performance.setAlternativeOperatingMode1(modelObject->cast<CoilCoolingDXCurveFitOperatingMode>());
120 }
121 ✗ }
122
123
1/1
✓ Branch 1 taken 2 times.
2 return performance;
124 2 } // End of translate function
125
126 } // end namespace energyplus
127 } // end namespace openstudio
128