GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 28 / 0 / 28
Functions: 100.0% 1 / 0 / 1
Branches: 94.2% 49 / 0 / 52

src/energyplus/ForwardTranslator/ForwardTranslateSetpointManagerSingleZoneReheat.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 #include "../../model/SetpointManagerSingleZoneReheat.hpp"
8 #include "../../model/ThermalZone.hpp"
9 #include "../../model/Node.hpp"
10 #include "../../model/Node_Impl.hpp"
11 #include "../../model/PortList.hpp"
12 #include <utilities/idd/SetpointManager_SingleZone_Reheat_FieldEnums.hxx>
13 #include "../../utilities/idd/IddEnums.hpp"
14 #include <utilities/idd/IddEnums.hxx>
15
16 using namespace openstudio::model;
17
18 namespace openstudio {
19
20 namespace energyplus {
21
22 58 boost::optional<IdfObject> ForwardTranslator::translateSetpointManagerSingleZoneReheat(SetpointManagerSingleZoneReheat& modelObject) {
23 58 std::string s;
24 double n;
25 58 boost::optional<Node> node;
26
27
2/2
✓ Branch 1 taken 58 times.
✓ Branch 4 taken 58 times.
58 IdfObject idfObject(IddObjectType::SetpointManager_SingleZone_Reheat);
28
29
1/1
✓ Branch 1 taken 58 times.
58 m_idfObjects.push_back(idfObject);
30
31 // Name
32
3/3
✓ Branch 1 taken 58 times.
✓ Branch 4 taken 58 times.
✓ Branch 7 taken 58 times.
58 s = modelObject.name().get();
33
1/1
✓ Branch 1 taken 58 times.
58 idfObject.setString(SetpointManager_SingleZone_ReheatFields::Name, s);
34
35 // ControlVariable
36
2/2
✓ Branch 1 taken 58 times.
✓ Branch 4 taken 58 times.
58 idfObject.setString(SetpointManager_SingleZone_ReheatFields::ControlVariable, "Temperature");
37
38 // MinimumSupplyAirTemperature
39
1/1
✓ Branch 1 taken 58 times.
58 n = modelObject.minimumSupplyAirTemperature();
40
1/1
✓ Branch 1 taken 58 times.
58 idfObject.setDouble(SetpointManager_SingleZone_ReheatFields::MinimumSupplyAirTemperature, n);
41
42 // MaximumSupplyAirTemperature
43
1/1
✓ Branch 1 taken 58 times.
58 n = modelObject.maximumSupplyAirTemperature();
44
1/1
✓ Branch 1 taken 58 times.
58 idfObject.setDouble(SetpointManager_SingleZone_ReheatFields::MaximumSupplyAirTemperature, n);
45
46 // ControlZoneName
47
1/1
✓ Branch 1 taken 58 times.
58 boost::optional<ThermalZone> thermalZone = modelObject.controlZone();
48
2/2
✓ Branch 0 taken 57 times.
✓ Branch 1 taken 1 time.
58 if (thermalZone) {
49
4/4
✓ Branch 1 taken 57 times.
✓ Branch 4 taken 57 times.
✓ Branch 7 taken 57 times.
✓ Branch 10 taken 57 times.
57 idfObject.setString(SetpointManager_SingleZone_ReheatFields::ControlZoneName, thermalZone->name().get());
50 }
51
52 // ZoneNodeName
53
2/2
✓ Branch 0 taken 57 times.
✓ Branch 1 taken 1 time.
58 if (thermalZone) {
54
3/3
✓ Branch 1 taken 57 times.
✓ Branch 4 taken 57 times.
✓ Branch 7 taken 57 times.
57 node = thermalZone->zoneAirNode();
55
4/4
✓ Branch 1 taken 57 times.
✓ Branch 4 taken 57 times.
✓ Branch 7 taken 57 times.
✓ Branch 10 taken 57 times.
57 idfObject.setString(SetpointManager_SingleZone_ReheatFields::ZoneNodeName, node->name().get());
56 }
57
58 // ZoneInletNodeName
59
2/2
✓ Branch 0 taken 57 times.
✓ Branch 1 taken 1 time.
58 if (thermalZone) {
60
4/5
✓ Branch 1 taken 57 times.
✓ Branch 4 taken 57 times.
✓ Branch 7 taken 57 times.
✓ Branch 11 taken 57 times.
✗ Branch 12 not taken.
114 if (boost::optional<ModelObject> mo = thermalZone->inletPortList().airLoopHVACModelObject()) {
61
3/4
✓ Branch 1 taken 57 times.
✓ Branch 4 taken 57 times.
✓ Branch 8 taken 57 times.
✗ Branch 9 not taken.
114 if ((node = mo->optionalCast<Node>())) {
62
4/4
✓ Branch 1 taken 57 times.
✓ Branch 4 taken 57 times.
✓ Branch 7 taken 57 times.
✓ Branch 10 taken 57 times.
57 idfObject.setString(SetpointManager_SingleZone_ReheatFields::ZoneInletNodeName, node->name().get());
63 }
64 57 }
65 }
66
67 // SetpointNodeorNodeListName
68
1/1
✓ Branch 1 taken 58 times.
58 node = modelObject.setpointNode();
69
1/2
✓ Branch 0 taken 58 times.
✗ Branch 1 not taken.
58 if (node) {
70
4/4
✓ Branch 1 taken 58 times.
✓ Branch 4 taken 58 times.
✓ Branch 7 taken 58 times.
✓ Branch 10 taken 58 times.
58 idfObject.setString(SetpointManager_SingleZone_ReheatFields::SetpointNodeorNodeListName, node->name().get());
71 }
72
73
1/1
✓ Branch 1 taken 58 times.
116 return idfObject;
74 58 }
75
76 } // namespace energyplus
77
78 } // namespace openstudio
79