GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 93.8% 15 / 0 / 16
Functions: 100.0% 1 / 0 / 1
Branches: 79.2% 19 / 0 / 24

src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACBaseboardConvectiveElectric.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/Model.hpp"
8 #include "../../model/Schedule.hpp"
9 #include "../../model/Schedule_Impl.hpp"
10 #include "../../model/ModelObject.hpp"
11 #include "../../model/ModelObject_Impl.hpp"
12 #include "../../model/Node.hpp"
13 #include "../../model/Node_Impl.hpp"
14 #include "../../model/ZoneHVACBaseboardConvectiveElectric.hpp"
15 #include "../../model/ZoneHVACBaseboardConvectiveElectric_Impl.hpp"
16 #include "../../model/ThermalZone.hpp"
17 #include "../../model/ThermalZone_Impl.hpp"
18 #include "../../model/StraightComponent.hpp"
19 #include "../../model/StraightComponent_Impl.hpp"
20 #include <utilities/idd/ZoneHVAC_Baseboard_Convective_Electric_FieldEnums.hxx>
21 #include "../../utilities/idd/IddEnums.hpp"
22 #include <utilities/idd/IddEnums.hxx>
23 #include <utilities/idd/IddFactory.hxx>
24
25 using namespace openstudio::model;
26
27 namespace openstudio {
28
29 namespace energyplus {
30
31 10 boost::optional<IdfObject> ForwardTranslator::translateZoneHVACBaseboardConvectiveElectric(ZoneHVACBaseboardConvectiveElectric& modelObject) {
32 // Makes sure the modelObject gets put in the map, and that the new idfObject gets put in
33 // the final file. Also set's the idfObject's name.
34
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::ZoneHVAC_Baseboard_Convective_Electric, modelObject);
35
36 10 boost::optional<std::string> s;
37 10 boost::optional<double> value;
38 10 boost::optional<ModelObject> temp;
39
40 // AvailabilityScheduleName
41
1/1
✓ Branch 1 taken 10 times.
10 Schedule availabilitySchedule = modelObject.availabilitySchedule();
42
1/1
✓ Branch 1 taken 10 times.
10 translateAndMapModelObject(availabilitySchedule);
43
3/3
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
10 idfObject.setString(ZoneHVAC_Baseboard_Convective_ElectricFields::AvailabilityScheduleName, availabilitySchedule.name().get());
44
45 // NominalCapacity
46
47
2/3
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
10 if (modelObject.isNominalCapacityAutosized()) {
48 ✗ idfObject.setString(ZoneHVAC_Baseboard_Convective_ElectricFields::HeatingDesignCapacity, "Autosize");
49
2/3
✓ Branch 1 taken 10 times.
✓ Branch 3 taken 10 times.
✗ Branch 4 not taken.
20 } else if ((value = modelObject.nominalCapacity())) {
50
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 idfObject.setDouble(ZoneHVAC_Baseboard_Convective_ElectricFields::HeatingDesignCapacity, value.get());
51 }
52
53 // Efficiency
54
55
3/4
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✗ Branch 8 not taken.
20 if ((value = modelObject.efficiency())) {
56
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 idfObject.setDouble(ZoneHVAC_Baseboard_Convective_ElectricFields::Efficiency, value.get());
57 }
58
59
1/1
✓ Branch 1 taken 10 times.
20 return idfObject;
60 10 }
61
62 } // namespace energyplus
63
64 } // namespace openstudio
65