GCC Code Coverage Report


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

src/energyplus/ForwardTranslator/ForwardTranslateGasMixture.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/GasMixture.hpp"
9
10 #include "../../utilities/idf/IdfExtensibleGroup.hpp"
11 #include <utilities/idd/WindowMaterial_GasMixture_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 ✗ boost::optional<IdfObject> ForwardTranslator::translateGasMixture(GasMixture& modelObject) {
22 ✗ IdfObject idfObject(openstudio::IddObjectType::WindowMaterial_GasMixture);
23
24 ✗ m_idfObjects.push_back(idfObject);
25
26 ✗ idfObject.setString(WindowMaterial_GasMixtureFields::Name, modelObject.name().get());
27
28 ✗ idfObject.setDouble(WindowMaterial_GasMixtureFields::Thickness, modelObject.thickness());
29
30 ✗ idfObject.setInt(WindowMaterial_GasMixtureFields::NumberofGasesinMixture, modelObject.numGases());
31
32 ✗ int fieldIndex = WindowMaterial_GasMixtureFields::Gas1Type;
33 ✗ for (unsigned gasIndex = 0; gasIndex < modelObject.numGases(); ++gasIndex) {
34
35 ✗ idfObject.setString(fieldIndex++, modelObject.getGasType(gasIndex));
36
37 ✗ idfObject.setDouble(fieldIndex++, modelObject.getGasFraction(gasIndex));
38 }
39
40 ✗ return boost::optional<IdfObject>(idfObject);
41 ✗ }
42
43 } // namespace energyplus
44
45 } // namespace openstudio
46