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: 83.3% 10 / 0 / 12

src/energyplus/ReverseTranslator/ReverseTranslateOutputControlTableStyle.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/OutputControlTableStyle.hpp"
9 #include "../../model/OutputControlTableStyle_Impl.hpp"
10
11 #include <utilities/idd/OutputControl_Table_Style_FieldEnums.hxx>
12 #include <utilities/idd/IddEnums.hxx>
13
14 using namespace openstudio::model;
15
16 namespace openstudio {
17
18 namespace energyplus {
19
20 37 boost::optional<ModelObject> ReverseTranslator::translateOutputControlTableStyle(const WorkspaceObject& workspaceObject) {
21 37 boost::optional<ModelObject> result;
22
23 // This is a Unique ModelObject
24
1/1
✓ Branch 1 taken 37 times.
37 openstudio::model::OutputControlTableStyle modelObject = m_model.getUniqueModelObject<OutputControlTableStyle>();
25
26
2/3
✓ Branch 1 taken 37 times.
✓ Branch 3 taken 37 times.
✗ Branch 4 not taken.
74 if (boost::optional<std::string> _columnSeparator = workspaceObject.getString(OutputControl_Table_StyleFields::ColumnSeparator, true)) {
27
2/2
✓ Branch 1 taken 37 times.
✓ Branch 4 taken 37 times.
37 modelObject.setColumnSeparator(_columnSeparator.get());
28 37 }
29
30
2/3
✓ Branch 1 taken 37 times.
✓ Branch 3 taken 37 times.
✗ Branch 4 not taken.
74 if (boost::optional<std::string> _unitConversion = workspaceObject.getString(OutputControl_Table_StyleFields::UnitConversion, true)) {
31
2/2
✓ Branch 1 taken 37 times.
✓ Branch 4 taken 37 times.
37 modelObject.setUnitConversion(_unitConversion.get());
32 37 }
33
34
1/1
✓ Branch 1 taken 37 times.
37 result = modelObject;
35 74 return result;
36
37 37 } // End of translate function
38
39 } // end namespace energyplus
40 } // end namespace openstudio
41