GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.6% 25 / 0 / 31
Functions: 100.0% 1 / 0 / 1
Branches: 63.0% 34 / 0 / 54

src/energyplus/ReverseTranslator/ReverseTranslatePerformancePrecisionTradeoffs.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/PerformancePrecisionTradeoffs.hpp"
9 #include "../../model/PerformancePrecisionTradeoffs_Impl.hpp"
10
11 #include <utilities/idd/PerformancePrecisionTradeoffs_FieldEnums.hxx>
12 #include "../../utilities/idd/IddEnums.hpp"
13 #include <utilities/idd/IddEnums.hxx>
14
15 #include "../../utilities/core/Assert.hpp"
16
17 using namespace openstudio::model;
18
19 namespace openstudio {
20
21 namespace energyplus {
22
23 2 OptionalModelObject ReverseTranslator::translatePerformancePrecisionTradeoffs(const WorkspaceObject& workspaceObject) {
24
4/5
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
2 if (workspaceObject.iddObject().type() != IddObjectType::PerformancePrecisionTradeoffs) {
25 ✗ LOG(Error, "WorkspaceObject is not IddObjectType: PerformancePrecisionTradeoffs");
26 ✗ return boost::none;
27 }
28
29
1/1
✓ Branch 1 taken 2 times.
2 PerformancePrecisionTradeoffs performancePrecisionTradeoffs = m_model.getUniqueModelObject<PerformancePrecisionTradeoffs>();
30
31
1/1
✓ Branch 1 taken 2 times.
2 OptionalString optS = workspaceObject.getString(PerformancePrecisionTradeoffsFields::UseCoilDirectSolutions);
32
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (optS) {
33
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 std::string temp = *optS;
34
1/1
✓ Branch 2 taken 2 times.
2 boost::to_lower(temp);
35
2/3
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
2 if (temp == "no") {
36 ✗ performancePrecisionTradeoffs.setUseCoilDirectSolutions(false);
37 } else {
38
1/1
✓ Branch 1 taken 2 times.
2 performancePrecisionTradeoffs.setUseCoilDirectSolutions(true);
39 }
40 2 }
41
42
2/3
✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
4 if ((optS = workspaceObject.getString(PerformancePrecisionTradeoffsFields::ZoneRadiantExchangeAlgorithm))) {
43
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performancePrecisionTradeoffs.setZoneRadiantExchangeAlgorithm(optS.get());
44 }
45
46
2/3
✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
4 if ((optS = workspaceObject.getString(PerformancePrecisionTradeoffsFields::OverrideMode))) {
47
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 performancePrecisionTradeoffs.setOverrideMode(optS.get());
48 }
49
50
2/3
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
4 if (OptionalDouble optD = workspaceObject.getDouble(PerformancePrecisionTradeoffsFields::MaxZoneTempDiff)) {
51 ✗ performancePrecisionTradeoffs.setMaxZoneTempDiff(optD.get());
52 }
53
54
2/3
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
4 if (OptionalDouble optD = workspaceObject.getDouble(PerformancePrecisionTradeoffsFields::MaxAllowedDelTemp)) {
55 ✗ performancePrecisionTradeoffs.setMaxAllowedDelTemp(optD.get());
56 }
57
58
1/1
✓ Branch 1 taken 2 times.
2 optS = workspaceObject.getString(PerformancePrecisionTradeoffsFields::UseRepresentativeSurfacesforCalculations);
59
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (optS) {
60
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 std::string temp = *optS;
61
1/1
✓ Branch 2 taken 2 times.
2 boost::to_lower(temp);
62
2/3
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
2 if (temp == "no") {
63 ✗ performancePrecisionTradeoffs.setUseRepresentativeSurfacesforCalculations(false);
64 } else {
65
1/1
✓ Branch 1 taken 2 times.
2 performancePrecisionTradeoffs.setUseRepresentativeSurfacesforCalculations(true);
66 }
67 2 }
68
69
1/1
✓ Branch 1 taken 2 times.
2 return performancePrecisionTradeoffs;
70 2 }
71
72 } // namespace energyplus
73
74 } // namespace openstudio
75