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: 90.0% 18 / 0 / 20

src/energyplus/ForwardTranslator/ForwardTranslateSizingParameters.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/SizingParameters.hpp"
9 #include "../../model/SizingParameters_Impl.hpp"
10
11 #include <utilities/idd/Sizing_Parameters_FieldEnums.hxx>
12 #include "../../utilities/idd/IddEnums.hpp"
13 #include <utilities/idd/IddEnums.hxx>
14
15 using namespace openstudio::model;
16
17 using namespace std;
18
19 namespace openstudio {
20
21 namespace energyplus {
22
23 870 boost::optional<IdfObject> ForwardTranslator::translateSizingParameters(SizingParameters& modelObject) {
24
2/2
✓ Branch 1 taken 870 times.
✓ Branch 4 taken 870 times.
870 IdfObject idfObject(openstudio::IddObjectType::Sizing_Parameters);
25
26
1/1
✓ Branch 1 taken 870 times.
870 m_idfObjects.push_back(idfObject);
27
28
2/3
✓ Branch 1 taken 870 times.
✓ Branch 3 taken 870 times.
✗ Branch 4 not taken.
870 if (!modelObject.isHeatingSizingFactorDefaulted()) {
29
2/2
✓ Branch 1 taken 870 times.
✓ Branch 4 taken 870 times.
870 idfObject.setDouble(Sizing_ParametersFields::HeatingSizingFactor, modelObject.heatingSizingFactor());
30 }
31
32
2/3
✓ Branch 1 taken 870 times.
✓ Branch 3 taken 870 times.
✗ Branch 4 not taken.
870 if (!modelObject.isCoolingSizingFactorDefaulted()) {
33
2/2
✓ Branch 1 taken 870 times.
✓ Branch 4 taken 870 times.
870 idfObject.setDouble(Sizing_ParametersFields::CoolingSizingFactor, modelObject.coolingSizingFactor());
34 }
35
36
3/3
✓ Branch 1 taken 870 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 869 times.
1740 if (modelObject.timestepsinAveragingWindow()) {
37
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setInt(Sizing_ParametersFields::TimestepsinAveragingWindow, modelObject.timestepsinAveragingWindow().get());
38 }
39
40
1/1
✓ Branch 1 taken 870 times.
1740 return idfObject;
41 870 }
42
43 } // namespace energyplus
44
45 } // namespace openstudio
46