src/energyplus/ForwardTranslator/ForwardTranslateConstruction.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/Construction.hpp" | ||
| 10 | #include "../../model/Construction_Impl.hpp" | ||
| 11 | #include "../../model/Material.hpp" | ||
| 12 | #include "../../model/Material_Impl.hpp" | ||
| 13 | #include "../../model/LifeCycleCost.hpp" | ||
| 14 | #include "../../model/ShadingControl.hpp" | ||
| 15 | |||
| 16 | #include <utilities/idd/Construction_FieldEnums.hxx> | ||
| 17 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 18 | #include <utilities/idd/IddEnums.hxx> | ||
| 19 | #include <utilities/idd/IddFactory.hxx> | ||
| 20 | |||
| 21 | using namespace openstudio::model; | ||
| 22 | |||
| 23 | using namespace std; | ||
| 24 | |||
| 25 | namespace openstudio { | ||
| 26 | |||
| 27 | namespace energyplus { | ||
| 28 | |||
| 29 | 494 | boost::optional<IdfObject> ForwardTranslator::translateConstruction(Construction& modelObject) { | |
| 30 |
2/2✓ Branch 1 taken 494 times.
✓ Branch 4 taken 494 times.
|
494 | IdfObject construction(openstudio::IddObjectType::Construction); |
| 31 |
1/1✓ Branch 1 taken 494 times.
|
494 | m_idfObjects.push_back(construction); |
| 32 | |||
| 33 |
4/4✓ Branch 1 taken 494 times.
✓ Branch 7 taken 4 times.
✓ Branch 11 taken 4 times.
✓ Branch 12 taken 494 times.
|
498 | for (LifeCycleCost lifeCycleCost : modelObject.lifeCycleCosts()) { |
| 34 |
1/1✓ Branch 1 taken 4 times.
|
4 | translateAndMapModelObject(lifeCycleCost); |
| 35 | 498 | } | |
| 36 | |||
| 37 |
3/3✓ Branch 1 taken 494 times.
✓ Branch 4 taken 494 times.
✓ Branch 7 taken 494 times.
|
494 | construction.setName(modelObject.name().get()); |
| 38 | |||
| 39 |
1/1✓ Branch 1 taken 494 times.
|
494 | MaterialVector layers = modelObject.layers(); |
| 40 | |||
| 41 | 494 | unsigned fieldIndex = 1; | |
| 42 |
2/2✓ Branch 1 taken 1095 times.
✓ Branch 2 taken 494 times.
|
1589 | for (unsigned layerIndex = 0; layerIndex < layers.size(); ++layerIndex) { |
| 43 |
1/1✓ Branch 2 taken 1095 times.
|
1095 | Material material = layers[layerIndex]; |
| 44 |
1/1✓ Branch 1 taken 1095 times.
|
1095 | translateAndMapModelObject(material); |
| 45 |
3/3✓ Branch 1 taken 1095 times.
✓ Branch 4 taken 1095 times.
✓ Branch 7 taken 1095 times.
|
1095 | construction.setString(fieldIndex++, material.name().get()); |
| 46 | 1095 | } | |
| 47 | |||
| 48 |
1/1✓ Branch 1 taken 494 times.
|
988 | return boost::optional<IdfObject>(construction); |
| 49 | 494 | } | |
| 50 | |||
| 51 | } // namespace energyplus | ||
| 52 | |||
| 53 | } // namespace openstudio | ||
| 54 |