GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 11 / 0 / 11
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 10 / 0 / 10

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 858 boost::optional<IdfObject> ForwardTranslator::translateOutputTableSummaryReports(OutputTableSummaryReports& modelObject) {
27 // If object has no report, don't bother translating
28
1/1
✓ Branch 1 taken 858 times.
858 std::vector<std::string> summaryReports = modelObject.summaryReports();
29
2/2
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 857 times.
858 if (summaryReports.empty()) {
30 1 return boost::none;
31 }
32
33
2/2
✓ Branch 1 taken 857 times.
✓ Branch 4 taken 857 times.
857 IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_Table_SummaryReports, modelObject);
34
35
2/2
✓ Branch 5 taken 870 times.
✓ Branch 6 taken 857 times.
1727 for (const std::string& summaryReport : summaryReports) {
36
1/1
✓ Branch 1 taken 870 times.
870 auto eg = idfObject.pushExtensibleGroup();
37
1/1
✓ Branch 1 taken 870 times.
870 eg.setString(Output_Table_SummaryReportsExtensibleFields::ReportName, summaryReport);
38 870 }
39
40
1/1
✓ Branch 1 taken 857 times.
857 return idfObject;
41 858 }
42
43 } // namespace energyplus
44
45 } // namespace openstudio
46