GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 0.0% 0 / 0 / 23
Functions: 0.0% 0 / 0 / 1
Branches: 0.0% 0 / 0 / 34

src/energyplus/ForwardTranslator/ForwardTranslateSetpointManagerColdest.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/SetpointManagerColdest.hpp"
8 #include "../../model/Node.hpp"
9 #include "../../model/AirLoopHVAC.hpp"
10 #include <utilities/idd/SetpointManager_Coldest_FieldEnums.hxx>
11 #include "../../utilities/idd/IddEnums.hpp"
12 #include <utilities/idd/IddEnums.hxx>
13
14 using namespace openstudio::model;
15
16 namespace openstudio {
17
18 namespace energyplus {
19
20 ✗ boost::optional<IdfObject> ForwardTranslator::translateSetpointManagerColdest(SetpointManagerColdest& modelObject) {
21 ✗ boost::optional<Node> node;
22 ✗ boost::optional<double> value;
23 ✗ std::string s;
24
25 // Name
26 ✗ IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::SetpointManager_Coldest, modelObject);
27
28 // ControlVariable
29 ✗ s = modelObject.controlVariable();
30 ✗ idfObject.setString(SetpointManager_ColdestFields::ControlVariable, s);
31
32 // MinimumSetpointTemperature
33 ✗ value = modelObject.minimumSetpointTemperature();
34 ✗ if (value) {
35 ✗ idfObject.setDouble(SetpointManager_ColdestFields::MinimumSetpointTemperature, value.get());
36 }
37
38 // MaximumSetpointTemperature
39 ✗ value = modelObject.maximumSetpointTemperature();
40 ✗ if (value) {
41 ✗ idfObject.setDouble(SetpointManager_ColdestFields::MaximumSetpointTemperature, value.get());
42 }
43
44 // Strategy
45 ✗ s = modelObject.strategy();
46 ✗ idfObject.setString(SetpointManager_ColdestFields::Strategy, s);
47
48 // SetpointNodeorNodeListName
49 ✗ node = modelObject.setpointNode();
50 ✗ if (node) {
51 ✗ idfObject.setString(SetpointManager_ColdestFields::SetpointNodeorNodeListName, node->name().get());
52
53 // HVACAirLoopName
54 ✗ if (boost::optional<model::AirLoopHVAC> airLoop = node->airLoopHVAC()) {
55 ✗ idfObject.setString(SetpointManager_ColdestFields::HVACAirLoopName, airLoop->name().get());
56 ✗ }
57 }
58
59 ✗ return idfObject;
60 ✗ }
61
62 } // namespace energyplus
63
64 } // namespace openstudio
65