src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACZoneMixer.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/AirLoopHVACZoneMixer.hpp" | ||
| 8 | #include <utilities/idd/AirLoopHVAC_ZoneMixer_FieldEnums.hxx> | ||
| 9 | #include <utilities/idd/IddEnums.hxx> | ||
| 10 | |||
| 11 | using namespace openstudio::model; | ||
| 12 | |||
| 13 | using namespace std; | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | |||
| 17 | namespace energyplus { | ||
| 18 | |||
| 19 | 200 | boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACZoneMixer(AirLoopHVACZoneMixer& modelObject) { | |
| 20 | 200 | std::string s; | |
| 21 | 200 | OptionalString optS; | |
| 22 | 200 | OptionalModelObject temp; | |
| 23 | |||
| 24 |
2/2✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
|
200 | IdfObject idfObject(openstudio::IddObjectType::AirLoopHVAC_ZoneMixer); |
| 25 | |||
| 26 |
1/1✓ Branch 1 taken 200 times.
|
200 | m_idfObjects.push_back(idfObject); |
| 27 | |||
| 28 | /////////////////////////////////////////////////////////////////////////// | ||
| 29 | // Field: Name //////////////////////////////////////////////////////////// | ||
| 30 |
3/3✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
✓ Branch 7 taken 200 times.
|
200 | s = modelObject.name().get(); |
| 31 |
1/1✓ Branch 1 taken 200 times.
|
200 | idfObject.setName(s); |
| 32 | |||
| 33 | //////////////////////////////////////////////////////////////////////////// | ||
| 34 | // Field: Outlet Node Name ///////////////////////////////////////////////// | ||
| 35 |
1/1✓ Branch 1 taken 200 times.
|
200 | temp = modelObject.outletModelObject(); |
| 36 |
1/2✓ Branch 0 taken 200 times.
✗ Branch 1 not taken.
|
200 | if (temp) { |
| 37 |
2/2✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
|
200 | optS = temp->name(); |
| 38 |
1/2✓ Branch 0 taken 200 times.
✗ Branch 1 not taken.
|
200 | if (optS) { |
| 39 |
2/2✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
|
200 | idfObject.setString(openstudio::AirLoopHVAC_ZoneMixerFields::OutletNodeName, *optS); |
| 40 | } | ||
| 41 | } | ||
| 42 | /////////////////////////////////////////////////////////////////////////// | ||
| 43 | // Field: Inlet 1-N Node Name /////////////////////////////////////////////// | ||
| 44 |
1/1✓ Branch 1 taken 200 times.
|
200 | std::vector<ModelObject> inletModelObjects = modelObject.inletModelObjects(); |
| 45 | 200 | int i = 2; | |
| 46 |
2/2✓ Branch 4 taken 216 times.
✓ Branch 5 taken 200 times.
|
416 | for (const auto& inletModelObject : inletModelObjects) { |
| 47 |
1/1✓ Branch 1 taken 216 times.
|
216 | optS = inletModelObject.name(); |
| 48 |
1/2✓ Branch 0 taken 216 times.
✗ Branch 1 not taken.
|
216 | if (optS) { |
| 49 |
2/2✓ Branch 1 taken 216 times.
✓ Branch 4 taken 216 times.
|
216 | idfObject.setString(i, *optS); |
| 50 | } | ||
| 51 | 216 | i++; | |
| 52 | } | ||
| 53 | |||
| 54 |
1/1✓ Branch 1 taken 200 times.
|
400 | return boost::optional<IdfObject>(idfObject); |
| 55 | 200 | } | |
| 56 | |||
| 57 | } // namespace energyplus | ||
| 58 | |||
| 59 | } // namespace openstudio | ||
| 60 |