src/energyplus/ForwardTranslator/ForwardTranslateSetpointManagerWarmest.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/SetpointManagerWarmest.hpp" | ||
| 8 | #include "../../model/Node.hpp" | ||
| 9 | #include "../../model/AirLoopHVAC.hpp" | ||
| 10 | #include <utilities/idd/SetpointManager_Warmest_FieldEnums.hxx> | ||
| 11 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | namespace energyplus { | ||
| 19 | |||
| 20 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateSetpointManagerWarmest(SetpointManagerWarmest& modelObject) { | |
| 21 | ✗ | boost::optional<Node> node; | |
| 22 | ✗ | boost::optional<double> value; | |
| 23 | ✗ | std::string s; | |
| 24 | |||
| 25 | ✗ | IdfObject idfObject(IddObjectType::SetpointManager_Warmest); | |
| 26 | |||
| 27 | // Name | ||
| 28 | ✗ | s = modelObject.name().get(); | |
| 29 | ✗ | idfObject.setString(SetpointManager_WarmestFields::Name, s); | |
| 30 | |||
| 31 | // ControlVariable | ||
| 32 | ✗ | s = modelObject.controlVariable(); | |
| 33 | ✗ | idfObject.setString(SetpointManager_WarmestFields::ControlVariable, s); | |
| 34 | |||
| 35 | // MinimumSetpointTemperature | ||
| 36 | ✗ | value = modelObject.minimumSetpointTemperature(); | |
| 37 | ✗ | if (value) { | |
| 38 | ✗ | idfObject.setDouble(SetpointManager_WarmestFields::MinimumSetpointTemperature, value.get()); | |
| 39 | } | ||
| 40 | |||
| 41 | // MaximumSetpointTemperature | ||
| 42 | ✗ | value = modelObject.maximumSetpointTemperature(); | |
| 43 | ✗ | if (value) { | |
| 44 | ✗ | idfObject.setDouble(SetpointManager_WarmestFields::MaximumSetpointTemperature, value.get()); | |
| 45 | } | ||
| 46 | |||
| 47 | // Strategy | ||
| 48 | ✗ | s = modelObject.strategy(); | |
| 49 | ✗ | idfObject.setString(SetpointManager_WarmestFields::Strategy, s); | |
| 50 | |||
| 51 | // SetpointNodeorNodeListName | ||
| 52 | ✗ | node = modelObject.setpointNode(); | |
| 53 | ✗ | if (node) { | |
| 54 | ✗ | idfObject.setString(SetpointManager_WarmestFields::SetpointNodeorNodeListName, node->name().get()); | |
| 55 | |||
| 56 | // HVACAirLoopName | ||
| 57 | ✗ | if (boost::optional<model::AirLoopHVAC> airLoop = node->airLoopHVAC()) { | |
| 58 | ✗ | idfObject.setString(SetpointManager_WarmestFields::HVACAirLoopName, airLoop->name().get()); | |
| 59 | ✗ | } | |
| 60 | } | ||
| 61 | |||
| 62 | ✗ | m_idfObjects.push_back(idfObject); | |
| 63 | |||
| 64 | ✗ | return idfObject; | |
| 65 | ✗ | } | |
| 66 | |||
| 67 | } // namespace energyplus | ||
| 68 | |||
| 69 | } // namespace openstudio | ||
| 70 |