GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 89.5% 17 / 0 / 19
Functions: 100.0% 1 / 0 / 1
Branches: 82.5% 33 / 0 / 40

src/energyplus/ForwardTranslator/ForwardTranslateGasEquipmentDefinition.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/GasEquipmentDefinition.hpp"
9 #include "../../model/GasEquipmentDefinition_Impl.hpp"
10
11 #include <utilities/idd/GasEquipment_Definition_FieldEnums.hxx>
12 #include "../../utilities/idd/IddEnums.hpp"
13 #include <utilities/idd/IddEnums.hxx>
14
15 using namespace openstudio::model;
16
17 namespace openstudio {
18
19 namespace energyplus {
20
21 5 boost::optional<IdfObject> ForwardTranslator::translateGasEquipmentDefinition(GasEquipmentDefinition& modelObject) {
22
23
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::GasEquipment_Definition, modelObject);
24
25
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 idfObject.setString(GasEquipment_DefinitionFields::DesignLevelCalculationMethod, modelObject.designLevelCalculationMethod());
26
27
2/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
10 if (boost::optional<double> d = modelObject.designLevel()) {
28
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 idfObject.setDouble(GasEquipment_DefinitionFields::DesignLevel, *d);
29 }
30
31
2/3
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5 times.
10 if (boost::optional<double> d = modelObject.wattsperSpaceFloorArea()) {
32 ✗ idfObject.setDouble(GasEquipment_DefinitionFields::PowerperFloorArea, *d);
33 }
34
35
2/3
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5 times.
10 if (boost::optional<double> d = modelObject.wattsperPerson()) {
36 ✗ idfObject.setDouble(GasEquipment_DefinitionFields::PowerperPerson, *d);
37 }
38
39
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 4 times.
5 if (!modelObject.isFractionLatentDefaulted()) {
40
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(GasEquipment_DefinitionFields::FractionLatent, modelObject.fractionLatent());
41 }
42
43
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 4 times.
5 if (!modelObject.isFractionRadiantDefaulted()) {
44
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(GasEquipment_DefinitionFields::FractionRadiant, modelObject.fractionRadiant());
45 }
46
47
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 4 times.
5 if (!modelObject.isFractionLostDefaulted()) {
48
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(GasEquipment_DefinitionFields::FractionLost, modelObject.fractionLost());
49 }
50
51
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 4 times.
5 if (!modelObject.isCarbonDioxideGenerationRateDefaulted()) {
52
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(GasEquipment_DefinitionFields::CarbonDioxideGenerationRate, modelObject.carbonDioxideGenerationRate());
53 }
54
55
1/1
✓ Branch 1 taken 5 times.
10 return idfObject;
56 5 }
57
58 } // namespace energyplus
59
60 } // namespace openstudio
61