src/energyplus/ForwardTranslator/ForwardTranslateHeatExchangerDesiccantBalancedFlow.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/HeatExchangerDesiccantBalancedFlow.hpp" | ||
| 10 | |||
| 11 | #include "../../model/Node.hpp" | ||
| 12 | #include "../../model/Node_Impl.hpp" | ||
| 13 | #include "../../model/Schedule.hpp" | ||
| 14 | #include "../../model/Schedule_Impl.hpp" | ||
| 15 | #include "../../model/HeatExchangerDesiccantBalancedFlowPerformanceDataType1.hpp" | ||
| 16 | #include "../../model/HeatExchangerDesiccantBalancedFlowPerformanceDataType1_Impl.hpp" | ||
| 17 | |||
| 18 | #include <utilities/idd/HeatExchanger_Desiccant_BalancedFlow_FieldEnums.hxx> | ||
| 19 | // #include "../../utilities/idd/IddEnums.hpp" | ||
| 20 | #include <utilities/idd/IddEnums.hxx> | ||
| 21 | |||
| 22 | using namespace openstudio::model; | ||
| 23 | |||
| 24 | namespace openstudio { | ||
| 25 | |||
| 26 | namespace energyplus { | ||
| 27 | |||
| 28 | 3 | boost::optional<IdfObject> ForwardTranslator::translateHeatExchangerDesiccantBalancedFlow(HeatExchangerDesiccantBalancedFlow& modelObject) { | |
| 29 | 3 | boost::optional<std::string> s; | |
| 30 | 3 | boost::optional<double> value; | |
| 31 | 3 | OptionalModelObject temp; | |
| 32 | |||
| 33 | // HeatExchangerPerformance, is required, so start by that | ||
| 34 |
1/1✓ Branch 1 taken 3 times.
|
3 | HeatExchangerDesiccantBalancedFlowPerformanceDataType1 performance = modelObject.heatExchangerPerformance(); |
| 35 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<IdfObject> _performance = translateAndMapModelObject(performance); |
| 36 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!_performance) { |
| 37 | ✗ | LOG(Warn, modelObject.briefDescription() << " cannot be translated as its performance object cannot be translated: " | |
| 38 | << performance.briefDescription() << "."); | ||
| 39 | ✗ | return boost::none; | |
| 40 | } | ||
| 41 | |||
| 42 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::HeatExchanger_Desiccant_BalancedFlow, modelObject); |
| 43 | |||
| 44 | // AvailabilityScheduleName | ||
| 45 |
1/1✓ Branch 1 taken 3 times.
|
3 | Schedule sched = modelObject.availabilitySchedule(); |
| 46 |
1/1✓ Branch 1 taken 3 times.
|
3 | translateAndMapModelObject(sched); |
| 47 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::AvailabilityScheduleName, sched.name().get()); |
| 48 | |||
| 49 | // RegenerationAirInletNodeName | ||
| 50 |
1/1✓ Branch 1 taken 3 times.
|
3 | temp = modelObject.primaryAirInletModelObject(); |
| 51 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
|
3 | if (temp) { |
| 52 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::RegenerationAirInletNodeName, temp->nameString()); |
| 53 | } | ||
| 54 | |||
| 55 | // RegenerationAirOutletNodeName | ||
| 56 |
1/1✓ Branch 1 taken 3 times.
|
3 | temp = modelObject.primaryAirOutletModelObject(); |
| 57 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
|
3 | if (temp) { |
| 58 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::RegenerationAirOutletNodeName, temp->nameString()); |
| 59 | } | ||
| 60 | |||
| 61 | // ProcessAirInletNodeName | ||
| 62 |
1/1✓ Branch 1 taken 3 times.
|
3 | temp = modelObject.secondaryAirInletModelObject(); |
| 63 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
|
3 | if (temp) { |
| 64 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::ProcessAirInletNodeName, temp->nameString()); |
| 65 | } | ||
| 66 | |||
| 67 | // ProcessAirOutletNodeName | ||
| 68 |
1/1✓ Branch 1 taken 3 times.
|
3 | temp = modelObject.secondaryAirOutletModelObject(); |
| 69 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
|
3 | if (temp) { |
| 70 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::ProcessAirOutletNodeName, temp->nameString()); |
| 71 | } | ||
| 72 | |||
| 73 | // HeatExchangerPerformanceObjectType | ||
| 74 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::HeatExchangerPerformanceObjectType, _performance->iddObject().name()); |
| 75 | |||
| 76 | // HeatExchangerPerformanceName` | ||
| 77 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::HeatExchangerPerformanceName, _performance->name().get()); |
| 78 | |||
| 79 | // EconomizerLockout | ||
| 80 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | if (modelObject.economizerLockout()) { |
| 81 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::EconomizerLockout, "Yes"); |
| 82 | } else { | ||
| 83 | ✗ | idfObject.setString(HeatExchanger_Desiccant_BalancedFlowFields::EconomizerLockout, "No"); | |
| 84 | } | ||
| 85 | |||
| 86 |
1/1✓ Branch 1 taken 3 times.
|
3 | return boost::optional<IdfObject>(idfObject); |
| 87 | 3 | } | |
| 88 | |||
| 89 | } // namespace energyplus | ||
| 90 | |||
| 91 | } // namespace openstudio | ||
| 92 |