src/energyplus/ForwardTranslator/ForwardTranslateDaylightingDeviceTubular.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/DaylightingDeviceTubular.hpp" | ||
| 9 | #include "../../model/SubSurface.hpp" | ||
| 10 | #include "../../model/ConstructionBase.hpp" | ||
| 11 | |||
| 12 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 13 | |||
| 14 | #include <utilities/idd/DaylightingDevice_Tubular_FieldEnums.hxx> | ||
| 15 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | |||
| 18 | using namespace openstudio::model; | ||
| 19 | |||
| 20 | using namespace std; | ||
| 21 | |||
| 22 | namespace openstudio { | ||
| 23 | |||
| 24 | namespace energyplus { | ||
| 25 | |||
| 26 | 1 | boost::optional<IdfObject> ForwardTranslator::translateDaylightingDeviceTubular(model::DaylightingDeviceTubular& modelObject) { | |
| 27 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::DaylightingDevice_Tubular, modelObject); |
| 28 | |||
| 29 |
1/1✓ Branch 1 taken 1 time.
|
1 | SubSurface subSurfaceDome = modelObject.subSurfaceDome(); |
| 30 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<IdfObject> subSurfDome = translateAndMapModelObject(subSurfaceDome)) { |
| 31 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(DaylightingDevice_TubularFields::DomeName, subSurfDome->name().get()); |
| 32 | 1 | } | |
| 33 | |||
| 34 |
1/1✓ Branch 1 taken 1 time.
|
1 | SubSurface subSurfaceDiffuser = modelObject.subSurfaceDiffuser(); |
| 35 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<IdfObject> subSurfDiffuser = translateAndMapModelObject(subSurfaceDiffuser)) { |
| 36 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(DaylightingDevice_TubularFields::DiffuserName, subSurfDiffuser->name().get()); |
| 37 | 1 | } | |
| 38 | |||
| 39 |
1/1✓ Branch 1 taken 1 time.
|
1 | ConstructionBase construction = modelObject.construction(); |
| 40 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | idfObject.setString(DaylightingDevice_TubularFields::ConstructionName, construction.name().get()); |
| 41 | |||
| 42 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(DaylightingDevice_TubularFields::Diameter, modelObject.diameter()); |
| 43 | |||
| 44 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(DaylightingDevice_TubularFields::TotalLength, modelObject.totalLength()); |
| 45 | |||
| 46 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(DaylightingDevice_TubularFields::EffectiveThermalResistance, modelObject.effectiveThermalResistance()); |
| 47 | |||
| 48 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<TransitionZone> transitionZones = modelObject.transitionZones(); |
| 49 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | if (!transitionZones.empty()) { |
| 50 |
2/2✓ Branch 5 taken 2 times.
✓ Branch 6 taken 1 time.
|
3 | for (const TransitionZone& transitionZone : transitionZones) { |
| 51 |
1/1✓ Branch 1 taken 2 times.
|
2 | auto eg = idfObject.pushExtensibleGroup(); |
| 52 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | eg.setString(DaylightingDevice_TubularExtensibleFields::TransitionZoneName, transitionZone.thermalZone().name().get()); |
| 53 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | eg.setDouble(DaylightingDevice_TubularExtensibleFields::TransitionZoneLength, transitionZone.length()); |
| 54 | 2 | } | |
| 55 | } | ||
| 56 | |||
| 57 |
1/1✓ Branch 1 taken 1 time.
|
2 | return idfObject; |
| 58 | 1 | } | |
| 59 | |||
| 60 | } // namespace energyplus | ||
| 61 | |||
| 62 | } // namespace openstudio | ||
| 63 |