src/energyplus/ReverseTranslator/ReverseTranslateWindowPropertyFrameAndDivider.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 "../ReverseTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/WindowPropertyFrameAndDivider.hpp" | ||
| 9 | #include "../../utilities/idd/IddObject.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/WindowProperty_FrameAndDivider_FieldEnums.hxx> | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | namespace energyplus { | ||
| 19 | |||
| 20 | 7 | OptionalModelObject ReverseTranslator::translateWindowPropertyFrameAndDivider(const WorkspaceObject& workspaceObject) { | |
| 21 |
4/5✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 7 times.
|
7 | if (workspaceObject.iddObject().type() != IddObjectType::WindowProperty_FrameAndDivider) { |
| 22 | ✗ | LOG(Error, "WorkspaceObject is not IddObjectType: WindowProperty_FrameAndDivider"); | |
| 23 | ✗ | return boost::none; | |
| 24 | } | ||
| 25 | |||
| 26 |
1/1✓ Branch 1 taken 7 times.
|
7 | model::WindowPropertyFrameAndDivider result(m_model); |
| 27 | |||
| 28 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<std::string> s = workspaceObject.getString(WindowProperty_FrameAndDividerFields::Name); |
| 29 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (s) { |
| 30 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setName(*s); |
| 31 | } | ||
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::FrameWidth); |
| 34 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 35 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setFrameWidth(*d); |
| 36 | } | ||
| 37 | |||
| 38 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::FrameOutsideProjection); |
| 39 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 40 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setFrameOutsideProjection(*d); |
| 41 | } | ||
| 42 | |||
| 43 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::FrameInsideProjection); |
| 44 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 45 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setFrameInsideProjection(*d); |
| 46 | } | ||
| 47 | |||
| 48 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::FrameConductance); |
| 49 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 6 times.
|
7 | if (d) { |
| 50 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result.setFrameConductance(*d); |
| 51 | } | ||
| 52 | |||
| 53 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::RatioofFrameEdgeGlassConductancetoCenterOfGlassConductance); |
| 54 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 55 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setRatioOfFrameEdgeGlassConductanceToCenterOfGlassConductance(*d); |
| 56 | } | ||
| 57 | |||
| 58 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::FrameSolarAbsorptance); |
| 59 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 60 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setFrameSolarAbsorptance(*d); |
| 61 | } | ||
| 62 | |||
| 63 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::FrameVisibleAbsorptance); |
| 64 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 65 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setFrameVisibleAbsorptance(*d); |
| 66 | } | ||
| 67 | |||
| 68 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::FrameThermalHemisphericalEmissivity); |
| 69 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 70 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setFrameThermalHemisphericalEmissivity(*d); |
| 71 | } | ||
| 72 | |||
| 73 |
1/1✓ Branch 1 taken 7 times.
|
7 | s = workspaceObject.getString(WindowProperty_FrameAndDividerFields::DividerType); |
| 74 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (s) { |
| 75 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerType(*s); |
| 76 | } | ||
| 77 | |||
| 78 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::DividerWidth); |
| 79 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 80 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerWidth(*d); |
| 81 | } | ||
| 82 | |||
| 83 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<int> i = workspaceObject.getInt(WindowProperty_FrameAndDividerFields::NumberofHorizontalDividers); |
| 84 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (i) { |
| 85 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setNumberOfHorizontalDividers(*i); |
| 86 | } | ||
| 87 | |||
| 88 |
1/1✓ Branch 1 taken 7 times.
|
7 | i = workspaceObject.getInt(WindowProperty_FrameAndDividerFields::NumberofVerticalDividers); |
| 89 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (i) { |
| 90 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setNumberOfVerticalDividers(*i); |
| 91 | } | ||
| 92 | |||
| 93 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::DividerOutsideProjection); |
| 94 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 95 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerOutsideProjection(*d); |
| 96 | } | ||
| 97 | |||
| 98 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::DividerInsideProjection); |
| 99 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 100 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerInsideProjection(*d); |
| 101 | } | ||
| 102 | |||
| 103 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::DividerConductance); |
| 104 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 105 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerConductance(*d); |
| 106 | } | ||
| 107 | |||
| 108 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::RatioofDividerEdgeGlassConductancetoCenterOfGlassConductance); |
| 109 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 110 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setRatioOfDividerEdgeGlassConductanceToCenterOfGlassConductance(*d); |
| 111 | } | ||
| 112 | |||
| 113 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::DividerSolarAbsorptance); |
| 114 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 115 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerSolarAbsorptance(*d); |
| 116 | } | ||
| 117 | |||
| 118 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::DividerVisibleAbsorptance); |
| 119 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 120 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerVisibleAbsorptance(*d); |
| 121 | } | ||
| 122 | |||
| 123 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::DividerThermalHemisphericalEmissivity); |
| 124 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 125 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setDividerThermalHemisphericalEmissivity(*d); |
| 126 | } | ||
| 127 | |||
| 128 | // DLM: could attempt to set outside reveal depth here but that would require projecting sub surfaces to surfaces | ||
| 129 | // and making unique frame and divider object for each sub surface | ||
| 130 | |||
| 131 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::OutsideRevealSolarAbsorptance); |
| 132 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 133 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setOutsideRevealSolarAbsorptance(*d); |
| 134 | } | ||
| 135 | |||
| 136 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::InsideSillDepth); |
| 137 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 138 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setInsideSillDepth(*d); |
| 139 | } | ||
| 140 | |||
| 141 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::InsideSillSolarAbsorptance); |
| 142 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 143 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setInsideSillSolarAbsorptance(*d); |
| 144 | } | ||
| 145 | |||
| 146 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::InsideRevealDepth); |
| 147 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 148 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setInsideRevealDepth(*d); |
| 149 | } | ||
| 150 | |||
| 151 |
1/1✓ Branch 1 taken 7 times.
|
7 | d = workspaceObject.getDouble(WindowProperty_FrameAndDividerFields::InsideRevealSolarAbsorptance); |
| 152 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (d) { |
| 153 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setInsideRevealSolarAbsorptance(*d); |
| 154 | } | ||
| 155 | |||
| 156 |
1/1✓ Branch 1 taken 7 times.
|
7 | s = workspaceObject.getString(WindowProperty_FrameAndDividerFields::NFRCProductTypeforAssemblyCalculations); |
| 157 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (s) { |
| 158 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | result.setNFRCProductTypeforAssemblyCalculations(*s); |
| 159 | } | ||
| 160 | |||
| 161 |
1/1✓ Branch 1 taken 7 times.
|
7 | return result; |
| 162 | 7 | } | |
| 163 | |||
| 164 | } // namespace energyplus | ||
| 165 | |||
| 166 | } // namespace openstudio | ||
| 167 |