src/energyplus/ForwardTranslator/ForwardTranslateDuct.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/Duct.hpp" | ||
| 8 | #include "../../model/Duct_Impl.hpp" | ||
| 9 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 10 | #include <utilities/idd/IddEnums.hxx> | ||
| 11 | #include <utilities/idd/Duct_FieldEnums.hxx> | ||
| 12 | |||
| 13 | using namespace openstudio::model; | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | |||
| 17 | namespace energyplus { | ||
| 18 | |||
| 19 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateDuct(Duct& modelObject) { | |
| 20 | ✗ | IdfObject idfObject(openstudio::IddObjectType::Duct); | |
| 21 | |||
| 22 | ✗ | m_idfObjects.push_back(idfObject); | |
| 23 | |||
| 24 | ✗ | if (auto value = modelObject.name()) { | |
| 25 | ✗ | idfObject.setName(value.get()); | |
| 26 | ✗ | } | |
| 27 | |||
| 28 | ✗ | if (auto node = modelObject.inletModelObject()) { | |
| 29 | ✗ | idfObject.setString(openstudio::DuctFields::InletNodeName, node->name().get()); | |
| 30 | ✗ | } | |
| 31 | |||
| 32 | ✗ | if (auto node = modelObject.outletModelObject()) { | |
| 33 | ✗ | idfObject.setString(openstudio::DuctFields::OutletNodeName, node->name().get()); | |
| 34 | ✗ | } | |
| 35 | |||
| 36 | ✗ | return idfObject; | |
| 37 | ✗ | } | |
| 38 | |||
| 39 | } // namespace energyplus | ||
| 40 | |||
| 41 | } // namespace openstudio | ||
| 42 |