GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 84.6% 33 / 0 / 39
Functions: 100.0% 1 / 0 / 1
Branches: 66.7% 50 / 0 / 75

src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingDXVariableRefrigerantFlow.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 #include "../../model/Schedule.hpp"
9 #include "../../model/Schedule_Impl.hpp"
10 #include "../../model/Node.hpp"
11 #include "../../model/Node_Impl.hpp"
12 #include "../../model/ThermalZone.hpp"
13 #include "../../model/ThermalZone_Impl.hpp"
14 #include "../../model/CoilCoolingDXVariableRefrigerantFlow.hpp"
15 #include "../../model/CoilCoolingDXVariableRefrigerantFlow_Impl.hpp"
16 #include "../../model/Curve.hpp"
17 #include "../../model/Curve_Impl.hpp"
18 #include "../../model/CurveBiquadratic.hpp"
19 #include "../../model/CurveBiquadratic_Impl.hpp"
20 #include "../../model/CurveCubic.hpp"
21 #include "../../model/CurveCubic_Impl.hpp"
22 #include "../../utilities/core/Logger.hpp"
23 #include "../../utilities/core/Assert.hpp"
24 #include <utilities/idd/Coil_Cooling_DX_VariableRefrigerantFlow_FieldEnums.hxx>
25 #include "../../utilities/idd/IddEnums.hpp"
26 #include <utilities/idd/IddEnums.hxx>
27
28 using namespace openstudio::model;
29
30 using namespace std;
31
32 namespace openstudio {
33
34 namespace energyplus {
35
36 24 boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXVariableRefrigerantFlow(CoilCoolingDXVariableRefrigerantFlow& modelObject) {
37 24 boost::optional<std::string> s;
38 24 boost::optional<double> value;
39
40
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 IdfObject idfObject(IddObjectType::Coil_Cooling_DX_VariableRefrigerantFlow);
41
42
1/1
✓ Branch 1 taken 24 times.
24 m_idfObjects.push_back(idfObject);
43
44 // Name
45
46
1/1
✓ Branch 1 taken 24 times.
24 s = modelObject.name();
47
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (s) {
48
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 idfObject.setName(*s);
49 }
50
51 // AvailabilityScheduleName
52
53
3/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 8 taken 24 times.
✗ Branch 9 not taken.
48 if (boost::optional<model::Schedule> schedule = modelObject.availabilitySchedule()) {
54
3/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 24 times.
✗ Branch 7 not taken.
48 if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) {
55
4/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
24 idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlowFields::AvailabilityScheduleName, _schedule->name().get());
56 24 }
57 24 }
58
59 // RatedTotalCoolingCapacity
60
61
2/3
✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
24 if (modelObject.isRatedTotalCoolingCapacityAutosized()) {
62
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
48 idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlowFields::GrossRatedTotalCoolingCapacity, "Autosize");
63 ✗ } else if ((value = modelObject.ratedTotalCoolingCapacity())) {
64 ✗ idfObject.setDouble(Coil_Cooling_DX_VariableRefrigerantFlowFields::GrossRatedTotalCoolingCapacity, value.get());
65 }
66
67 // RatedSensibleHeatRatio
68
69
2/3
✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
24 if (modelObject.isRatedSensibleHeatRatioAutosized()) {
70
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
48 idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlowFields::GrossRatedSensibleHeatRatio, "Autosize");
71 ✗ } else if ((value = modelObject.ratedSensibleHeatRatio())) {
72 ✗ idfObject.setDouble(Coil_Cooling_DX_VariableRefrigerantFlowFields::GrossRatedSensibleHeatRatio, value.get());
73 }
74
75 // RatedAirFlowRate
76
77
2/3
✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
24 if (modelObject.isRatedAirFlowRateAutosized()) {
78
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
48 idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlowFields::RatedAirFlowRate, "Autosize");
79 ✗ } else if ((value = modelObject.ratedAirFlowRate())) {
80 ✗ idfObject.setDouble(Coil_Cooling_DX_VariableRefrigerantFlowFields::RatedAirFlowRate, value.get());
81 }
82
83 // CoolingCapacityRatioModifierFunctionofTemperatureCurveName
84
85
3/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 8 taken 24 times.
✗ Branch 9 not taken.
48 if (boost::optional<model::Curve> curve = modelObject.coolingCapacityRatioModifierFunctionofTemperatureCurve()) {
86
3/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 24 times.
✗ Branch 7 not taken.
48 if (boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get())) {
87 24 idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlowFields::CoolingCapacityRatioModifierFunctionofTemperatureCurveName,
88
4/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
24 _curve->name().get());
89 24 }
90 24 }
91
92 // CoolingCapacityModifierCurveFunctionofFlowFractionName
93
94
3/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 8 taken 24 times.
✗ Branch 9 not taken.
48 if (boost::optional<model::Curve> curve = modelObject.coolingCapacityModifierCurveFunctionofFlowFraction()) {
95
3/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 24 times.
✗ Branch 7 not taken.
48 if (boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get())) {
96 24 idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlowFields::CoolingCapacityModifierCurveFunctionofFlowFractionName,
97
4/4
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
24 _curve->name().get());
98 24 }
99 24 }
100
101 // TODO CoilAirInletNode
102 // TODO CoilAirOutletNode
103
104
1/1
✓ Branch 1 taken 24 times.
48 return idfObject;
105 24 }
106
107 } // namespace energyplus
108
109 } // namespace openstudio
110