src/energyplus/ForwardTranslator/ForwardTranslateHotWaterEquipmentDefinition.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 | |||
| 8 | #include "../../model/HotWaterEquipmentDefinition.hpp" | ||
| 9 | #include "../../model/HotWaterEquipmentDefinition_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/HotWaterEquipment_Definition_FieldEnums.hxx> | ||
| 12 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | |||
| 15 | using namespace openstudio::model; | ||
| 16 | |||
| 17 | namespace openstudio { | ||
| 18 | |||
| 19 | namespace energyplus { | ||
| 20 | |||
| 21 | 2 | boost::optional<IdfObject> ForwardTranslator::translateHotWaterEquipmentDefinition(HotWaterEquipmentDefinition& modelObject) { | |
| 22 | |||
| 23 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::HotWaterEquipment_Definition, modelObject); |
| 24 | |||
| 25 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(HotWaterEquipment_DefinitionFields::DesignLevelCalculationMethod, modelObject.designLevelCalculationMethod()); |
| 26 | |||
| 27 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<double> d = modelObject.designLevel()) { |
| 28 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(HotWaterEquipment_DefinitionFields::DesignLevel, *d); |
| 29 | } | ||
| 30 | |||
| 31 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
4 | if (boost::optional<double> d = modelObject.wattsperSpaceFloorArea()) { |
| 32 | ✗ | idfObject.setDouble(HotWaterEquipment_DefinitionFields::PowerperFloorArea, *d); | |
| 33 | } | ||
| 34 | |||
| 35 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
4 | if (boost::optional<double> d = modelObject.wattsperPerson()) { |
| 36 | ✗ | idfObject.setDouble(HotWaterEquipment_DefinitionFields::PowerperPerson, *d); | |
| 37 | } | ||
| 38 | |||
| 39 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | if (!modelObject.isFractionLatentDefaulted()) { |
| 40 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(HotWaterEquipment_DefinitionFields::FractionLatent, modelObject.fractionLatent()); |
| 41 | } | ||
| 42 | |||
| 43 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | if (!modelObject.isFractionRadiantDefaulted()) { |
| 44 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(HotWaterEquipment_DefinitionFields::FractionRadiant, modelObject.fractionRadiant()); |
| 45 | } | ||
| 46 | |||
| 47 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | if (!modelObject.isFractionLostDefaulted()) { |
| 48 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(HotWaterEquipment_DefinitionFields::FractionLost, modelObject.fractionLost()); |
| 49 | } | ||
| 50 | |||
| 51 |
1/1✓ Branch 1 taken 2 times.
|
4 | return idfObject; |
| 52 | 2 | } | |
| 53 | |||
| 54 | } // namespace energyplus | ||
| 55 | |||
| 56 | } // namespace openstudio | ||
| 57 |