src/energyplus/ReverseTranslator/ReverseTranslateCoilSystemCoolingDX.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 "../ReverseTranslator.hpp" | ||
| 7 | #include "../../model/CoilCoolingDXSingleSpeed.hpp" | ||
| 8 | #include "../../model/CoilCoolingDXSingleSpeed_Impl.hpp" | ||
| 9 | #include "../../model/Schedule.hpp" | ||
| 10 | #include "../../model/Schedule_Impl.hpp" | ||
| 11 | #include "../../model/CurveBiquadratic.hpp" | ||
| 12 | #include "../../model/CurveBiquadratic_Impl.hpp" | ||
| 13 | #include "../../model/CurveQuadratic.hpp" | ||
| 14 | #include "../../model/CurveQuadratic_Impl.hpp" | ||
| 15 | #include <utilities/idd/CoilSystem_Cooling_DX_FieldEnums.hxx> | ||
| 16 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 17 | #include <utilities/idd/IddEnums.hxx> | ||
| 18 | |||
| 19 | using namespace openstudio::model; | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace energyplus { | ||
| 24 | |||
| 25 | ✗ | OptionalModelObject ReverseTranslator::translateCoilSystemCoolingDX(const WorkspaceObject& workspaceObject) { | |
| 26 | ✗ | if (workspaceObject.iddObject().type() != IddObjectType::CoilSystem_Cooling_DX) { | |
| 27 | ✗ | LOG(Error, "WorkspaceObject is not IddObjectType: CoilSystem:Cooling:DX"); | |
| 28 | ✗ | return boost::none; | |
| 29 | } | ||
| 30 | |||
| 31 | ✗ | Workspace workspace = workspaceObject.workspace(); | |
| 32 | |||
| 33 | ✗ | boost::optional<std::string> coolingCoilObjectType; | |
| 34 | ✗ | boost::optional<std::string> coolingCoilName; | |
| 35 | |||
| 36 | ✗ | coolingCoilObjectType = workspaceObject.getString(CoilSystem_Cooling_DXFields::CoolingCoilObjectType); | |
| 37 | ✗ | coolingCoilName = workspaceObject.getString(CoilSystem_Cooling_DXFields::CoolingCoilName); | |
| 38 | |||
| 39 | ✗ | boost::optional<WorkspaceObject> wo; | |
| 40 | |||
| 41 | ✗ | if (coolingCoilObjectType && coolingCoilName) { | |
| 42 | ✗ | wo = workspace.getObjectByTypeAndName(IddObjectType(coolingCoilObjectType.get()), coolingCoilName.get()); | |
| 43 | } | ||
| 44 | |||
| 45 | ✗ | if (wo) { | |
| 46 | ✗ | return translateAndMapWorkspaceObject(wo.get()); | |
| 47 | } else { | ||
| 48 | ✗ | return boost::none; | |
| 49 | } | ||
| 50 | ✗ | } | |
| 51 | |||
| 52 | } // namespace energyplus | ||
| 53 | |||
| 54 | } // namespace openstudio | ||
| 55 |