src/energyplus/ForwardTranslator/ForwardTranslateBlind.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/Blind.hpp" | ||
| 9 | #include <utilities/idd/OS_WindowMaterial_Blind_FieldEnums.hxx> | ||
| 10 | |||
| 11 | #include <utilities/idd/WindowMaterial_Blind_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 | 3 | boost::optional<IdfObject> ForwardTranslator::translateBlind(model::Blind& modelObject) { | |
| 22 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | IdfObject idfObject(openstudio::IddObjectType::WindowMaterial_Blind); |
| 23 | |||
| 24 |
1/1✓ Branch 1 taken 3 times.
|
3 | m_idfObjects.push_back(idfObject); |
| 25 | |||
| 26 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | idfObject.setString(WindowMaterial_BlindFields::Name, modelObject.name().get()); |
| 27 | |||
| 28 |
1/1✓ Branch 1 taken 3 times.
|
3 | OptionalString s = modelObject.getString(OS_WindowMaterial_BlindFields::SlatOrientation, true, true); |
| 29 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (s) { |
| 30 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setString(WindowMaterial_BlindFields::SlatOrientation, *s); |
| 31 | } | ||
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 3 times.
|
3 | OptionalDouble d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatWidth, true); |
| 34 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 35 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatWidth, *d); |
| 36 | } | ||
| 37 | |||
| 38 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatSeparation, true); |
| 39 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 40 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatSeparation, *d); |
| 41 | } | ||
| 42 | |||
| 43 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatThickness, true); |
| 44 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 45 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatThickness, *d); |
| 46 | } | ||
| 47 | |||
| 48 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatAngle, true); |
| 49 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 50 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatAngle, *d); |
| 51 | } | ||
| 52 | |||
| 53 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatConductivity, true); |
| 54 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 55 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatConductivity, *d); |
| 56 | } | ||
| 57 | |||
| 58 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatBeamSolarTransmittance, true); |
| 59 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 60 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatBeamSolarTransmittance, *d); |
| 61 | } | ||
| 62 | |||
| 63 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::FrontSideSlatBeamSolarReflectance, true); |
| 64 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 65 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::FrontSideSlatBeamSolarReflectance, *d); |
| 66 | } | ||
| 67 | |||
| 68 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BackSideSlatBeamSolarReflectance, true); |
| 69 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 70 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BackSideSlatBeamSolarReflectance, *d); |
| 71 | } | ||
| 72 | |||
| 73 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatDiffuseSolarTransmittance, true); |
| 74 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 75 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatDiffuseSolarTransmittance, *d); |
| 76 | } | ||
| 77 | |||
| 78 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::FrontSideSlatDiffuseSolarReflectance, true); |
| 79 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 80 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::FrontSideSlatDiffuseSolarReflectance, *d); |
| 81 | } | ||
| 82 | |||
| 83 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BackSideSlatDiffuseSolarReflectance, true); |
| 84 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 85 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BackSideSlatDiffuseSolarReflectance, *d); |
| 86 | } | ||
| 87 | |||
| 88 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatBeamVisibleTransmittance, true); |
| 89 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 90 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatBeamVisibleTransmittance, *d); |
| 91 | } | ||
| 92 | |||
| 93 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::FrontSideSlatBeamVisibleReflectance, true); |
| 94 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 95 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::FrontSideSlatBeamVisibleReflectance, *d); |
| 96 | } | ||
| 97 | |||
| 98 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BackSideSlatBeamVisibleReflectance, true); |
| 99 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 100 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BackSideSlatBeamVisibleReflectance, *d); |
| 101 | } | ||
| 102 | |||
| 103 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatDiffuseVisibleTransmittance, true); |
| 104 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 105 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatDiffuseVisibleTransmittance, *d); |
| 106 | } | ||
| 107 | |||
| 108 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::FrontSideSlatDiffuseVisibleReflectance, true); |
| 109 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 110 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::FrontSideSlatDiffuseVisibleReflectance, *d); |
| 111 | } | ||
| 112 | |||
| 113 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BackSideSlatDiffuseVisibleReflectance, true); |
| 114 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 115 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BackSideSlatDiffuseVisibleReflectance, *d); |
| 116 | } | ||
| 117 | |||
| 118 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::SlatInfraredHemisphericalTransmittance, true); |
| 119 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 120 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::SlatInfraredHemisphericalTransmittance, *d); |
| 121 | } | ||
| 122 | |||
| 123 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::FrontSideSlatInfraredHemisphericalEmissivity, true); |
| 124 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 125 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::FrontSideSlatInfraredHemisphericalEmissivity, *d); |
| 126 | } | ||
| 127 | |||
| 128 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BackSideSlatInfraredHemisphericalEmissivity, true); |
| 129 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 130 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BackSideSlatInfraredHemisphericalEmissivity, *d); |
| 131 | } | ||
| 132 | |||
| 133 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BlindtoGlassDistance, true); |
| 134 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 135 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BlindtoGlassDistance, *d); |
| 136 | } | ||
| 137 | |||
| 138 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BlindTopOpeningMultiplier, true); |
| 139 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 140 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BlindTopOpeningMultiplier, *d); |
| 141 | } | ||
| 142 | |||
| 143 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BlindBottomOpeningMultiplier, true); |
| 144 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 145 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BlindBottomOpeningMultiplier, *d); |
| 146 | } | ||
| 147 | |||
| 148 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BlindLeftSideOpeningMultiplier, true); |
| 149 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 150 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BlindLeftSideOpeningMultiplier, *d); |
| 151 | } | ||
| 152 | |||
| 153 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::BlindRightSideOpeningMultiplier, true); |
| 154 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 155 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::BlindRightSideOpeningMultiplier, *d); |
| 156 | } | ||
| 157 | |||
| 158 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::MinimumSlatAngle, true); |
| 159 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 160 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::MinimumSlatAngle, *d); |
| 161 | } | ||
| 162 | |||
| 163 |
1/1✓ Branch 1 taken 3 times.
|
3 | d = modelObject.getDouble(OS_WindowMaterial_BlindFields::MaximumSlatAngle, true); |
| 164 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 165 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(WindowMaterial_BlindFields::MaximumSlatAngle, *d); |
| 166 | } | ||
| 167 | |||
| 168 |
1/1✓ Branch 1 taken 3 times.
|
6 | return boost::optional<IdfObject>(idfObject); |
| 169 | 3 | } | |
| 170 | |||
| 171 | } // namespace energyplus | ||
| 172 | |||
| 173 | } // namespace openstudio | ||
| 174 |