GCC Code Coverage Report


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

src/energyplus/ReverseTranslator/ReverseTranslateOutputMeterCumulativeMeterFileOnly.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/OutputMeter.hpp"
9 #include "../../model/OutputMeter_Impl.hpp"
10
11 #include <utilities/idd/Output_Meter_Cumulative_MeterFileOnly_FieldEnums.hxx>
12
13 using namespace openstudio::model;
14
15 namespace openstudio {
16
17 namespace energyplus {
18
19 2 OptionalModelObject ReverseTranslator::translateOutputMeterCumulativeMeterFileOnly(const WorkspaceObject& workspaceObject) {
20
1/1
✓ Branch 1 taken 2 times.
2 openstudio::model::OutputMeter meter(m_model);
21
22
1/1
✓ Branch 1 taken 2 times.
2 OptionalString s = workspaceObject.getString(Output_Meter_Cumulative_MeterFileOnlyFields::KeyName);
23
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
24
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 meter.setName(*s);
25 }
26
27
1/1
✓ Branch 1 taken 2 times.
2 s = workspaceObject.getString(Output_Meter_Cumulative_MeterFileOnlyFields::ReportingFrequency);
28
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
29
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 meter.setReportingFrequency(*s);
30 }
31
32
1/1
✓ Branch 1 taken 2 times.
2 meter.setMeterFileOnly(true);
33
34
1/1
✓ Branch 1 taken 2 times.
2 meter.setCumulative(true);
35
36
1/1
✓ Branch 1 taken 2 times.
4 return meter;
37 2 }
38
39 } // namespace energyplus
40
41 } // namespace openstudio
42