src/energyplus/ForwardTranslator/ForwardTranslateOutputConstructions.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 | #include "../../model/Model.hpp" | ||
| 8 | |||
| 9 | #include "../../model/OutputConstructions.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Output_Constructions_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 | 5 | boost::optional<IdfObject> ForwardTranslator::translateOutputConstructions(OutputConstructions& modelObject) { | |
| 22 | // If nothing to write, don't | ||
| 23 |
1/1✓ Branch 1 taken 5 times.
|
5 | bool reportConstructions = modelObject.reportConstructions(); |
| 24 |
1/1✓ Branch 1 taken 5 times.
|
5 | bool reportMaterials = modelObject.reportMaterials(); |
| 25 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 1 time.
|
5 | if (!reportConstructions && !reportMaterials) { |
| 26 | 1 | return boost::none; | |
| 27 | } | ||
| 28 | |||
| 29 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_Constructions, modelObject); |
| 30 | |||
| 31 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
|
4 | if (reportConstructions) { |
| 32 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setString(Output_ConstructionsFields::DetailsType1, "Constructions"); |
| 33 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 2 times.
|
3 | if (reportMaterials) { |
| 34 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | idfObject.setString(Output_ConstructionsFields::DetailsType2, "Materials"); |
| 35 | } | ||
| 36 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | } else if (reportMaterials) { |
| 37 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | idfObject.setString(Output_ConstructionsFields::DetailsType1, "Materials"); |
| 38 | } | ||
| 39 | |||
| 40 |
1/1✓ Branch 1 taken 4 times.
|
4 | return idfObject; |
| 41 | 4 | } | |
| 42 | |||
| 43 | } // namespace energyplus | ||
| 44 | |||
| 45 | } // namespace openstudio | ||
| 46 |