src/energyplus/ForwardTranslator/ForwardTranslatePipeAdiabatic.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/PipeAdiabatic.hpp" | ||
| 9 | #include "../../model/PipeAdiabatic_Impl.hpp" | ||
| 10 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 11 | #include "../../utilities/idf/Workspace.hpp" | ||
| 12 | #include "../../utilities/idf/WorkspaceObjectOrder.hpp" | ||
| 13 | #include "../../utilities/core/Logger.hpp" | ||
| 14 | #include <utilities/idd/Pipe_Adiabatic_FieldEnums.hxx> | ||
| 15 | #include <utilities/idd/IddEnums.hxx> | ||
| 16 | |||
| 17 | using namespace openstudio::model; | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | |||
| 21 | namespace energyplus { | ||
| 22 | |||
| 23 | 10 | boost::optional<IdfObject> ForwardTranslator::translatePipeAdiabatic(PipeAdiabatic& modelObject) { | |
| 24 | 10 | OptionalString s; | |
| 25 | 10 | OptionalDouble d; | |
| 26 | 10 | OptionalModelObject temp; | |
| 27 | |||
| 28 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | IdfObject idfObject(IddObjectType::Pipe_Adiabatic); |
| 29 | |||
| 30 |
1/1✓ Branch 1 taken 10 times.
|
10 | m_idfObjects.push_back(idfObject); |
| 31 | |||
| 32 | /////////////////////////////////////////////////////////////////////////// | ||
| 33 | // Field: Name //////////////////////////////////////////////////////////// | ||
| 34 |
1/1✓ Branch 1 taken 10 times.
|
10 | s = modelObject.name(); |
| 35 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (s) { |
| 36 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setName(*s); |
| 37 | } | ||
| 38 | /////////////////////////////////////////////////////////////////////////// | ||
| 39 | |||
| 40 | /////////////////////////////////////////////////////////////////////////// | ||
| 41 | // Inlet Node Name //////////////////////////////////////////////////// | ||
| 42 |
1/1✓ Branch 1 taken 10 times.
|
10 | temp = modelObject.inletModelObject(); |
| 43 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (temp) { |
| 44 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | s = temp->name(); |
| 45 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (s) { |
| 46 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setString(openstudio::Pipe_AdiabaticFields::InletNodeName, *s); |
| 47 | } | ||
| 48 | } | ||
| 49 | /////////////////////////////////////////////////////////////////////////// | ||
| 50 | |||
| 51 | /////////////////////////////////////////////////////////////////////////// | ||
| 52 | // Outlet Node Name /////////////////////////////////////////////////// | ||
| 53 |
1/1✓ Branch 1 taken 10 times.
|
10 | temp = modelObject.outletModelObject(); |
| 54 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (temp) { |
| 55 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | s = temp->name(); |
| 56 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (s) { |
| 57 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setString(openstudio::Pipe_AdiabaticFields::OutletNodeName, *s); |
| 58 | } | ||
| 59 | } | ||
| 60 | /// | ||
| 61 | //////////////////////////////////////////////////////////////////////// | ||
| 62 | |||
| 63 |
1/1✓ Branch 1 taken 10 times.
|
20 | return boost::optional<IdfObject>(idfObject); |
| 64 | 10 | } | |
| 65 | |||
| 66 | } // namespace energyplus | ||
| 67 | |||
| 68 | } // namespace openstudio | ||
| 69 |