src/energyplus/ForwardTranslator/ForwardTranslateElectricEquipmentDefinition.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/ElectricEquipmentDefinition.hpp" | ||
| 9 | #include "../../model/ElectricEquipmentDefinition_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/ElectricEquipment_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 | 176 | boost::optional<IdfObject> ForwardTranslator::translateElectricEquipmentDefinition(ElectricEquipmentDefinition& modelObject) { | |
| 22 | |||
| 23 |
2/2✓ Branch 1 taken 176 times.
✓ Branch 4 taken 176 times.
|
176 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ElectricEquipment_Definition, modelObject); |
| 24 | |||
| 25 |
2/2✓ Branch 1 taken 176 times.
✓ Branch 4 taken 176 times.
|
176 | idfObject.setString(ElectricEquipment_DefinitionFields::DesignLevelCalculationMethod, modelObject.designLevelCalculationMethod()); |
| 26 | |||
| 27 |
3/3✓ Branch 1 taken 176 times.
✓ Branch 3 taken 138 times.
✓ Branch 4 taken 38 times.
|
352 | if (boost::optional<double> d = modelObject.designLevel()) { |
| 28 |
2/2✓ Branch 1 taken 138 times.
✓ Branch 4 taken 138 times.
|
138 | idfObject.setDouble(ElectricEquipment_DefinitionFields::DesignLevel, *d); |
| 29 | } | ||
| 30 | |||
| 31 |
3/3✓ Branch 1 taken 176 times.
✓ Branch 3 taken 38 times.
✓ Branch 4 taken 138 times.
|
352 | if (boost::optional<double> d = modelObject.wattsperSpaceFloorArea()) { |
| 32 |
2/2✓ Branch 1 taken 38 times.
✓ Branch 4 taken 38 times.
|
38 | idfObject.setDouble(ElectricEquipment_DefinitionFields::WattsperFloorArea, *d); |
| 33 | } | ||
| 34 | |||
| 35 |
2/3✓ Branch 1 taken 176 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 176 times.
|
352 | if (boost::optional<double> d = modelObject.wattsperPerson()) { |
| 36 | ✗ | idfObject.setDouble(ElectricEquipment_DefinitionFields::WattsperPerson, *d); | |
| 37 | } | ||
| 38 | |||
| 39 |
3/3✓ Branch 1 taken 176 times.
✓ Branch 3 taken 9 times.
✓ Branch 4 taken 167 times.
|
176 | if (!modelObject.isFractionLatentDefaulted()) { |
| 40 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(ElectricEquipment_DefinitionFields::FractionLatent, modelObject.fractionLatent()); |
| 41 | } | ||
| 42 | |||
| 43 |
3/3✓ Branch 1 taken 176 times.
✓ Branch 3 taken 99 times.
✓ Branch 4 taken 77 times.
|
176 | if (!modelObject.isFractionRadiantDefaulted()) { |
| 44 |
2/2✓ Branch 1 taken 99 times.
✓ Branch 4 taken 99 times.
|
99 | idfObject.setDouble(ElectricEquipment_DefinitionFields::FractionRadiant, modelObject.fractionRadiant()); |
| 45 | } | ||
| 46 | |||
| 47 |
3/3✓ Branch 1 taken 176 times.
✓ Branch 3 taken 9 times.
✓ Branch 4 taken 167 times.
|
176 | if (!modelObject.isFractionLostDefaulted()) { |
| 48 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(ElectricEquipment_DefinitionFields::FractionLost, modelObject.fractionLost()); |
| 49 | } | ||
| 50 | |||
| 51 |
1/1✓ Branch 1 taken 176 times.
|
352 | return idfObject; |
| 52 | 176 | } | |
| 53 | |||
| 54 | } // namespace energyplus | ||
| 55 | |||
| 56 | } // namespace openstudio | ||
| 57 |