src/energyplus/ForwardTranslator/ForwardTranslateFoundationKiva.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/Model.hpp" | ||
| 9 | #include "../../model/FoundationKiva.hpp" | ||
| 10 | #include "../../model/FoundationKiva_Impl.hpp" | ||
| 11 | #include "../../model/Material.hpp" | ||
| 12 | #include "../../model/Material_Impl.hpp" | ||
| 13 | #include "../../model/ConstructionBase.hpp" | ||
| 14 | #include "../../model/ConstructionBase_Impl.hpp" | ||
| 15 | |||
| 16 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 17 | |||
| 18 | #include <utilities/idd/Foundation_Kiva_FieldEnums.hxx> | ||
| 19 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 20 | #include <utilities/idd/IddEnums.hxx> | ||
| 21 | |||
| 22 | using namespace openstudio::model; | ||
| 23 | |||
| 24 | using namespace std; | ||
| 25 | |||
| 26 | namespace openstudio { | ||
| 27 | |||
| 28 | namespace energyplus { | ||
| 29 | |||
| 30 | 1 | boost::optional<IdfObject> ForwardTranslator::translateFoundationKiva(FoundationKiva& modelObject) { | |
| 31 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject(openstudio::IddObjectType::Foundation_Kiva); |
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(idfObject); |
| 34 | |||
| 35 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | idfObject.setString(Foundation_KivaFields::Name, modelObject.name().get()); |
| 36 | |||
| 37 | 1 | boost::optional<double> value; | |
| 38 | |||
| 39 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if ((value = modelObject.initialIndoorAirTemperature())) { |
| 40 | ✗ | idfObject.setDouble(Foundation_KivaFields::InitialIndoorAirTemperature, value.get()); | |
| 41 | } | ||
| 42 | |||
| 43 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<Material> interiorHorizontalInsulationMaterial = modelObject.interiorHorizontalInsulationMaterial(); |
| 44 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (interiorHorizontalInsulationMaterial) { |
| 45 | ✗ | idfObject.setString(Foundation_KivaFields::InteriorHorizontalInsulationMaterialName, interiorHorizontalInsulationMaterial->name().get()); | |
| 46 | ✗ | idfObject.setDouble(Foundation_KivaFields::InteriorHorizontalInsulationDepth, modelObject.interiorHorizontalInsulationDepth()); | |
| 47 | } | ||
| 48 | |||
| 49 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if ((value = modelObject.interiorHorizontalInsulationWidth())) { |
| 50 | ✗ | idfObject.setDouble(Foundation_KivaFields::InteriorHorizontalInsulationWidth, value.get()); | |
| 51 | } | ||
| 52 | |||
| 53 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<Material> interiorVerticalInsulationMaterial = modelObject.interiorVerticalInsulationMaterial(); |
| 54 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (interiorVerticalInsulationMaterial) { |
| 55 | ✗ | idfObject.setString(Foundation_KivaFields::InteriorVerticalInsulationMaterialName, interiorVerticalInsulationMaterial->name().get()); | |
| 56 | } | ||
| 57 | |||
| 58 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if ((value = modelObject.interiorVerticalInsulationDepth())) { |
| 59 | ✗ | idfObject.setDouble(Foundation_KivaFields::InteriorVerticalInsulationDepth, value.get()); | |
| 60 | } | ||
| 61 | |||
| 62 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<Material> exteriorHorizontalInsulationMaterial = modelObject.exteriorHorizontalInsulationMaterial(); |
| 63 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (exteriorHorizontalInsulationMaterial) { |
| 64 | ✗ | idfObject.setString(Foundation_KivaFields::ExteriorHorizontalInsulationMaterialName, exteriorHorizontalInsulationMaterial->name().get()); | |
| 65 | ✗ | idfObject.setDouble(Foundation_KivaFields::ExteriorHorizontalInsulationWidth, modelObject.exteriorHorizontalInsulationWidth()); | |
| 66 | } | ||
| 67 | |||
| 68 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if ((value = modelObject.exteriorHorizontalInsulationDepth())) { |
| 69 | ✗ | idfObject.setDouble(Foundation_KivaFields::ExteriorHorizontalInsulationDepth, value.get()); | |
| 70 | } | ||
| 71 | |||
| 72 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<Material> exteriorVerticalInsulationMaterial = modelObject.exteriorVerticalInsulationMaterial(); |
| 73 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (exteriorVerticalInsulationMaterial) { |
| 74 | ✗ | idfObject.setString(Foundation_KivaFields::ExteriorVerticalInsulationMaterialName, exteriorVerticalInsulationMaterial->name().get()); | |
| 75 | } | ||
| 76 | |||
| 77 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if ((value = modelObject.exteriorVerticalInsulationDepth())) { |
| 78 | ✗ | idfObject.setDouble(Foundation_KivaFields::ExteriorVerticalInsulationDepth, value.get()); | |
| 79 | } | ||
| 80 | |||
| 81 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(Foundation_KivaFields::WallHeightAboveGrade, modelObject.wallHeightAboveGrade()); |
| 82 | |||
| 83 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(Foundation_KivaFields::WallDepthBelowSlab, modelObject.wallDepthBelowSlab()); |
| 84 | |||
| 85 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<ConstructionBase> footingWallConstruction = modelObject.footingWallConstruction(); |
| 86 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (footingWallConstruction) { |
| 87 | ✗ | idfObject.setString(Foundation_KivaFields::FootingWallConstructionName, footingWallConstruction->name().get()); | |
| 88 | } | ||
| 89 | |||
| 90 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<Material> footingMaterial = modelObject.footingMaterial(); |
| 91 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (footingMaterial) { |
| 92 | ✗ | idfObject.setString(Foundation_KivaFields::FootingMaterialName, footingMaterial->name().get()); | |
| 93 | ✗ | idfObject.setDouble(Foundation_KivaFields::FootingDepth, modelObject.footingDepth()); | |
| 94 | } | ||
| 95 | |||
| 96 | //UserDefinedCustomBlocks | ||
| 97 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<CustomBlock> customBlocks = modelObject.customBlocks(); |
| 98 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!customBlocks.empty()) { |
| 99 | ✗ | for (const CustomBlock& customBlock : customBlocks) { | |
| 100 | ✗ | auto eg = idfObject.pushExtensibleGroup(); | |
| 101 | ✗ | eg.setString(Foundation_KivaExtensibleFields::CustomBlockMaterialName, customBlock.material().name().get()); | |
| 102 | ✗ | eg.setDouble(Foundation_KivaExtensibleFields::CustomBlockDepth, customBlock.depth()); | |
| 103 | ✗ | eg.setDouble(Foundation_KivaExtensibleFields::CustomBlockXPosition, customBlock.xPosition()); | |
| 104 | ✗ | eg.setDouble(Foundation_KivaExtensibleFields::CustomBlockZPosition, customBlock.zPosition()); | |
| 105 | ✗ | } | |
| 106 | } | ||
| 107 | |||
| 108 |
1/1✓ Branch 1 taken 1 time.
|
2 | return boost::optional<IdfObject>(idfObject); |
| 109 | 1 | } | |
| 110 | |||
| 111 | } // namespace energyplus | ||
| 112 | |||
| 113 | } // namespace openstudio | ||
| 114 |