src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingDXVariableRefrigerantFlowFluidTemperatureControl.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/CoilCoolingDXVariableRefrigerantFlowFluidTemperatureControl.hpp" | ||
| 10 | #include "../../model/CoilCoolingDXVariableRefrigerantFlowFluidTemperatureControl_Impl.hpp" | ||
| 11 | |||
| 12 | #include "../../model/Schedule.hpp" | ||
| 13 | #include "../../model/Schedule_Impl.hpp" | ||
| 14 | #include "../../model/Node.hpp" | ||
| 15 | #include "../../model/Node_Impl.hpp" | ||
| 16 | #include "../../model/Curve.hpp" | ||
| 17 | #include "../../model/Curve_Impl.hpp" | ||
| 18 | |||
| 19 | #include <utilities/idd/Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControl_FieldEnums.hxx> | ||
| 20 | // #include "../../utilities/idd/IddEnums.hpp" | ||
| 21 | #include <utilities/idd/IddEnums.hxx> | ||
| 22 | |||
| 23 | using namespace openstudio::model; | ||
| 24 | |||
| 25 | namespace openstudio { | ||
| 26 | |||
| 27 | namespace energyplus { | ||
| 28 | |||
| 29 | 4 | boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXVariableRefrigerantFlowFluidTemperatureControl( | |
| 30 | model::CoilCoolingDXVariableRefrigerantFlowFluidTemperatureControl& modelObject) { | ||
| 31 | 4 | boost::optional<std::string> s; | |
| 32 | 4 | boost::optional<double> value; | |
| 33 | |||
| 34 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | IdfObject idfObject(IddObjectType::Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControl); |
| 35 | |||
| 36 |
1/1✓ Branch 1 taken 4 times.
|
4 | m_idfObjects.push_back(idfObject); |
| 37 | |||
| 38 | // Name | ||
| 39 |
1/1✓ Branch 1 taken 4 times.
|
4 | s = modelObject.name(); |
| 40 |
1/2✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
|
4 | if (s) { |
| 41 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | idfObject.setName(*s); |
| 42 | } | ||
| 43 | |||
| 44 | // Availability Schedule Name: Optional Object | ||
| 45 |
3/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
|
8 | if (boost::optional<Schedule> _availabilitySchedule = modelObject.availabilitySchedule()) { |
| 46 |
3/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
|
8 | if (boost::optional<IdfObject> _owo = translateAndMapModelObject(_availabilitySchedule.get())) { |
| 47 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
4 | idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControlFields::AvailabilityScheduleName, _owo->nameString()); |
| 48 | 4 | } | |
| 49 | 4 | } | |
| 50 | |||
| 51 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | if (modelObject.isRatedTotalCoolingCapacityAutosized()) { |
| 52 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControlFields::RatedTotalCoolingCapacity, "Autosize"); |
| 53 | } else { | ||
| 54 | // Rated Total Cooling Capacity: boost::optional<double> | ||
| 55 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<double> _ratedTotalCoolingCapacity = modelObject.ratedTotalCoolingCapacity()) { |
| 56 | 2 | idfObject.setDouble(Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControlFields::RatedTotalCoolingCapacity, | |
| 57 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | _ratedTotalCoolingCapacity.get()); |
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | if (modelObject.isRatedSensibleHeatRatioAutosized()) { |
| 62 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | idfObject.setString(Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControlFields::RatedSensibleHeatRatio, "Autosize"); |
| 63 | } else { | ||
| 64 | // Rated Sensible Heat Ratio: boost::optional<double> | ||
| 65 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<double> _ratedSensibleHeatRatio = modelObject.ratedSensibleHeatRatio()) { |
| 66 | 2 | idfObject.setDouble(Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControlFields::RatedSensibleHeatRatio, | |
| 67 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | _ratedSensibleHeatRatio.get()); |
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | // Indoor Unit Reference Superheating: Optional Double | ||
| 72 |
1/1✓ Branch 1 taken 4 times.
|
4 | double indoorUnitReferenceSuperheating = modelObject.indoorUnitReferenceSuperheating(); |
| 73 |
1/1✓ Branch 1 taken 4 times.
|
4 | idfObject.setDouble(Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControlFields::IndoorUnitReferenceSuperheating, |
| 74 | indoorUnitReferenceSuperheating); | ||
| 75 | |||
| 76 | // Indoor Unit Evaporating Temperature Function of Superheating Curve Name: Required Object | ||
| 77 |
1/1✓ Branch 1 taken 4 times.
|
4 | Curve indoorUnitEvaporatingTemperatureFunctionofSuperheatingCurve = modelObject.indoorUnitEvaporatingTemperatureFunctionofSuperheatingCurve(); |
| 78 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
|
8 | if (boost::optional<IdfObject> _owo = translateAndMapModelObject(indoorUnitEvaporatingTemperatureFunctionofSuperheatingCurve)) { |
| 79 |
1/1✓ Branch 1 taken 4 times.
|
4 | idfObject.setString( |
| 80 | Coil_Cooling_DX_VariableRefrigerantFlow_FluidTemperatureControlFields::IndoorUnitEvaporatingTemperatureFunctionofSuperheatingCurveName, | ||
| 81 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | _owo->nameString()); |
| 82 | 4 | } | |
| 83 | |||
| 84 |
1/1✓ Branch 1 taken 4 times.
|
8 | return idfObject; |
| 85 | 4 | } // End of translate function | |
| 86 | |||
| 87 | } // end namespace energyplus | ||
| 88 | } // end namespace openstudio | ||
| 89 |