src/energyplus/ForwardTranslator/ForwardTranslateOutputTableSummaryReports.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/OutputTableSummaryReports.hpp" | ||
| 10 | #include "../../model/OutputTableSummaryReports_Impl.hpp" | ||
| 11 | |||
| 12 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 13 | |||
| 14 | #include <utilities/idd/Output_Table_SummaryReports_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 | 844 | boost::optional<IdfObject> ForwardTranslator::translateOutputTableSummaryReports(OutputTableSummaryReports& modelObject) { | |
| 27 | // If object has no report, don't bother translating | ||
| 28 |
1/1✓ Branch 1 taken 844 times.
|
844 | std::vector<std::string> summaryReports = modelObject.summaryReports(); |
| 29 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 2 taken 843 times.
|
844 | if (summaryReports.empty()) { |
| 30 | 1 | return boost::none; | |
| 31 | } | ||
| 32 | |||
| 33 |
2/2✓ Branch 1 taken 843 times.
✓ Branch 4 taken 843 times.
|
843 | IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_Table_SummaryReports, modelObject); |
| 34 | |||
| 35 |
2/2✓ Branch 5 taken 856 times.
✓ Branch 6 taken 843 times.
|
1699 | for (const std::string& summaryReport : summaryReports) { |
| 36 |
1/1✓ Branch 1 taken 856 times.
|
856 | auto eg = idfObject.pushExtensibleGroup(); |
| 37 |
1/1✓ Branch 1 taken 856 times.
|
856 | eg.setString(Output_Table_SummaryReportsExtensibleFields::ReportName, summaryReport); |
| 38 | 856 | } | |
| 39 | |||
| 40 |
1/1✓ Branch 1 taken 843 times.
|
843 | return idfObject; |
| 41 | 844 | } | |
| 42 | |||
| 43 | } // namespace energyplus | ||
| 44 | |||
| 45 | } // namespace openstudio | ||
| 46 |