src/energyplus/ReverseTranslator/ReverseTranslateOutputTableSummaryReports.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 "../ReverseTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/OutputTableSummaryReports.hpp" | ||
| 9 | #include "../../model/OutputTableSummaryReports_Impl.hpp" | ||
| 10 | |||
| 11 | #include "../../utilities/idf/WorkspaceExtensibleGroup.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/Output_Table_SummaryReports_FieldEnums.hxx> | ||
| 14 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 15 | #include <utilities/idd/IddEnums.hxx> | ||
| 16 | |||
| 17 | #include "../../utilities/core/Assert.hpp" | ||
| 18 | |||
| 19 | using namespace openstudio::model; | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace energyplus { | ||
| 24 | |||
| 25 | 38 | OptionalModelObject ReverseTranslator::translateOutputTableSummaryReports(const WorkspaceObject& workspaceObject) { | |
| 26 |
4/5✓ Branch 1 taken 38 times.
✓ Branch 4 taken 38 times.
✓ Branch 7 taken 38 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 38 times.
|
38 | if (workspaceObject.iddObject().type() != IddObjectType::Output_Table_SummaryReports) { |
| 27 | ✗ | LOG(Error, "WorkspaceObject is not IddObjectType: OutputTableSummaryReports"); | |
| 28 | ✗ | return boost::none; | |
| 29 | } | ||
| 30 | |||
| 31 |
1/1✓ Branch 1 taken 38 times.
|
38 | OutputTableSummaryReports outputTableSummaryReports = m_model.getUniqueModelObject<OutputTableSummaryReports>(); |
| 32 | |||
| 33 |
3/3✓ Branch 1 taken 38 times.
✓ Branch 8 taken 66 times.
✓ Branch 9 taken 38 times.
|
104 | for (const IdfExtensibleGroup& idfGroup : workspaceObject.extensibleGroups()) { |
| 34 |
1/1✓ Branch 1 taken 66 times.
|
66 | auto workspaceGroup = idfGroup.cast<WorkspaceExtensibleGroup>(); |
| 35 |
1/1✓ Branch 1 taken 66 times.
|
66 | OptionalString summaryReport = workspaceGroup.getString(Output_Table_SummaryReportsExtensibleFields::ReportName); |
| 36 | |||
| 37 | // add the summary report | ||
| 38 |
2/2✓ Branch 1 taken 66 times.
✓ Branch 4 taken 66 times.
|
66 | outputTableSummaryReports.addSummaryReport(*summaryReport); |
| 39 | 104 | } | |
| 40 | |||
| 41 |
1/1✓ Branch 1 taken 38 times.
|
38 | std::vector<std::string> summaryReports = outputTableSummaryReports.summaryReports(); |
| 42 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 38 times.
|
38 | if (summaryReports.empty()) { |
| 43 | ✗ | return boost::none; | |
| 44 | } | ||
| 45 | |||
| 46 |
1/1✓ Branch 1 taken 38 times.
|
38 | return outputTableSummaryReports; |
| 47 | 38 | } | |
| 48 | |||
| 49 | } // namespace energyplus | ||
| 50 | |||
| 51 | } // namespace openstudio | ||
| 52 |