src/energyplus/ForwardTranslator/ForwardTranslateZoneControlHumidistat.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/ZoneControlHumidistat.hpp" | ||
| 8 | #include "../../model/Schedule.hpp" | ||
| 9 | #include <utilities/idd/ZoneControl_Humidistat_FieldEnums.hxx> | ||
| 10 | #include <utilities/idd/IddEnums.hxx> | ||
| 11 | |||
| 12 | using namespace openstudio::model; | ||
| 13 | |||
| 14 | namespace openstudio { | ||
| 15 | |||
| 16 | namespace energyplus { | ||
| 17 | |||
| 18 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateZoneControlHumidistat(ZoneControlHumidistat& modelObject) { | |
| 19 | ✗ | boost::optional<IdfObject> result; | |
| 20 | |||
| 21 | ✗ | auto humidifyingSchedule = modelObject.humidifyingRelativeHumiditySetpointSchedule(); | |
| 22 | ✗ | auto dehumidifyingSchedule = modelObject.dehumidifyingRelativeHumiditySetpointSchedule(); | |
| 23 | |||
| 24 | ✗ | if (humidifyingSchedule || dehumidifyingSchedule) { | |
| 25 | // Name | ||
| 26 | ✗ | result = createRegisterAndNameIdfObject(openstudio::IddObjectType::ZoneControl_Humidistat, modelObject); | |
| 27 | |||
| 28 | // Zone Name | ||
| 29 | // set by ThermalZone | ||
| 30 | |||
| 31 | // Humidifying Setpoint Schedule Name | ||
| 32 | ✗ | if (humidifyingSchedule) { | |
| 33 | ✗ | boost::optional<IdfObject> _humidifyingSchedule = translateAndMapModelObject(humidifyingSchedule.get()); | |
| 34 | |||
| 35 | ✗ | if (_humidifyingSchedule && _humidifyingSchedule->name()) { | |
| 36 | ✗ | result->setString(ZoneControl_HumidistatFields::HumidifyingSetpointScheduleName, _humidifyingSchedule->name().get()); | |
| 37 | } | ||
| 38 | ✗ | } | |
| 39 | |||
| 40 | // Dehumidifying Setpoint Schedule Name | ||
| 41 | ✗ | if (dehumidifyingSchedule) { | |
| 42 | ✗ | boost::optional<IdfObject> _dehumidifyingSchedule = translateAndMapModelObject(dehumidifyingSchedule.get()); | |
| 43 | |||
| 44 | ✗ | if (_dehumidifyingSchedule && _dehumidifyingSchedule->name()) { | |
| 45 | ✗ | result->setString(ZoneControl_HumidistatFields::DehumidifyingSetpointScheduleName, _dehumidifyingSchedule->name().get()); | |
| 46 | } | ||
| 47 | ✗ | } | |
| 48 | } | ||
| 49 | |||
| 50 | ✗ | return result; | |
| 51 | ✗ | } | |
| 52 | |||
| 53 | } // namespace energyplus | ||
| 54 | |||
| 55 | } // namespace openstudio | ||
| 56 |