GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 14 / 0 / 14
Functions: 100.0% 1 / 0 / 1
Branches: 89.5% 17 / 0 / 19

src/energyplus/ForwardTranslator/ForwardTranslateEnergyManagementSystemProgramCallingManager.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/EnergyManagementSystemProgram.hpp"
16 #include "../../model/EnergyManagementSystemProgram_Impl.hpp"
17 #include "../../model/EnergyManagementSystemProgramCallingManager.hpp"
18 #include "../../model/EnergyManagementSystemProgramCallingManager_Impl.hpp"
19
20 #include "../../utilities/idf/IdfExtensibleGroup.hpp"
21
22 #include <utilities/idd/EnergyManagementSystem_ProgramCallingManager_FieldEnums.hxx>
23 #include "../../utilities/idd/IddEnums.hpp"
24 #include <utilities/idd/IddEnums.hxx>
25 #include <utilities/idd/IddFactory.hxx>
26
27 using namespace openstudio::model;
28
29 using namespace std;
30
31 namespace openstudio {
32
33 namespace energyplus {
34
35 boost::optional<IdfObject>
36 12 ForwardTranslator::translateEnergyManagementSystemProgramCallingManager(EnergyManagementSystemProgramCallingManager& modelObject) {
37 12 boost::optional<std::string> s;
38
39
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 IdfObject pcm = createAndRegisterIdfObject(openstudio::IddObjectType::EnergyManagementSystem_ProgramCallingManager, modelObject);
40 //Name
41
1/1
✓ Branch 1 taken 12 times.
12 s = modelObject.name();
42
1/2
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
12 if (s) {
43
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 pcm.setName(*s);
44 }
45
46 //callingpoint
47
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 s = modelObject.callingPoint();
48
1/2
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
12 if (s) {
49
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 pcm.setString(EnergyManagementSystem_ProgramCallingManagerFields::EnergyPlusModelCallingPoint, s.get());
50 }
51
52 //program names
53
3/3
✓ Branch 1 taken 12 times.
✓ Branch 7 taken 18 times.
✓ Branch 8 taken 12 times.
30 for (const IdfExtensibleGroup& eg : modelObject.extensibleGroups()) {
54
2/2
✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
18 pcm.pushExtensibleGroup(eg.fields());
55 12 }
56
1/1
✓ Branch 1 taken 12 times.
24 return pcm;
57 12 }
58
59 } // namespace energyplus
60
61 } // namespace openstudio
62