src/energyplus/ForwardTranslator/ForwardTranslateAvailabilityManagerDifferentialThermostat.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/AvailabilityManagerDifferentialThermostat.hpp" | ||
| 8 | #include "../../model/AvailabilityManagerDifferentialThermostat_Impl.hpp" | ||
| 9 | #include "../../model/Node.hpp" | ||
| 10 | #include "../../model/Node_Impl.hpp" | ||
| 11 | #include "../../utilities/core/Assert.hpp" | ||
| 12 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 13 | #include <utilities/idd/AvailabilityManager_DifferentialThermostat_FieldEnums.hxx> | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | using namespace std; | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | |||
| 21 | namespace energyplus { | ||
| 22 | |||
| 23 | boost::optional<IdfObject> | ||
| 24 | ✗ | ForwardTranslator::translateAvailabilityManagerDifferentialThermostat(AvailabilityManagerDifferentialThermostat& modelObject) { | |
| 25 | ✗ | IdfObject idfObject(IddObjectType::AvailabilityManager_DifferentialThermostat); | |
| 26 | ✗ | m_idfObjects.push_back(idfObject); | |
| 27 | |||
| 28 | // Name | ||
| 29 | ✗ | if (auto s = modelObject.name()) { | |
| 30 | ✗ | idfObject.setName(*s); | |
| 31 | ✗ | } | |
| 32 | |||
| 33 | // HotNodeName | ||
| 34 | ✗ | if (auto node = modelObject.hotNode()) { | |
| 35 | ✗ | idfObject.setString(AvailabilityManager_DifferentialThermostatFields::HotNodeName, node->name().get()); | |
| 36 | ✗ | } | |
| 37 | |||
| 38 | // ColdNodeName | ||
| 39 | ✗ | if (auto node = modelObject.coldNode()) { | |
| 40 | ✗ | idfObject.setString(AvailabilityManager_DifferentialThermostatFields::ColdNodeName, node->name().get()); | |
| 41 | ✗ | } | |
| 42 | |||
| 43 | // TemperatureDifferenceOnLimit | ||
| 44 | { | ||
| 45 | ✗ | auto value = modelObject.temperatureDifferenceOnLimit(); | |
| 46 | ✗ | idfObject.setDouble(AvailabilityManager_DifferentialThermostatFields::TemperatureDifferenceOnLimit, value); | |
| 47 | } | ||
| 48 | |||
| 49 | // TemperatureDifferenceOffLimit | ||
| 50 | { | ||
| 51 | ✗ | auto value = modelObject.temperatureDifferenceOffLimit(); | |
| 52 | ✗ | idfObject.setDouble(AvailabilityManager_DifferentialThermostatFields::TemperatureDifferenceOffLimit, value); | |
| 53 | } | ||
| 54 | |||
| 55 | ✗ | return idfObject; | |
| 56 | ✗ | } | |
| 57 | |||
| 58 | } // namespace energyplus | ||
| 59 | } // namespace openstudio | ||
| 60 |