src/energyplus/ForwardTranslator/ForwardTranslateMaterialPropertyGlazingSpectralData.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/MaterialPropertyGlazingSpectralData.hpp" | ||
| 10 | #include "../../model/MaterialPropertyGlazingSpectralData_Impl.hpp" | ||
| 11 | |||
| 12 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 13 | |||
| 14 | #include <utilities/idd/MaterialProperty_GlazingSpectralData_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::translateMaterialPropertyGlazingSpectralData(MaterialPropertyGlazingSpectralData& modelObject) { | |
| 27 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject(openstudio::IddObjectType::MaterialProperty_GlazingSpectralData); |
| 28 | |||
| 29 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(idfObject); |
| 30 | |||
| 31 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | idfObject.setString(openstudio::MaterialProperty_GlazingSpectralDataFields::Name, modelObject.name().get()); |
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 1 time.
|
1 | idfObject.clearExtensibleGroups(); |
| 34 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 time.
|
1 | for (const auto& spectralDataField : modelObject.spectralDataFields()) { |
| 35 | ✗ | IdfExtensibleGroup group = idfObject.pushExtensibleGroup(); | |
| 36 | ✗ | OS_ASSERT(group.numFields() == 4); | |
| 37 | ✗ | group.setDouble(MaterialProperty_GlazingSpectralDataExtensibleFields::Wavelength, spectralDataField.wavelength()); | |
| 38 | ✗ | group.setDouble(MaterialProperty_GlazingSpectralDataExtensibleFields::Transmittance, spectralDataField.transmittance()); | |
| 39 | ✗ | group.setDouble(MaterialProperty_GlazingSpectralDataExtensibleFields::FrontReflectance, spectralDataField.frontReflectance()); | |
| 40 | ✗ | group.setDouble(MaterialProperty_GlazingSpectralDataExtensibleFields::BackReflectance, spectralDataField.backReflectance()); | |
| 41 | 1 | } | |
| 42 | |||
| 43 |
1/1✓ Branch 1 taken 1 time.
|
2 | return boost::optional<IdfObject>(idfObject); |
| 44 | 1 | } | |
| 45 | |||
| 46 | } // namespace energyplus | ||
| 47 | |||
| 48 | } // namespace openstudio | ||
| 49 |