GCC Code Coverage Report


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

src/energyplus/ForwardTranslator/ForwardTranslateScheduleConstant.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/ScheduleConstant.hpp"
10 #include "../../model/ScheduleConstant_Impl.hpp"
11
12 #include <utilities/idd/Schedule_Constant_FieldEnums.hxx>
13 #include <utilities/idd/OS_Schedule_Constant_FieldEnums.hxx>
14
15 #include "../../utilities/idd/IddEnums.hpp"
16 #include <utilities/idd/IddEnums.hxx>
17 #include <utilities/idd/IddFactory.hxx>
18
19 using namespace openstudio::model;
20
21 using namespace std;
22
23 namespace openstudio {
24
25 namespace energyplus {
26
27 3029 boost::optional<IdfObject> ForwardTranslator::translateScheduleConstant(ScheduleConstant& modelObject) {
28
2/2
✓ Branch 1 taken 3029 times.
✓ Branch 4 taken 3029 times.
3029 IdfObject scheduleConstant = createAndRegisterIdfObject(openstudio::IddObjectType::Schedule_Constant, modelObject);
29
30
3/3
✓ Branch 1 taken 3029 times.
✓ Branch 4 taken 3029 times.
✓ Branch 7 taken 3029 times.
3029 scheduleConstant.setName(modelObject.name().get());
31 3029 scheduleConstant.setString(Schedule_ConstantFields::ScheduleTypeLimitsName,
32
3/3
✓ Branch 1 taken 3029 times.
✓ Branch 4 taken 3029 times.
✓ Branch 7 taken 3029 times.
3029 modelObject.getString(OS_Schedule_ConstantFields::ScheduleTypeLimitsName, true).get());
33
2/2
✓ Branch 1 taken 3029 times.
✓ Branch 4 taken 3029 times.
3029 scheduleConstant.setDouble(Schedule_ConstantFields::HourlyValue, modelObject.value());
34
35
1/1
✓ Branch 1 taken 3029 times.
6058 return boost::optional<IdfObject>(scheduleConstant);
36 3029 }
37
38 } // namespace energyplus
39
40 } // namespace openstudio
41