GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 94.7% 18 / 0 / 19
Functions: 100.0% 1 / 0 / 1
Branches: 73.1% 19 / 0 / 26

src/energyplus/ForwardTranslator/ForwardTranslateExternalInterfaceFunctionalMockupUnitExportToSchedule.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/ModelObject.hpp"
10 #include "../../model/ExternalInterfaceFunctionalMockupUnitExportToSchedule.hpp"
11 #include "../../model/ExternalInterfaceFunctionalMockupUnitExportToSchedule_Impl.hpp"
12 #include "../../model/ScheduleTypeLimits.hpp"
13
14 #include <utilities/idd/ExternalInterface_FunctionalMockupUnitExport_To_Schedule_FieldEnums.hxx>
15 #include "../../utilities/idd/IddEnums.hpp"
16 #include <utilities/idd/IddEnums.hxx>
17
18 using namespace openstudio::model;
19
20 using namespace std;
21
22 namespace openstudio {
23
24 namespace energyplus {
25
26 1 boost::optional<IdfObject> ForwardTranslator::translateExternalInterfaceFunctionalMockupUnitExportToSchedule(
27 ExternalInterfaceFunctionalMockupUnitExportToSchedule& modelObject) {
28 1 boost::optional<std::string> s;
29 1 boost::optional<double> d;
30
31
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 IdfObject idfObject(openstudio::IddObjectType::ExternalInterface_FunctionalMockupUnitExport_To_Schedule);
32
1/1
✓ Branch 1 taken 1 time.
1 m_idfObjects.push_back(idfObject);
33 //Name
34
1/1
✓ Branch 1 taken 1 time.
1 s = modelObject.name();
35
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (s) {
36
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setName(*s);
37 }
38
39
1/1
✓ Branch 1 taken 1 time.
1 const boost::optional<ScheduleTypeLimits> m = modelObject.scheduleTypeLimits();
40
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
1 if (m.is_initialized()) {
41 ✗ idfObject.setString(ExternalInterface_FunctionalMockupUnitExport_To_ScheduleFields::ScheduleTypeLimitsNames, m.get().nameString());
42 }
43
44
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 s = modelObject.fMUVariableName();
45
1/2
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
1 if (s.is_initialized()) {
46
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setString(ExternalInterface_FunctionalMockupUnitExport_To_ScheduleFields::FMUVariableName, s.get());
47 }
48
49
1/1
✓ Branch 1 taken 1 time.
1 d = modelObject.initialValue();
50
1/2
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
1 if (d.is_initialized()) {
51
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(ExternalInterface_FunctionalMockupUnitExport_To_ScheduleFields::InitialValue, d.get());
52 }
53
54
1/1
✓ Branch 1 taken 1 time.
2 return idfObject;
55 1 }
56
57 } // namespace energyplus
58
59 } // namespace openstudio
60