GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 81.8% 36 / 0 / 44
Functions: 100.0% 1 / 0 / 1
Branches: 67.1% 57 / 0 / 85

src/energyplus/ForwardTranslator/ForwardTranslateElectricEquipmentITEAirCooledDefinition.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/ElectricEquipmentITEAirCooledDefinition.hpp"
9 #include "../../model/ElectricEquipmentITEAirCooledDefinition_Impl.hpp"
10 #include "../../model/Curve.hpp"
11 #include "../../model/Curve_Impl.hpp"
12 #include "../../model/Schedule.hpp"
13 #include "../../model/Schedule_Impl.hpp"
14
15 #include "../../utilities/core/Compare.hpp"
16
17 #include <utilities/idd/ElectricEquipment_ITE_AirCooled_Definition_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::translateElectricEquipmentITEAirCooledDefinition(ElectricEquipmentITEAirCooledDefinition& modelObject) {
29
30
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ElectricEquipment_ITE_AirCooled_Definition, modelObject);
31
32
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::AirFlowCalculationMethod, modelObject.airFlowCalculationMethod());
33
34 // The model (like the legacy ElectricEquipment:ITE:AirCooled object) uses 'Watts/Unit', but the E+ ...:Definition object
35 // renamed that choice to 'EquipmentLevel' to match the naming convention used by the other *:Definition objects.
36
1/1
✓ Branch 1 taken 1 time.
1 std::string designPowerInputCalculationMethod = modelObject.designPowerInputCalculationMethod();
37
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
2 if (istringEqual(designPowerInputCalculationMethod, "Watts/Unit")) {
38
1/1
✓ Branch 1 taken 1 time.
1 designPowerInputCalculationMethod = "EquipmentLevel";
39 }
40
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::DesignPowerInputCalculationMethod, designPowerInputCalculationMethod);
41
42
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<double> d = modelObject.designLevel()) {
43
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::WattsperUnit, *d);
44 }
45
46
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
2 if (boost::optional<double> d = modelObject.wattsperSpaceFloorArea()) {
47 ✗ idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::WattsperFloorArea, *d);
48 }
49
50 1 idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::CPUPowerInputFunctionofLoadingandAirTemperatureCurveName,
51
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 modelObject.cPUPowerInputFunctionofLoadingandAirTemperatureCurve().name().get());
52
53
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::DesignFanPowerInputFraction, modelObject.designFanPowerInputFraction());
54
55
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
2 if (boost::optional<double> d = modelObject.designFanAirFlowRateperPowerInput()) {
56 ✗ idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::DesignFanAirFlowRateperPowerInput, *d);
57 }
58
59 1 idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::AirFlowFunctionofLoadingandAirTemperatureCurveName,
60
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 modelObject.airFlowFunctionofLoadingandAirTemperatureCurve().name().get());
61
62 1 idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::FanPowerInputFunctionofFlowCurveName,
63
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 modelObject.fanPowerInputFunctionofFlowCurve().name().get());
64
65
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::DesignEnteringAirTemperature, modelObject.designEnteringAirTemperature());
66
67
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::EnvironmentalClass, modelObject.environmentalClass());
68
69
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::AirInletConnectionType, modelObject.airInletConnectionType());
70
71
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::DesignRecirculationFraction, modelObject.designRecirculationFraction());
72
73
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
2 if (boost::optional<Curve> curve = modelObject.recirculationFunctionofLoadingandSupplyTemperatureCurve()) {
74 ✗ idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::RecirculationFunctionofLoadingandSupplyTemperatureCurveName,
75 ✗ curve->name().get());
76 1 }
77
78
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::DesignElectricPowerSupplyEfficiency,
79 modelObject.designElectricPowerSupplyEfficiency());
80
81
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
2 if (boost::optional<Curve> curve = modelObject.electricPowerSupplyEfficiencyFunctionofPartLoadRatioCurve()) {
82 ✗ idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::ElectricPowerSupplyEfficiencyFunctionofPartLoadRatioCurveName,
83 ✗ curve->name().get());
84 1 }
85
86
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::FractionofElectricPowerSupplyLossestoZone,
87 modelObject.fractionofElectricPowerSupplyLossestoZone());
88
89
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::SupplyTemperatureDifference, modelObject.supplyTemperatureDifference());
90
91
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
2 if (boost::optional<Schedule> schedule = modelObject.supplyTemperatureDifferenceSchedule()) {
92 ✗ idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::SupplyTemperatureDifferenceSchedule, schedule->name().get());
93 1 }
94
95
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ElectricEquipment_ITE_AirCooled_DefinitionFields::ReturnTemperatureDifference, modelObject.returnTemperatureDifference());
96
97
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
2 if (boost::optional<Schedule> schedule = modelObject.returnTemperatureDifferenceSchedule()) {
98 ✗ idfObject.setString(ElectricEquipment_ITE_AirCooled_DefinitionFields::ReturnTemperatureDifferenceSchedule, schedule->name().get());
99 1 }
100
101
1/1
✓ Branch 1 taken 1 time.
2 return idfObject;
102 1 }
103
104 } // namespace energyplus
105
106 } // namespace openstudio
107