src/energyplus/ForwardTranslator/ForwardTranslateRefrigerationSubcoolerMechanical.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/RefrigerationSystem.hpp" | ||
| 9 | #include "../../model/RefrigerationSubcoolerMechanical.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Refrigeration_Subcooler_FieldEnums.hxx> | ||
| 12 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | #include <utilities/idd/IddFactory.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | |||
| 20 | namespace energyplus { | ||
| 21 | |||
| 22 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateRefrigerationSubcoolerMechanical(RefrigerationSubcoolerMechanical& modelObject) { | |
| 23 | ✗ | OptionalModelObject temp; | |
| 24 | ✗ | OptionalString optS; | |
| 25 | ✗ | boost::optional<std::string> s; | |
| 26 | ✗ | boost::optional<double> d; | |
| 27 | |||
| 28 | // Name | ||
| 29 | ✗ | IdfObject subcoolerMechanical = createRegisterAndNameIdfObject(openstudio::IddObjectType::Refrigeration_Subcooler, modelObject); | |
| 30 | |||
| 31 | ✗ | subcoolerMechanical.setString(Refrigeration_SubcoolerFields::SubcoolerType, "Mechanical"); | |
| 32 | |||
| 33 | // Capacity-Providing System | ||
| 34 | ✗ | boost::optional<RefrigerationSystem> capacityProvidingSystem = modelObject.capacityProvidingSystem(); | |
| 35 | |||
| 36 | ✗ | if (capacityProvidingSystem) { | |
| 37 | ✗ | boost::optional<IdfObject> _capacityProvidingSystem = translateAndMapModelObject(capacityProvidingSystem.get()); | |
| 38 | |||
| 39 | ✗ | if (_capacityProvidingSystem && _capacityProvidingSystem->name()) { | |
| 40 | ✗ | subcoolerMechanical.setString(Refrigeration_SubcoolerFields::CapacityProvidingSystem, _capacityProvidingSystem->name().get()); | |
| 41 | } | ||
| 42 | ✗ | } | |
| 43 | |||
| 44 | // Outlet Control Temperature | ||
| 45 | ✗ | d = modelObject.outletControlTemperature(); | |
| 46 | ✗ | if (d) { | |
| 47 | ✗ | subcoolerMechanical.setDouble(Refrigeration_SubcoolerFields::OutletControlTemperature, d.get()); | |
| 48 | } | ||
| 49 | |||
| 50 | ✗ | return subcoolerMechanical; | |
| 51 | ✗ | } | |
| 52 | } // namespace energyplus | ||
| 53 | } // namespace openstudio | ||
| 54 |