GCC Code Coverage Report


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

src/energyplus/ForwardTranslator/ForwardTranslateOutputVariable.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/OutputVariable.hpp"
10 #include "../../model/OutputVariable_Impl.hpp"
11 #include "../../model/Schedule.hpp"
12 #include "../../model/Schedule_Impl.hpp"
13
14 #include <utilities/idd/Output_Variable_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 148 boost::optional<IdfObject> ForwardTranslator::translateOutputVariable(OutputVariable& modelObject) {
27
28
2/2
✓ Branch 1 taken 148 times.
✓ Branch 4 taken 148 times.
148 IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_Variable, modelObject);
29
30
3/3
✓ Branch 1 taken 148 times.
✓ Branch 3 taken 60 times.
✓ Branch 4 taken 88 times.
148 if (!modelObject.isKeyValueDefaulted()) {
31
2/2
✓ Branch 1 taken 60 times.
✓ Branch 4 taken 60 times.
60 idfObject.setString(Output_VariableFields::KeyValue, modelObject.keyValue());
32 }
33
34
2/2
✓ Branch 1 taken 148 times.
✓ Branch 4 taken 148 times.
148 idfObject.setString(Output_VariableFields::VariableName, modelObject.variableName());
35
36
3/3
✓ Branch 1 taken 148 times.
✓ Branch 3 taken 63 times.
✓ Branch 4 taken 85 times.
148 if (!modelObject.isReportingFrequencyDefaulted()) {
37
2/2
✓ Branch 1 taken 63 times.
✓ Branch 4 taken 63 times.
63 idfObject.setString(Output_VariableFields::ReportingFrequency, modelObject.reportingFrequency());
38 }
39
40
2/3
✓ Branch 1 taken 148 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 148 times.
296 if (modelObject.schedule()) {
41 ✗ idfObject.setString(Output_VariableFields::ScheduleName, modelObject.schedule()->name().get());
42 }
43
44
1/1
✓ Branch 1 taken 148 times.
296 return idfObject;
45 148 }
46
47 } // namespace energyplus
48
49 } // namespace openstudio
50