GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 9 / 0 / 9
Functions: 100.0% 1 / 0 / 1
Branches: 88.9% 8 / 0 / 9

src/energyplus/ForwardTranslator/ForwardTranslateEnergyManagementSystemGlobalVariable.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/OutputMeter.hpp"
12 #include "../../model/OutputMeter_Impl.hpp"
13 #include "../../model/Schedule.hpp"
14 #include "../../model/Schedule_Impl.hpp"
15 #include "../../model/EnergyManagementSystemGlobalVariable.hpp"
16 #include "../../model/EnergyManagementSystemGlobalVariable_Impl.hpp"
17
18 #include "../../utilities/idf/IdfExtensibleGroup.hpp"
19
20 #include <utilities/idd/EnergyManagementSystem_GlobalVariable_FieldEnums.hxx>
21 #include "../../utilities/idd/IddEnums.hpp"
22 #include <utilities/idd/IddEnums.hxx>
23
24 using namespace openstudio::model;
25
26 using namespace std;
27
28 namespace openstudio {
29
30 namespace energyplus {
31
32 15 boost::optional<IdfObject> ForwardTranslator::translateEnergyManagementSystemGlobalVariable(EnergyManagementSystemGlobalVariable& modelObject) {
33 15 boost::optional<std::string> s;
34 //TODO add all the global variables to one object in the IDF
35
2/2
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
15 IdfObject idfObject(openstudio::IddObjectType::EnergyManagementSystem_GlobalVariable);
36
1/1
✓ Branch 1 taken 15 times.
15 m_idfObjects.push_back(idfObject);
37 //m_map.insert(std::make_pair(modelObject.handle(), idfObject));
38
39 //AddErlVariable
40
1/1
✓ Branch 1 taken 15 times.
15 s = modelObject.name();
41
1/2
✓ Branch 0 taken 15 times.
✗ Branch 1 not taken.
15 if (s) {
42
2/2
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
15 idfObject.setString(EnergyManagementSystem_GlobalVariableExtensibleFields::ErlVariableName, s.get());
43 }
44
45
1/1
✓ Branch 1 taken 15 times.
30 return idfObject;
46 15 }
47
48 } // namespace energyplus
49
50 } // namespace openstudio
51