urbanopt-cli 0.4.1 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (944) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/CHANGELOG.md +59 -0
  4. data/CMakeLists.txt +17 -17
  5. data/FindOpenStudioSDK.cmake +12 -7
  6. data/Gemfile +8 -10
  7. data/LICENSE.md +11 -1
  8. data/README.md +1 -0
  9. data/Rakefile +16 -6
  10. data/example_files/Gemfile +25 -9
  11. data/example_files/example_project.json +35 -20
  12. data/example_files/example_project_combined.json +100 -5
  13. data/example_files/example_project_with_electric_network.json +2116 -0
  14. data/example_files/mappers/Baseline.rb +111 -51
  15. data/example_files/mappers/CreateBar.rb +19 -7
  16. data/example_files/mappers/EvCharging.rb +141 -0
  17. data/example_files/mappers/Floorspace.rb +29 -17
  18. data/example_files/mappers/HighEfficiency.rb +20 -8
  19. data/example_files/mappers/HighEfficiencyCreateBar.rb +19 -8
  20. data/example_files/mappers/HighEfficiencyFloorspace.rb +19 -8
  21. data/example_files/mappers/ThermalStorage.rb +16 -6
  22. data/example_files/mappers/base_workflow.osw +26 -1
  23. data/example_files/mappers/floorspace_workflow.osw +9 -0
  24. data/example_files/measures/BuildResidentialModel/measure.rb +249 -134
  25. data/example_files/reopt/base_assumptions.json +2 -2
  26. data/example_files/reopt/multiPV_assumptions.json +4 -3
  27. data/example_files/residential/clothes_dryer.tsv +7 -7
  28. data/example_files/residential/clothes_washer.tsv +2 -2
  29. data/example_files/residential/cooling_system.tsv +42 -22
  30. data/example_files/residential/dishwasher.tsv +1 -1
  31. data/example_files/residential/exhaust.tsv +3 -0
  32. data/example_files/residential/heat_pump.tsv +62 -40
  33. data/example_files/residential/water_heater.tsv +1 -1
  34. data/example_files/resources/hpxml-measures/.github/pull_request_template.md +14 -0
  35. data/example_files/resources/hpxml-measures/.github/workflows/config.yml +116 -0
  36. data/example_files/resources/hpxml-measures/.gitignore +1 -8
  37. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/measure.rb +1088 -1329
  38. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/measure.xml +1819 -1383
  39. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/constants.rb +0 -8
  40. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/geometry.rb +450 -362
  41. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules.rb +165 -112
  42. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules_config.json +388 -0
  43. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules_config.md +43 -0
  44. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules_weekday_state_and_monthly_schedule_shift.csv +613 -0
  45. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules_weekend_state_and_monthly_schedule_shift.csv +613 -0
  46. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-coal.osw +56 -82
  47. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-appliances-dehumidifier-ief.osw → base-appliances-dehumidifier-ief-portable.osw} +57 -83
  48. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-appliances-dehumidifier-50percent.osw → base-appliances-dehumidifier-ief-whole-home.osw} +59 -85
  49. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-dehumidifier.osw +56 -82
  50. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-gas.osw +56 -82
  51. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-modified.osw +56 -82
  52. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-none.osw +61 -87
  53. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-oil.osw +56 -82
  54. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-propane.osw +56 -82
  55. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-wood.osw +56 -82
  56. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-flat.osw +56 -82
  57. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-radiant-barrier.osw +56 -82
  58. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-unvented-insulated-roof.osw +56 -82
  59. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-vented.osw +56 -82
  60. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-bldgtype-multifamily-shared-boiler-only-baseboard.osw +341 -0
  61. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-bldgtype-multifamily-shared-boiler-only-fan-coil.osw +341 -0
  62. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-mechvent-shared-preconditioning.osw → base-bldgtype-multifamily-shared-mechvent-preconditioning.osw} +70 -95
  63. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-mechvent-shared.osw → base-bldgtype-multifamily-shared-mechvent.osw} +70 -95
  64. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-bldgtype-multifamily-shared-pv.osw +341 -0
  65. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-bldgtype-multifamily-shared-water-heater.osw +341 -0
  66. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-bldgtype-multifamily.osw +341 -0
  67. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-single-family-attached.osw → base-bldgtype-single-family-attached.osw} +59 -85
  68. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-combi-tankless-outside.osw +56 -82
  69. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-combi-tankless.osw +56 -82
  70. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-dwhr.osw +56 -82
  71. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect-outside.osw +56 -82
  72. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect-standbyloss.osw +56 -82
  73. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect-with-solar-fraction.osw +56 -82
  74. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect.osw +56 -82
  75. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-electric.osw +56 -82
  76. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-gas.osw +56 -82
  77. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-hpwh.osw +56 -82
  78. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-indirect.osw +56 -82
  79. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-low-flow-fixtures.osw +56 -82
  80. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-none.osw +57 -83
  81. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-demand.osw +56 -82
  82. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-manual.osw +56 -82
  83. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-nocontrol.osw +56 -82
  84. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-temperature.osw +56 -82
  85. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-timer.osw +56 -82
  86. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-direct-evacuated-tube.osw +56 -82
  87. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-direct-flat-plate.osw +56 -82
  88. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-direct-ics.osw +56 -82
  89. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-fraction.osw +56 -82
  90. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-indirect-flat-plate.osw +56 -82
  91. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-thermosyphon-flat-plate.osw +56 -82
  92. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-coal.osw +56 -82
  93. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-elec-uef.osw +338 -0
  94. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-gas-outside.osw +56 -82
  95. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-gas-uef.osw +338 -0
  96. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-gas.osw +56 -82
  97. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-outside.osw +56 -82
  98. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-uef.osw +338 -0
  99. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-with-solar-fraction.osw +56 -82
  100. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-with-solar.osw +56 -82
  101. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump.osw +56 -82
  102. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-oil.osw +56 -82
  103. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-wood.osw +56 -82
  104. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-electric-outside.osw +56 -83
  105. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-electric-uef.osw +337 -0
  106. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-electric.osw +56 -82
  107. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas-uef.osw +337 -0
  108. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas-with-solar-fraction.osw +56 -82
  109. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas-with-solar.osw +56 -82
  110. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas.osw +56 -82
  111. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-propane.osw +56 -82
  112. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-2stories-garage.osw +56 -82
  113. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-2stories.osw +56 -82
  114. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-1.osw +56 -82
  115. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-2.osw +56 -82
  116. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-4.osw +56 -82
  117. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-5.osw +56 -82
  118. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-garage.osw +56 -82
  119. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-ach-house-pressure.osw +56 -82
  120. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-cfm-house-pressure.osw +56 -82
  121. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-cfm50.osw +56 -82
  122. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-flue.osw +56 -82
  123. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-natural-ach.osw +57 -83
  124. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-overhangs.osw +57 -83
  125. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-windows-none.osw +56 -82
  126. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-ambient.osw +56 -82
  127. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-conditioned-basement-slab-insulation.osw +56 -82
  128. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-slab.osw +56 -82
  129. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unconditioned-basement-assembly-r.osw +55 -81
  130. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unconditioned-basement-wall-insulation.osw +55 -81
  131. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unconditioned-basement.osw +55 -81
  132. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unvented-crawlspace.osw +55 -81
  133. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-vented-crawlspace.osw +55 -81
  134. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-1-speed-cooling-only.osw +337 -0
  135. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-1-speed-heating-only.osw +337 -0
  136. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-1-speed.osw +56 -82
  137. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-2-speed.osw +56 -82
  138. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-var-speed.osw +56 -82
  139. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-coal-only.osw +56 -82
  140. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-elec-only.osw +56 -82
  141. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-gas-central-ac-1-speed.osw +56 -82
  142. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-gas-only.osw +56 -82
  143. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-oil-only.osw +56 -82
  144. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-propane-only.osw +56 -82
  145. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-wood-only.osw +56 -82
  146. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-only-1-speed.osw +56 -82
  147. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-only-2-speed.osw +56 -82
  148. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-only-var-speed.osw +56 -82
  149. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-plus-air-to-air-heat-pump-heating.osw +56 -82
  150. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-electric.osw +55 -81
  151. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed.osw +55 -81
  152. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-2-speed.osw +55 -81
  153. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-var-speed.osw +55 -81
  154. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-mini-split-heat-pump-ducted.osw +56 -82
  155. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-ducts-leakage-percent.osw +56 -82
  156. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-elec-resistance-only.osw +56 -82
  157. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-evap-cooler-furnace-gas.osw +56 -82
  158. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-evap-cooler-only-ducted.osw +57 -83
  159. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-evap-cooler-only.osw +56 -82
  160. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-fireplace-wood-only.osw +56 -82
  161. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-fixed-heater-gas-only.osw +57 -83
  162. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-floor-furnace-propane-only.osw +56 -82
  163. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-coal-only.osw +337 -0
  164. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-elec-central-ac-1-speed.osw +56 -82
  165. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-elec-only.osw +56 -82
  166. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-central-ac-2-speed.osw +56 -82
  167. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-central-ac-var-speed.osw +56 -82
  168. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-only.osw +56 -82
  169. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-room-ac.osw +56 -82
  170. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-oil-only.osw +56 -82
  171. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-propane-only.osw +56 -82
  172. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-wood-only.osw +56 -82
  173. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-ground-to-air-heat-pump-cooling-only.osw +336 -0
  174. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-ground-to-air-heat-pump-heating-only.osw +336 -0
  175. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-ground-to-air-heat-pump.osw +56 -84
  176. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-airflow-defect-furnace-gas-central-ac-1-speed.osw +339 -0
  177. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-air-to-air-heat-pump-1-speed.osw +339 -0
  178. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-air-to-air-heat-pump-2-speed.osw +339 -0
  179. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-air-to-air-heat-pump-var-speed.osw +339 -0
  180. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-furnace-gas-central-ac-1-speed.osw +340 -0
  181. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-furnace-gas-central-ac-2-speed.osw +340 -0
  182. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-furnace-gas-central-ac-var-speed.osw +340 -0
  183. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-furnace-gas-only.osw +338 -0
  184. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-ground-to-air-heat-pump.osw +338 -0
  185. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-mini-split-air-conditioner-only-ducted.osw +338 -0
  186. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-all-mini-split-heat-pump-ducted.osw +339 -0
  187. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-charge-defect-furnace-gas-central-ac-1-speed.osw +338 -0
  188. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-install-quality-none-furnace-gas-central-ac-1-speed.osw +340 -0
  189. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-air-conditioner-only-ducted.osw +56 -82
  190. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-air-conditioner-only-ductless.osw +56 -82
  191. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ducted-cooling-only.osw +56 -82
  192. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ducted-heating-only.osw +56 -82
  193. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ducted.osw +57 -83
  194. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ductless.osw +57 -83
  195. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-none.osw +56 -82
  196. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-portable-heater-gas-only.osw +57 -83
  197. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-programmable-thermostat-detailed.osw +337 -0
  198. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-room-ac-only-33percent.osw +56 -82
  199. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-room-ac-only.osw +56 -82
  200. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-setpoints.osw +56 -82
  201. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-stove-oil-only.osw +56 -82
  202. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-stove-wood-pellets-only.osw +56 -82
  203. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-undersized.osw +56 -82
  204. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-wall-furnace-elec-only.osw +56 -82
  205. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-lighting-ceiling-fans.osw +57 -83
  206. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-lighting-detailed.osw +56 -82
  207. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-AMY-2012.osw +56 -82
  208. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-baltimore-md.osw +64 -90
  209. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-dallas-tx.osw +56 -82
  210. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-duluth-mn.osw +69 -95
  211. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-helena-mt.osw +337 -0
  212. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-honolulu-hi.osw +337 -0
  213. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-miami-fl.osw +56 -82
  214. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-phoenix-az.osw +337 -0
  215. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-portland-or.osw +337 -0
  216. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-balanced.osw +56 -82
  217. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-bath-kitchen-fans.osw +64 -92
  218. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-cfis-evap-cooler-only-ducted.osw +57 -83
  219. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-cfis.osw +56 -82
  220. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-erv-atre-asre.osw +56 -82
  221. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-erv.osw +56 -82
  222. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-exhaust-rated-flow-rate.osw +337 -0
  223. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-exhaust.osw +56 -82
  224. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-hrv-asre.osw +56 -82
  225. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-hrv.osw +56 -82
  226. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-supply.osw +56 -82
  227. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-whole-house-fan.osw +56 -82
  228. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-defaults.osw +57 -83
  229. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-loads-large-uncommon.osw +60 -86
  230. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-loads-large-uncommon2.osw +60 -86
  231. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-neighbor-shading.osw +56 -82
  232. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-shielding-of-home.osw +337 -0
  233. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-usage-multiplier.osw +52 -78
  234. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-pv.osw +52 -78
  235. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-vacancy-6-months.osw → base-schedules-stochastic-vacant.osw} +59 -85
  236. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-schedules-stochastic.osw +56 -82
  237. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-schedules-user-specified.osw +56 -82
  238. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-calendar-year-custom.osw +56 -82
  239. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-daylight-saving-custom.osw +56 -82
  240. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-daylight-saving-disabled.osw +56 -82
  241. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-runperiod-1-month.osw +56 -82
  242. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-timestep-10-mins.osw +56 -82
  243. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base.osw +56 -82
  244. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/build_residential_hpxml_test.rb +71 -57
  245. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-auto.osw +56 -82
  246. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-double-exterior.osw +341 -0
  247. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-double-loaded-interior.osw +341 -0
  248. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-eaves.osw +341 -0
  249. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-single-exterior-front.osw +341 -0
  250. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-double-loaded-interior.osw +341 -0
  251. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-left-bottom-double-loaded-interior.osw +341 -0
  252. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-left-bottom.osw +341 -0
  253. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-left-middle-double-loaded-interior.osw +341 -0
  254. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-left-middle.osw +341 -0
  255. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-left-top-double-loaded-interior.osw +341 -0
  256. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-left-top.osw +341 -0
  257. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-middle-bottom-double-loaded-interior.osw +341 -0
  258. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-middle-bottom.osw +341 -0
  259. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-middle-middle-double-loaded-interior.osw +341 -0
  260. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-middle-middle.osw +341 -0
  261. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-middle-top-double-loaded-interior.osw +341 -0
  262. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-middle-top.osw +341 -0
  263. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-right-bottom-double-loaded-interior.osw +341 -0
  264. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-right-bottom.osw +341 -0
  265. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-right-middle-double-loaded-interior.osw +341 -0
  266. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-right-middle.osw +341 -0
  267. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-right-top-double-loaded-interior.osw +341 -0
  268. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab-right-top.osw +341 -0
  269. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-slab.osw +341 -0
  270. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-double-loaded-interior.osw +341 -0
  271. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-left-bottom-double-loaded-interior.osw +341 -0
  272. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-left-bottom.osw +341 -0
  273. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-left-middle-double-loaded-interior.osw +341 -0
  274. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-left-middle.osw +341 -0
  275. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-left-top-double-loaded-interior.osw +341 -0
  276. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-left-top.osw +341 -0
  277. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-middle-bottom-double-loaded-interior.osw +341 -0
  278. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-middle-bottom.osw +341 -0
  279. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-middle-middle-double-loaded-interior.osw +341 -0
  280. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-middle-middle.osw +341 -0
  281. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-middle-top-double-loaded-interior.osw +341 -0
  282. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-middle-top.osw +341 -0
  283. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-right-bottom-double-loaded-interior.osw +341 -0
  284. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-right-bottom.osw +341 -0
  285. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-right-middle-double-loaded-interior.osw +341 -0
  286. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-right-middle.osw +341 -0
  287. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-right-top-double-loaded-interior.osw +341 -0
  288. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace-right-top.osw +341 -0
  289. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-unvented-crawlspace.osw +341 -0
  290. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-double-loaded-interior.osw +341 -0
  291. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-left-bottom-double-loaded-interior.osw +341 -0
  292. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-left-bottom.osw +341 -0
  293. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-left-middle-double-loaded-interior.osw +341 -0
  294. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-left-middle.osw +341 -0
  295. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-left-top-double-loaded-interior.osw +341 -0
  296. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-left-top.osw +341 -0
  297. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-middle-bottom-double-loaded-interior.osw +341 -0
  298. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-middle-bottom.osw +341 -0
  299. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-middle-middle-double-loaded-interior.osw +341 -0
  300. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-middle-middle.osw +341 -0
  301. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-middle-top-double-loaded-interior.osw +341 -0
  302. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-middle-top.osw +341 -0
  303. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-right-bottom-double-loaded-interior.osw +341 -0
  304. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-right-bottom.osw +341 -0
  305. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-right-middle-double-loaded-interior.osw +341 -0
  306. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-right-middle.osw +341 -0
  307. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-right-top-double-loaded-interior.osw +341 -0
  308. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace-right-top.osw +341 -0
  309. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-multifamily-vented-crawlspace.osw +341 -0
  310. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-atticroof-conditioned-eaves-gable.osw +339 -0
  311. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-atticroof-conditioned-eaves-hip.osw +339 -0
  312. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-atticroof-flat.osw +339 -0
  313. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-pv-shared.osw → extra-bldgtype-single-family-attached-double-exterior.osw} +62 -89
  314. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-double-loaded-interior.osw +339 -0
  315. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-dhw-shared-water-heater.osw → extra-bldgtype-single-family-attached-single-exterior-front.osw} +60 -86
  316. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-slab-middle.osw +339 -0
  317. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-slab-right.osw +339 -0
  318. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-slab.osw +339 -0
  319. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-unconditioned-basement-middle.osw +339 -0
  320. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-unconditioned-basement-right.osw +339 -0
  321. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-multifamily.osw → extra-bldgtype-single-family-attached-unconditioned-basement.osw} +64 -91
  322. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-unvented-crawlspace-middle.osw +339 -0
  323. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-unvented-crawlspace-right.osw +339 -0
  324. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-unvented-crawlspace.osw +339 -0
  325. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-vented-crawlspace-middle.osw +339 -0
  326. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-vented-crawlspace-right.osw +339 -0
  327. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-bldgtype-single-family-attached-vented-crawlspace.osw +339 -0
  328. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-dhw-solar-latitude.osw +56 -82
  329. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-enclosure-atticroof-conditioned-eaves-gable.osw +337 -0
  330. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-enclosure-atticroof-conditioned-eaves-hip.osw +337 -0
  331. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-enclosure-garage-atticroof-conditioned.osw +337 -0
  332. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-enclosure-garage-partially-protruded.osw +56 -82
  333. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-enclosure-windows-shading.osw +339 -0
  334. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-gas-hot-tub-heater-with-zero-kwh.osw +337 -0
  335. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-gas-pool-heater-with-zero-kwh.osw +337 -0
  336. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-pv-roofpitch.osw +56 -82
  337. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-schedules-random-seed.osw +338 -0
  338. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-heating-system-boiler-to-heat-pump.osw +336 -0
  339. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-heating-system-boiler-to-heating-system.osw +337 -0
  340. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-heating-system-fireplace-to-heat-pump.osw +337 -0
  341. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-second-heating-system-fireplace.osw → extra-second-heating-system-fireplace-to-heating-system.osw} +58 -84
  342. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-heating-system-portable-heater-to-heat-pump.osw +337 -0
  343. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-second-heating-system-portable-heater.osw → extra-second-heating-system-portable-heater-to-heating-system.osw} +56 -82
  344. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-refrigerator.osw +56 -82
  345. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-zero-clothes-washer-kwh.osw +337 -0
  346. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-zero-dishwasher-kwh.osw +337 -0
  347. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-zero-extra-refrigerator-kwh.osw +337 -0
  348. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-zero-freezer-kwh.osw +337 -0
  349. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-zero-refrigerator-kwh.osw +337 -0
  350. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/conditioned-attic-with-floor-insulation.osw +59 -85
  351. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/conditioned-attic-with-one-floor-above-grade.osw +337 -0
  352. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/conditioned-basement-with-ceiling-insulation.osw +56 -82
  353. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/cooling-system-and-heat-pump.osw +56 -82
  354. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/dhw-indirect-without-boiler.osw +56 -82
  355. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/ducts-location-and-areas-not-same-type.osw +56 -82
  356. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/foundation-wall-insulation-greater-than-height.osw +337 -0
  357. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/heating-system-and-heat-pump.osw +56 -82
  358. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multifamily-bottom-crawlspace-zero-foundation-height.osw +64 -89
  359. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multifamily-bottom-slab-non-zero-foundation-height.osw +64 -89
  360. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multifamily-no-building-orientation.osw +63 -88
  361. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-hvac-programmable-thermostat.osw → invalid_files/multipliers-without-fuel-loads.osw} +54 -80
  362. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multipliers-without-other-plug-loads.osw +337 -0
  363. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multipliers-without-tv-plug-loads.osw +337 -0
  364. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-dhw-uef.osw → invalid_files/multipliers-without-vehicle-plug-loads.osw} +58 -84
  365. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multipliers-without-well-pump-plug-loads.osw +337 -0
  366. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/non-electric-heat-pump-water-heater.osw +56 -82
  367. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/non-integer-ceiling-fan-quantity.osw +56 -82
  368. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/non-integer-geometry-num-bathrooms.osw +56 -82
  369. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/second-heating-system-but-no-primary-heating.osw +337 -0
  370. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/second-heating-system-serves-majority-heat.osw +56 -82
  371. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/second-heating-system-serves-total-heat-load.osw +337 -0
  372. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-attached-ambient.osw +58 -84
  373. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-attached-no-building-orientation.osw +58 -84
  374. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-detached-finished-basement-zero-foundation-height.osw +56 -82
  375. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-detached-slab-non-zero-foundation-height.osw +56 -82
  376. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-detached-with-shared-system.osw +337 -0
  377. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/slab-non-zero-foundation-height-above-grade.osw +56 -82
  378. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/unconditioned-basement-with-wall-and-ceiling-insulation.osw +56 -82
  379. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/unvented-attic-with-floor-and-roof-insulation.osw +56 -82
  380. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/unvented-crawlspace-with-wall-and-ceiling-insulation.osw +59 -85
  381. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/vented-attic-with-floor-and-roof-insulation.osw +58 -84
  382. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/vented-crawlspace-with-wall-and-ceiling-insulation.osw +56 -82
  383. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/zero-number-of-bedrooms.osw +337 -0
  384. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/schedules/vacant.csv +8761 -0
  385. data/example_files/resources/hpxml-measures/Changelog.md +249 -0
  386. data/example_files/resources/hpxml-measures/Gemfile +2 -5
  387. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/measure.rb +404 -1357
  388. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/measure.xml +247 -171
  389. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/BaseElements.xsd +11 -101
  390. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/EPvalidator.xml +824 -301
  391. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/HPXMLDataTypes.xsd +18 -35
  392. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/HPXMLvalidator.xml +526 -0
  393. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/airflow.rb +135 -207
  394. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/constants.rb +14 -186
  395. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/constructions.rb +549 -93
  396. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/energyplus.rb +12 -15
  397. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/generator.rb +78 -0
  398. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/geometry.rb +413 -15
  399. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hotwater_appliances.rb +48 -37
  400. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml.rb +1627 -1227
  401. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_defaults.rb +1192 -434
  402. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hvac.rb +1555 -1616
  403. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hvac_sizing.rb +1436 -1479
  404. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/lighting.rb +3 -2
  405. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/location.rb +22 -10
  406. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/meta_measure.rb +85 -19
  407. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/minitest_helper.rb +4 -26
  408. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/misc_loads.rb +22 -46
  409. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/pv.rb +22 -21
  410. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedules.rb +51 -14
  411. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/simcontrols.rb +24 -7
  412. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/unit_conversions.rb +2 -0
  413. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/validator.rb +80 -19
  414. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/version.rb +9 -2
  415. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/waterheater.rb +106 -75
  416. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/xmlhelper.rb +109 -34
  417. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_airflow.rb +22 -36
  418. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_defaults.rb +1565 -768
  419. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_enclosure.rb +151 -0
  420. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_generator.rb +101 -0
  421. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hotwater_appliance.rb +9 -18
  422. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hvac.rb +316 -28
  423. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hvac_sizing.rb +53 -0
  424. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_lighting.rb +4 -2
  425. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_location.rb +13 -11
  426. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_miscloads.rb +4 -2
  427. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_pv.rb +5 -3
  428. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_simcontrols.rb +13 -11
  429. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_validation.rb +102 -62
  430. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_water_heater.rb +189 -35
  431. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/util.rb +26 -0
  432. data/example_files/resources/hpxml-measures/README.md +5 -5
  433. data/example_files/resources/hpxml-measures/Rakefile +2 -10
  434. data/example_files/resources/hpxml-measures/SimulationOutputReport/measure.rb +416 -299
  435. data/example_files/resources/hpxml-measures/SimulationOutputReport/measure.xml +364 -481
  436. data/example_files/resources/hpxml-measures/SimulationOutputReport/resources/constants.rb +1 -2
  437. data/example_files/resources/hpxml-measures/SimulationOutputReport/tests/output_report_test.rb +327 -320
  438. data/example_files/resources/hpxml-measures/docs/source/build_residential_hpxml.rst +3 -3
  439. data/example_files/resources/hpxml-measures/docs/source/conf.py +11 -5
  440. data/example_files/resources/hpxml-measures/docs/source/getting_started.rst +6 -6
  441. data/example_files/resources/hpxml-measures/docs/source/index.rst +2 -2
  442. data/example_files/resources/hpxml-measures/docs/source/intro.rst +7 -109
  443. data/example_files/resources/hpxml-measures/docs/source/nstatic/stylesheet.css +13 -1
  444. data/example_files/resources/hpxml-measures/docs/source/workflow_inputs.rst +2482 -0
  445. data/example_files/resources/hpxml-measures/docs/source/workflow_outputs.rst +282 -0
  446. data/example_files/resources/hpxml-measures/tasks.rb +2494 -1248
  447. data/example_files/resources/hpxml-measures/weather/USA_AZ_Phoenix-Sky.Harbor.Intl.AP.722780_TMY3-cache.csv +35 -0
  448. data/example_files/resources/hpxml-measures/weather/USA_AZ_Phoenix-Sky.Harbor.Intl.AP.722780_TMY3.epw +8768 -0
  449. data/example_files/resources/hpxml-measures/weather/USA_CO_Denver.Intl.AP.725650_TMY3-cache.csv +10 -10
  450. data/example_files/resources/hpxml-measures/weather/USA_HI_Honolulu.Intl.AP.911820_TMY3-cache.csv +35 -0
  451. data/example_files/resources/hpxml-measures/weather/USA_HI_Honolulu.Intl.AP.911820_TMY3.epw +8768 -0
  452. data/example_files/resources/hpxml-measures/weather/USA_MT_Helena.Rgnl.AP.727720_TMY3-cache.csv +35 -0
  453. data/example_files/resources/hpxml-measures/weather/USA_MT_Helena.Rgnl.AP.727720_TMY3.epw +8768 -0
  454. data/example_files/resources/hpxml-measures/weather/USA_OR_Portland.Intl.AP.726980_TMY3-cache.csv +35 -0
  455. data/example_files/resources/hpxml-measures/weather/USA_OR_Portland.Intl.AP.726980_TMY3.epw +8768 -0
  456. data/example_files/resources/hpxml-measures/workflow/run_simulation.rb +96 -21
  457. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-coal.xml +558 -559
  458. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-appliances-dehumidifier-ief.xml → base-appliances-dehumidifier-ief-portable.xml} +8 -7
  459. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-appliances-dehumidifier-50percent.xml → base-appliances-dehumidifier-ief-whole-home.xml} +10 -9
  460. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier-multiple.xml +535 -0
  461. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier.xml +525 -524
  462. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-gas.xml +558 -559
  463. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-modified.xml +564 -565
  464. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-none.xml +513 -513
  465. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-oil.xml +558 -559
  466. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-propane.xml +558 -559
  467. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-wood.xml +558 -559
  468. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-cathedral.xml +565 -566
  469. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-conditioned.xml +633 -634
  470. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-flat.xml +531 -532
  471. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-radiant-barrier.xml +517 -518
  472. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-unvented-insulated-roof.xml +562 -563
  473. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-vented.xml +565 -566
  474. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-enclosure-other-multifamily-buffer-space.xml → base-bldgtype-multifamily-adjacent-to-multifamily-buffer-space.xml} +34 -62
  475. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-adjacent-to-multiple.xml +554 -0
  476. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-enclosure-other-non-freezing-space.xml → base-bldgtype-multifamily-adjacent-to-non-freezing-space.xml} +34 -62
  477. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-enclosure-other-heated-space.xml → base-bldgtype-multifamily-adjacent-to-other-heated-space.xml} +34 -62
  478. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-enclosure-other-housing-unit.xml → base-bldgtype-multifamily-adjacent-to-other-housing-unit.xml} +34 -62
  479. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-baseboard.xml +425 -0
  480. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-fan-coil-ducted.xml +457 -0
  481. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-fan-coil.xml +427 -0
  482. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-water-loop-heat-pump.xml +479 -0
  483. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-cooling-tower-water-loop-heat-pump.xml +474 -0
  484. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-baseboard.xml +408 -0
  485. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil-ducted.xml +439 -0
  486. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil-eae.xml +406 -0
  487. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil.xml +409 -0
  488. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-water-loop-heat-pump.xml +457 -0
  489. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-baseboard.xml +407 -0
  490. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-fan-coil-ducted.xml +438 -0
  491. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-fan-coil.xml +408 -0
  492. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-water-loop-heat-pump.xml +456 -0
  493. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-cooling-tower-only-water-loop-heat-pump.xml +451 -0
  494. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-generator.xml +460 -0
  495. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-ground-loop-ground-to-air-heat-pump.xml +451 -0
  496. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-laundry-room.xml +466 -0
  497. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-mechvent-shared-multiple.xml → base-bldgtype-multifamily-shared-mechvent-multiple.xml} +43 -415
  498. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-mechvent-preconditioning.xml +489 -0
  499. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-mechvent.xml +473 -0
  500. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-pv.xml +465 -0
  501. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-water-heater-recirc.xml +458 -0
  502. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-water-heater.xml +451 -0
  503. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily.xml +448 -0
  504. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-single-family-attached.xml +619 -0
  505. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-combi-tankless-outside.xml +516 -519
  506. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-combi-tankless.xml +516 -519
  507. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-2-speed.xml +550 -551
  508. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-gshp.xml +7 -9
  509. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-hpwh.xml +563 -564
  510. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-tankless.xml +548 -549
  511. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-var-speed.xml +550 -551
  512. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater.xml +550 -551
  513. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-dwhr.xml +567 -568
  514. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-dse.xml +517 -520
  515. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-outside.xml +517 -520
  516. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-standbyloss.xml +518 -521
  517. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-with-solar-fraction.xml +525 -528
  518. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect.xml +517 -520
  519. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-electric.xml +567 -568
  520. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-gas.xml +568 -569
  521. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-hpwh.xml +566 -567
  522. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-indirect.xml +522 -525
  523. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-low-flow-fixtures.xml +562 -563
  524. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-multiple.xml +575 -578
  525. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-none.xml +497 -497
  526. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-demand.xml +565 -566
  527. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-manual.xml +565 -566
  528. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-nocontrol.xml +565 -566
  529. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-temperature.xml +565 -566
  530. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-timer.xml +565 -566
  531. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-evacuated-tube.xml +577 -578
  532. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-flat-plate.xml +577 -578
  533. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-ics.xml +577 -578
  534. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-fraction.xml +570 -571
  535. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-indirect-flat-plate.xml +577 -578
  536. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-thermosyphon-flat-plate.xml +577 -578
  537. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-coal.xml +563 -564
  538. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-elec-uef.xml +564 -0
  539. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas-outside.xml +563 -564
  540. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas-uef.xml +565 -0
  541. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas.xml +563 -564
  542. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-outside.xml +561 -562
  543. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-uef.xml +564 -0
  544. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-with-solar-fraction.xml +569 -570
  545. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-with-solar.xml +576 -577
  546. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump.xml +561 -562
  547. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-oil.xml +563 -564
  548. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-wood.xml +563 -564
  549. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric-outside.xml +561 -562
  550. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric-uef.xml +561 -0
  551. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric.xml +560 -561
  552. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-uef.xml +561 -0
  553. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-with-solar-fraction.xml +568 -569
  554. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-with-solar.xml +575 -576
  555. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas.xml +560 -561
  556. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-propane.xml +560 -561
  557. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-2stories-garage.xml +661 -664
  558. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-2stories.xml +575 -576
  559. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-1.xml +562 -563
  560. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-2.xml +562 -563
  561. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-4.xml +562 -563
  562. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-5.xml +562 -563
  563. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-garage.xml +636 -639
  564. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-ach-house-pressure.xml +562 -563
  565. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-cfm-house-pressure.xml +562 -563
  566. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-cfm50.xml +562 -563
  567. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-flue.xml +565 -566
  568. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-natural-ach.xml +561 -562
  569. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-overhangs.xml +582 -578
  570. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-rooftypes.xml +590 -591
  571. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-skylights-shading.xml +601 -0
  572. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-skylights.xml +590 -591
  573. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-level.xml +517 -0
  574. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-surfaces.xml +2474 -2493
  575. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-surfaces2.xml +2475 -0
  576. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-walltypes.xml +754 -755
  577. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-none.xml +504 -505
  578. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-enclosure-windows-interior-shading.xml → base-enclosure-windows-shading.xml} +23 -9
  579. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-ambient.xml +498 -497
  580. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-basement-garage.xml +644 -0
  581. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-complex.xml +724 -729
  582. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-conditioned-basement-slab-insulation.xml +562 -563
  583. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-conditioned-basement-wall-interior-insulation.xml +562 -563
  584. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-multiple.xml +685 -688
  585. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-slab.xml +516 -517
  586. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-above-grade.xml +609 -610
  587. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-assembly-r.xml +558 -559
  588. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-wall-insulation.xml +573 -574
  589. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement.xml +573 -574
  590. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unvented-crawlspace.xml +573 -574
  591. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-vented-crawlspace.xml +576 -577
  592. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-walkout-basement.xml +627 -628
  593. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-autosize.xml → base-hvac-air-to-air-heat-pump-1-speed-cooling-only.xml} +8 -12
  594. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-air-to-air-heat-pump-1-speed-autosize-manual-s-oversize-allowances.xml → base-hvac-air-to-air-heat-pump-1-speed-heating-only.xml} +9 -9
  595. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-1-speed.xml +561 -562
  596. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-2-speed.xml +561 -562
  597. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-var-speed.xml +561 -562
  598. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-cooling-only.xml +553 -0
  599. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-air-to-air-heat-pump-1-speed-autosize.xml → base-hvac-autosize-air-to-air-heat-pump-1-speed-heating-only.xml} +5 -6
  600. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-manual-s-oversize-allowances.xml +561 -0
  601. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed.xml +558 -0
  602. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-air-to-air-heat-pump-2-speed-autosize-manual-s-oversize-allowances.xml → base-hvac-autosize-air-to-air-heat-pump-2-speed-manual-s-oversize-allowances.xml} +4 -5
  603. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-air-to-air-heat-pump-2-speed-autosize.xml → base-hvac-autosize-air-to-air-heat-pump-2-speed.xml} +4 -5
  604. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-air-to-air-heat-pump-var-speed-autosize-manual-s-oversize-allowances.xml → base-hvac-autosize-air-to-air-heat-pump-var-speed-manual-s-oversize-allowances.xml} +4 -5
  605. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-air-to-air-heat-pump-var-speed-autosize.xml → base-hvac-autosize-air-to-air-heat-pump-var-speed.xml} +4 -5
  606. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-boiler-elec-only-autosize.xml → base-hvac-autosize-boiler-elec-only.xml} +2 -5
  607. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-boiler-gas-central-ac-1-speed-autosize.xml → base-hvac-autosize-boiler-gas-central-ac-1-speed.xml} +4 -6
  608. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-boiler-gas-only-autosize.xml → base-hvac-autosize-boiler-gas-only.xml} +2 -5
  609. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-central-ac-only-1-speed-autosize.xml → base-hvac-autosize-central-ac-only-1-speed.xml} +547 -548
  610. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-central-ac-only-2-speed-autosize.xml → base-hvac-autosize-central-ac-only-2-speed.xml} +4 -5
  611. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-central-ac-only-var-speed-autosize.xml → base-hvac-autosize-central-ac-only-var-speed.xml} +4 -5
  612. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-central-ac-plus-air-to-air-heat-pump-heating-autosize.xml → base-hvac-autosize-central-ac-plus-air-to-air-heat-pump-heating.xml} +570 -571
  613. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-dual-fuel-air-to-air-heat-pump-1-speed.xml +559 -0
  614. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-dual-fuel-mini-split-heat-pump-ducted-autosize.xml → base-hvac-autosize-dual-fuel-mini-split-heat-pump-ducted.xml} +557 -558
  615. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-elec-resistance-only-autosize.xml → base-hvac-autosize-elec-resistance-only.xml} +2 -5
  616. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-evap-cooler-furnace-gas-autosize.xml → base-hvac-autosize-evap-cooler-furnace-gas.xml} +4 -5
  617. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-floor-furnace-propane-only-autosize.xml → base-hvac-autosize-floor-furnace-propane-only.xml} +5 -6
  618. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-furnace-elec-only-autosize.xml → base-hvac-autosize-furnace-elec-only.xml} +4 -5
  619. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-furnace-gas-central-ac-2-speed-autosize.xml → base-hvac-autosize-furnace-gas-central-ac-2-speed.xml} +4 -5
  620. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-furnace-gas-central-ac-var-speed-autosize.xml → base-hvac-autosize-furnace-gas-central-ac-var-speed.xml} +4 -5
  621. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-furnace-gas-only-autosize.xml → base-hvac-autosize-furnace-gas-only.xml} +4 -6
  622. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-furnace-gas-room-ac-autosize.xml → base-hvac-autosize-furnace-gas-room-ac.xml} +4 -5
  623. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ground-to-air-heat-pump-cooling-only.xml +555 -0
  624. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ground-to-air-heat-pump-heating-only.xml +560 -0
  625. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-ground-to-air-heat-pump-autosize-manual-s-oversize-allowances.xml → base-hvac-autosize-ground-to-air-heat-pump-manual-s-oversize-allowances.xml} +4 -6
  626. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-ground-to-air-heat-pump-autosize.xml → base-hvac-autosize-ground-to-air-heat-pump.xml} +4 -6
  627. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-air-conditioner-only-ducted.xml +547 -0
  628. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-cooling-only-autosize.xml → base-hvac-autosize-mini-split-heat-pump-ducted-cooling-only.xml} +551 -552
  629. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-heating-only-autosize.xml → base-hvac-autosize-mini-split-heat-pump-ducted-heating-only.xml} +556 -557
  630. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ducted-manual-s-oversize-allowances.xml +560 -0
  631. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-autosize.xml → base-hvac-autosize-mini-split-heat-pump-ducted.xml} +556 -557
  632. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-room-ac-only-autosize.xml → base-hvac-autosize-room-ac-only.xml} +2 -5
  633. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-stove-oil-only-autosize.xml → base-hvac-autosize-stove-oil-only.xml} +5 -6
  634. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-wall-furnace-elec-only-autosize.xml → base-hvac-autosize-wall-furnace-elec-only.xml} +5 -6
  635. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-autosize.xml → base-hvac-autosize.xml} +4 -5
  636. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-coal-only.xml +518 -521
  637. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-elec-only.xml +518 -521
  638. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-gas-central-ac-1-speed.xml +571 -573
  639. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-gas-only.xml +519 -522
  640. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-oil-only.xml +518 -521
  641. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-propane-only.xml +518 -521
  642. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-wood-only.xml +518 -521
  643. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-1-speed.xml +548 -549
  644. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-2-speed.xml +548 -549
  645. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-var-speed.xml +548 -549
  646. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-plus-air-to-air-heat-pump-heating.xml +575 -576
  647. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dse.xml +532 -535
  648. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-electric.xml +562 -563
  649. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed.xml +562 -563
  650. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-2-speed.xml +562 -563
  651. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-var-speed.xml +562 -563
  652. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-mini-split-heat-pump-ducted.xml +561 -562
  653. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-leakage-percent.xml +562 -563
  654. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-elec-resistance-only.xml +509 -512
  655. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-furnace-gas.xml +555 -555
  656. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-only-ducted.xml +536 -528
  657. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-only.xml +503 -505
  658. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-fireplace-wood-only.xml +6 -7
  659. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-fixed-heater-gas-only.xml +6 -57
  660. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-floor-furnace-propane-only.xml +6 -7
  661. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-coal-only.xml +549 -0
  662. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-elec-central-ac-1-speed.xml +562 -563
  663. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-elec-only.xml +548 -549
  664. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-central-ac-2-speed.xml +562 -563
  665. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-central-ac-var-speed.xml +562 -563
  666. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-only.xml +5 -7
  667. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-room-ac.xml +560 -561
  668. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-oil-only.xml +548 -549
  669. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-propane-only.xml +548 -549
  670. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-wood-only.xml +548 -549
  671. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-x3-dse.xml +576 -579
  672. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ground-to-air-heat-pump-cooling-only.xml +557 -0
  673. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ground-to-air-heat-pump-heating-only.xml +563 -0
  674. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ground-to-air-heat-pump.xml +7 -9
  675. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-hvac-flowrate.xml → base-hvac-install-quality-airflow-defect-furnace-gas-central-ac-1-speed.xml} +8 -9
  676. data/example_files/resources/hpxml-measures/workflow/sample_files/{invalid_files/heat-pump-mixed-fixed-and-autosize-capacities2.xml → base-hvac-install-quality-all-air-to-air-heat-pump-1-speed.xml} +13 -8
  677. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-all-air-to-air-heat-pump-2-speed.xml +567 -0
  678. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-all-air-to-air-heat-pump-var-speed.xml +567 -0
  679. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-all-furnace-gas-central-ac-1-speed.xml +572 -0
  680. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-all-furnace-gas-central-ac-2-speed.xml +572 -0
  681. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-all-furnace-gas-central-ac-var-speed.xml +572 -0
  682. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-all-furnace-gas-only.xml +553 -0
  683. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-all-ground-to-air-heat-pump.xml +566 -0
  684. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-mini-split-air-conditioner-only-ducted-autosize.xml → base-hvac-install-quality-all-mini-split-air-conditioner-only-ducted.xml} +10 -5
  685. data/example_files/resources/hpxml-measures/workflow/sample_files/{hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-autosize-manual-s-oversize-allowances.xml → base-hvac-install-quality-all-mini-split-heat-pump-ducted.xml} +13 -8
  686. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-blower-efficiency-furnace-gas-central-ac-1-speed.xml +569 -0
  687. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-misc-shelter-coefficient.xml → base-hvac-install-quality-charge-defect-furnace-gas-central-ac-1-speed.xml} +9 -10
  688. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-none-furnace-gas-central-ac-1-speed.xml +570 -0
  689. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-air-conditioner-only-ducted.xml +547 -548
  690. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-air-conditioner-only-ductless.xml +508 -511
  691. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted-cooling-only.xml +554 -555
  692. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted-heating-only.xml +560 -561
  693. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted.xml +560 -561
  694. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ductless.xml +515 -518
  695. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-multiple.xml +21 -13
  696. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-none.xml +486 -489
  697. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-portable-heater-gas-only.xml +6 -57
  698. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-programmable-thermostat-detailed.xml +567 -0
  699. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-programmable-thermostat.xml +570 -571
  700. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only-33percent.xml +508 -511
  701. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only.xml +508 -511
  702. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-setpoints.xml +562 -563
  703. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-stove-oil-only.xml +6 -7
  704. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-stove-wood-pellets-only.xml +6 -7
  705. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-undersized-allow-increased-fixed-capacities.xml +565 -566
  706. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-undersized.xml +562 -563
  707. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-wall-furnace-elec-only.xml +6 -7
  708. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-ceiling-fans.xml +573 -574
  709. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-detailed.xml +585 -586
  710. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-none.xml +488 -489
  711. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-AMY-2012.xml +562 -563
  712. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-baltimore-md.xml +573 -563
  713. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-dallas-tx.xml +516 -517
  714. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-duluth-mn.xml +573 -563
  715. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-helena-mt.xml +563 -0
  716. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-honolulu-hi.xml +517 -0
  717. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-miami-fl.xml +516 -517
  718. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-phoenix-az.xml +517 -0
  719. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-portland-or.xml +577 -0
  720. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-balanced.xml +574 -575
  721. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-bath-kitchen-fans.xml +590 -591
  722. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-dse.xml +545 -548
  723. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-evap-cooler-only-ducted.xml +549 -541
  724. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis.xml +575 -576
  725. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-erv-atre-asre.xml +576 -577
  726. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-erv.xml +576 -577
  727. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-exhaust-rated-flow-rate.xml +574 -575
  728. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-exhaust.xml +574 -575
  729. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-hrv-asre.xml +575 -576
  730. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-hrv.xml +575 -576
  731. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-multiple.xml +796 -795
  732. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-supply.xml +574 -575
  733. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-whole-house-fan.xml +572 -573
  734. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-defaults.xml +478 -495
  735. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-generators.xml +579 -0
  736. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-large-uncommon.xml +758 -833
  737. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-large-uncommon2.xml +749 -820
  738. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-none.xml +550 -559
  739. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-neighbor-shading.xml +575 -576
  740. data/example_files/resources/hpxml-measures/workflow/sample_files/{invalid_files/invalid-calendar-year.xml → base-misc-shielding-of-home.xml} +7 -8
  741. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-usage-multiplier.xml +728 -725
  742. data/example_files/resources/hpxml-measures/workflow/sample_files/base-multiple-buildings.xml +1657 -0
  743. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv.xml +6 -7
  744. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-stochastic-vacant.xml +564 -0
  745. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-stochastic.xml +6 -7
  746. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-user-specified.xml +6 -7
  747. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-calendar-year-custom.xml +563 -564
  748. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-daylight-saving-custom.xml +569 -570
  749. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-daylight-saving-disabled.xml +565 -566
  750. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-runperiod-1-month.xml +566 -567
  751. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-timestep-10-mins.xml +562 -563
  752. data/example_files/resources/hpxml-measures/workflow/sample_files/base.xml +562 -563
  753. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/boiler-invalid-afue.xml +519 -0
  754. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/cfis-with-hydronic-distribution.xml +532 -535
  755. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/clothes-dryer-location.xml +562 -563
  756. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/clothes-washer-location.xml +562 -563
  757. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/cooking-range-location.xml +562 -563
  758. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dehumidifier-fraction-served.xml +535 -0
  759. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dehumidifier-setpoints.xml +535 -0
  760. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dhw-frac-load-served.xml +575 -578
  761. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-dhw-uef.xml → invalid_files/dhw-invalid-ef-tank.xml} +7 -8
  762. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dhw-invalid-uef-tank-heat-pump.xml +564 -0
  763. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dishwasher-location.xml +562 -563
  764. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duct-leakage-cfm25.xml +563 -0
  765. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duct-leakage-percent.xml +563 -0
  766. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duct-location-unconditioned-space.xml +562 -563
  767. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duct-location.xml +562 -563
  768. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duplicate-id.xml +562 -563
  769. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-attic-missing-roof.xml +546 -547
  770. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-basement-missing-exterior-foundation-wall.xml +543 -544
  771. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-basement-missing-slab.xml +546 -545
  772. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-floor-area-exceeds-cfa.xml +563 -0
  773. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-floor-area-exceeds-cfa2.xml +448 -0
  774. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-garage-missing-exterior-wall.xml +613 -616
  775. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-garage-missing-roof-ceiling.xml +626 -629
  776. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-garage-missing-slab.xml +610 -611
  777. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-living-missing-ceiling-roof.xml +550 -551
  778. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-living-missing-exterior-wall.xml +472 -473
  779. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-living-missing-floor-slab.xml +488 -534
  780. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/frac-sensible-fuel-load.xml +760 -0
  781. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/frac-sensible-plug-load.xml +759 -0
  782. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/frac-total-fuel-load.xml +761 -0
  783. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/frac-total-plug-load.xml +759 -0
  784. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/furnace-invalid-afue.xml +563 -0
  785. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/generator-number-of-bedrooms-served.xml +460 -0
  786. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/generator-output-greater-than-consumption.xml +579 -0
  787. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/heat-pump-mixed-fixed-and-autosize-capacities.xml +559 -560
  788. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-distribution-multiple-attached-cooling.xml +21 -13
  789. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-distribution-multiple-attached-heating.xml +21 -13
  790. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-distribution-return-duct-leakage-missing.xml +528 -534
  791. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-dse-multiple-attached-cooling.xml +546 -549
  792. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-dse-multiple-attached-heating.xml +546 -549
  793. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-frac-load-served.xml +21 -13
  794. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-inconsistent-fan-powers.xml +569 -0
  795. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-invalid-distribution-system-type.xml +570 -571
  796. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-shared-negative-seer-eq.xml +407 -0
  797. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-assembly-effective-rvalue.xml +563 -0
  798. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-datatype-boolean.xml +563 -0
  799. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-datatype-float.xml +563 -0
  800. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-datatype-integer.xml +563 -0
  801. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-daylight-saving.xml +569 -567
  802. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-distribution-cfa-served.xml +562 -563
  803. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-epw-filepath.xml +562 -563
  804. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-facility-type-equipment.xml +466 -0
  805. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-facility-type-surfaces.xml +644 -0
  806. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/{appliances-location-unconditioned-space.xml → invalid-foundation-wall-properties.xml} +39 -29
  807. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-id.xml +591 -0
  808. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-id2.xml +591 -0
  809. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-infiltration-volume.xml +563 -0
  810. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-input-parameters.xml +565 -0
  811. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-neighbor-shading-azimuth.xml +575 -576
  812. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-number-of-bedrooms-served.xml +465 -0
  813. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/{slab-zero-exposed-perimeter.xml → invalid-number-of-conditioned-floors.xml} +7 -8
  814. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-number-of-units-served.xml +451 -0
  815. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-relatedhvac-desuperheater.xml +550 -551
  816. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-relatedhvac-dhw-indirect.xml +517 -520
  817. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-runperiod.xml +564 -565
  818. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-schema-version.xml +563 -0
  819. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-shared-vent-in-unit-flowrate.xml +473 -0
  820. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-timestep.xml +562 -563
  821. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-window-height.xml +582 -578
  822. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/lighting-fractions.xml +562 -563
  823. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/missing-duct-location.xml +21 -13
  824. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/missing-elements.xml +560 -561
  825. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-appliance.xml +562 -563
  826. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-duct.xml +562 -563
  827. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-surface.xml +575 -566
  828. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-water-heater.xml +562 -563
  829. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multiple-buildings-without-building-id.xml +1657 -0
  830. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multiple-buildings-wrong-building-id.xml +1657 -0
  831. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multiple-shared-cooling-systems.xml +432 -0
  832. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multiple-shared-heating-systems.xml +434 -0
  833. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/net-area-negative-roof.xml +590 -591
  834. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/net-area-negative-wall.xml +562 -563
  835. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/num-bedrooms-exceeds-limit.xml +563 -0
  836. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/orphaned-hvac-distribution.xml +546 -547
  837. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/refrigerator-location.xml +562 -563
  838. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/refrigerators-multiple-primary.xml +568 -569
  839. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/refrigerators-no-primary.xml +568 -569
  840. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/repeated-relatedhvac-desuperheater.xml +563 -564
  841. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/repeated-relatedhvac-dhw-indirect.xml +526 -529
  842. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/solar-fraction-one.xml +571 -0
  843. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/solar-thermal-system-with-combi-tankless.xml +531 -534
  844. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/solar-thermal-system-with-desuperheater.xml +565 -566
  845. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/solar-thermal-system-with-dhw-indirect.xml +531 -534
  846. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-cfis.xml +575 -576
  847. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-door.xml +562 -563
  848. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-hvac-distribution.xml +562 -563
  849. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-shared-clothes-washer-water-heater.xml +465 -827
  850. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-shared-dishwasher-water-heater.xml +465 -827
  851. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-skylight.xml +590 -591
  852. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-solar-thermal-system.xml +577 -578
  853. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-window.xml +562 -563
  854. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/water-heater-location-other.xml +562 -563
  855. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/water-heater-location.xml +562 -563
  856. data/example_files/resources/hpxml-measures/workflow/template.osw +5 -1
  857. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L100AC.xml +6 -17
  858. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L100AL.xml +6 -17
  859. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L110AC.xml +6 -17
  860. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L110AL.xml +6 -17
  861. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L120AC.xml +6 -17
  862. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L120AL.xml +6 -17
  863. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L130AC.xml +6 -17
  864. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L130AL.xml +6 -17
  865. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L140AC.xml +6 -17
  866. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L140AL.xml +6 -17
  867. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L150AC.xml +6 -17
  868. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L150AL.xml +6 -17
  869. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L155AC.xml +6 -17
  870. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L155AL.xml +6 -17
  871. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L160AC.xml +6 -17
  872. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L160AL.xml +6 -17
  873. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L170AC.xml +6 -17
  874. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L170AL.xml +6 -17
  875. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L200AC.xml +6 -17
  876. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L200AL.xml +6 -17
  877. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L202AC.xml +6 -17
  878. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L202AL.xml +6 -17
  879. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L302XC.xml +6 -19
  880. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L304XC.xml +6 -19
  881. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L322XC.xml +6 -19
  882. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L324XC.xml +6 -19
  883. data/example_files/resources/hpxml-measures/workflow/tests/base_results/results.csv +294 -0
  884. data/example_files/resources/hpxml-measures/workflow/tests/base_results/results_ashrae_140.csv +27 -0
  885. data/example_files/resources/hpxml-measures/workflow/tests/base_results/results_hvac_sizing.csv +294 -0
  886. data/example_files/resources/hpxml-measures/workflow/tests/compare.rb +130 -0
  887. data/example_files/resources/hpxml-measures/workflow/tests/hpxml_translator_test.rb +522 -527
  888. data/example_files/{measures/BuildResidentialModel/resources → resources}/measure-info.json +0 -0
  889. data/example_files/{measures/BuildResidentialModel/resources → resources}/meta_measure.rb +53 -44
  890. data/example_files/validation_schema.yaml +149 -0
  891. data/example_files/visualization/input_visualization_feature.html +213 -56
  892. data/example_files/visualization/input_visualization_scenario.html +92 -30
  893. data/lib/uo_cli.rb +406 -128
  894. data/lib/uo_cli/version.rb +17 -7
  895. data/requirements.txt +2 -0
  896. data/scripts/setup-env-gitbash.sh +5 -5
  897. data/scripts/setup-env-unix.sh +4 -4
  898. data/scripts/setup-env.bat +14 -11
  899. data/scripts/setup-env.ps1 +13 -10
  900. data/uo_cli.gemspec +10 -8
  901. metadata +390 -130
  902. data/developer_nrel_key.rb +0 -31
  903. data/example_files/measures/ResidentialGeometryCreateMultifamily/measure.rb +0 -1005
  904. data/example_files/measures/ResidentialGeometryCreateMultifamily/measure.xml +0 -326
  905. data/example_files/measures/ResidentialGeometryCreateMultifamily/tests/create_residential_multifamily_geometry_test.rb +0 -477
  906. data/example_files/measures/ResidentialGeometryCreateSingleFamilyAttached/measure.rb +0 -1039
  907. data/example_files/measures/ResidentialGeometryCreateSingleFamilyAttached/measure.xml +0 -393
  908. data/example_files/measures/ResidentialGeometryCreateSingleFamilyAttached/tests/create_residential_single_family_attached_geometry_test.rb +0 -456
  909. data/example_files/measures/ResidentialGeometryCreateSingleFamilyDetached/measure.rb +0 -979
  910. data/example_files/measures/ResidentialGeometryCreateSingleFamilyDetached/measure.xml +0 -388
  911. data/example_files/measures/ResidentialGeometryCreateSingleFamilyDetached/tests/create_residential_single_family_detached_geometry_test.rb +0 -704
  912. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/location.rb +0 -24
  913. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules_config.yml +0 -61
  914. data/example_files/resources/hpxml-measures/docs/source/hpxml_to_openstudio.rst +0 -1386
  915. data/example_files/resources/hpxml-measures/docs/source/simulation_output_report.rst +0 -252
  916. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-shared-laundry-room.xml +0 -828
  917. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-shared-water-heater-recirc.xml +0 -820
  918. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-shared-water-heater.xml +0 -813
  919. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-attached-multifamily.xml +0 -810
  920. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-common-surfaces.xml +0 -928
  921. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ideal-air.xml +0 -501
  922. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-multiple2.xml +0 -838
  923. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-baseboard.xml +0 -777
  924. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-fan-coil-ducted.xml +0 -808
  925. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-fan-coil.xml +0 -780
  926. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-water-loop-heat-pump.xml +0 -820
  927. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-cooling-tower-water-loop-heat-pump.xml +0 -815
  928. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-baseboard.xml +0 -760
  929. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-fan-coil-ducted.xml +0 -790
  930. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-fan-coil-eae.xml +0 -759
  931. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-fan-coil.xml +0 -762
  932. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-water-loop-heat-pump.xml +0 -796
  933. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-baseboard.xml +0 -759
  934. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-fan-coil-ducted.xml +0 -789
  935. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-fan-coil.xml +0 -761
  936. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-water-loop-heat-pump.xml +0 -796
  937. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-cooling-tower-only-water-loop-heat-pump.xml +0 -791
  938. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-ground-loop-ground-to-air-heat-pump.xml +0 -814
  939. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-shared-preconditioning.xml +0 -851
  940. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-shared.xml +0 -835
  941. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-shared.xml +0 -827
  942. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/coal-for-non-boiler-heating.xml +0 -514
  943. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-facility-type.xml +0 -828
  944. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-window-interior-shading.xml +0 -564
@@ -1,28 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class HotWaterAndAppliances
4
- def self.apply(model, runner, weather, living_space,
5
- cfa, nbeds, ncfl, has_uncond_bsmnt, clothes_washers,
6
- clothes_dryers, dishwashers, refrigerators,
7
- freezers, cooking_ranges, ovens, water_heating,
8
- water_heating_systems, hot_water_distribution, water_fixtures,
4
+ def self.apply(model, runner, hpxml, weather, spaces, hot_water_distribution,
9
5
  solar_thermal_system, eri_version, dhw_map, schedules_file)
10
6
 
11
- # Get appliances
12
- if not clothes_washers.empty?
13
- clothes_washer = clothes_washers[0]
7
+ cfa = hpxml.building_construction.conditioned_floor_area
8
+ nbeds = hpxml.building_construction.number_of_bedrooms
9
+ ncfl = hpxml.building_construction.number_of_conditioned_floors
10
+ has_uncond_bsmnt = hpxml.has_space_type(HPXML::LocationBasementUnconditioned)
11
+ fixtures_usage_multiplier = hpxml.water_heating.water_fixtures_usage_multiplier
12
+ living_space = spaces[HPXML::LocationLivingSpace]
13
+
14
+ # Get appliances, etc.
15
+ if not hpxml.clothes_washers.empty?
16
+ clothes_washer = hpxml.clothes_washers[0]
14
17
  end
15
- if not clothes_dryers.empty?
16
- clothes_dryer = clothes_dryers[0]
18
+ if not hpxml.clothes_dryers.empty?
19
+ clothes_dryer = hpxml.clothes_dryers[0]
17
20
  end
18
- if not dishwashers.empty?
19
- dishwasher = dishwashers[0]
21
+ if not hpxml.dishwashers.empty?
22
+ dishwasher = hpxml.dishwashers[0]
20
23
  end
21
- if not cooking_ranges.empty?
22
- cooking_range = cooking_ranges[0]
24
+ if not hpxml.cooking_ranges.empty?
25
+ cooking_range = hpxml.cooking_ranges[0]
23
26
  end
24
- if not ovens.empty?
25
- oven = ovens[0]
27
+ if not hpxml.ovens.empty?
28
+ oven = hpxml.ovens[0]
26
29
  end
27
30
 
28
31
  # For each water heater (plant loop):
@@ -106,7 +109,7 @@ class HotWaterAndAppliances
106
109
  end
107
110
 
108
111
  # Refrigerator(s) energy
109
- refrigerators.each do |refrigerator|
112
+ hpxml.refrigerators.each do |refrigerator|
110
113
  rf_annual_kwh, rf_frac_sens, rf_frac_lat = calc_refrigerator_or_freezer_energy(refrigerator, refrigerator.additional_properties.space.nil?)
111
114
 
112
115
  if not schedules_file.nil?
@@ -127,7 +130,7 @@ class HotWaterAndAppliances
127
130
  end
128
131
 
129
132
  # Freezer(s) energy
130
- freezers.each do |freezer|
133
+ hpxml.freezers.each do |freezer|
131
134
  fz_annual_kwh, fz_frac_sens, fz_frac_lat = calc_refrigerator_or_freezer_energy(freezer, freezer.additional_properties.space.nil?)
132
135
 
133
136
  if not schedules_file.nil?
@@ -173,7 +176,7 @@ class HotWaterAndAppliances
173
176
 
174
177
  if not hot_water_distribution.nil?
175
178
  fixtures_all_low_flow = true
176
- water_fixtures.each do |water_fixture|
179
+ hpxml.water_fixtures.each do |water_fixture|
177
180
  next unless [HPXML::WaterFixtureTypeShowerhead, HPXML::WaterFixtureTypeFaucet].include? water_fixture.water_fixture_type
178
181
 
179
182
  fixtures_all_low_flow = false if not water_fixture.low_flow
@@ -182,7 +185,7 @@ class HotWaterAndAppliances
182
185
  # Calculate mixed water fractions
183
186
  t_mix = 105.0 # F, Temperature of mixed water at fixtures
184
187
  avg_setpoint_temp = 0.0 # WH Setpoint: Weighted average by fraction DHW load served
185
- water_heating_systems.each do |water_heating_system|
188
+ hpxml.water_heating_systems.each do |water_heating_system|
186
189
  avg_setpoint_temp += water_heating_system.temperature * water_heating_system.fraction_dhw_load_served
187
190
  end
188
191
  daily_wh_inlet_temperatures = calc_water_heater_daily_inlet_temperatures(weather, nbeds, hot_water_distribution, fixtures_all_low_flow)
@@ -210,14 +213,14 @@ class HotWaterAndAppliances
210
213
  end
211
214
  end
212
215
 
213
- water_heating_systems.each do |water_heating_system|
216
+ hpxml.water_heating_systems.each do |water_heating_system|
214
217
  non_solar_fraction = 1.0 - Waterheater.get_water_heater_solar_fraction(water_heating_system, solar_thermal_system)
215
218
 
216
219
  gpd_frac = water_heating_system.fraction_dhw_load_served # Fixtures fraction
217
220
  if gpd_frac > 0
218
221
 
219
- fx_gpd = get_fixtures_gpd(eri_version, nbeds, fixtures_all_low_flow, daily_mw_fractions, water_heating.water_fixtures_usage_multiplier)
220
- w_gpd = get_dist_waste_gpd(eri_version, nbeds, has_uncond_bsmnt, cfa, ncfl, hot_water_distribution, fixtures_all_low_flow, water_heating.water_fixtures_usage_multiplier)
222
+ fx_gpd = get_fixtures_gpd(eri_version, nbeds, fixtures_all_low_flow, daily_mw_fractions, fixtures_usage_multiplier)
223
+ w_gpd = get_dist_waste_gpd(eri_version, nbeds, has_uncond_bsmnt, cfa, ncfl, hot_water_distribution, fixtures_all_low_flow, fixtures_usage_multiplier)
221
224
 
222
225
  if not schedules_file.nil?
223
226
  fx_peak_flow = schedules_file.calc_peak_flow_from_daily_gpm(col_name: 'fixtures', daily_water: fx_gpd)
@@ -350,13 +353,22 @@ class HotWaterAndAppliances
350
353
  return annual_kwh, annual_therm, frac_sens, frac_lat
351
354
  end
352
355
 
353
- def self.get_dishwasher_default_values()
354
- return { rated_annual_kwh: 467.0, # kWh/yr
355
- label_electric_rate: 0.12, # $/kWh
356
- label_gas_rate: 1.09, # $/therm
357
- label_annual_gas_cost: 33.12, # $
358
- label_usage: 4.0, # cyc/week
359
- place_setting_capacity: 12.0 }
356
+ def self.get_dishwasher_default_values(eri_version)
357
+ if Constants.ERIVersions.index(eri_version) >= Constants.ERIVersions.index('2019A')
358
+ return { rated_annual_kwh: 467.0, # kWh/yr
359
+ label_electric_rate: 0.12, # $/kWh
360
+ label_gas_rate: 1.09, # $/therm
361
+ label_annual_gas_cost: 33.12, # $
362
+ label_usage: 4.0, # cyc/week
363
+ place_setting_capacity: 12.0 }
364
+ else
365
+ return { rated_annual_kwh: 467.0, # kWh/yr
366
+ label_electric_rate: 999, # unused
367
+ label_gas_rate: 999, # unused
368
+ label_annual_gas_cost: 999, # unused
369
+ label_usage: 999, # unused
370
+ place_setting_capacity: 12.0 }
371
+ end
360
372
  end
361
373
 
362
374
  def self.calc_dishwasher_energy_gpd(eri_version, nbeds, dishwasher, is_outside = false)
@@ -426,8 +438,7 @@ class HotWaterAndAppliances
426
438
 
427
439
  def self.get_clothes_dryer_default_values(eri_version, fuel_type)
428
440
  if Constants.ERIVersions.index(eri_version) >= Constants.ERIVersions.index('2019A')
429
- return { combined_energy_factor: 3.01,
430
- control_type: HPXML::ClothesDryerControlTypeTimer }
441
+ return { combined_energy_factor: 3.01 }
431
442
  else
432
443
  if fuel_type == HPXML::FuelTypeElectricity
433
444
  return { combined_energy_factor: 2.62,
@@ -526,11 +537,11 @@ class HotWaterAndAppliances
526
537
  else
527
538
  return { integrated_modified_energy_factor: 0.331, # ft3/(kWh/cyc)
528
539
  rated_annual_kwh: 704.0, # kWh/yr
529
- label_electric_rate: 0.08, # $/kWh, unused
530
- label_gas_rate: 0.58, # $/therm, unused
531
- label_annual_gas_cost: 23.0, # $, unused
540
+ label_electric_rate: 0.08, # $/kWh
541
+ label_gas_rate: 0.58, # $/therm
542
+ label_annual_gas_cost: 23.0, # $
532
543
  capacity: 2.874, # ft^3
533
- label_usage: 6.0 } # cyc/week, unused
544
+ label_usage: 999 } # unused
534
545
  end
535
546
  end
536
547
 
@@ -693,7 +704,7 @@ class HotWaterAndAppliances
693
704
  if fuel_type.nil?
694
705
  oe.setFuelType('None')
695
706
  else
696
- oe.setFuelType(EPlus.input_fuel_map(fuel_type))
707
+ oe.setFuelType(EPlus.fuel_type(fuel_type))
697
708
  end
698
709
  oe.setSpace(space)
699
710
  oe_def.setName(obj_name)
@@ -42,6 +42,9 @@ XMLHelper.write_file(hpxml.to_oga, "out.xml")
42
42
 
43
43
  '''
44
44
 
45
+ require_relative 'version'
46
+ require 'ostruct'
47
+
45
48
  # FUTURE: Remove all idref attributes, make object attributes instead
46
49
  # E.g., in class Window, :wall_idref => :wall
47
50
 
@@ -49,19 +52,26 @@ class HPXML < Object
49
52
  HPXML_ATTRS = [:header, :site, :neighbor_buildings, :building_occupancy, :building_construction,
50
53
  :climate_and_risk_zones, :air_infiltration_measurements, :attics, :foundations,
51
54
  :roofs, :rim_joists, :walls, :foundation_walls, :frame_floors, :slabs, :windows,
52
- :skylights, :doors, :heating_systems, :cooling_systems, :heat_pumps, :hvac_controls,
53
- :hvac_distributions, :ventilation_fans, :water_heating_systems, :hot_water_distributions,
54
- :water_fixtures, :water_heating, :solar_thermal_systems, :pv_systems, :clothes_washers,
55
- :clothes_dryers, :dishwashers, :refrigerators, :freezers, :dehumidifiers, :cooking_ranges, :ovens,
56
- :lighting_groups, :lighting, :ceiling_fans, :pools, :hot_tubs, :plug_loads, :fuel_loads]
57
- attr_reader(*HPXML_ATTRS, :doc)
55
+ :skylights, :doors, :heating_systems, :cooling_systems, :heat_pumps, :hvac_plant,
56
+ :hvac_controls, :hvac_distributions, :ventilation_fans, :water_heating_systems,
57
+ :hot_water_distributions, :water_fixtures, :water_heating, :solar_thermal_systems,
58
+ :pv_systems, :generators, :clothes_washers, :clothes_dryers, :dishwashers, :refrigerators,
59
+ :freezers, :dehumidifiers, :cooking_ranges, :ovens, :lighting_groups, :lighting,
60
+ :ceiling_fans, :pools, :hot_tubs, :plug_loads, :fuel_loads]
61
+ attr_reader(*HPXML_ATTRS, :doc, :errors, :warnings)
58
62
 
59
63
  # Constants
64
+ # FUTURE: Move some of these to within child classes (e.g., HPXML::Attic class)
65
+ AirTypeFanCoil = 'fan coil'
66
+ AirTypeGravity = 'gravity'
67
+ AirTypeHighVelocity = 'high velocity'
68
+ AirTypeRegularVelocity = 'regular velocity'
60
69
  AtticTypeCathedral = 'CathedralCeiling'
61
70
  AtticTypeConditioned = 'ConditionedAttic'
62
71
  AtticTypeFlatRoof = 'FlatRoof'
63
72
  AtticTypeUnvented = 'UnventedAttic'
64
73
  AtticTypeVented = 'VentedAttic'
74
+ CertificationEnergyStar = 'Energy Star'
65
75
  ClothesDryerControlTypeMoisture = 'moisture'
66
76
  ClothesDryerControlTypeTimer = 'timer'
67
77
  ColorDark = 'dark'
@@ -69,6 +79,8 @@ class HPXML < Object
69
79
  ColorMedium = 'medium'
70
80
  ColorMediumDark = 'medium dark'
71
81
  ColorReflective = 'reflective'
82
+ DehumidifierTypePortable = 'portable'
83
+ DehumidifierTypeWholeHome = 'whole-home'
72
84
  DHWRecirControlTypeManual = 'manual demand control'
73
85
  DHWRecirControlTypeNone = 'no control'
74
86
  DHWRecirControlTypeSensor = 'presence sensor demand control'
@@ -84,6 +96,7 @@ class HPXML < Object
84
96
  DuctTypeSupply = 'supply'
85
97
  DWHRFacilitiesConnectedAll = 'all'
86
98
  DWHRFacilitiesConnectedOne = 'one'
99
+ ExteriorShadingTypeSolarScreens = 'solar screens'
87
100
  FoundationTypeAmbient = 'Ambient'
88
101
  FoundationTypeBasementConditioned = 'ConditionedBasement'
89
102
  FoundationTypeBasementUnconditioned = 'UnconditionedBasement'
@@ -122,7 +135,6 @@ class HPXML < Object
122
135
  HVACDistributionTypeAir = 'AirDistribution'
123
136
  HVACDistributionTypeDSE = 'DSE'
124
137
  HVACDistributionTypeHydronic = 'HydronicDistribution'
125
- HVACDistributionTypeHydronicAndAir = 'HydronicAndAirDistribution'
126
138
  HVACTypeBoiler = 'Boiler'
127
139
  HVACTypeCentralAirConditioner = 'central air conditioner'
128
140
  HVACTypeChiller = 'chiller'
@@ -142,12 +154,11 @@ class HPXML < Object
142
154
  HVACTypeRoomAirConditioner = 'room air conditioner'
143
155
  HVACTypeStove = 'Stove'
144
156
  HVACTypeWallFurnace = 'WallFurnace'
145
- HydronicAndAirTypeFanCoil = 'fan coil'
146
- HydronicAndAirTypeWaterLoopHeatPump = 'water loop heat pump'
147
157
  HydronicTypeBaseboard = 'baseboard'
148
158
  HydronicTypeRadiantCeiling = 'radiant ceiling'
149
159
  HydronicTypeRadiantFloor = 'radiant floor'
150
160
  HydronicTypeRadiator = 'radiator'
161
+ HydronicTypeWaterLoop = 'water loop'
151
162
  LeakinessTight = 'tight'
152
163
  LeakinessAverage = 'average'
153
164
  LightingTypeCFL = 'CompactFluorescent'
@@ -176,6 +187,7 @@ class HPXML < Object
176
187
  LocationOutside = 'outside'
177
188
  LocationRoof = 'roof'
178
189
  LocationRoofDeck = 'roof deck'
190
+ LocationUnconditionedSpace = 'unconditioned space'
179
191
  LocationUnderSlab = 'under slab'
180
192
  MechVentTypeBalanced = 'balanced'
181
193
  MechVentTypeCFIS = 'central fan integrated supply'
@@ -212,6 +224,9 @@ class HPXML < Object
212
224
  RoofTypeMetal = 'metal surfacing'
213
225
  RoofTypePlasticRubber = 'plastic/rubber/synthetic sheeting'
214
226
  RoofTypeWoodShingles = 'wood shingles or shakes'
227
+ ShieldingExposed = 'exposed'
228
+ ShieldingNormal = 'normal'
229
+ ShieldingWellShielded = 'well-shielded'
215
230
  SidingTypeAluminum = 'aluminum siding'
216
231
  SidingTypeBrick = 'brick veneer'
217
232
  SidingTypeFiberCement = 'fiber cement siding'
@@ -228,6 +243,8 @@ class HPXML < Object
228
243
  SolarThermalTypeEvacuatedTube = 'evacuated tube'
229
244
  SolarThermalTypeICS = 'integrated collector storage'
230
245
  SolarThermalTypeSingleGlazing = 'single glazing black'
246
+ TypeNone = 'none'
247
+ TypeUnknown = 'unknown'
231
248
  UnitsACH = 'ACH'
232
249
  UnitsACHNatural = 'ACHnatural'
233
250
  UnitsAFUE = 'AFUE'
@@ -262,6 +279,10 @@ class HPXML < Object
262
279
  WaterHeaterTypeTankless = 'instantaneous water heater'
263
280
  WaterHeaterTypeStorage = 'storage water heater'
264
281
  WindowFrameTypeAluminum = 'Aluminum'
282
+ WindowFrameTypeComposite = 'Composite'
283
+ WindowFrameTypeFiberglass = 'Fiberglass'
284
+ WindowFrameTypeMetal = 'Metal'
285
+ WindowFrameTypeVinyl = 'Vinyl'
265
286
  WindowFrameTypeWood = 'Wood'
266
287
  WindowGasAir = 'air'
267
288
  WindowGasArgon = 'argon'
@@ -271,19 +292,57 @@ class HPXML < Object
271
292
  WindowLayersDoublePane = 'double-pane'
272
293
  WindowLayersSinglePane = 'single-pane'
273
294
  WindowLayersTriplePane = 'triple-pane'
295
+ WindowClassArchitectural = 'architectural'
296
+ WindowClassCommercial = 'commercial'
297
+ WindowClassHeavyCommercial = 'heavy commercial'
298
+ WindowClassResidential = 'residential'
299
+ WindowClassLightCommercial = 'light commercial'
274
300
 
275
- def initialize(hpxml_path: nil, collapse_enclosure: true)
301
+ def initialize(hpxml_path: nil, schematron_validators: [], collapse_enclosure: true, building_id: nil)
276
302
  @doc = nil
277
303
  @hpxml_path = hpxml_path
304
+ @errors = []
305
+ @warnings = []
278
306
 
279
- # Create/populate child objects
280
307
  hpxml = nil
281
308
  if not hpxml_path.nil?
282
309
  @doc = XMLHelper.parse_file(hpxml_path)
310
+
311
+ # Check HPXML version
283
312
  hpxml = XMLHelper.get_element(@doc, '/HPXML')
313
+ Version.check_hpxml_version(XMLHelper.get_attribute_value(hpxml, 'schemaVersion'))
314
+
315
+ # Validate against Schematron docs
316
+ @errors, @warnings = validate_against_schematron(schematron_validators: schematron_validators)
317
+ return unless @errors.empty?
318
+
319
+ # Handle multiple buildings
320
+ if XMLHelper.get_elements(hpxml, 'Building').size > 1
321
+ if building_id.nil?
322
+ @errors << 'Multiple Building elements defined in HPXML file; Building ID argument must be provided.'
323
+ return unless @errors.empty?
324
+ end
325
+
326
+ # Discard all Building elements except the one of interest
327
+ XMLHelper.get_elements(hpxml, 'Building').reverse_each do |building|
328
+ next if XMLHelper.get_attribute_value(XMLHelper.get_element(building, 'BuildingID'), 'id') == building_id
329
+
330
+ building.remove
331
+ end
332
+ if XMLHelper.get_elements(hpxml, 'Building').size == 0
333
+ @errors << "Could not find Building element with ID '#{building_id}'."
334
+ return unless @errors.empty?
335
+ end
336
+ end
284
337
  end
338
+
339
+ # Create/populate child objects
285
340
  from_oga(hpxml)
286
341
 
342
+ # Check for additional errors (those hard to check via Schematron)
343
+ @errors += check_for_errors()
344
+ return unless @errors.empty?
345
+
287
346
  # Clean up
288
347
  delete_tiny_surfaces()
289
348
  delete_adiabatic_subsurfaces()
@@ -292,6 +351,10 @@ class HPXML < Object
292
351
  end
293
352
  end
294
353
 
354
+ def hvac_systems
355
+ return (@heating_systems + @cooling_systems + @heat_pumps)
356
+ end
357
+
295
358
  def has_space_type(space_type)
296
359
  # Look for surfaces attached to this space type
297
360
  (@roofs + @rim_joists + @walls + @foundation_walls + @frame_floors + @slabs).each do |surface|
@@ -448,10 +511,9 @@ class HPXML < Object
448
511
  # The WithinInfiltrationVolume properties are intentionally ignored for now.
449
512
  # FUTURE: Move into AirInfiltrationMeasurement class?
450
513
  cfa = @building_construction.conditioned_floor_area
451
- ncfl = @building_construction.number_of_conditioned_floors
452
514
  ncfl_ag = @building_construction.number_of_conditioned_floors_above_grade
453
515
  if has_walkout_basement()
454
- infil_height = Float(ncfl_ag) * infil_volume / cfa
516
+ infil_height = ncfl_ag * infil_volume / cfa
455
517
  else
456
518
  # Calculate maximum above-grade height of conditioned basement walls
457
519
  max_cond_bsmt_wall_height_ag = 0.0
@@ -470,7 +532,7 @@ class HPXML < Object
470
532
 
471
533
  cond_bsmt_rim_joist_height = UnitConversions.convert(9, 'in', 'ft')
472
534
  end
473
- infil_height = Float(ncfl_ag) * infil_volume / cfa + max_cond_bsmt_wall_height_ag + cond_bsmt_rim_joist_height
535
+ infil_height = ncfl_ag * infil_volume / cfa + max_cond_bsmt_wall_height_ag + cond_bsmt_rim_joist_height
474
536
  end
475
537
  return infil_height
476
538
  end
@@ -498,6 +560,7 @@ class HPXML < Object
498
560
  @heating_systems.to_oga(@doc)
499
561
  @cooling_systems.to_oga(@doc)
500
562
  @heat_pumps.to_oga(@doc)
563
+ @hvac_plant.to_oga(@doc)
501
564
  @hvac_controls.to_oga(@doc)
502
565
  @hvac_distributions.to_oga(@doc)
503
566
  @ventilation_fans.to_oga(@doc)
@@ -507,6 +570,7 @@ class HPXML < Object
507
570
  @water_heating.to_oga(@doc)
508
571
  @solar_thermal_systems.to_oga(@doc)
509
572
  @pv_systems.to_oga(@doc)
573
+ @generators.to_oga(@doc)
510
574
  @clothes_washers.to_oga(@doc)
511
575
  @clothes_dryers.to_oga(@doc)
512
576
  @dishwashers.to_oga(@doc)
@@ -547,6 +611,7 @@ class HPXML < Object
547
611
  @heating_systems = HeatingSystems.new(self, hpxml)
548
612
  @cooling_systems = CoolingSystems.new(self, hpxml)
549
613
  @heat_pumps = HeatPumps.new(self, hpxml)
614
+ @hvac_plant = HVACPlant.new(self, hpxml)
550
615
  @hvac_controls = HVACControls.new(self, hpxml)
551
616
  @hvac_distributions = HVACDistributions.new(self, hpxml)
552
617
  @ventilation_fans = VentilationFans.new(self, hpxml)
@@ -556,6 +621,7 @@ class HPXML < Object
556
621
  @water_heating = WaterHeating.new(self, hpxml)
557
622
  @solar_thermal_systems = SolarThermalSystems.new(self, hpxml)
558
623
  @pv_systems = PVSystems.new(self, hpxml)
624
+ @generators = Generators.new(self, hpxml)
559
625
  @clothes_washers = ClothesWashers.new(self, hpxml)
560
626
  @clothes_dryers = ClothesDryers.new(self, hpxml)
561
627
  @dishwashers = Dishwashers.new(self, hpxml)
@@ -592,6 +658,19 @@ class HPXML < Object
592
658
  def initialize(hpxml_object, oga_element = nil, **kwargs)
593
659
  @hpxml_object = hpxml_object
594
660
  @additional_properties = AdditionalProperties.new
661
+
662
+ # Automatically add :foo_isdefaulted attributes to class
663
+ self.class::ATTRS.each do |attribute|
664
+ next if attribute.to_s.end_with? '_isdefaulted'
665
+
666
+ attr = "#{attribute}_isdefaulted".to_sym
667
+ next if self.class::ATTRS.include? attr
668
+
669
+ # Add attribute to ATTRS and class
670
+ self.class::ATTRS << attr
671
+ create_attr(attr.to_s) # From https://stackoverflow.com/a/4082937
672
+ end
673
+
595
674
  if not oga_element.nil?
596
675
  # Set values from HPXML Oga element
597
676
  from_oga(oga_element)
@@ -603,6 +682,15 @@ class HPXML < Object
603
682
  end
604
683
  end
605
684
 
685
+ def create_method(name, &block)
686
+ self.class.send(:define_method, name, &block)
687
+ end
688
+
689
+ def create_attr(name)
690
+ create_method("#{name}=".to_sym) { |val| instance_variable_set('@' + name, val) }
691
+ create_method(name.to_sym) { instance_variable_get('@' + name) }
692
+ end
693
+
606
694
  def to_h
607
695
  h = {}
608
696
  self.class::ATTRS.each do |attribute|
@@ -618,6 +706,7 @@ class HPXML < Object
618
706
  def nil?
619
707
  # Returns true if all attributes are nil
620
708
  to_h.each do |k, v|
709
+ next if k.to_s.end_with? '_isdefaulted'
621
710
  return false if not v.nil?
622
711
  end
623
712
  return true
@@ -631,6 +720,7 @@ class HPXML < Object
631
720
  def initialize(hpxml_object, oga_element = nil)
632
721
  @hpxml_object = hpxml_object
633
722
  @additional_properties = AdditionalProperties.new
723
+
634
724
  if not oga_element.nil?
635
725
  # Set values from HPXML Oga element
636
726
  from_oga(oga_element)
@@ -664,10 +754,10 @@ class HPXML < Object
664
754
  ATTRS = [:xml_type, :xml_generated_by, :created_date_and_time, :transaction,
665
755
  :software_program_used, :software_program_version, :eri_calculation_version,
666
756
  :eri_design, :timestep, :building_id, :event_type, :state_code,
667
- :sim_begin_month, :sim_begin_day_of_month, :sim_end_month, :sim_end_day_of_month, :sim_calendar_year,
668
- :dst_enabled, :dst_begin_month, :dst_begin_day_of_month, :dst_end_month, :dst_end_day_of_month,
757
+ :sim_begin_month, :sim_begin_day, :sim_end_month, :sim_end_day, :sim_calendar_year,
758
+ :dst_enabled, :dst_begin_month, :dst_begin_day, :dst_end_month, :dst_end_day,
669
759
  :use_max_load_for_heat_pumps, :allow_increased_fixed_capacities,
670
- :apply_ashrae140_assumptions, :schedules_path]
760
+ :apply_ashrae140_assumptions, :energystar_calculation_version, :schedules_path]
671
761
  attr_accessor(*ATTRS)
672
762
 
673
763
  def check_for_errors
@@ -676,7 +766,7 @@ class HPXML < Object
676
766
  if not @timestep.nil?
677
767
  valid_tsteps = [60, 30, 20, 15, 12, 10, 6, 5, 4, 3, 2, 1]
678
768
  if not valid_tsteps.include? @timestep
679
- fail "Timestep (#{@timestep}) must be one of: #{valid_tsteps.join(', ')}."
769
+ errors << "Timestep (#{@timestep}) must be one of: #{valid_tsteps.join(', ')}."
680
770
  end
681
771
  end
682
772
 
@@ -685,7 +775,7 @@ class HPXML < Object
685
775
 
686
776
  valid_months = (1..12).to_a
687
777
  if not valid_months.include? begin_month
688
- fail "#{sim_ctl} Begin Month (#{begin_month}) must be one of: #{valid_months.join(', ')}."
778
+ errors << "#{sim_ctl} Begin Month (#{begin_month}) must be one of: #{valid_months.join(', ')}."
689
779
  end
690
780
  end
691
781
 
@@ -694,43 +784,40 @@ class HPXML < Object
694
784
 
695
785
  valid_months = (1..12).to_a
696
786
  if not valid_months.include? end_month
697
- fail "#{sim_ctl} End Month (#{end_month}) must be one of: #{valid_months.join(', ')}."
787
+ errors << "#{sim_ctl} End Month (#{end_month}) must be one of: #{valid_months.join(', ')}."
698
788
  end
699
789
  end
700
790
 
701
791
  months_days = { [1, 3, 5, 7, 8, 10, 12] => (1..31).to_a, [4, 6, 9, 11] => (1..30).to_a, [2] => (1..28).to_a }
702
792
  months_days.each do |months, valid_days|
703
- { 'Run Period' => [@sim_begin_month, @sim_begin_day_of_month, @sim_end_month, @sim_end_day_of_month], 'Daylight Saving' => [@dst_begin_month, @dst_begin_day_of_month, @dst_end_month, @dst_end_day_of_month] }.each do |sim_ctl, months_and_days|
704
- begin_month, begin_day_of_month, end_month, end_day_of_month = months_and_days
705
- if (not begin_day_of_month.nil?) && (months.include? begin_month)
706
- if not valid_days.include? begin_day_of_month
707
- fail "#{sim_ctl} Begin Day of Month (#{begin_day_of_month}) must be one of: #{valid_days.join(', ')}."
793
+ { 'Run Period' => [@sim_begin_month, @sim_begin_day, @sim_end_month, @sim_end_day], 'Daylight Saving' => [@dst_begin_month, @dst_begin_day, @dst_end_month, @dst_end_day] }.each do |sim_ctl, months_and_days|
794
+ begin_month, begin_day, end_month, end_day = months_and_days
795
+ if (not begin_day.nil?) && (months.include? begin_month)
796
+ if not valid_days.include? begin_day
797
+ errors << "#{sim_ctl} Begin Day of Month (#{begin_day}) must be one of: #{valid_days.join(', ')}."
708
798
  end
709
799
  end
710
- next unless (not end_day_of_month.nil?) && (months.include? end_month)
711
- if not valid_days.include? end_day_of_month
712
- fail "#{sim_ctl} End Day of Month (#{end_day_of_month}) must be one of: #{valid_days.join(', ')}."
800
+ next unless (not end_day.nil?) && (months.include? end_month)
801
+
802
+ if not valid_days.include? end_day
803
+ errors << "#{sim_ctl} End Day of Month (#{end_day}) must be one of: #{valid_days.join(', ')}."
713
804
  end
714
805
  end
715
806
  end
716
807
 
717
- { 'Run Period' => [@sim_begin_month, @sim_begin_day_of_month, @sim_end_month, @sim_end_day_of_month] }.each do |sim_ctl, months_and_days|
718
- begin_month, begin_day_of_month, end_month, end_day_of_month = months_and_days
808
+ { 'Run Period' => [@sim_begin_month, @sim_begin_day, @sim_end_month, @sim_end_day] }.each do |sim_ctl, months_and_days|
809
+ begin_month, begin_day, end_month, end_day = months_and_days
719
810
  next unless (not begin_month.nil?) && (not end_month.nil?)
811
+
720
812
  if begin_month > end_month
721
- fail "#{sim_ctl} Begin Month (#{begin_month}) cannot come after #{sim_ctl} End Month (#{end_month})."
813
+ errors << "#{sim_ctl} Begin Month (#{begin_month}) cannot come after #{sim_ctl} End Month (#{end_month})."
722
814
  end
723
815
 
724
- next unless (not begin_day_of_month.nil?) && (not end_day_of_month.nil?)
816
+ next unless (not begin_day.nil?) && (not end_day.nil?)
725
817
  next unless begin_month == end_month
726
- if begin_day_of_month > end_day_of_month
727
- fail "#{sim_ctl} Begin Day of Month (#{begin_day_of_month}) cannot come after #{sim_ctl} End Day of Month (#{end_day_of_month}) for the same month (#{begin_month})."
728
- end
729
- end
730
818
 
731
- if not @sim_calendar_year.nil?
732
- if (@sim_calendar_year < 1600) || (@sim_calendar_year > 9999)
733
- fail "Calendar Year (#{@sim_calendar_year}) must be between 1600 and 9999."
819
+ if begin_day > end_day
820
+ errors << "#{sim_ctl} Begin Day of Month (#{begin_day}) cannot come after #{sim_ctl} End Day of Month (#{end_day}) for the same month (#{begin_month})."
734
821
  end
735
822
  end
736
823
 
@@ -742,55 +829,60 @@ class HPXML < Object
742
829
 
743
830
  hpxml = XMLHelper.get_element(doc, '/HPXML')
744
831
  header = XMLHelper.add_element(hpxml, 'XMLTransactionHeaderInformation')
745
- XMLHelper.add_element(header, 'XMLType', @xml_type)
746
- XMLHelper.add_element(header, 'XMLGeneratedBy', @xml_generated_by)
832
+ XMLHelper.add_element(header, 'XMLType', @xml_type, :string)
833
+ XMLHelper.add_element(header, 'XMLGeneratedBy', @xml_generated_by, :string)
747
834
  if not @created_date_and_time.nil?
748
- XMLHelper.add_element(header, 'CreatedDateAndTime', @created_date_and_time)
835
+ XMLHelper.add_element(header, 'CreatedDateAndTime', @created_date_and_time, :string)
749
836
  else
750
- XMLHelper.add_element(header, 'CreatedDateAndTime', Time.now.strftime('%Y-%m-%dT%H:%M:%S%:z'))
837
+ XMLHelper.add_element(header, 'CreatedDateAndTime', Time.now.strftime('%Y-%m-%dT%H:%M:%S%:z'), :string)
751
838
  end
752
- XMLHelper.add_element(header, 'Transaction', @transaction)
839
+ XMLHelper.add_element(header, 'Transaction', @transaction, :string)
753
840
 
754
841
  software_info = XMLHelper.add_element(hpxml, 'SoftwareInfo')
755
- XMLHelper.add_element(software_info, 'SoftwareProgramUsed', @software_program_used) unless @software_program_used.nil?
756
- XMLHelper.add_element(software_info, 'SoftwareProgramVersion', software_program_version) unless software_program_version.nil?
842
+ XMLHelper.add_element(software_info, 'SoftwareProgramUsed', @software_program_used, :string) unless @software_program_used.nil?
843
+ XMLHelper.add_element(software_info, 'SoftwareProgramVersion', @software_program_version, :string) unless @software_program_version.nil?
757
844
  if not @apply_ashrae140_assumptions.nil?
758
845
  extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
759
- XMLHelper.add_element(extension, 'ApplyASHRAE140Assumptions', to_boolean(@apply_ashrae140_assumptions)) unless @apply_ashrae140_assumptions.nil?
846
+ XMLHelper.add_element(extension, 'ApplyASHRAE140Assumptions', @apply_ashrae140_assumptions, :boolean) unless @apply_ashrae140_assumptions.nil?
760
847
  end
761
848
  if (not @eri_calculation_version.nil?) || (not @eri_design.nil?)
762
849
  extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
763
850
  eri_calculation = XMLHelper.add_element(extension, 'ERICalculation')
764
- XMLHelper.add_element(eri_calculation, 'Version', @eri_calculation_version) unless @eri_calculation_version.nil?
765
- XMLHelper.add_element(eri_calculation, 'Design', @eri_design) unless @eri_design.nil?
851
+ XMLHelper.add_element(eri_calculation, 'Version', @eri_calculation_version, :string) unless @eri_calculation_version.nil?
852
+ XMLHelper.add_element(eri_calculation, 'Design', @eri_design, :string) unless @eri_design.nil?
853
+ end
854
+ if not @energystar_calculation_version.nil?
855
+ extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
856
+ energystar_calculation = XMLHelper.add_element(extension, 'EnergyStarCalculation')
857
+ XMLHelper.add_element(energystar_calculation, 'Version', @energystar_calculation_version, :string) unless @energystar_calculation_version.nil?
766
858
  end
767
- if (not @timestep.nil?) || (not @sim_begin_month.nil?) || (not @sim_begin_day_of_month.nil?) || (not @sim_end_month.nil?) || (not @sim_end_day_of_month.nil?) || (not @dst_enabled.nil?) || (not @dst_begin_month.nil?) || (not @dst_begin_day_of_month.nil?) || (not @dst_end_month.nil?) || (not @dst_end_day_of_month.nil?)
859
+ if (not @timestep.nil?) || (not @sim_begin_month.nil?) || (not @sim_begin_day.nil?) || (not @sim_end_month.nil?) || (not @sim_end_day.nil?) || (not @dst_enabled.nil?) || (not @dst_begin_month.nil?) || (not @dst_begin_day.nil?) || (not @dst_end_month.nil?) || (not @dst_end_day.nil?)
768
860
  extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
769
861
  simulation_control = XMLHelper.add_element(extension, 'SimulationControl')
770
- XMLHelper.add_element(simulation_control, 'Timestep', to_integer(@timestep)) unless @timestep.nil?
771
- XMLHelper.add_element(simulation_control, 'BeginMonth', to_integer(@sim_begin_month)) unless @sim_begin_month.nil?
772
- XMLHelper.add_element(simulation_control, 'BeginDayOfMonth', to_integer(@sim_begin_day_of_month)) unless @sim_begin_day_of_month.nil?
773
- XMLHelper.add_element(simulation_control, 'EndMonth', to_integer(@sim_end_month)) unless @sim_end_month.nil?
774
- XMLHelper.add_element(simulation_control, 'EndDayOfMonth', to_integer(@sim_end_day_of_month)) unless @sim_end_day_of_month.nil?
775
- XMLHelper.add_element(simulation_control, 'CalendarYear', to_integer(@sim_calendar_year)) unless @sim_calendar_year.nil?
776
- if (not @dst_enabled.nil?) || (not @dst_begin_month.nil?) || (not @dst_begin_day_of_month.nil?) || (not @dst_end_month.nil?) || (not @dst_end_day_of_month.nil?)
862
+ XMLHelper.add_element(simulation_control, 'Timestep', @timestep, :integer, @timestep_isdefaulted) unless @timestep.nil?
863
+ XMLHelper.add_element(simulation_control, 'BeginMonth', @sim_begin_month, :integer, @sim_begin_month_isdefaulted) unless @sim_begin_month.nil?
864
+ XMLHelper.add_element(simulation_control, 'BeginDayOfMonth', @sim_begin_day, :integer, @sim_begin_day_isdefaulted) unless @sim_begin_day.nil?
865
+ XMLHelper.add_element(simulation_control, 'EndMonth', @sim_end_month, :integer, @sim_end_month_isdefaulted) unless @sim_end_month.nil?
866
+ XMLHelper.add_element(simulation_control, 'EndDayOfMonth', @sim_end_day, :integer, @sim_end_day_isdefaulted) unless @sim_end_day.nil?
867
+ XMLHelper.add_element(simulation_control, 'CalendarYear', @sim_calendar_year, :integer, @sim_calendar_year_isdefaulted) unless @sim_calendar_year.nil?
868
+ if (not @dst_enabled.nil?) || (not @dst_begin_month.nil?) || (not @dst_begin_day.nil?) || (not @dst_end_month.nil?) || (not @dst_end_day.nil?)
777
869
  daylight_saving = XMLHelper.add_element(simulation_control, 'DaylightSaving')
778
- XMLHelper.add_element(daylight_saving, 'Enabled', to_boolean(@dst_enabled)) unless @dst_enabled.nil?
779
- XMLHelper.add_element(daylight_saving, 'BeginMonth', to_integer(@dst_begin_month)) unless @dst_begin_month.nil?
780
- XMLHelper.add_element(daylight_saving, 'BeginDayOfMonth', to_integer(@dst_begin_day_of_month)) unless @dst_begin_day_of_month.nil?
781
- XMLHelper.add_element(daylight_saving, 'EndMonth', to_integer(@dst_end_month)) unless @dst_end_month.nil?
782
- XMLHelper.add_element(daylight_saving, 'EndDayOfMonth', to_integer(@dst_end_day_of_month)) unless @dst_end_day_of_month.nil?
870
+ XMLHelper.add_element(daylight_saving, 'Enabled', @dst_enabled, :boolean, @dst_enabled_isdefaulted) unless @dst_enabled.nil?
871
+ XMLHelper.add_element(daylight_saving, 'BeginMonth', @dst_begin_month, :integer, @dst_begin_month_isdefaulted) unless @dst_begin_month.nil?
872
+ XMLHelper.add_element(daylight_saving, 'BeginDayOfMonth', @dst_begin_day, :integer, @dst_begin_day_isdefaulted) unless @dst_begin_day.nil?
873
+ XMLHelper.add_element(daylight_saving, 'EndMonth', @dst_end_month, :integer, @dst_end_month_isdefaulted) unless @dst_end_month.nil?
874
+ XMLHelper.add_element(daylight_saving, 'EndDayOfMonth', @dst_end_day, :integer, @dst_end_day_isdefaulted) unless @dst_end_day.nil?
783
875
  end
784
876
  end
785
877
  if (not @use_max_load_for_heat_pumps.nil?) || (not @allow_increased_fixed_capacities.nil?)
786
878
  extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
787
879
  hvac_sizing_control = XMLHelper.add_element(extension, 'HVACSizingControl')
788
- XMLHelper.add_element(hvac_sizing_control, 'UseMaxLoadForHeatPumps', to_boolean(@use_max_load_for_heat_pumps)) unless @use_max_load_for_heat_pumps.nil?
789
- XMLHelper.add_element(hvac_sizing_control, 'AllowIncreasedFixedCapacities', to_boolean(@allow_increased_fixed_capacities)) unless @allow_increased_fixed_capacities.nil?
880
+ XMLHelper.add_element(hvac_sizing_control, 'UseMaxLoadForHeatPumps', @use_max_load_for_heat_pumps, :boolean, @use_max_load_for_heat_pumps_isdefaulted) unless @use_max_load_for_heat_pumps.nil?
881
+ XMLHelper.add_element(hvac_sizing_control, 'AllowIncreasedFixedCapacities', @allow_increased_fixed_capacities, :boolean, @allow_increased_fixed_capacities_isdefaulted) unless @allow_increased_fixed_capacities.nil?
790
882
  end
791
-
792
883
  if not @schedules_path.nil?
793
- XMLHelper.add_element(extension, 'OccupancySchedulesCSVPath', @schedules_path) unless @schedules_path.nil?
884
+ extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
885
+ XMLHelper.add_element(extension, 'OccupancySchedulesCSVPath', @schedules_path, :string) unless @schedules_path.nil?
794
886
  end
795
887
 
796
888
  building = XMLHelper.add_element(hpxml, 'Building')
@@ -801,46 +893,47 @@ class HPXML < Object
801
893
  site_id = XMLHelper.add_element(site, 'SiteID')
802
894
  XMLHelper.add_attribute(site_id, 'id', 'SiteID')
803
895
  address = XMLHelper.add_element(site, 'Address')
804
- XMLHelper.add_element(address, 'StateCode', @state_code)
896
+ XMLHelper.add_element(address, 'StateCode', @state_code, :string)
805
897
  end
806
898
  project_status = XMLHelper.add_element(building, 'ProjectStatus')
807
- XMLHelper.add_element(project_status, 'EventType', @event_type)
899
+ XMLHelper.add_element(project_status, 'EventType', @event_type, :string)
808
900
  end
809
901
 
810
902
  def from_oga(hpxml)
811
903
  return if hpxml.nil?
812
904
 
813
- @xml_type = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/XMLType')
814
- @xml_generated_by = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/XMLGeneratedBy')
815
- @created_date_and_time = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/CreatedDateAndTime')
816
- @transaction = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/Transaction')
817
- @software_program_used = XMLHelper.get_value(hpxml, 'SoftwareInfo/SoftwareProgramUsed')
818
- @software_program_version = XMLHelper.get_value(hpxml, 'SoftwareInfo/SoftwareProgramVersion')
819
- @eri_calculation_version = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ERICalculation/Version')
820
- @eri_design = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ERICalculation/Design')
821
- @timestep = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/Timestep'))
822
- @sim_begin_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/BeginMonth'))
823
- @sim_begin_day_of_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/BeginDayOfMonth'))
824
- @sim_end_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/EndMonth'))
825
- @sim_end_day_of_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/EndDayOfMonth'))
826
- @sim_calendar_year = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/CalendarYear'))
827
- @dst_enabled = to_boolean_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/Enabled'))
828
- @dst_begin_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/BeginMonth'))
829
- @dst_begin_day_of_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/BeginDayOfMonth'))
830
- @dst_end_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/EndMonth'))
831
- @dst_end_day_of_month = to_integer_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/EndDayOfMonth'))
832
- @apply_ashrae140_assumptions = to_boolean_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ApplyASHRAE140Assumptions'))
833
- @use_max_load_for_heat_pumps = to_boolean_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/HVACSizingControl/UseMaxLoadForHeatPumps'))
834
- @allow_increased_fixed_capacities = to_boolean_or_nil(XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/HVACSizingControl/AllowIncreasedFixedCapacities'))
835
- @schedules_path = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/OccupancySchedulesCSVPath')
905
+ @xml_type = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/XMLType', :string)
906
+ @xml_generated_by = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/XMLGeneratedBy', :string)
907
+ @created_date_and_time = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/CreatedDateAndTime', :string)
908
+ @transaction = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/Transaction', :string)
909
+ @software_program_used = XMLHelper.get_value(hpxml, 'SoftwareInfo/SoftwareProgramUsed', :string)
910
+ @software_program_version = XMLHelper.get_value(hpxml, 'SoftwareInfo/SoftwareProgramVersion', :string)
911
+ @eri_calculation_version = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ERICalculation/Version', :string)
912
+ @eri_design = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ERICalculation/Design', :string)
913
+ @energystar_calculation_version = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/EnergyStarCalculation/Version', :string)
914
+ @timestep = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/Timestep', :integer)
915
+ @sim_begin_month = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/BeginMonth', :integer)
916
+ @sim_begin_day = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/BeginDayOfMonth', :integer)
917
+ @sim_end_month = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/EndMonth', :integer)
918
+ @sim_end_day = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/EndDayOfMonth', :integer)
919
+ @sim_calendar_year = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/CalendarYear', :integer)
920
+ @dst_enabled = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/Enabled', :boolean)
921
+ @dst_begin_month = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/BeginMonth', :integer)
922
+ @dst_begin_day = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/BeginDayOfMonth', :integer)
923
+ @dst_end_month = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/EndMonth', :integer)
924
+ @dst_end_day = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/EndDayOfMonth', :integer)
925
+ @apply_ashrae140_assumptions = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ApplyASHRAE140Assumptions', :boolean)
926
+ @use_max_load_for_heat_pumps = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/HVACSizingControl/UseMaxLoadForHeatPumps', :boolean)
927
+ @allow_increased_fixed_capacities = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/HVACSizingControl/AllowIncreasedFixedCapacities', :boolean)
928
+ @schedules_path = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/OccupancySchedulesCSVPath', :string)
836
929
  @building_id = HPXML::get_id(hpxml, 'Building/BuildingID')
837
- @event_type = XMLHelper.get_value(hpxml, 'Building/ProjectStatus/EventType')
838
- @state_code = XMLHelper.get_value(hpxml, 'Building/Site/Address/StateCode')
930
+ @event_type = XMLHelper.get_value(hpxml, 'Building/ProjectStatus/EventType', :string)
931
+ @state_code = XMLHelper.get_value(hpxml, 'Building/Site/Address/StateCode', :string)
839
932
  end
840
933
  end
841
934
 
842
935
  class Site < BaseElement
843
- ATTRS = [:site_type, :surroundings, :orientation_of_front_of_home, :fuels, :shelter_coefficient]
936
+ ATTRS = [:site_type, :surroundings, :shielding_of_home, :orientation_of_front_of_home, :fuels]
844
937
  attr_accessor(*ATTRS)
845
938
 
846
939
  def check_for_errors
@@ -852,16 +945,16 @@ class HPXML < Object
852
945
  return if nil?
853
946
 
854
947
  site = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'BuildingSummary', 'Site'])
855
- XMLHelper.add_element(site, 'SiteType', @site_type) unless @site_type.nil?
856
- XMLHelper.add_element(site, 'Surroundings', @surroundings) unless @surroundings.nil?
857
- XMLHelper.add_element(site, 'OrientationOfFrontOfHome', @orientation_of_front_of_home) unless @orientation_of_front_of_home.nil?
948
+ XMLHelper.add_element(site, 'SiteType', @site_type, :string, @site_type_isdefaulted) unless @site_type.nil?
949
+ XMLHelper.add_element(site, 'Surroundings', @surroundings, :string) unless @surroundings.nil?
950
+ XMLHelper.add_element(site, 'ShieldingofHome', @shielding_of_home, :string, @shielding_of_home_isdefaulted) unless @shielding_of_home.nil?
951
+ XMLHelper.add_element(site, 'OrientationOfFrontOfHome', @orientation_of_front_of_home, :string) unless @orientation_of_front_of_home.nil?
858
952
  if (not @fuels.nil?) && (not @fuels.empty?)
859
953
  fuel_types_available = XMLHelper.add_element(site, 'FuelTypesAvailable')
860
954
  @fuels.each do |fuel|
861
- XMLHelper.add_element(fuel_types_available, 'Fuel', fuel)
955
+ XMLHelper.add_element(fuel_types_available, 'Fuel', fuel, :string)
862
956
  end
863
957
  end
864
- XMLHelper.add_extension(site, 'ShelterCoefficient', to_float(@shelter_coefficient)) unless @shelter_coefficient.nil?
865
958
  end
866
959
 
867
960
  def from_oga(hpxml)
@@ -870,11 +963,11 @@ class HPXML < Object
870
963
  site = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/BuildingSummary/Site')
871
964
  return if site.nil?
872
965
 
873
- @site_type = XMLHelper.get_value(site, 'SiteType')
874
- @surroundings = XMLHelper.get_value(site, 'Surroundings')
875
- @orientation_of_front_of_home = XMLHelper.get_value(site, 'OrientationOfFrontOfHome')
876
- @fuels = XMLHelper.get_values(site, 'FuelTypesAvailable/Fuel')
877
- @shelter_coefficient = to_float_or_nil(XMLHelper.get_value(site, 'extension/ShelterCoefficient'))
966
+ @site_type = XMLHelper.get_value(site, 'SiteType', :string)
967
+ @surroundings = XMLHelper.get_value(site, 'Surroundings', :string)
968
+ @shielding_of_home = XMLHelper.get_value(site, 'ShieldingofHome', :string)
969
+ @orientation_of_front_of_home = XMLHelper.get_value(site, 'OrientationOfFrontOfHome', :string)
970
+ @fuels = XMLHelper.get_values(site, 'FuelTypesAvailable/Fuel', :string)
878
971
  end
879
972
  end
880
973
 
@@ -906,17 +999,17 @@ class HPXML < Object
906
999
 
907
1000
  neighbors = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'BuildingSummary', 'Site', 'extension', 'Neighbors'])
908
1001
  neighbor_building = XMLHelper.add_element(neighbors, 'NeighborBuilding')
909
- XMLHelper.add_element(neighbor_building, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
910
- XMLHelper.add_element(neighbor_building, 'Distance', to_float(@distance)) unless @distance.nil?
911
- XMLHelper.add_element(neighbor_building, 'Height', to_float(@height)) unless @height.nil?
1002
+ XMLHelper.add_element(neighbor_building, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1003
+ XMLHelper.add_element(neighbor_building, 'Distance', @distance, :float) unless @distance.nil?
1004
+ XMLHelper.add_element(neighbor_building, 'Height', @height, :float) unless @height.nil?
912
1005
  end
913
1006
 
914
1007
  def from_oga(neighbor_building)
915
1008
  return if neighbor_building.nil?
916
1009
 
917
- @azimuth = to_integer_or_nil(XMLHelper.get_value(neighbor_building, 'Azimuth'))
918
- @distance = to_float_or_nil(XMLHelper.get_value(neighbor_building, 'Distance'))
919
- @height = to_float_or_nil(XMLHelper.get_value(neighbor_building, 'Height'))
1010
+ @azimuth = XMLHelper.get_value(neighbor_building, 'Azimuth', :integer)
1011
+ @distance = XMLHelper.get_value(neighbor_building, 'Distance', :float)
1012
+ @height = XMLHelper.get_value(neighbor_building, 'Height', :float)
920
1013
  end
921
1014
  end
922
1015
 
@@ -933,7 +1026,7 @@ class HPXML < Object
933
1026
  return if nil?
934
1027
 
935
1028
  building_occupancy = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'BuildingSummary', 'BuildingOccupancy'])
936
- XMLHelper.add_element(building_occupancy, 'NumberofResidents', to_float(@number_of_residents)) unless @number_of_residents.nil?
1029
+ XMLHelper.add_element(building_occupancy, 'NumberofResidents', @number_of_residents, :float, @number_of_residents_isdefaulted) unless @number_of_residents.nil?
937
1030
  end
938
1031
 
939
1032
  def from_oga(hpxml)
@@ -942,15 +1035,15 @@ class HPXML < Object
942
1035
  building_occupancy = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/BuildingSummary/BuildingOccupancy')
943
1036
  return if building_occupancy.nil?
944
1037
 
945
- @number_of_residents = to_float_or_nil(XMLHelper.get_value(building_occupancy, 'NumberofResidents'))
1038
+ @number_of_residents = XMLHelper.get_value(building_occupancy, 'NumberofResidents', :float)
946
1039
  end
947
1040
  end
948
1041
 
949
1042
  class BuildingConstruction < BaseElement
950
1043
  ATTRS = [:year_built, :number_of_conditioned_floors, :number_of_conditioned_floors_above_grade,
951
1044
  :average_ceiling_height, :number_of_bedrooms, :number_of_bathrooms,
952
- :conditioned_floor_area, :conditioned_building_volume, :use_only_ideal_air_system,
953
- :residential_facility_type, :has_flue_or_chimney]
1045
+ :conditioned_floor_area, :conditioned_building_volume, :residential_facility_type,
1046
+ :has_flue_or_chimney]
954
1047
  attr_accessor(*ATTRS)
955
1048
 
956
1049
  def check_for_errors
@@ -962,16 +1055,16 @@ class HPXML < Object
962
1055
  return if nil?
963
1056
 
964
1057
  building_construction = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'BuildingSummary', 'BuildingConstruction'])
965
- XMLHelper.add_element(building_construction, 'ResidentialFacilityType', @residential_facility_type) unless @residential_facility_type.nil?
966
- XMLHelper.add_element(building_construction, 'NumberofConditionedFloors', to_integer(@number_of_conditioned_floors)) unless @number_of_conditioned_floors.nil?
967
- XMLHelper.add_element(building_construction, 'NumberofConditionedFloorsAboveGrade', to_integer(@number_of_conditioned_floors_above_grade)) unless @number_of_conditioned_floors_above_grade.nil?
968
- XMLHelper.add_element(building_construction, 'AverageCeilingHeight', to_float(@average_ceiling_height)) unless @average_ceiling_height.nil?
969
- XMLHelper.add_element(building_construction, 'NumberofBedrooms', to_integer(@number_of_bedrooms)) unless @number_of_bedrooms.nil?
970
- XMLHelper.add_element(building_construction, 'NumberofBathrooms', to_integer(@number_of_bathrooms)) unless @number_of_bathrooms.nil?
971
- XMLHelper.add_element(building_construction, 'ConditionedFloorArea', to_float(@conditioned_floor_area)) unless @conditioned_floor_area.nil?
972
- XMLHelper.add_element(building_construction, 'ConditionedBuildingVolume', to_float(@conditioned_building_volume)) unless @conditioned_building_volume.nil?
973
- XMLHelper.add_extension(building_construction, 'UseOnlyIdealAirSystem', to_boolean(@use_only_ideal_air_system)) unless @use_only_ideal_air_system.nil?
974
- XMLHelper.add_extension(building_construction, 'HasFlueOrChimney', to_boolean(@has_flue_or_chimney)) unless @has_flue_or_chimney.nil?
1058
+ XMLHelper.add_element(building_construction, 'YearBuilt', @year_built, :integer) unless @year_built.nil?
1059
+ XMLHelper.add_element(building_construction, 'ResidentialFacilityType', @residential_facility_type, :string) unless @residential_facility_type.nil?
1060
+ XMLHelper.add_element(building_construction, 'NumberofConditionedFloors', @number_of_conditioned_floors, :float) unless @number_of_conditioned_floors.nil?
1061
+ XMLHelper.add_element(building_construction, 'NumberofConditionedFloorsAboveGrade', @number_of_conditioned_floors_above_grade, :float) unless @number_of_conditioned_floors_above_grade.nil?
1062
+ XMLHelper.add_element(building_construction, 'AverageCeilingHeight', @average_ceiling_height, :float, @average_ceiling_height_isdefaulted) unless @average_ceiling_height.nil?
1063
+ XMLHelper.add_element(building_construction, 'NumberofBedrooms', @number_of_bedrooms, :integer) unless @number_of_bedrooms.nil?
1064
+ XMLHelper.add_element(building_construction, 'NumberofBathrooms', @number_of_bathrooms, :integer, @number_of_bathrooms_isdefaulted) unless @number_of_bathrooms.nil?
1065
+ XMLHelper.add_element(building_construction, 'ConditionedFloorArea', @conditioned_floor_area, :float) unless @conditioned_floor_area.nil?
1066
+ XMLHelper.add_element(building_construction, 'ConditionedBuildingVolume', @conditioned_building_volume, :float, @conditioned_building_volume_isdefaulted) unless @conditioned_building_volume.nil?
1067
+ XMLHelper.add_extension(building_construction, 'HasFlueOrChimney', @has_flue_or_chimney, :boolean, @has_flue_or_chimney_isdefaulted) unless @has_flue_or_chimney.nil?
975
1068
  end
976
1069
 
977
1070
  def from_oga(hpxml)
@@ -980,17 +1073,16 @@ class HPXML < Object
980
1073
  building_construction = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/BuildingSummary/BuildingConstruction')
981
1074
  return if building_construction.nil?
982
1075
 
983
- @year_built = to_integer_or_nil(XMLHelper.get_value(building_construction, 'YearBuilt'))
984
- @number_of_conditioned_floors = to_integer_or_nil(XMLHelper.get_value(building_construction, 'NumberofConditionedFloors'))
985
- @number_of_conditioned_floors_above_grade = to_integer_or_nil(XMLHelper.get_value(building_construction, 'NumberofConditionedFloorsAboveGrade'))
986
- @average_ceiling_height = to_float_or_nil(XMLHelper.get_value(building_construction, 'AverageCeilingHeight'))
987
- @number_of_bedrooms = to_integer_or_nil(XMLHelper.get_value(building_construction, 'NumberofBedrooms'))
988
- @number_of_bathrooms = to_integer_or_nil(XMLHelper.get_value(building_construction, 'NumberofBathrooms'))
989
- @conditioned_floor_area = to_float_or_nil(XMLHelper.get_value(building_construction, 'ConditionedFloorArea'))
990
- @conditioned_building_volume = to_float_or_nil(XMLHelper.get_value(building_construction, 'ConditionedBuildingVolume'))
991
- @use_only_ideal_air_system = to_boolean_or_nil(XMLHelper.get_value(building_construction, 'extension/UseOnlyIdealAirSystem'))
992
- @residential_facility_type = XMLHelper.get_value(building_construction, 'ResidentialFacilityType')
993
- @has_flue_or_chimney = to_boolean_or_nil(XMLHelper.get_value(building_construction, 'extension/HasFlueOrChimney'))
1076
+ @year_built = XMLHelper.get_value(building_construction, 'YearBuilt', :integer)
1077
+ @residential_facility_type = XMLHelper.get_value(building_construction, 'ResidentialFacilityType', :string)
1078
+ @number_of_conditioned_floors = XMLHelper.get_value(building_construction, 'NumberofConditionedFloors', :float)
1079
+ @number_of_conditioned_floors_above_grade = XMLHelper.get_value(building_construction, 'NumberofConditionedFloorsAboveGrade', :float)
1080
+ @average_ceiling_height = XMLHelper.get_value(building_construction, 'AverageCeilingHeight', :float)
1081
+ @number_of_bedrooms = XMLHelper.get_value(building_construction, 'NumberofBedrooms', :integer)
1082
+ @number_of_bathrooms = XMLHelper.get_value(building_construction, 'NumberofBathrooms', :integer)
1083
+ @conditioned_floor_area = XMLHelper.get_value(building_construction, 'ConditionedFloorArea', :float)
1084
+ @conditioned_building_volume = XMLHelper.get_value(building_construction, 'ConditionedBuildingVolume', :float)
1085
+ @has_flue_or_chimney = XMLHelper.get_value(building_construction, 'extension/HasFlueOrChimney', :boolean)
994
1086
  end
995
1087
  end
996
1088
 
@@ -1011,17 +1103,17 @@ class HPXML < Object
1011
1103
 
1012
1104
  if (not @iecc_year.nil?) && (not @iecc_zone.nil?)
1013
1105
  climate_zone_iecc = XMLHelper.add_element(climate_and_risk_zones, 'ClimateZoneIECC')
1014
- XMLHelper.add_element(climate_zone_iecc, 'Year', to_integer(@iecc_year)) unless @iecc_year.nil?
1015
- XMLHelper.add_element(climate_zone_iecc, 'ClimateZone', @iecc_zone) unless @iecc_zone.nil?
1106
+ XMLHelper.add_element(climate_zone_iecc, 'Year', @iecc_year, :integer) unless @iecc_year.nil?
1107
+ XMLHelper.add_element(climate_zone_iecc, 'ClimateZone', @iecc_zone, :string) unless @iecc_zone.nil?
1016
1108
  end
1017
1109
 
1018
1110
  if not @weather_station_id.nil?
1019
1111
  weather_station = XMLHelper.add_element(climate_and_risk_zones, 'WeatherStation')
1020
1112
  sys_id = XMLHelper.add_element(weather_station, 'SystemIdentifier')
1021
1113
  XMLHelper.add_attribute(sys_id, 'id', @weather_station_id)
1022
- XMLHelper.add_element(weather_station, 'Name', @weather_station_name) unless @weather_station_name.nil?
1023
- XMLHelper.add_element(weather_station, 'WMO', @weather_station_wmo) unless @weather_station_wmo.nil?
1024
- XMLHelper.add_extension(weather_station, 'EPWFilePath', @weather_station_epw_filepath) unless @weather_station_epw_filepath.nil?
1114
+ XMLHelper.add_element(weather_station, 'Name', @weather_station_name, :string) unless @weather_station_name.nil?
1115
+ XMLHelper.add_element(weather_station, 'WMO', @weather_station_wmo, :string) unless @weather_station_wmo.nil?
1116
+ XMLHelper.add_extension(weather_station, 'EPWFilePath', @weather_station_epw_filepath, :string) unless @weather_station_epw_filepath.nil?
1025
1117
  end
1026
1118
  end
1027
1119
 
@@ -1031,14 +1123,14 @@ class HPXML < Object
1031
1123
  climate_and_risk_zones = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/ClimateandRiskZones')
1032
1124
  return if climate_and_risk_zones.nil?
1033
1125
 
1034
- @iecc_year = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/Year')
1035
- @iecc_zone = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/ClimateZone')
1126
+ @iecc_year = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/Year', :integer)
1127
+ @iecc_zone = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/ClimateZone', :string)
1036
1128
  weather_station = XMLHelper.get_element(climate_and_risk_zones, 'WeatherStation')
1037
1129
  if not weather_station.nil?
1038
1130
  @weather_station_id = HPXML::get_id(weather_station)
1039
- @weather_station_name = XMLHelper.get_value(weather_station, 'Name')
1040
- @weather_station_wmo = XMLHelper.get_value(weather_station, 'WMO')
1041
- @weather_station_epw_filepath = XMLHelper.get_value(weather_station, 'extension/EPWFilePath')
1131
+ @weather_station_name = XMLHelper.get_value(weather_station, 'Name', :string)
1132
+ @weather_station_wmo = XMLHelper.get_value(weather_station, 'WMO', :string)
1133
+ @weather_station_epw_filepath = XMLHelper.get_value(weather_station, 'extension/EPWFilePath', :string)
1042
1134
  end
1043
1135
  end
1044
1136
  end
@@ -1058,7 +1150,7 @@ class HPXML < Object
1058
1150
  end
1059
1151
 
1060
1152
  class AirInfiltrationMeasurement < BaseElement
1061
- ATTRS = [:id, :house_pressure, :unit_of_measure, :air_leakage, :effective_leakage_area,
1153
+ ATTRS = [:id, :house_pressure, :unit_of_measure, :air_leakage, :effective_leakage_area, :type,
1062
1154
  :infiltration_volume, :leakiness_description, :infiltration_height, :a_ext]
1063
1155
  attr_accessor(*ATTRS)
1064
1156
 
@@ -1074,30 +1166,33 @@ class HPXML < Object
1074
1166
  air_infiltration_measurement = XMLHelper.add_element(air_infiltration, 'AirInfiltrationMeasurement')
1075
1167
  sys_id = XMLHelper.add_element(air_infiltration_measurement, 'SystemIdentifier')
1076
1168
  XMLHelper.add_attribute(sys_id, 'id', @id)
1077
- XMLHelper.add_element(air_infiltration_measurement, 'HousePressure', to_float(@house_pressure)) unless @house_pressure.nil?
1169
+ XMLHelper.add_element(air_infiltration_measurement, 'TypeOfInfiltrationMeasurement', @type, :string) unless @type.nil?
1170
+ XMLHelper.add_element(air_infiltration_measurement, 'HousePressure', @house_pressure, :float) unless @house_pressure.nil?
1171
+ XMLHelper.add_element(air_infiltration_measurement, 'LeakinessDescription', @leakiness_description, :string) unless @leakiness_description.nil?
1078
1172
  if (not @unit_of_measure.nil?) && (not @air_leakage.nil?)
1079
1173
  building_air_leakage = XMLHelper.add_element(air_infiltration_measurement, 'BuildingAirLeakage')
1080
- XMLHelper.add_element(building_air_leakage, 'UnitofMeasure', @unit_of_measure)
1081
- XMLHelper.add_element(building_air_leakage, 'AirLeakage', to_float(@air_leakage))
1174
+ XMLHelper.add_element(building_air_leakage, 'UnitofMeasure', @unit_of_measure, :string)
1175
+ XMLHelper.add_element(building_air_leakage, 'AirLeakage', @air_leakage, :float)
1082
1176
  end
1083
- XMLHelper.add_element(air_infiltration_measurement, 'EffectiveLeakageArea', to_float(@effective_leakage_area)) unless @effective_leakage_area.nil?
1084
- XMLHelper.add_element(air_infiltration_measurement, 'InfiltrationVolume', to_float(@infiltration_volume)) unless @infiltration_volume.nil?
1085
- XMLHelper.add_extension(air_infiltration_measurement, 'InfiltrationHeight', to_float(@infiltration_height)) unless @infiltration_height.nil?
1086
- XMLHelper.add_extension(air_infiltration_measurement, 'Aext', to_float(@a_ext)) unless @a_ext.nil?
1177
+ XMLHelper.add_element(air_infiltration_measurement, 'EffectiveLeakageArea', @effective_leakage_area, :float) unless @effective_leakage_area.nil?
1178
+ XMLHelper.add_element(air_infiltration_measurement, 'InfiltrationVolume', @infiltration_volume, :float, @infiltration_volume_isdefaulted) unless @infiltration_volume.nil?
1179
+ XMLHelper.add_extension(air_infiltration_measurement, 'InfiltrationHeight', @infiltration_height, :float) unless @infiltration_height.nil?
1180
+ XMLHelper.add_extension(air_infiltration_measurement, 'Aext', @a_ext, :float) unless @a_ext.nil?
1087
1181
  end
1088
1182
 
1089
1183
  def from_oga(air_infiltration_measurement)
1090
1184
  return if air_infiltration_measurement.nil?
1091
1185
 
1092
1186
  @id = HPXML::get_id(air_infiltration_measurement)
1093
- @house_pressure = to_float_or_nil(XMLHelper.get_value(air_infiltration_measurement, 'HousePressure'))
1094
- @unit_of_measure = XMLHelper.get_value(air_infiltration_measurement, 'BuildingAirLeakage/UnitofMeasure')
1095
- @air_leakage = to_float_or_nil(XMLHelper.get_value(air_infiltration_measurement, 'BuildingAirLeakage/AirLeakage'))
1096
- @effective_leakage_area = to_float_or_nil(XMLHelper.get_value(air_infiltration_measurement, 'EffectiveLeakageArea'))
1097
- @infiltration_volume = to_float_or_nil(XMLHelper.get_value(air_infiltration_measurement, 'InfiltrationVolume'))
1098
- @leakiness_description = XMLHelper.get_value(air_infiltration_measurement, 'LeakinessDescription')
1099
- @infiltration_height = to_float_or_nil(XMLHelper.get_value(air_infiltration_measurement, 'extension/InfiltrationHeight'))
1100
- @a_ext = to_float_or_nil(XMLHelper.get_value(air_infiltration_measurement, 'extension/Aext'))
1187
+ @type = XMLHelper.get_value(air_infiltration_measurement, 'TypeOfInfiltrationMeasurement', :string)
1188
+ @house_pressure = XMLHelper.get_value(air_infiltration_measurement, 'HousePressure', :float)
1189
+ @leakiness_description = XMLHelper.get_value(air_infiltration_measurement, 'LeakinessDescription', :string)
1190
+ @unit_of_measure = XMLHelper.get_value(air_infiltration_measurement, 'BuildingAirLeakage/UnitofMeasure', :string)
1191
+ @air_leakage = XMLHelper.get_value(air_infiltration_measurement, 'BuildingAirLeakage/AirLeakage', :float)
1192
+ @effective_leakage_area = XMLHelper.get_value(air_infiltration_measurement, 'EffectiveLeakageArea', :float)
1193
+ @infiltration_volume = XMLHelper.get_value(air_infiltration_measurement, 'InfiltrationVolume', :float)
1194
+ @infiltration_height = XMLHelper.get_value(air_infiltration_measurement, 'extension/InfiltrationHeight', :float)
1195
+ @a_ext = XMLHelper.get_value(air_infiltration_measurement, 'extension/Aext', :float)
1101
1196
  end
1102
1197
  end
1103
1198
 
@@ -1176,32 +1271,32 @@ class HPXML < Object
1176
1271
  sys_id = XMLHelper.add_element(attic, 'SystemIdentifier')
1177
1272
  XMLHelper.add_attribute(sys_id, 'id', @id)
1178
1273
  if not @attic_type.nil?
1179
- attic_type_e = XMLHelper.add_element(attic, 'AtticType')
1274
+ attic_type_el = XMLHelper.add_element(attic, 'AtticType')
1180
1275
  if @attic_type == AtticTypeUnvented
1181
- attic_type_attic = XMLHelper.add_element(attic_type_e, 'Attic')
1182
- XMLHelper.add_element(attic_type_attic, 'Vented', false)
1276
+ attic_type_attic = XMLHelper.add_element(attic_type_el, 'Attic')
1277
+ XMLHelper.add_element(attic_type_attic, 'Vented', false, :boolean)
1183
1278
  elsif @attic_type == AtticTypeVented
1184
- attic_type_attic = XMLHelper.add_element(attic_type_e, 'Attic')
1185
- XMLHelper.add_element(attic_type_attic, 'Vented', true)
1279
+ attic_type_attic = XMLHelper.add_element(attic_type_el, 'Attic')
1280
+ XMLHelper.add_element(attic_type_attic, 'Vented', true, :boolean)
1186
1281
  if not @vented_attic_sla.nil?
1187
1282
  ventilation_rate = XMLHelper.add_element(attic, 'VentilationRate')
1188
- XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsSLA)
1189
- XMLHelper.add_element(ventilation_rate, 'Value', to_float(@vented_attic_sla))
1283
+ XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsSLA, :string)
1284
+ XMLHelper.add_element(ventilation_rate, 'Value', @vented_attic_sla, :float, @vented_attic_sla_isdefaulted)
1190
1285
  elsif not @vented_attic_ach.nil?
1191
1286
  ventilation_rate = XMLHelper.add_element(attic, 'VentilationRate')
1192
- XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsACHNatural)
1193
- XMLHelper.add_element(ventilation_rate, 'Value', to_float(@vented_attic_ach))
1287
+ XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsACHNatural, :string)
1288
+ XMLHelper.add_element(ventilation_rate, 'Value', @vented_attic_ach, :float)
1194
1289
  end
1195
1290
  elsif @attic_type == AtticTypeConditioned
1196
- attic_type_attic = XMLHelper.add_element(attic_type_e, 'Attic')
1197
- XMLHelper.add_element(attic_type_attic, 'Conditioned', true)
1291
+ attic_type_attic = XMLHelper.add_element(attic_type_el, 'Attic')
1292
+ XMLHelper.add_element(attic_type_attic, 'Conditioned', true, :boolean)
1198
1293
  elsif (@attic_type == AtticTypeFlatRoof) || (@attic_type == AtticTypeCathedral)
1199
- XMLHelper.add_element(attic_type_e, @attic_type)
1294
+ XMLHelper.add_element(attic_type_el, @attic_type)
1200
1295
  else
1201
1296
  fail "Unhandled attic type '#{@attic_type}'."
1202
1297
  end
1203
1298
  end
1204
- XMLHelper.add_element(attic, 'WithinInfiltrationVolume', to_boolean(@within_infiltration_volume)) unless @within_infiltration_volume.nil?
1299
+ XMLHelper.add_element(attic, 'WithinInfiltrationVolume', within_infiltration_volume, :boolean) unless @within_infiltration_volume.nil?
1205
1300
  end
1206
1301
 
1207
1302
  def from_oga(attic)
@@ -1220,10 +1315,10 @@ class HPXML < Object
1220
1315
  @attic_type = AtticTypeCathedral
1221
1316
  end
1222
1317
  if @attic_type == AtticTypeVented
1223
- @vented_attic_sla = to_float_or_nil(XMLHelper.get_value(attic, "VentilationRate[UnitofMeasure='#{UnitsSLA}']/Value"))
1224
- @vented_attic_ach = to_float_or_nil(XMLHelper.get_value(attic, "VentilationRate[UnitofMeasure='#{UnitsACHNatural}']/Value"))
1318
+ @vented_attic_sla = XMLHelper.get_value(attic, "VentilationRate[UnitofMeasure='#{UnitsSLA}']/Value", :float)
1319
+ @vented_attic_ach = XMLHelper.get_value(attic, "VentilationRate[UnitofMeasure='#{UnitsACHNatural}']/Value", :float)
1225
1320
  end
1226
- @within_infiltration_volume = to_boolean_or_nil(XMLHelper.get_value(attic, 'WithinInfiltrationVolume'))
1321
+ @within_infiltration_volume = XMLHelper.get_value(attic, 'WithinInfiltrationVolume', :boolean)
1227
1322
  @attached_to_roof_idrefs = []
1228
1323
  XMLHelper.get_elements(attic, 'AttachedToRoof').each do |roof|
1229
1324
  @attached_to_roof_idrefs << HPXML::get_idref(roof)
@@ -1339,31 +1434,31 @@ class HPXML < Object
1339
1434
  sys_id = XMLHelper.add_element(foundation, 'SystemIdentifier')
1340
1435
  XMLHelper.add_attribute(sys_id, 'id', @id)
1341
1436
  if not @foundation_type.nil?
1342
- foundation_type_e = XMLHelper.add_element(foundation, 'FoundationType')
1437
+ foundation_type_el = XMLHelper.add_element(foundation, 'FoundationType')
1343
1438
  if [FoundationTypeSlab, FoundationTypeAmbient].include? @foundation_type
1344
- XMLHelper.add_element(foundation_type_e, @foundation_type)
1439
+ XMLHelper.add_element(foundation_type_el, @foundation_type)
1345
1440
  elsif @foundation_type == FoundationTypeBasementConditioned
1346
- basement = XMLHelper.add_element(foundation_type_e, 'Basement')
1347
- XMLHelper.add_element(basement, 'Conditioned', true)
1441
+ basement = XMLHelper.add_element(foundation_type_el, 'Basement')
1442
+ XMLHelper.add_element(basement, 'Conditioned', true, :boolean)
1348
1443
  elsif @foundation_type == FoundationTypeBasementUnconditioned
1349
- basement = XMLHelper.add_element(foundation_type_e, 'Basement')
1350
- XMLHelper.add_element(basement, 'Conditioned', false)
1444
+ basement = XMLHelper.add_element(foundation_type_el, 'Basement')
1445
+ XMLHelper.add_element(basement, 'Conditioned', false, :boolean)
1351
1446
  elsif @foundation_type == FoundationTypeCrawlspaceVented
1352
- crawlspace = XMLHelper.add_element(foundation_type_e, 'Crawlspace')
1353
- XMLHelper.add_element(crawlspace, 'Vented', true)
1447
+ crawlspace = XMLHelper.add_element(foundation_type_el, 'Crawlspace')
1448
+ XMLHelper.add_element(crawlspace, 'Vented', true, :boolean)
1354
1449
  if not @vented_crawlspace_sla.nil?
1355
1450
  ventilation_rate = XMLHelper.add_element(foundation, 'VentilationRate')
1356
- XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsSLA)
1357
- XMLHelper.add_element(ventilation_rate, 'Value', to_float(@vented_crawlspace_sla))
1451
+ XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsSLA, :string)
1452
+ XMLHelper.add_element(ventilation_rate, 'Value', @vented_crawlspace_sla, :float, @vented_crawlspace_sla_isdefaulted)
1358
1453
  end
1359
1454
  elsif @foundation_type == FoundationTypeCrawlspaceUnvented
1360
- crawlspace = XMLHelper.add_element(foundation_type_e, 'Crawlspace')
1361
- XMLHelper.add_element(crawlspace, 'Vented', false)
1455
+ crawlspace = XMLHelper.add_element(foundation_type_el, 'Crawlspace')
1456
+ XMLHelper.add_element(crawlspace, 'Vented', false, :boolean)
1362
1457
  else
1363
1458
  fail "Unhandled foundation type '#{@foundation_type}'."
1364
1459
  end
1365
1460
  end
1366
- XMLHelper.add_element(foundation, 'WithinInfiltrationVolume', to_boolean(@within_infiltration_volume)) unless @within_infiltration_volume.nil?
1461
+ XMLHelper.add_element(foundation, 'WithinInfiltrationVolume', @within_infiltration_volume, :boolean) unless @within_infiltration_volume.nil?
1367
1462
  end
1368
1463
 
1369
1464
  def from_oga(foundation)
@@ -1384,9 +1479,9 @@ class HPXML < Object
1384
1479
  @foundation_type = FoundationTypeAmbient
1385
1480
  end
1386
1481
  if @foundation_type == FoundationTypeCrawlspaceVented
1387
- @vented_crawlspace_sla = to_float_or_nil(XMLHelper.get_value(foundation, "VentilationRate[UnitofMeasure='SLA']/Value"))
1482
+ @vented_crawlspace_sla = XMLHelper.get_value(foundation, "VentilationRate[UnitofMeasure='#{UnitsSLA}']/Value", :float)
1388
1483
  end
1389
- @within_infiltration_volume = to_boolean_or_nil(XMLHelper.get_value(foundation, 'WithinInfiltrationVolume'))
1484
+ @within_infiltration_volume = XMLHelper.get_value(foundation, 'WithinInfiltrationVolume', :boolean)
1390
1485
  @attached_to_slab_idrefs = []
1391
1486
  XMLHelper.get_elements(foundation, 'AttachedToSlab').each do |slab|
1392
1487
  @attached_to_slab_idrefs << HPXML::get_idref(slab)
@@ -1417,7 +1512,7 @@ class HPXML < Object
1417
1512
  end
1418
1513
 
1419
1514
  class Roof < BaseElement
1420
- ATTRS = [:id, :interior_adjacent_to, :area, :azimuth, :roof_type,
1515
+ ATTRS = [:id, :interior_adjacent_to, :area, :azimuth, :orientation, :roof_type,
1421
1516
  :roof_color, :solar_absorptance, :emittance, :pitch, :radiant_barrier,
1422
1517
  :insulation_id, :insulation_assembly_r_value, :insulation_cavity_r_value,
1423
1518
  :insulation_continuous_r_value, :radiant_barrier_grade]
@@ -1429,6 +1524,7 @@ class HPXML < Object
1429
1524
 
1430
1525
  def net_area
1431
1526
  return if nil?
1527
+ return if @area.nil?
1432
1528
 
1433
1529
  val = @area
1434
1530
  skylights.each do |skylight|
@@ -1482,16 +1578,17 @@ class HPXML < Object
1482
1578
  roof = XMLHelper.add_element(roofs, 'Roof')
1483
1579
  sys_id = XMLHelper.add_element(roof, 'SystemIdentifier')
1484
1580
  XMLHelper.add_attribute(sys_id, 'id', @id)
1485
- XMLHelper.add_element(roof, 'InteriorAdjacentTo', @interior_adjacent_to) unless @interior_adjacent_to.nil?
1486
- XMLHelper.add_element(roof, 'Area', to_float(@area)) unless @area.nil?
1487
- XMLHelper.add_element(roof, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
1488
- XMLHelper.add_element(roof, 'RoofType', @roof_type) unless @roof_type.nil?
1489
- XMLHelper.add_element(roof, 'RoofColor', @roof_color) unless @roof_color.nil?
1490
- XMLHelper.add_element(roof, 'SolarAbsorptance', to_float(@solar_absorptance)) unless @solar_absorptance.nil?
1491
- XMLHelper.add_element(roof, 'Emittance', to_float(@emittance)) unless @emittance.nil?
1492
- XMLHelper.add_element(roof, 'Pitch', to_float(@pitch)) unless @pitch.nil?
1493
- XMLHelper.add_element(roof, 'RadiantBarrier', to_boolean(@radiant_barrier)) unless @radiant_barrier.nil?
1494
- XMLHelper.add_element(roof, 'RadiantBarrierGrade', to_integer(@radiant_barrier_grade)) unless @radiant_barrier_grade.nil?
1581
+ XMLHelper.add_element(roof, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1582
+ XMLHelper.add_element(roof, 'Area', @area, :float) unless @area.nil?
1583
+ XMLHelper.add_element(roof, 'Orientation', @orientation, :string) unless @orientation.nil?
1584
+ XMLHelper.add_element(roof, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1585
+ XMLHelper.add_element(roof, 'RoofType', @roof_type, :string, @roof_type_isdefaulted) unless @roof_type.nil?
1586
+ XMLHelper.add_element(roof, 'RoofColor', @roof_color, :string, @roof_color_isdefaulted) unless @roof_color.nil?
1587
+ XMLHelper.add_element(roof, 'SolarAbsorptance', @solar_absorptance, :float, @solar_absorptance_isdefaulted) unless @solar_absorptance.nil?
1588
+ XMLHelper.add_element(roof, 'Emittance', @emittance, :float, @emittance_isdefaulted) unless @emittance.nil?
1589
+ XMLHelper.add_element(roof, 'Pitch', @pitch, :float) unless @pitch.nil?
1590
+ XMLHelper.add_element(roof, 'RadiantBarrier', @radiant_barrier, :boolean, @radiant_barrier_isdefaulted) unless @radiant_barrier.nil?
1591
+ XMLHelper.add_element(roof, 'RadiantBarrierGrade', @radiant_barrier_grade, :integer) unless @radiant_barrier_grade.nil?
1495
1592
  insulation = XMLHelper.add_element(roof, 'Insulation')
1496
1593
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1497
1594
  if not @insulation_id.nil?
@@ -1499,29 +1596,40 @@ class HPXML < Object
1499
1596
  else
1500
1597
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1501
1598
  end
1502
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
1599
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1600
+ if not @insulation_cavity_r_value.nil?
1601
+ layer = XMLHelper.add_element(insulation, 'Layer')
1602
+ XMLHelper.add_element(layer, 'InstallationType', 'cavity', :string)
1603
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_cavity_r_value, :float)
1604
+ end
1605
+ if not @insulation_continuous_r_value.nil?
1606
+ layer = XMLHelper.add_element(insulation, 'Layer')
1607
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous', :string)
1608
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_continuous_r_value, :float)
1609
+ end
1503
1610
  end
1504
1611
 
1505
1612
  def from_oga(roof)
1506
1613
  return if roof.nil?
1507
1614
 
1508
1615
  @id = HPXML::get_id(roof)
1509
- @interior_adjacent_to = XMLHelper.get_value(roof, 'InteriorAdjacentTo')
1510
- @area = to_float_or_nil(XMLHelper.get_value(roof, 'Area'))
1511
- @azimuth = to_integer_or_nil(XMLHelper.get_value(roof, 'Azimuth'))
1512
- @roof_type = XMLHelper.get_value(roof, 'RoofType')
1513
- @roof_color = XMLHelper.get_value(roof, 'RoofColor')
1514
- @solar_absorptance = to_float_or_nil(XMLHelper.get_value(roof, 'SolarAbsorptance'))
1515
- @emittance = to_float_or_nil(XMLHelper.get_value(roof, 'Emittance'))
1516
- @pitch = to_float_or_nil(XMLHelper.get_value(roof, 'Pitch'))
1517
- @radiant_barrier = to_boolean_or_nil(XMLHelper.get_value(roof, 'RadiantBarrier'))
1518
- @radiant_barrier_grade = to_integer_or_nil(XMLHelper.get_value(roof, 'RadiantBarrierGrade'))
1616
+ @interior_adjacent_to = XMLHelper.get_value(roof, 'InteriorAdjacentTo', :string)
1617
+ @area = XMLHelper.get_value(roof, 'Area', :float)
1618
+ @orientation = XMLHelper.get_value(roof, 'Orientation', :string)
1619
+ @azimuth = XMLHelper.get_value(roof, 'Azimuth', :integer)
1620
+ @roof_type = XMLHelper.get_value(roof, 'RoofType', :string)
1621
+ @roof_color = XMLHelper.get_value(roof, 'RoofColor', :string)
1622
+ @solar_absorptance = XMLHelper.get_value(roof, 'SolarAbsorptance', :float)
1623
+ @emittance = XMLHelper.get_value(roof, 'Emittance', :float)
1624
+ @pitch = XMLHelper.get_value(roof, 'Pitch', :float)
1625
+ @radiant_barrier = XMLHelper.get_value(roof, 'RadiantBarrier', :boolean)
1626
+ @radiant_barrier_grade = XMLHelper.get_value(roof, 'RadiantBarrierGrade', :integer)
1519
1627
  insulation = XMLHelper.get_element(roof, 'Insulation')
1520
1628
  if not insulation.nil?
1521
1629
  @insulation_id = HPXML::get_id(insulation)
1522
- @insulation_assembly_r_value = to_float_or_nil(XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue'))
1523
- @insulation_cavity_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue"))
1524
- @insulation_continuous_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue"))
1630
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
1631
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
1632
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1525
1633
  end
1526
1634
  end
1527
1635
  end
@@ -1541,8 +1649,8 @@ class HPXML < Object
1541
1649
  end
1542
1650
 
1543
1651
  class RimJoist < BaseElement
1544
- ATTRS = [:id, :exterior_adjacent_to, :interior_adjacent_to, :area, :azimuth, :siding, :color,
1545
- :solar_absorptance, :emittance, :insulation_id, :insulation_assembly_r_value,
1652
+ ATTRS = [:id, :exterior_adjacent_to, :interior_adjacent_to, :area, :orientation, :azimuth, :siding,
1653
+ :color, :solar_absorptance, :emittance, :insulation_id, :insulation_assembly_r_value,
1546
1654
  :insulation_cavity_r_value, :insulation_continuous_r_value]
1547
1655
  attr_accessor(*ATTRS)
1548
1656
 
@@ -1586,14 +1694,15 @@ class HPXML < Object
1586
1694
  rim_joist = XMLHelper.add_element(rim_joists, 'RimJoist')
1587
1695
  sys_id = XMLHelper.add_element(rim_joist, 'SystemIdentifier')
1588
1696
  XMLHelper.add_attribute(sys_id, 'id', @id)
1589
- XMLHelper.add_element(rim_joist, 'ExteriorAdjacentTo', @exterior_adjacent_to) unless @exterior_adjacent_to.nil?
1590
- XMLHelper.add_element(rim_joist, 'InteriorAdjacentTo', @interior_adjacent_to) unless @interior_adjacent_to.nil?
1591
- XMLHelper.add_element(rim_joist, 'Area', to_float(@area)) unless @area.nil?
1592
- XMLHelper.add_element(rim_joist, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
1593
- XMLHelper.add_element(rim_joist, 'Siding', @siding) unless @siding.nil?
1594
- XMLHelper.add_element(rim_joist, 'Color', @color) unless @color.nil?
1595
- XMLHelper.add_element(rim_joist, 'SolarAbsorptance', to_float(@solar_absorptance)) unless @solar_absorptance.nil?
1596
- XMLHelper.add_element(rim_joist, 'Emittance', to_float(@emittance)) unless @emittance.nil?
1697
+ XMLHelper.add_element(rim_joist, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
1698
+ XMLHelper.add_element(rim_joist, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1699
+ XMLHelper.add_element(rim_joist, 'Area', @area, :float) unless @area.nil?
1700
+ XMLHelper.add_element(rim_joist, 'Orientation', @orientation, :string) unless @orientation.nil?
1701
+ XMLHelper.add_element(rim_joist, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1702
+ XMLHelper.add_element(rim_joist, 'Siding', @siding, :string, @siding_isdefaulted) unless @siding.nil?
1703
+ XMLHelper.add_element(rim_joist, 'Color', @color, :string, @color_isdefaulted) unless @color.nil?
1704
+ XMLHelper.add_element(rim_joist, 'SolarAbsorptance', @solar_absorptance, :float, @solar_absorptance_isdefaulted) unless @solar_absorptance.nil?
1705
+ XMLHelper.add_element(rim_joist, 'Emittance', @emittance, :float, @emittance_isdefaulted) unless @emittance.nil?
1597
1706
  insulation = XMLHelper.add_element(rim_joist, 'Insulation')
1598
1707
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1599
1708
  if not @insulation_id.nil?
@@ -1601,27 +1710,38 @@ class HPXML < Object
1601
1710
  else
1602
1711
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1603
1712
  end
1604
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
1713
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1714
+ if not @insulation_cavity_r_value.nil?
1715
+ layer = XMLHelper.add_element(insulation, 'Layer')
1716
+ XMLHelper.add_element(layer, 'InstallationType', 'cavity', :string)
1717
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_cavity_r_value, :float)
1718
+ end
1719
+ if not @insulation_continuous_r_value.nil?
1720
+ layer = XMLHelper.add_element(insulation, 'Layer')
1721
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous', :string)
1722
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_continuous_r_value, :float)
1723
+ end
1605
1724
  end
1606
1725
 
1607
1726
  def from_oga(rim_joist)
1608
1727
  return if rim_joist.nil?
1609
1728
 
1610
1729
  @id = HPXML::get_id(rim_joist)
1611
- @exterior_adjacent_to = XMLHelper.get_value(rim_joist, 'ExteriorAdjacentTo')
1612
- @interior_adjacent_to = XMLHelper.get_value(rim_joist, 'InteriorAdjacentTo')
1613
- @area = to_float_or_nil(XMLHelper.get_value(rim_joist, 'Area'))
1614
- @azimuth = to_integer_or_nil(XMLHelper.get_value(rim_joist, 'Azimuth'))
1615
- @siding = XMLHelper.get_value(rim_joist, 'Siding')
1616
- @color = XMLHelper.get_value(rim_joist, 'Color')
1617
- @solar_absorptance = to_float_or_nil(XMLHelper.get_value(rim_joist, 'SolarAbsorptance'))
1618
- @emittance = to_float_or_nil(XMLHelper.get_value(rim_joist, 'Emittance'))
1730
+ @exterior_adjacent_to = XMLHelper.get_value(rim_joist, 'ExteriorAdjacentTo', :string)
1731
+ @interior_adjacent_to = XMLHelper.get_value(rim_joist, 'InteriorAdjacentTo', :string)
1732
+ @area = XMLHelper.get_value(rim_joist, 'Area', :float)
1733
+ @orientation = XMLHelper.get_value(rim_joist, 'Orientation', :string)
1734
+ @azimuth = XMLHelper.get_value(rim_joist, 'Azimuth', :integer)
1735
+ @siding = XMLHelper.get_value(rim_joist, 'Siding', :string)
1736
+ @color = XMLHelper.get_value(rim_joist, 'Color', :string)
1737
+ @solar_absorptance = XMLHelper.get_value(rim_joist, 'SolarAbsorptance', :float)
1738
+ @emittance = XMLHelper.get_value(rim_joist, 'Emittance', :float)
1619
1739
  insulation = XMLHelper.get_element(rim_joist, 'Insulation')
1620
1740
  if not insulation.nil?
1621
1741
  @insulation_id = HPXML::get_id(insulation)
1622
- @insulation_assembly_r_value = to_float_or_nil(XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue'))
1623
- @insulation_cavity_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue"))
1624
- @insulation_continuous_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue"))
1742
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
1743
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
1744
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1625
1745
  end
1626
1746
  end
1627
1747
  end
@@ -1656,6 +1776,7 @@ class HPXML < Object
1656
1776
 
1657
1777
  def net_area
1658
1778
  return if nil?
1779
+ return if @area.nil?
1659
1780
 
1660
1781
  val = @area
1661
1782
  (windows + doors).each do |subsurface|
@@ -1713,18 +1834,22 @@ class HPXML < Object
1713
1834
  wall = XMLHelper.add_element(walls, 'Wall')
1714
1835
  sys_id = XMLHelper.add_element(wall, 'SystemIdentifier')
1715
1836
  XMLHelper.add_attribute(sys_id, 'id', @id)
1716
- XMLHelper.add_element(wall, 'ExteriorAdjacentTo', @exterior_adjacent_to) unless @exterior_adjacent_to.nil?
1717
- XMLHelper.add_element(wall, 'InteriorAdjacentTo', @interior_adjacent_to) unless @interior_adjacent_to.nil?
1837
+ XMLHelper.add_element(wall, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
1838
+ XMLHelper.add_element(wall, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1718
1839
  if not @wall_type.nil?
1719
- wall_type_e = XMLHelper.add_element(wall, 'WallType')
1720
- XMLHelper.add_element(wall_type_e, @wall_type)
1721
- end
1722
- XMLHelper.add_element(wall, 'Area', to_float(@area)) unless @area.nil?
1723
- XMLHelper.add_element(wall, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
1724
- XMLHelper.add_element(wall, 'Siding', @siding) unless @siding.nil?
1725
- XMLHelper.add_element(wall, 'Color', @color) unless @color.nil?
1726
- XMLHelper.add_element(wall, 'SolarAbsorptance', to_float(@solar_absorptance)) unless @solar_absorptance.nil?
1727
- XMLHelper.add_element(wall, 'Emittance', to_float(@emittance)) unless @emittance.nil?
1840
+ wall_type_el = XMLHelper.add_element(wall, 'WallType')
1841
+ wall_type = XMLHelper.add_element(wall_type_el, @wall_type)
1842
+ if @wall_type == HPXML::WallTypeWoodStud
1843
+ XMLHelper.add_element(wall_type, 'OptimumValueEngineering', @optimum_value_engineering, :boolean) unless @optimum_value_engineering.nil?
1844
+ end
1845
+ end
1846
+ XMLHelper.add_element(wall, 'Area', @area, :float) unless @area.nil?
1847
+ XMLHelper.add_element(wall, 'Orientation', @orientation, :string) unless @orientation.nil?
1848
+ XMLHelper.add_element(wall, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1849
+ XMLHelper.add_element(wall, 'Siding', @siding, :string, @siding_isdefaulted) unless @siding.nil?
1850
+ XMLHelper.add_element(wall, 'Color', @color, :string, @color_isdefaulted) unless @color.nil?
1851
+ XMLHelper.add_element(wall, 'SolarAbsorptance', @solar_absorptance, :float, @solar_absorptance_isdefaulted) unless @solar_absorptance.nil?
1852
+ XMLHelper.add_element(wall, 'Emittance', @emittance, :float, @emittance_isdefaulted) unless @emittance.nil?
1728
1853
  insulation = XMLHelper.add_element(wall, 'Insulation')
1729
1854
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1730
1855
  if not @insulation_id.nil?
@@ -1732,30 +1857,42 @@ class HPXML < Object
1732
1857
  else
1733
1858
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1734
1859
  end
1735
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
1860
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1861
+ if not @insulation_cavity_r_value.nil?
1862
+ layer = XMLHelper.add_element(insulation, 'Layer')
1863
+ XMLHelper.add_element(layer, 'InstallationType', 'cavity', :string)
1864
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_cavity_r_value, :float)
1865
+ end
1866
+ if not @insulation_continuous_r_value.nil?
1867
+ layer = XMLHelper.add_element(insulation, 'Layer')
1868
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous', :string)
1869
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_continuous_r_value, :float)
1870
+ end
1736
1871
  end
1737
1872
 
1738
1873
  def from_oga(wall)
1739
1874
  return if wall.nil?
1740
1875
 
1741
1876
  @id = HPXML::get_id(wall)
1742
- @exterior_adjacent_to = XMLHelper.get_value(wall, 'ExteriorAdjacentTo')
1743
- @interior_adjacent_to = XMLHelper.get_value(wall, 'InteriorAdjacentTo')
1877
+ @exterior_adjacent_to = XMLHelper.get_value(wall, 'ExteriorAdjacentTo', :string)
1878
+ @interior_adjacent_to = XMLHelper.get_value(wall, 'InteriorAdjacentTo', :string)
1744
1879
  @wall_type = XMLHelper.get_child_name(wall, 'WallType')
1745
- @optimum_value_engineering = to_boolean_or_nil(XMLHelper.get_value(wall, 'WallType/WoodStud/OptimumValueEngineering'))
1746
- @area = to_float_or_nil(XMLHelper.get_value(wall, 'Area'))
1747
- @orientation = XMLHelper.get_value(wall, 'Orientation')
1748
- @azimuth = to_integer_or_nil(XMLHelper.get_value(wall, 'Azimuth'))
1749
- @siding = XMLHelper.get_value(wall, 'Siding')
1750
- @color = XMLHelper.get_value(wall, 'Color')
1751
- @solar_absorptance = to_float_or_nil(XMLHelper.get_value(wall, 'SolarAbsorptance'))
1752
- @emittance = to_float_or_nil(XMLHelper.get_value(wall, 'Emittance'))
1880
+ if @wall_type == HPXML::WallTypeWoodStud
1881
+ @optimum_value_engineering = XMLHelper.get_value(wall, 'WallType/WoodStud/OptimumValueEngineering', :boolean)
1882
+ end
1883
+ @area = XMLHelper.get_value(wall, 'Area', :float)
1884
+ @orientation = XMLHelper.get_value(wall, 'Orientation', :string)
1885
+ @azimuth = XMLHelper.get_value(wall, 'Azimuth', :integer)
1886
+ @siding = XMLHelper.get_value(wall, 'Siding', :string)
1887
+ @color = XMLHelper.get_value(wall, 'Color', :string)
1888
+ @solar_absorptance = XMLHelper.get_value(wall, 'SolarAbsorptance', :float)
1889
+ @emittance = XMLHelper.get_value(wall, 'Emittance', :float)
1753
1890
  insulation = XMLHelper.get_element(wall, 'Insulation')
1754
1891
  if not insulation.nil?
1755
1892
  @insulation_id = HPXML::get_id(insulation)
1756
- @insulation_assembly_r_value = to_float_or_nil(XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue'))
1757
- @insulation_cavity_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue"))
1758
- @insulation_continuous_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue"))
1893
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
1894
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
1895
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1759
1896
  end
1760
1897
  end
1761
1898
  end
@@ -1775,8 +1912,8 @@ class HPXML < Object
1775
1912
  end
1776
1913
 
1777
1914
  class FoundationWall < BaseElement
1778
- ATTRS = [:id, :exterior_adjacent_to, :interior_adjacent_to, :height, :area, :azimuth, :thickness,
1779
- :depth_below_grade, :insulation_id, :insulation_r_value, :insulation_interior_r_value,
1915
+ ATTRS = [:id, :exterior_adjacent_to, :interior_adjacent_to, :height, :area, :orientation, :azimuth,
1916
+ :thickness, :depth_below_grade, :insulation_id, :insulation_interior_r_value,
1780
1917
  :insulation_interior_distance_to_top, :insulation_interior_distance_to_bottom,
1781
1918
  :insulation_exterior_r_value, :insulation_exterior_distance_to_top,
1782
1919
  :insulation_exterior_distance_to_bottom, :insulation_assembly_r_value,
@@ -1793,6 +1930,7 @@ class HPXML < Object
1793
1930
 
1794
1931
  def net_area
1795
1932
  return if nil?
1933
+ return if @area.nil?
1796
1934
 
1797
1935
  val = @area
1798
1936
  (@hpxml_object.windows + @hpxml_object.doors).each do |subsurface|
@@ -1855,13 +1993,14 @@ class HPXML < Object
1855
1993
  foundation_wall = XMLHelper.add_element(foundation_walls, 'FoundationWall')
1856
1994
  sys_id = XMLHelper.add_element(foundation_wall, 'SystemIdentifier')
1857
1995
  XMLHelper.add_attribute(sys_id, 'id', @id)
1858
- XMLHelper.add_element(foundation_wall, 'ExteriorAdjacentTo', @exterior_adjacent_to) unless @exterior_adjacent_to.nil?
1859
- XMLHelper.add_element(foundation_wall, 'InteriorAdjacentTo', @interior_adjacent_to) unless @interior_adjacent_to.nil?
1860
- XMLHelper.add_element(foundation_wall, 'Height', to_float(@height)) unless @height.nil?
1861
- XMLHelper.add_element(foundation_wall, 'Area', to_float(@area)) unless @area.nil?
1862
- XMLHelper.add_element(foundation_wall, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
1863
- XMLHelper.add_element(foundation_wall, 'Thickness', to_float(@thickness)) unless @thickness.nil?
1864
- XMLHelper.add_element(foundation_wall, 'DepthBelowGrade', to_float(@depth_below_grade)) unless @depth_below_grade.nil?
1996
+ XMLHelper.add_element(foundation_wall, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
1997
+ XMLHelper.add_element(foundation_wall, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1998
+ XMLHelper.add_element(foundation_wall, 'Height', @height, :float) unless @height.nil?
1999
+ XMLHelper.add_element(foundation_wall, 'Area', @area, :float) unless @area.nil?
2000
+ XMLHelper.add_element(foundation_wall, 'Orientation', @orientation, :string) unless @orientation.nil?
2001
+ XMLHelper.add_element(foundation_wall, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
2002
+ XMLHelper.add_element(foundation_wall, 'Thickness', @thickness, :float, @thickness_isdefaulted) unless @thickness.nil?
2003
+ XMLHelper.add_element(foundation_wall, 'DepthBelowGrade', @depth_below_grade, :float) unless @depth_below_grade.nil?
1865
2004
  insulation = XMLHelper.add_element(foundation_wall, 'Insulation')
1866
2005
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1867
2006
  if not @insulation_id.nil?
@@ -1869,20 +2008,20 @@ class HPXML < Object
1869
2008
  else
1870
2009
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1871
2010
  end
1872
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
2011
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1873
2012
  if not @insulation_exterior_r_value.nil?
1874
2013
  layer = XMLHelper.add_element(insulation, 'Layer')
1875
- XMLHelper.add_element(layer, 'InstallationType', 'continuous - exterior')
1876
- XMLHelper.add_element(layer, 'NominalRValue', to_float(@insulation_exterior_r_value))
1877
- XMLHelper.add_extension(layer, 'DistanceToTopOfInsulation', to_float(@insulation_exterior_distance_to_top)) unless @insulation_exterior_distance_to_top.nil?
1878
- XMLHelper.add_extension(layer, 'DistanceToBottomOfInsulation', to_float(@insulation_exterior_distance_to_bottom)) unless @insulation_exterior_distance_to_bottom.nil?
2014
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous - exterior', :string)
2015
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_exterior_r_value, :float)
2016
+ XMLHelper.add_extension(layer, 'DistanceToTopOfInsulation', @insulation_exterior_distance_to_top, :float) unless @insulation_exterior_distance_to_top.nil?
2017
+ XMLHelper.add_extension(layer, 'DistanceToBottomOfInsulation', @insulation_exterior_distance_to_bottom, :float) unless @insulation_exterior_distance_to_bottom.nil?
1879
2018
  end
1880
2019
  if not @insulation_interior_r_value.nil?
1881
2020
  layer = XMLHelper.add_element(insulation, 'Layer')
1882
- XMLHelper.add_element(layer, 'InstallationType', 'continuous - interior')
1883
- XMLHelper.add_element(layer, 'NominalRValue', to_float(@insulation_interior_r_value))
1884
- XMLHelper.add_extension(layer, 'DistanceToTopOfInsulation', to_float(@insulation_interior_distance_to_top)) unless @insulation_interior_distance_to_top.nil?
1885
- XMLHelper.add_extension(layer, 'DistanceToBottomOfInsulation', to_float(@insulation_interior_distance_to_bottom)) unless @insulation_interior_distance_to_bottom.nil?
2021
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous - interior', :string)
2022
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_interior_r_value, :float)
2023
+ XMLHelper.add_extension(layer, 'DistanceToTopOfInsulation', @insulation_interior_distance_to_top, :float) unless @insulation_interior_distance_to_top.nil?
2024
+ XMLHelper.add_extension(layer, 'DistanceToBottomOfInsulation', @insulation_interior_distance_to_bottom, :float) unless @insulation_interior_distance_to_bottom.nil?
1886
2025
  end
1887
2026
  end
1888
2027
 
@@ -1890,25 +2029,25 @@ class HPXML < Object
1890
2029
  return if foundation_wall.nil?
1891
2030
 
1892
2031
  @id = HPXML::get_id(foundation_wall)
1893
- @exterior_adjacent_to = XMLHelper.get_value(foundation_wall, 'ExteriorAdjacentTo')
1894
- @interior_adjacent_to = XMLHelper.get_value(foundation_wall, 'InteriorAdjacentTo')
1895
- @height = to_float_or_nil(XMLHelper.get_value(foundation_wall, 'Height'))
1896
- @area = to_float_or_nil(XMLHelper.get_value(foundation_wall, 'Area'))
1897
- @azimuth = to_integer_or_nil(XMLHelper.get_value(foundation_wall, 'Azimuth'))
1898
- @thickness = to_float_or_nil(XMLHelper.get_value(foundation_wall, 'Thickness'))
1899
- @depth_below_grade = to_float_or_nil(XMLHelper.get_value(foundation_wall, 'DepthBelowGrade'))
2032
+ @exterior_adjacent_to = XMLHelper.get_value(foundation_wall, 'ExteriorAdjacentTo', :string)
2033
+ @interior_adjacent_to = XMLHelper.get_value(foundation_wall, 'InteriorAdjacentTo', :string)
2034
+ @height = XMLHelper.get_value(foundation_wall, 'Height', :float)
2035
+ @area = XMLHelper.get_value(foundation_wall, 'Area', :float)
2036
+ @orientation = XMLHelper.get_value(foundation_wall, 'Orientation', :string)
2037
+ @azimuth = XMLHelper.get_value(foundation_wall, 'Azimuth', :integer)
2038
+ @thickness = XMLHelper.get_value(foundation_wall, 'Thickness', :float)
2039
+ @depth_below_grade = XMLHelper.get_value(foundation_wall, 'DepthBelowGrade', :float)
1900
2040
  insulation = XMLHelper.get_element(foundation_wall, 'Insulation')
1901
2041
  if not insulation.nil?
1902
2042
  @insulation_id = HPXML::get_id(insulation)
1903
- @insulation_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue"))
1904
- @insulation_interior_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/NominalRValue"))
1905
- @insulation_interior_distance_to_top = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/extension/DistanceToTopOfInsulation"))
1906
- @insulation_interior_distance_to_bottom = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/extension/DistanceToBottomOfInsulation"))
1907
- @insulation_exterior_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/NominalRValue"))
1908
- @insulation_exterior_distance_to_top = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/extension/DistanceToTopOfInsulation"))
1909
- @insulation_exterior_distance_to_bottom = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/extension/DistanceToBottomOfInsulation"))
1910
- @insulation_continuous_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue"))
1911
- @insulation_assembly_r_value = to_float_or_nil(XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue'))
2043
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
2044
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
2045
+ @insulation_interior_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/NominalRValue", :float)
2046
+ @insulation_interior_distance_to_top = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/extension/DistanceToTopOfInsulation", :float)
2047
+ @insulation_interior_distance_to_bottom = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/extension/DistanceToBottomOfInsulation", :float)
2048
+ @insulation_exterior_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/NominalRValue", :float)
2049
+ @insulation_exterior_distance_to_top = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/extension/DistanceToTopOfInsulation", :float)
2050
+ @insulation_exterior_distance_to_bottom = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/extension/DistanceToBottomOfInsulation", :float)
1912
2051
  end
1913
2052
  end
1914
2053
  end
@@ -1995,9 +2134,9 @@ class HPXML < Object
1995
2134
  frame_floor = XMLHelper.add_element(frame_floors, 'FrameFloor')
1996
2135
  sys_id = XMLHelper.add_element(frame_floor, 'SystemIdentifier')
1997
2136
  XMLHelper.add_attribute(sys_id, 'id', @id)
1998
- XMLHelper.add_element(frame_floor, 'ExteriorAdjacentTo', @exterior_adjacent_to) unless @exterior_adjacent_to.nil?
1999
- XMLHelper.add_element(frame_floor, 'InteriorAdjacentTo', @interior_adjacent_to) unless @interior_adjacent_to.nil?
2000
- XMLHelper.add_element(frame_floor, 'Area', to_float(@area)) unless @area.nil?
2137
+ XMLHelper.add_element(frame_floor, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
2138
+ XMLHelper.add_element(frame_floor, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
2139
+ XMLHelper.add_element(frame_floor, 'Area', @area, :float) unless @area.nil?
2001
2140
  insulation = XMLHelper.add_element(frame_floor, 'Insulation')
2002
2141
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
2003
2142
  if not @insulation_id.nil?
@@ -2005,25 +2144,35 @@ class HPXML < Object
2005
2144
  else
2006
2145
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
2007
2146
  end
2008
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
2009
- XMLHelper.add_extension(frame_floor, 'OtherSpaceAboveOrBelow', @other_space_above_or_below) unless @other_space_above_or_below.nil?
2147
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
2148
+ if not @insulation_cavity_r_value.nil?
2149
+ layer = XMLHelper.add_element(insulation, 'Layer')
2150
+ XMLHelper.add_element(layer, 'InstallationType', 'cavity', :string)
2151
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_cavity_r_value, :float)
2152
+ end
2153
+ if not @insulation_continuous_r_value.nil?
2154
+ layer = XMLHelper.add_element(insulation, 'Layer')
2155
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous', :string)
2156
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_continuous_r_value, :float)
2157
+ end
2158
+ XMLHelper.add_extension(frame_floor, 'OtherSpaceAboveOrBelow', @other_space_above_or_below, :string) unless @other_space_above_or_below.nil?
2010
2159
  end
2011
2160
 
2012
2161
  def from_oga(frame_floor)
2013
2162
  return if frame_floor.nil?
2014
2163
 
2015
2164
  @id = HPXML::get_id(frame_floor)
2016
- @exterior_adjacent_to = XMLHelper.get_value(frame_floor, 'ExteriorAdjacentTo')
2017
- @interior_adjacent_to = XMLHelper.get_value(frame_floor, 'InteriorAdjacentTo')
2018
- @area = to_float_or_nil(XMLHelper.get_value(frame_floor, 'Area'))
2165
+ @exterior_adjacent_to = XMLHelper.get_value(frame_floor, 'ExteriorAdjacentTo', :string)
2166
+ @interior_adjacent_to = XMLHelper.get_value(frame_floor, 'InteriorAdjacentTo', :string)
2167
+ @area = XMLHelper.get_value(frame_floor, 'Area', :float)
2019
2168
  insulation = XMLHelper.get_element(frame_floor, 'Insulation')
2020
2169
  if not insulation.nil?
2021
2170
  @insulation_id = HPXML::get_id(insulation)
2022
- @insulation_assembly_r_value = to_float_or_nil(XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue'))
2023
- @insulation_cavity_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue"))
2024
- @insulation_continuous_r_value = to_float_or_nil(XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue"))
2171
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
2172
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
2173
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
2025
2174
  end
2026
- @other_space_above_or_below = XMLHelper.get_value(frame_floor, 'extension/OtherSpaceAboveOrBelow')
2175
+ @other_space_above_or_below = XMLHelper.get_value(frame_floor, 'extension/OtherSpaceAboveOrBelow', :string)
2027
2176
  end
2028
2177
  end
2029
2178
 
@@ -2078,13 +2227,6 @@ class HPXML < Object
2078
2227
 
2079
2228
  def check_for_errors
2080
2229
  errors = []
2081
-
2082
- if not @exposed_perimeter.nil?
2083
- if @exposed_perimeter <= 0
2084
- fail "Exposed perimeter for Slab '#{@id}' must be greater than zero."
2085
- end
2086
- end
2087
-
2088
2230
  return errors
2089
2231
  end
2090
2232
 
@@ -2095,14 +2237,14 @@ class HPXML < Object
2095
2237
  slab = XMLHelper.add_element(slabs, 'Slab')
2096
2238
  sys_id = XMLHelper.add_element(slab, 'SystemIdentifier')
2097
2239
  XMLHelper.add_attribute(sys_id, 'id', @id)
2098
- XMLHelper.add_element(slab, 'InteriorAdjacentTo', @interior_adjacent_to) unless @interior_adjacent_to.nil?
2099
- XMLHelper.add_element(slab, 'Area', to_float(@area)) unless @area.nil?
2100
- XMLHelper.add_element(slab, 'Thickness', to_float(@thickness)) unless @thickness.nil?
2101
- XMLHelper.add_element(slab, 'ExposedPerimeter', to_float(@exposed_perimeter)) unless @exposed_perimeter.nil?
2102
- XMLHelper.add_element(slab, 'PerimeterInsulationDepth', to_float(@perimeter_insulation_depth)) unless @perimeter_insulation_depth.nil?
2103
- XMLHelper.add_element(slab, 'UnderSlabInsulationWidth', to_float(@under_slab_insulation_width)) unless @under_slab_insulation_width.nil?
2104
- XMLHelper.add_element(slab, 'UnderSlabInsulationSpansEntireSlab', to_boolean(@under_slab_insulation_spans_entire_slab)) unless @under_slab_insulation_spans_entire_slab.nil?
2105
- XMLHelper.add_element(slab, 'DepthBelowGrade', to_float(@depth_below_grade)) unless @depth_below_grade.nil?
2240
+ XMLHelper.add_element(slab, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
2241
+ XMLHelper.add_element(slab, 'Area', @area, :float) unless @area.nil?
2242
+ XMLHelper.add_element(slab, 'Thickness', @thickness, :float, @thickness_isdefaulted) unless @thickness.nil?
2243
+ XMLHelper.add_element(slab, 'ExposedPerimeter', @exposed_perimeter, :float) unless @exposed_perimeter.nil?
2244
+ XMLHelper.add_element(slab, 'PerimeterInsulationDepth', @perimeter_insulation_depth, :float) unless @perimeter_insulation_depth.nil?
2245
+ XMLHelper.add_element(slab, 'UnderSlabInsulationWidth', @under_slab_insulation_width, :float) unless @under_slab_insulation_width.nil?
2246
+ XMLHelper.add_element(slab, 'UnderSlabInsulationSpansEntireSlab', @under_slab_insulation_spans_entire_slab, :boolean) unless @under_slab_insulation_spans_entire_slab.nil?
2247
+ XMLHelper.add_element(slab, 'DepthBelowGrade', @depth_below_grade, :float) unless @depth_below_grade.nil?
2106
2248
  insulation = XMLHelper.add_element(slab, 'PerimeterInsulation')
2107
2249
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
2108
2250
  if not @perimeter_insulation_id.nil?
@@ -2111,8 +2253,7 @@ class HPXML < Object
2111
2253
  XMLHelper.add_attribute(sys_id, 'id', @id + 'PerimeterInsulation')
2112
2254
  end
2113
2255
  layer = XMLHelper.add_element(insulation, 'Layer')
2114
- XMLHelper.add_element(layer, 'InstallationType', 'continuous')
2115
- XMLHelper.add_element(layer, 'NominalRValue', to_float(@perimeter_insulation_r_value)) unless @perimeter_insulation_r_value.nil?
2256
+ XMLHelper.add_element(layer, 'NominalRValue', @perimeter_insulation_r_value, :float) unless @perimeter_insulation_r_value.nil?
2116
2257
  insulation = XMLHelper.add_element(slab, 'UnderSlabInsulation')
2117
2258
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
2118
2259
  if not @under_slab_insulation_id.nil?
@@ -2121,36 +2262,35 @@ class HPXML < Object
2121
2262
  XMLHelper.add_attribute(sys_id, 'id', @id + 'UnderSlabInsulation')
2122
2263
  end
2123
2264
  layer = XMLHelper.add_element(insulation, 'Layer')
2124
- XMLHelper.add_element(layer, 'InstallationType', 'continuous')
2125
- XMLHelper.add_element(layer, 'NominalRValue', to_float(@under_slab_insulation_r_value)) unless @under_slab_insulation_r_value.nil?
2126
- XMLHelper.add_extension(slab, 'CarpetFraction', to_float(@carpet_fraction)) unless @carpet_fraction.nil?
2127
- XMLHelper.add_extension(slab, 'CarpetRValue', to_float(@carpet_r_value)) unless @carpet_r_value.nil?
2265
+ XMLHelper.add_element(layer, 'NominalRValue', @under_slab_insulation_r_value, :float) unless @under_slab_insulation_r_value.nil?
2266
+ XMLHelper.add_extension(slab, 'CarpetFraction', @carpet_fraction, :float, @carpet_fraction_isdefaulted) unless @carpet_fraction.nil?
2267
+ XMLHelper.add_extension(slab, 'CarpetRValue', @carpet_r_value, :float, @carpet_r_value_isdefaulted) unless @carpet_r_value.nil?
2128
2268
  end
2129
2269
 
2130
2270
  def from_oga(slab)
2131
2271
  return if slab.nil?
2132
2272
 
2133
2273
  @id = HPXML::get_id(slab)
2134
- @interior_adjacent_to = XMLHelper.get_value(slab, 'InteriorAdjacentTo')
2135
- @area = to_float_or_nil(XMLHelper.get_value(slab, 'Area'))
2136
- @thickness = to_float_or_nil(XMLHelper.get_value(slab, 'Thickness'))
2137
- @exposed_perimeter = to_float_or_nil(XMLHelper.get_value(slab, 'ExposedPerimeter'))
2138
- @perimeter_insulation_depth = to_float_or_nil(XMLHelper.get_value(slab, 'PerimeterInsulationDepth'))
2139
- @under_slab_insulation_width = to_float_or_nil(XMLHelper.get_value(slab, 'UnderSlabInsulationWidth'))
2140
- @under_slab_insulation_spans_entire_slab = to_boolean_or_nil(XMLHelper.get_value(slab, 'UnderSlabInsulationSpansEntireSlab'))
2141
- @depth_below_grade = to_float_or_nil(XMLHelper.get_value(slab, 'DepthBelowGrade'))
2142
- @carpet_fraction = to_float_or_nil(XMLHelper.get_value(slab, 'extension/CarpetFraction'))
2143
- @carpet_r_value = to_float_or_nil(XMLHelper.get_value(slab, 'extension/CarpetRValue'))
2274
+ @interior_adjacent_to = XMLHelper.get_value(slab, 'InteriorAdjacentTo', :string)
2275
+ @area = XMLHelper.get_value(slab, 'Area', :float)
2276
+ @thickness = XMLHelper.get_value(slab, 'Thickness', :float)
2277
+ @exposed_perimeter = XMLHelper.get_value(slab, 'ExposedPerimeter', :float)
2278
+ @perimeter_insulation_depth = XMLHelper.get_value(slab, 'PerimeterInsulationDepth', :float)
2279
+ @under_slab_insulation_width = XMLHelper.get_value(slab, 'UnderSlabInsulationWidth', :float)
2280
+ @under_slab_insulation_spans_entire_slab = XMLHelper.get_value(slab, 'UnderSlabInsulationSpansEntireSlab', :boolean)
2281
+ @depth_below_grade = XMLHelper.get_value(slab, 'DepthBelowGrade', :float)
2144
2282
  perimeter_insulation = XMLHelper.get_element(slab, 'PerimeterInsulation')
2145
2283
  if not perimeter_insulation.nil?
2146
2284
  @perimeter_insulation_id = HPXML::get_id(perimeter_insulation)
2147
- @perimeter_insulation_r_value = to_float_or_nil(XMLHelper.get_value(perimeter_insulation, "Layer[InstallationType='continuous']/NominalRValue"))
2285
+ @perimeter_insulation_r_value = XMLHelper.get_value(perimeter_insulation, 'Layer/NominalRValue', :float)
2148
2286
  end
2149
2287
  under_slab_insulation = XMLHelper.get_element(slab, 'UnderSlabInsulation')
2150
2288
  if not under_slab_insulation.nil?
2151
2289
  @under_slab_insulation_id = HPXML::get_id(under_slab_insulation)
2152
- @under_slab_insulation_r_value = to_float_or_nil(XMLHelper.get_value(under_slab_insulation, "Layer[InstallationType='continuous']/NominalRValue"))
2290
+ @under_slab_insulation_r_value = XMLHelper.get_value(under_slab_insulation, 'Layer/NominalRValue', :float)
2153
2291
  end
2292
+ @carpet_fraction = XMLHelper.get_value(slab, 'extension/CarpetFraction', :float)
2293
+ @carpet_r_value = XMLHelper.get_value(slab, 'extension/CarpetRValue', :float)
2154
2294
  end
2155
2295
  end
2156
2296
 
@@ -2171,9 +2311,10 @@ class HPXML < Object
2171
2311
  class Window < BaseElement
2172
2312
  ATTRS = [:id, :area, :azimuth, :orientation, :frame_type, :aluminum_thermal_break, :glass_layers,
2173
2313
  :glass_type, :gas_fill, :ufactor, :shgc, :interior_shading_factor_summer,
2174
- :interior_shading_factor_winter, :exterior_shading, :overhangs_depth,
2314
+ :interior_shading_factor_winter, :interior_shading_type, :exterior_shading_factor_summer,
2315
+ :exterior_shading_factor_winter, :exterior_shading_type, :overhangs_depth,
2175
2316
  :overhangs_distance_to_top_of_window, :overhangs_distance_to_bottom_of_window,
2176
- :fraction_operable, :wall_idref]
2317
+ :fraction_operable, :performance_class, :wall_idref]
2177
2318
  attr_accessor(*ATTRS)
2178
2319
 
2179
2320
  def wall
@@ -2210,18 +2351,6 @@ class HPXML < Object
2210
2351
  def check_for_errors
2211
2352
  errors = []
2212
2353
  begin; wall; rescue StandardError => e; errors << e.message; end
2213
- if (not @overhangs_distance_to_top_of_window.nil?) && (not @overhangs_distance_to_bottom_of_window.nil?)
2214
- if @overhangs_distance_to_bottom_of_window <= @overhangs_distance_to_top_of_window
2215
- fail "For Window '#{@id}', overhangs distance to bottom (#{@overhangs_distance_to_bottom_of_window}) must be greater than distance to top (#{@overhangs_distance_to_top_of_window})."
2216
- end
2217
- end
2218
- # TODO: Remove this error when we can support it w/ EnergyPlus
2219
- if (not @interior_shading_factor_summer.nil?) && (not @interior_shading_factor_winter.nil?)
2220
- if @interior_shading_factor_summer > @interior_shading_factor_winter
2221
- fail "SummerShadingCoefficient (#{interior_shading_factor_summer}) must be less than or equal to WinterShadingCoefficient (#{interior_shading_factor_winter}) for window '#{@id}'."
2222
- end
2223
- end
2224
-
2225
2354
  return errors
2226
2355
  end
2227
2356
 
@@ -2232,24 +2361,45 @@ class HPXML < Object
2232
2361
  window = XMLHelper.add_element(windows, 'Window')
2233
2362
  sys_id = XMLHelper.add_element(window, 'SystemIdentifier')
2234
2363
  XMLHelper.add_attribute(sys_id, 'id', @id)
2235
- XMLHelper.add_element(window, 'Area', to_float(@area)) unless @area.nil?
2236
- XMLHelper.add_element(window, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
2237
- XMLHelper.add_element(window, 'UFactor', to_float(@ufactor)) unless @ufactor.nil?
2238
- XMLHelper.add_element(window, 'SHGC', to_float(@shgc)) unless @shgc.nil?
2239
- if (not @interior_shading_factor_summer.nil?) || (not @interior_shading_factor_winter.nil?)
2364
+ XMLHelper.add_element(window, 'Area', @area, :float) unless @area.nil?
2365
+ XMLHelper.add_element(window, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
2366
+ XMLHelper.add_element(window, 'Orientation', @orientation, :string) unless @orientation.nil?
2367
+ if not @frame_type.nil?
2368
+ frame_type_el = XMLHelper.add_element(window, 'FrameType')
2369
+ frame_type = XMLHelper.add_element(frame_type_el, @frame_type)
2370
+ if @frame_type == HPXML::WindowFrameTypeAluminum
2371
+ XMLHelper.add_element(frame_type, 'ThermalBreak', @aluminum_thermal_break, :boolean) unless @aluminum_thermal_break.nil?
2372
+ end
2373
+ end
2374
+ XMLHelper.add_element(window, 'GlassLayers', @glass_layers, :string) unless @glass_layers.nil?
2375
+ XMLHelper.add_element(window, 'GlassType', @glass_type, :string) unless @glass_type.nil?
2376
+ XMLHelper.add_element(window, 'GasFill', @gas_fill, :string) unless @gas_fill.nil?
2377
+ XMLHelper.add_element(window, 'UFactor', @ufactor, :float) unless @ufactor.nil?
2378
+ XMLHelper.add_element(window, 'SHGC', @shgc, :float) unless @shgc.nil?
2379
+ if (not @exterior_shading_type.nil?) || (not @exterior_shading_factor_summer.nil?) || (not @exterior_shading_factor_winter.nil?)
2380
+ exterior_shading = XMLHelper.add_element(window, 'ExteriorShading')
2381
+ sys_id = XMLHelper.add_element(exterior_shading, 'SystemIdentifier')
2382
+ XMLHelper.add_attribute(sys_id, 'id', "#{id}ExteriorShading")
2383
+ XMLHelper.add_element(exterior_shading, 'Type', @exterior_shading_type, :string) unless @exterior_shading_type.nil?
2384
+ XMLHelper.add_element(exterior_shading, 'SummerShadingCoefficient', @exterior_shading_factor_summer, :float, @exterior_shading_factor_summer_isdefaulted) unless @exterior_shading_factor_summer.nil?
2385
+ XMLHelper.add_element(exterior_shading, 'WinterShadingCoefficient', @exterior_shading_factor_winter, :float, @exterior_shading_factor_winter_isdefaulted) unless @exterior_shading_factor_winter.nil?
2386
+ end
2387
+ if (not @interior_shading_type.nil?) || (not @interior_shading_factor_summer.nil?) || (not @interior_shading_factor_winter.nil?)
2240
2388
  interior_shading = XMLHelper.add_element(window, 'InteriorShading')
2241
2389
  sys_id = XMLHelper.add_element(interior_shading, 'SystemIdentifier')
2242
2390
  XMLHelper.add_attribute(sys_id, 'id', "#{id}InteriorShading")
2243
- XMLHelper.add_element(interior_shading, 'SummerShadingCoefficient', to_float(@interior_shading_factor_summer)) unless @interior_shading_factor_summer.nil?
2244
- XMLHelper.add_element(interior_shading, 'WinterShadingCoefficient', to_float(@interior_shading_factor_winter)) unless @interior_shading_factor_winter.nil?
2391
+ XMLHelper.add_element(interior_shading, 'Type', @interior_shading_type, :string) unless @interior_shading_type.nil?
2392
+ XMLHelper.add_element(interior_shading, 'SummerShadingCoefficient', @interior_shading_factor_summer, :float, @interior_shading_factor_summer_isdefaulted) unless @interior_shading_factor_summer.nil?
2393
+ XMLHelper.add_element(interior_shading, 'WinterShadingCoefficient', @interior_shading_factor_winter, :float, @interior_shading_factor_winter_isdefaulted) unless @interior_shading_factor_winter.nil?
2245
2394
  end
2246
2395
  if (not @overhangs_depth.nil?) || (not @overhangs_distance_to_top_of_window.nil?) || (not @overhangs_distance_to_bottom_of_window.nil?)
2247
2396
  overhangs = XMLHelper.add_element(window, 'Overhangs')
2248
- XMLHelper.add_element(overhangs, 'Depth', to_float(@overhangs_depth)) unless @overhangs_depth.nil?
2249
- XMLHelper.add_element(overhangs, 'DistanceToTopOfWindow', to_float(@overhangs_distance_to_top_of_window)) unless @overhangs_distance_to_top_of_window.nil?
2250
- XMLHelper.add_element(overhangs, 'DistanceToBottomOfWindow', to_float(@overhangs_distance_to_bottom_of_window)) unless @overhangs_distance_to_bottom_of_window.nil?
2397
+ XMLHelper.add_element(overhangs, 'Depth', @overhangs_depth, :float) unless @overhangs_depth.nil?
2398
+ XMLHelper.add_element(overhangs, 'DistanceToTopOfWindow', @overhangs_distance_to_top_of_window, :float) unless @overhangs_distance_to_top_of_window.nil?
2399
+ XMLHelper.add_element(overhangs, 'DistanceToBottomOfWindow', @overhangs_distance_to_bottom_of_window, :float) unless @overhangs_distance_to_bottom_of_window.nil?
2251
2400
  end
2252
- XMLHelper.add_element(window, 'FractionOperable', to_float(@fraction_operable)) unless @fraction_operable.nil?
2401
+ XMLHelper.add_element(window, 'FractionOperable', @fraction_operable, :float, @fraction_operable_isdefaulted) unless @fraction_operable.nil?
2402
+ XMLHelper.add_element(window, 'PerformanceClass', @performance_class, :string, @performance_class_isdefaulted) unless @performance_class.nil?
2253
2403
  if not @wall_idref.nil?
2254
2404
  attached_to_wall = XMLHelper.add_element(window, 'AttachedToWall')
2255
2405
  XMLHelper.add_attribute(attached_to_wall, 'idref', @wall_idref)
@@ -2260,23 +2410,29 @@ class HPXML < Object
2260
2410
  return if window.nil?
2261
2411
 
2262
2412
  @id = HPXML::get_id(window)
2263
- @area = to_float_or_nil(XMLHelper.get_value(window, 'Area'))
2264
- @azimuth = to_integer_or_nil(XMLHelper.get_value(window, 'Azimuth'))
2265
- @orientation = XMLHelper.get_value(window, 'Orientation')
2413
+ @area = XMLHelper.get_value(window, 'Area', :float)
2414
+ @azimuth = XMLHelper.get_value(window, 'Azimuth', :integer)
2415
+ @orientation = XMLHelper.get_value(window, 'Orientation', :string)
2266
2416
  @frame_type = XMLHelper.get_child_name(window, 'FrameType')
2267
- @aluminum_thermal_break = to_boolean_or_nil(XMLHelper.get_value(window, 'FrameType/Aluminum/ThermalBreak'))
2268
- @glass_layers = XMLHelper.get_value(window, 'GlassLayers')
2269
- @glass_type = XMLHelper.get_value(window, 'GlassType')
2270
- @gas_fill = XMLHelper.get_value(window, 'GasFill')
2271
- @ufactor = to_float_or_nil(XMLHelper.get_value(window, 'UFactor'))
2272
- @shgc = to_float_or_nil(XMLHelper.get_value(window, 'SHGC'))
2273
- @interior_shading_factor_summer = to_float_or_nil(XMLHelper.get_value(window, 'InteriorShading/SummerShadingCoefficient'))
2274
- @interior_shading_factor_winter = to_float_or_nil(XMLHelper.get_value(window, 'InteriorShading/WinterShadingCoefficient'))
2275
- @exterior_shading = XMLHelper.get_value(window, 'ExteriorShading/Type')
2276
- @overhangs_depth = to_float_or_nil(XMLHelper.get_value(window, 'Overhangs/Depth'))
2277
- @overhangs_distance_to_top_of_window = to_float_or_nil(XMLHelper.get_value(window, 'Overhangs/DistanceToTopOfWindow'))
2278
- @overhangs_distance_to_bottom_of_window = to_float_or_nil(XMLHelper.get_value(window, 'Overhangs/DistanceToBottomOfWindow'))
2279
- @fraction_operable = to_float_or_nil(XMLHelper.get_value(window, 'FractionOperable'))
2417
+ if not @frame_type.nil?
2418
+ @aluminum_thermal_break = XMLHelper.get_value(window, 'FrameType/Aluminum/ThermalBreak', :boolean)
2419
+ end
2420
+ @glass_layers = XMLHelper.get_value(window, 'GlassLayers', :string)
2421
+ @glass_type = XMLHelper.get_value(window, 'GlassType', :string)
2422
+ @gas_fill = XMLHelper.get_value(window, 'GasFill', :string)
2423
+ @ufactor = XMLHelper.get_value(window, 'UFactor', :float)
2424
+ @shgc = XMLHelper.get_value(window, 'SHGC', :float)
2425
+ @exterior_shading_type = XMLHelper.get_value(window, 'ExteriorShading/Type', :string)
2426
+ @exterior_shading_factor_summer = XMLHelper.get_value(window, 'ExteriorShading/SummerShadingCoefficient', :float)
2427
+ @exterior_shading_factor_winter = XMLHelper.get_value(window, 'ExteriorShading/WinterShadingCoefficient', :float)
2428
+ @interior_shading_type = XMLHelper.get_value(window, 'InteriorShading/Type', :string)
2429
+ @interior_shading_factor_summer = XMLHelper.get_value(window, 'InteriorShading/SummerShadingCoefficient', :float)
2430
+ @interior_shading_factor_winter = XMLHelper.get_value(window, 'InteriorShading/WinterShadingCoefficient', :float)
2431
+ @overhangs_depth = XMLHelper.get_value(window, 'Overhangs/Depth', :float)
2432
+ @overhangs_distance_to_top_of_window = XMLHelper.get_value(window, 'Overhangs/DistanceToTopOfWindow', :float)
2433
+ @overhangs_distance_to_bottom_of_window = XMLHelper.get_value(window, 'Overhangs/DistanceToBottomOfWindow', :float)
2434
+ @fraction_operable = XMLHelper.get_value(window, 'FractionOperable', :float)
2435
+ @performance_class = XMLHelper.get_value(window, 'PerformanceClass', :string)
2280
2436
  @wall_idref = HPXML::get_idref(XMLHelper.get_element(window, 'AttachedToWall'))
2281
2437
  end
2282
2438
  end
@@ -2298,7 +2454,8 @@ class HPXML < Object
2298
2454
  class Skylight < BaseElement
2299
2455
  ATTRS = [:id, :area, :azimuth, :orientation, :frame_type, :aluminum_thermal_break, :glass_layers,
2300
2456
  :glass_type, :gas_fill, :ufactor, :shgc, :interior_shading_factor_summer,
2301
- :interior_shading_factor_winter, :exterior_shading, :roof_idref]
2457
+ :interior_shading_factor_winter, :interior_shading_type, :exterior_shading_factor_summer,
2458
+ :exterior_shading_factor_winter, :exterior_shading_type, :roof_idref]
2302
2459
  attr_accessor(*ATTRS)
2303
2460
 
2304
2461
  def roof
@@ -2345,16 +2502,36 @@ class HPXML < Object
2345
2502
  skylight = XMLHelper.add_element(skylights, 'Skylight')
2346
2503
  sys_id = XMLHelper.add_element(skylight, 'SystemIdentifier')
2347
2504
  XMLHelper.add_attribute(sys_id, 'id', @id)
2348
- XMLHelper.add_element(skylight, 'Area', to_float(@area)) unless @area.nil?
2349
- XMLHelper.add_element(skylight, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
2350
- XMLHelper.add_element(skylight, 'UFactor', to_float(@ufactor)) unless @ufactor.nil?
2351
- XMLHelper.add_element(skylight, 'SHGC', to_float(@shgc)) unless @shgc.nil?
2352
- if (not @interior_shading_factor_summer.nil?) || (not @interior_shading_factor_winter.nil?)
2505
+ XMLHelper.add_element(skylight, 'Area', @area, :float) unless @area.nil?
2506
+ XMLHelper.add_element(skylight, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
2507
+ XMLHelper.add_element(skylight, 'Orientation', @orientation, :string) unless @orientation.nil?
2508
+ if not @frame_type.nil?
2509
+ frame_type_el = XMLHelper.add_element(skylight, 'FrameType')
2510
+ frame_type = XMLHelper.add_element(frame_type_el, @frame_type)
2511
+ if @frame_type == HPXML::WindowFrameTypeAluminum
2512
+ XMLHelper.add_element(frame_type, 'ThermalBreak', @aluminum_thermal_break, :boolean) unless @aluminum_thermal_break.nil?
2513
+ end
2514
+ end
2515
+ XMLHelper.add_element(skylight, 'GlassLayers', @glass_layers, :string) unless @glass_layers.nil?
2516
+ XMLHelper.add_element(skylight, 'GlassType', @glass_type, :string) unless @glass_type.nil?
2517
+ XMLHelper.add_element(skylight, 'GasFill', @gas_fill, :string) unless @gas_fill.nil?
2518
+ XMLHelper.add_element(skylight, 'UFactor', @ufactor, :float) unless @ufactor.nil?
2519
+ XMLHelper.add_element(skylight, 'SHGC', @shgc, :float) unless @shgc.nil?
2520
+ if (not @exterior_shading_type.nil?) || (not @exterior_shading_factor_summer.nil?) || (not @exterior_shading_factor_winter.nil?)
2521
+ exterior_shading = XMLHelper.add_element(skylight, 'ExteriorShading')
2522
+ sys_id = XMLHelper.add_element(exterior_shading, 'SystemIdentifier')
2523
+ XMLHelper.add_attribute(sys_id, 'id', "#{id}ExteriorShading")
2524
+ XMLHelper.add_element(exterior_shading, 'Type', @exterior_shading_type, :string) unless @exterior_shading_type.nil?
2525
+ XMLHelper.add_element(exterior_shading, 'SummerShadingCoefficient', @exterior_shading_factor_summer, :float, @exterior_shading_factor_summer_isdefaulted) unless @exterior_shading_factor_summer.nil?
2526
+ XMLHelper.add_element(exterior_shading, 'WinterShadingCoefficient', @exterior_shading_factor_winter, :float, @exterior_shading_factor_winter_isdefaulted) unless @exterior_shading_factor_winter.nil?
2527
+ end
2528
+ if (not @interior_shading_type.nil?) || (not @interior_shading_factor_summer.nil?) || (not @interior_shading_factor_winter.nil?)
2353
2529
  interior_shading = XMLHelper.add_element(skylight, 'InteriorShading')
2354
2530
  sys_id = XMLHelper.add_element(interior_shading, 'SystemIdentifier')
2355
2531
  XMLHelper.add_attribute(sys_id, 'id', "#{id}InteriorShading")
2356
- XMLHelper.add_element(interior_shading, 'SummerShadingCoefficient', to_float(@interior_shading_factor_summer)) unless @interior_shading_factor_summer.nil?
2357
- XMLHelper.add_element(interior_shading, 'WinterShadingCoefficient', to_float(@interior_shading_factor_winter)) unless @interior_shading_factor_winter.nil?
2532
+ XMLHelper.add_element(interior_shading, 'Type', @interior_shading_type, :string) unless @interior_shading_type.nil?
2533
+ XMLHelper.add_element(interior_shading, 'SummerShadingCoefficient', @interior_shading_factor_summer, :float, @interior_shading_factor_summer_isdefaulted) unless @interior_shading_factor_summer.nil?
2534
+ XMLHelper.add_element(interior_shading, 'WinterShadingCoefficient', @interior_shading_factor_winter, :float, @interior_shading_factor_winter_isdefaulted) unless @interior_shading_factor_winter.nil?
2358
2535
  end
2359
2536
  if not @roof_idref.nil?
2360
2537
  attached_to_roof = XMLHelper.add_element(skylight, 'AttachedToRoof')
@@ -2366,19 +2543,22 @@ class HPXML < Object
2366
2543
  return if skylight.nil?
2367
2544
 
2368
2545
  @id = HPXML::get_id(skylight)
2369
- @area = to_float_or_nil(XMLHelper.get_value(skylight, 'Area'))
2370
- @azimuth = to_integer_or_nil(XMLHelper.get_value(skylight, 'Azimuth'))
2371
- @orientation = XMLHelper.get_value(skylight, 'Orientation')
2546
+ @area = XMLHelper.get_value(skylight, 'Area', :float)
2547
+ @azimuth = XMLHelper.get_value(skylight, 'Azimuth', :integer)
2548
+ @orientation = XMLHelper.get_value(skylight, 'Orientation', :string)
2372
2549
  @frame_type = XMLHelper.get_child_name(skylight, 'FrameType')
2373
- @aluminum_thermal_break = to_boolean_or_nil(XMLHelper.get_value(skylight, 'FrameType/Aluminum/ThermalBreak'))
2374
- @glass_layers = XMLHelper.get_value(skylight, 'GlassLayers')
2375
- @glass_type = XMLHelper.get_value(skylight, 'GlassType')
2376
- @gas_fill = XMLHelper.get_value(skylight, 'GasFill')
2377
- @ufactor = to_float_or_nil(XMLHelper.get_value(skylight, 'UFactor'))
2378
- @shgc = to_float_or_nil(XMLHelper.get_value(skylight, 'SHGC'))
2379
- @interior_shading_factor_summer = to_float_or_nil(XMLHelper.get_value(skylight, 'InteriorShading/SummerShadingCoefficient'))
2380
- @interior_shading_factor_winter = to_float_or_nil(XMLHelper.get_value(skylight, 'InteriorShading/WinterShadingCoefficient'))
2381
- @exterior_shading = XMLHelper.get_value(skylight, 'ExteriorShading/Type')
2550
+ @aluminum_thermal_break = XMLHelper.get_value(skylight, 'FrameType/Aluminum/ThermalBreak', :boolean)
2551
+ @glass_layers = XMLHelper.get_value(skylight, 'GlassLayers', :string)
2552
+ @glass_type = XMLHelper.get_value(skylight, 'GlassType', :string)
2553
+ @gas_fill = XMLHelper.get_value(skylight, 'GasFill', :string)
2554
+ @ufactor = XMLHelper.get_value(skylight, 'UFactor', :float)
2555
+ @shgc = XMLHelper.get_value(skylight, 'SHGC', :float)
2556
+ @exterior_shading_type = XMLHelper.get_value(skylight, 'ExteriorShading/Type', :string)
2557
+ @exterior_shading_factor_summer = XMLHelper.get_value(skylight, 'ExteriorShading/SummerShadingCoefficient', :float)
2558
+ @exterior_shading_factor_winter = XMLHelper.get_value(skylight, 'ExteriorShading/WinterShadingCoefficient', :float)
2559
+ @interior_shading_type = XMLHelper.get_value(skylight, 'InteriorShading/Type', :string)
2560
+ @interior_shading_factor_summer = XMLHelper.get_value(skylight, 'InteriorShading/SummerShadingCoefficient', :float)
2561
+ @interior_shading_factor_winter = XMLHelper.get_value(skylight, 'InteriorShading/WinterShadingCoefficient', :float)
2382
2562
  @roof_idref = HPXML::get_idref(XMLHelper.get_element(skylight, 'AttachedToRoof'))
2383
2563
  end
2384
2564
  end
@@ -2398,7 +2578,7 @@ class HPXML < Object
2398
2578
  end
2399
2579
 
2400
2580
  class Door < BaseElement
2401
- ATTRS = [:id, :wall_idref, :area, :azimuth, :r_value]
2581
+ ATTRS = [:id, :wall_idref, :area, :azimuth, :orientation, :r_value]
2402
2582
  attr_accessor(*ATTRS)
2403
2583
 
2404
2584
  def wall
@@ -2449,9 +2629,10 @@ class HPXML < Object
2449
2629
  attached_to_wall = XMLHelper.add_element(door, 'AttachedToWall')
2450
2630
  XMLHelper.add_attribute(attached_to_wall, 'idref', @wall_idref)
2451
2631
  end
2452
- XMLHelper.add_element(door, 'Area', to_float(@area)) unless @area.nil?
2453
- XMLHelper.add_element(door, 'Azimuth', to_integer(@azimuth)) unless @azimuth.nil?
2454
- XMLHelper.add_element(door, 'RValue', to_float(@r_value)) unless @r_value.nil?
2632
+ XMLHelper.add_element(door, 'Area', @area, :float) unless @area.nil?
2633
+ XMLHelper.add_element(door, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
2634
+ XMLHelper.add_element(door, 'Orientation', @orientation, :string) unless @orientation.nil?
2635
+ XMLHelper.add_element(door, 'RValue', @r_value, :float) unless @r_value.nil?
2455
2636
  end
2456
2637
 
2457
2638
  def from_oga(door)
@@ -2459,9 +2640,10 @@ class HPXML < Object
2459
2640
 
2460
2641
  @id = HPXML::get_id(door)
2461
2642
  @wall_idref = HPXML::get_idref(XMLHelper.get_element(door, 'AttachedToWall'))
2462
- @area = to_float_or_nil(XMLHelper.get_value(door, 'Area'))
2463
- @azimuth = to_integer_or_nil(XMLHelper.get_value(door, 'Azimuth'))
2464
- @r_value = to_float_or_nil(XMLHelper.get_value(door, 'RValue'))
2643
+ @area = XMLHelper.get_value(door, 'Area', :float)
2644
+ @azimuth = XMLHelper.get_value(door, 'Azimuth', :integer)
2645
+ @orientation = XMLHelper.get_value(door, 'Orientation', :string)
2646
+ @r_value = XMLHelper.get_value(door, 'RValue', :float)
2465
2647
  end
2466
2648
  end
2467
2649
 
@@ -2487,8 +2669,10 @@ class HPXML < Object
2487
2669
  ATTRS = [:id, :distribution_system_idref, :year_installed, :heating_system_type,
2488
2670
  :heating_system_fuel, :heating_capacity, :heating_efficiency_afue,
2489
2671
  :heating_efficiency_percent, :fraction_heat_load_served, :electric_auxiliary_energy,
2490
- :heating_cfm, :energy_star, :seed_id, :is_shared_system, :number_of_units_served,
2491
- :shared_loop_watts, :fan_coil_watts, :wlhp_heating_efficiency_cop]
2672
+ :third_party_certification, :seed_id, :is_shared_system, :number_of_units_served,
2673
+ :shared_loop_watts, :shared_loop_motor_efficiency, :fan_coil_watts, :fan_watts_per_cfm,
2674
+ :fan_power_not_tested, :airflow_defect_ratio, :airflow_not_tested,
2675
+ :fan_watts, :heating_airflow_cfm, :location]
2492
2676
  attr_accessor(*ATTRS)
2493
2677
 
2494
2678
  def distribution_system
@@ -2535,18 +2719,21 @@ class HPXML < Object
2535
2719
  heating_system = XMLHelper.add_element(hvac_plant, 'HeatingSystem')
2536
2720
  sys_id = XMLHelper.add_element(heating_system, 'SystemIdentifier')
2537
2721
  XMLHelper.add_attribute(sys_id, 'id', @id)
2722
+ XMLHelper.add_element(heating_system, 'UnitLocation', @location, :string) unless @location.nil?
2723
+ XMLHelper.add_element(heating_system, 'YearInstalled', @year_installed, :integer) unless @year_installed.nil?
2724
+ XMLHelper.add_element(heating_system, 'ThirdPartyCertification', @third_party_certification, :string) unless @third_party_certification.nil?
2538
2725
  if not @distribution_system_idref.nil?
2539
2726
  distribution_system = XMLHelper.add_element(heating_system, 'DistributionSystem')
2540
2727
  XMLHelper.add_attribute(distribution_system, 'idref', @distribution_system_idref)
2541
2728
  end
2542
- XMLHelper.add_element(heating_system, 'IsSharedSystem', to_boolean(@is_shared_system)) unless @is_shared_system.nil?
2543
- XMLHelper.add_element(heating_system, 'NumberofUnitsServed', to_integer(@number_of_units_served)) unless @number_of_units_served.nil?
2729
+ XMLHelper.add_element(heating_system, 'IsSharedSystem', @is_shared_system, :boolean) unless @is_shared_system.nil?
2730
+ XMLHelper.add_element(heating_system, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
2544
2731
  if not @heating_system_type.nil?
2545
- heating_system_type_e = XMLHelper.add_element(heating_system, 'HeatingSystemType')
2546
- XMLHelper.add_element(heating_system_type_e, @heating_system_type)
2732
+ heating_system_type_el = XMLHelper.add_element(heating_system, 'HeatingSystemType')
2733
+ XMLHelper.add_element(heating_system_type_el, @heating_system_type)
2547
2734
  end
2548
- XMLHelper.add_element(heating_system, 'HeatingSystemFuel', @heating_system_fuel) unless @heating_system_fuel.nil?
2549
- XMLHelper.add_element(heating_system, 'HeatingCapacity', to_float(@heating_capacity)) unless @heating_capacity.nil?
2735
+ XMLHelper.add_element(heating_system, 'HeatingSystemFuel', @heating_system_fuel, :string) unless @heating_system_fuel.nil?
2736
+ XMLHelper.add_element(heating_system, 'HeatingCapacity', @heating_capacity, :float, @heating_capacity_isdefaulted) unless @heating_capacity.nil?
2550
2737
 
2551
2738
  efficiency_units = nil
2552
2739
  efficiency_value = nil
@@ -2559,47 +2746,53 @@ class HPXML < Object
2559
2746
  end
2560
2747
  if not efficiency_value.nil?
2561
2748
  annual_efficiency = XMLHelper.add_element(heating_system, 'AnnualHeatingEfficiency')
2562
- XMLHelper.add_element(annual_efficiency, 'Units', efficiency_units)
2563
- XMLHelper.add_element(annual_efficiency, 'Value', to_float(efficiency_value))
2564
- end
2565
- XMLHelper.add_element(heating_system, 'FractionHeatLoadServed', to_float(@fraction_heat_load_served)) unless @fraction_heat_load_served.nil?
2566
- XMLHelper.add_element(heating_system, 'ElectricAuxiliaryEnergy', to_float(@electric_auxiliary_energy)) unless @electric_auxiliary_energy.nil?
2567
- XMLHelper.add_extension(heating_system, 'HeatingFlowRate', to_float(@heating_cfm)) unless @heating_cfm.nil?
2568
- XMLHelper.add_extension(heating_system, 'SharedLoopWatts', to_float(@shared_loop_watts)) unless @shared_loop_watts.nil?
2569
- XMLHelper.add_extension(heating_system, 'FanCoilWatts', to_float(@fan_coil_watts)) unless @fan_coil_watts.nil?
2570
- XMLHelper.add_extension(heating_system, 'SeedId', @seed_id) unless @seed_id.nil?
2571
- if not @wlhp_heating_efficiency_cop.nil?
2572
- wlhp = XMLHelper.create_elements_as_needed(heating_system, ['extension', 'WaterLoopHeatPump'])
2573
- annual_efficiency = XMLHelper.add_element(wlhp, 'AnnualHeatingEfficiency')
2574
- XMLHelper.add_element(annual_efficiency, 'Units', UnitsCOP)
2575
- XMLHelper.add_element(annual_efficiency, 'Value', to_float(@wlhp_heating_efficiency_cop))
2576
- end
2749
+ XMLHelper.add_element(annual_efficiency, 'Units', efficiency_units, :string)
2750
+ XMLHelper.add_element(annual_efficiency, 'Value', efficiency_value, :float)
2751
+ end
2752
+ XMLHelper.add_element(heating_system, 'FractionHeatLoadServed', @fraction_heat_load_served, :float, @fraction_heat_load_served_isdefaulted) unless @fraction_heat_load_served.nil?
2753
+ XMLHelper.add_element(heating_system, 'ElectricAuxiliaryEnergy', @electric_auxiliary_energy, :float, @electric_auxiliary_energy_isdefaulted) unless @electric_auxiliary_energy.nil?
2754
+ XMLHelper.add_extension(heating_system, 'SharedLoopWatts', @shared_loop_watts, :float) unless @shared_loop_watts.nil?
2755
+ XMLHelper.add_extension(heating_system, 'SharedLoopMotorEfficiency', @shared_loop_motor_efficiency, :float) unless @shared_loop_motor_efficiency.nil?
2756
+ XMLHelper.add_extension(heating_system, 'FanCoilWatts', @fan_coil_watts, :float) unless @fan_coil_watts.nil?
2757
+ XMLHelper.add_extension(heating_system, 'FanPowerWattsPerCFM', @fan_watts_per_cfm, :float, @fan_watts_per_cfm_isdefaulted) unless @fan_watts_per_cfm.nil?
2758
+ XMLHelper.add_extension(heating_system, 'FanPowerWatts', @fan_watts, :float, @fan_watts_isdefaulted) unless @fan_watts.nil?
2759
+ XMLHelper.add_extension(heating_system, 'FanPowerNotTested', @fan_power_not_tested, :boolean) unless @fan_power_not_tested.nil?
2760
+ XMLHelper.add_extension(heating_system, 'AirflowDefectRatio', @airflow_defect_ratio, :float, @airflow_defect_ratio_isdefaulted) unless @airflow_defect_ratio.nil?
2761
+ XMLHelper.add_extension(heating_system, 'AirflowNotTested', @airflow_not_tested, :boolean) unless @airflow_not_tested.nil?
2762
+ XMLHelper.add_extension(heating_system, 'HeatingAirflowCFM', @heating_airflow_cfm, :float, @heating_airflow_cfm_isdefaulted) unless @heating_airflow_cfm.nil?
2763
+ XMLHelper.add_extension(heating_system, 'SeedId', @seed_id, :string) unless @seed_id.nil?
2577
2764
  end
2578
2765
 
2579
2766
  def from_oga(heating_system)
2580
2767
  return if heating_system.nil?
2581
2768
 
2582
2769
  @id = HPXML::get_id(heating_system)
2770
+ @location = XMLHelper.get_value(heating_system, 'UnitLocation', :string)
2771
+ @year_installed = XMLHelper.get_value(heating_system, 'YearInstalled', :integer)
2772
+ @third_party_certification = XMLHelper.get_value(heating_system, 'ThirdPartyCertification', :string)
2583
2773
  @distribution_system_idref = HPXML::get_idref(XMLHelper.get_element(heating_system, 'DistributionSystem'))
2584
- @year_installed = to_integer_or_nil(XMLHelper.get_value(heating_system, 'YearInstalled'))
2585
- @is_shared_system = to_boolean_or_nil(XMLHelper.get_value(heating_system, 'IsSharedSystem'))
2586
- @number_of_units_served = to_integer_or_nil(XMLHelper.get_value(heating_system, 'NumberofUnitsServed'))
2774
+ @is_shared_system = XMLHelper.get_value(heating_system, 'IsSharedSystem', :boolean)
2775
+ @number_of_units_served = XMLHelper.get_value(heating_system, 'NumberofUnitsServed', :integer)
2587
2776
  @heating_system_type = XMLHelper.get_child_name(heating_system, 'HeatingSystemType')
2588
- @heating_system_fuel = XMLHelper.get_value(heating_system, 'HeatingSystemFuel')
2589
- @heating_capacity = to_float_or_nil(XMLHelper.get_value(heating_system, 'HeatingCapacity'))
2777
+ @heating_system_fuel = XMLHelper.get_value(heating_system, 'HeatingSystemFuel', :string)
2778
+ @heating_capacity = XMLHelper.get_value(heating_system, 'HeatingCapacity', :float)
2590
2779
  if [HVACTypeFurnace, HVACTypeWallFurnace, HVACTypeFloorFurnace, HVACTypeBoiler].include? @heating_system_type
2591
- @heating_efficiency_afue = to_float_or_nil(XMLHelper.get_value(heating_system, "AnnualHeatingEfficiency[Units='#{UnitsAFUE}']/Value"))
2780
+ @heating_efficiency_afue = XMLHelper.get_value(heating_system, "AnnualHeatingEfficiency[Units='#{UnitsAFUE}']/Value", :float)
2592
2781
  elsif [HVACTypeElectricResistance, HVACTypeStove, HVACTypePortableHeater, HVACTypeFixedHeater, HVACTypeFireplace].include? @heating_system_type
2593
- @heating_efficiency_percent = to_float_or_nil(XMLHelper.get_value(heating_system, "AnnualHeatingEfficiency[Units='Percent']/Value"))
2594
- end
2595
- @fraction_heat_load_served = to_float_or_nil(XMLHelper.get_value(heating_system, 'FractionHeatLoadServed'))
2596
- @electric_auxiliary_energy = to_float_or_nil(XMLHelper.get_value(heating_system, 'ElectricAuxiliaryEnergy'))
2597
- @heating_cfm = to_float_or_nil(XMLHelper.get_value(heating_system, 'extension/HeatingFlowRate'))
2598
- @energy_star = XMLHelper.get_values(heating_system, 'ThirdPartyCertification').include?('Energy Star')
2599
- @seed_id = XMLHelper.get_value(heating_system, 'extension/SeedId')
2600
- @shared_loop_watts = to_float_or_nil(XMLHelper.get_value(heating_system, 'extension/SharedLoopWatts'))
2601
- @fan_coil_watts = to_float_or_nil(XMLHelper.get_value(heating_system, 'extension/FanCoilWatts'))
2602
- @wlhp_heating_efficiency_cop = to_float_or_nil(XMLHelper.get_value(heating_system, "extension/WaterLoopHeatPump/AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value"))
2782
+ @heating_efficiency_percent = XMLHelper.get_value(heating_system, "AnnualHeatingEfficiency[Units='Percent']/Value", :float)
2783
+ end
2784
+ @fraction_heat_load_served = XMLHelper.get_value(heating_system, 'FractionHeatLoadServed', :float)
2785
+ @electric_auxiliary_energy = XMLHelper.get_value(heating_system, 'ElectricAuxiliaryEnergy', :float)
2786
+ @shared_loop_watts = XMLHelper.get_value(heating_system, 'extension/SharedLoopWatts', :float)
2787
+ @shared_loop_motor_efficiency = XMLHelper.get_value(heating_system, 'extension/SharedLoopMotorEfficiency', :float)
2788
+ @fan_coil_watts = XMLHelper.get_value(heating_system, 'extension/FanCoilWatts', :float)
2789
+ @fan_watts_per_cfm = XMLHelper.get_value(heating_system, 'extension/FanPowerWattsPerCFM', :float)
2790
+ @fan_watts = XMLHelper.get_value(heating_system, 'extension/FanPowerWatts', :float)
2791
+ @fan_power_not_tested = XMLHelper.get_value(heating_system, 'extension/FanPowerNotTested', :boolean)
2792
+ @airflow_defect_ratio = XMLHelper.get_value(heating_system, 'extension/AirflowDefectRatio', :float)
2793
+ @airflow_not_tested = XMLHelper.get_value(heating_system, 'extension/AirflowNotTested', :boolean)
2794
+ @heating_airflow_cfm = XMLHelper.get_value(heating_system, 'extension/HeatingAirflowCFM', :float)
2795
+ @seed_id = XMLHelper.get_value(heating_system, 'extension/SeedId', :string)
2603
2796
  end
2604
2797
  end
2605
2798
 
@@ -2625,9 +2818,10 @@ class HPXML < Object
2625
2818
  ATTRS = [:id, :distribution_system_idref, :year_installed, :cooling_system_type,
2626
2819
  :cooling_system_fuel, :cooling_capacity, :compressor_type, :fraction_cool_load_served,
2627
2820
  :cooling_efficiency_seer, :cooling_efficiency_eer, :cooling_efficiency_kw_per_ton,
2628
- :cooling_shr, :cooling_cfm, :energy_star, :seed_id, :is_shared_system,
2629
- :number_of_units_served, :shared_loop_watts, :fan_coil_watts, :wlhp_cooling_capacity,
2630
- :wlhp_cooling_efficiency_eer]
2821
+ :cooling_shr, :third_party_certification, :seed_id, :is_shared_system, :number_of_units_served,
2822
+ :shared_loop_watts, :shared_loop_motor_efficiency, :fan_coil_watts, :airflow_defect_ratio,
2823
+ :fan_watts_per_cfm, :fan_power_not_tested, :airflow_not_tested, :charge_defect_ratio,
2824
+ :charge_not_tested, :cooling_airflow_cfm, :location]
2631
2825
  attr_accessor(*ATTRS)
2632
2826
 
2633
2827
  def distribution_system
@@ -2674,17 +2868,20 @@ class HPXML < Object
2674
2868
  cooling_system = XMLHelper.add_element(hvac_plant, 'CoolingSystem')
2675
2869
  sys_id = XMLHelper.add_element(cooling_system, 'SystemIdentifier')
2676
2870
  XMLHelper.add_attribute(sys_id, 'id', @id)
2871
+ XMLHelper.add_element(cooling_system, 'UnitLocation', @location, :string) unless @location.nil?
2872
+ XMLHelper.add_element(cooling_system, 'YearInstalled', @year_installed, :integer) unless @year_installed.nil?
2873
+ XMLHelper.add_element(cooling_system, 'ThirdPartyCertification', @third_party_certification, :string) unless @third_party_certification.nil?
2677
2874
  if not @distribution_system_idref.nil?
2678
2875
  distribution_system = XMLHelper.add_element(cooling_system, 'DistributionSystem')
2679
2876
  XMLHelper.add_attribute(distribution_system, 'idref', @distribution_system_idref)
2680
2877
  end
2681
- XMLHelper.add_element(cooling_system, 'IsSharedSystem', to_boolean(@is_shared_system)) unless @is_shared_system.nil?
2682
- XMLHelper.add_element(cooling_system, 'NumberofUnitsServed', to_integer(@number_of_units_served)) unless @number_of_units_served.nil?
2683
- XMLHelper.add_element(cooling_system, 'CoolingSystemType', @cooling_system_type) unless @cooling_system_type.nil?
2684
- XMLHelper.add_element(cooling_system, 'CoolingSystemFuel', @cooling_system_fuel) unless @cooling_system_fuel.nil?
2685
- XMLHelper.add_element(cooling_system, 'CoolingCapacity', to_float(@cooling_capacity)) unless @cooling_capacity.nil?
2686
- XMLHelper.add_element(cooling_system, 'CompressorType', @compressor_type) unless @compressor_type.nil?
2687
- XMLHelper.add_element(cooling_system, 'FractionCoolLoadServed', to_float(@fraction_cool_load_served)) unless @fraction_cool_load_served.nil?
2878
+ XMLHelper.add_element(cooling_system, 'IsSharedSystem', @is_shared_system, :boolean) unless @is_shared_system.nil?
2879
+ XMLHelper.add_element(cooling_system, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
2880
+ XMLHelper.add_element(cooling_system, 'CoolingSystemType', @cooling_system_type, :string) unless @cooling_system_type.nil?
2881
+ XMLHelper.add_element(cooling_system, 'CoolingSystemFuel', @cooling_system_fuel, :string) unless @cooling_system_fuel.nil?
2882
+ XMLHelper.add_element(cooling_system, 'CoolingCapacity', @cooling_capacity, :float, @cooling_capacity_isdefaulted) unless @cooling_capacity.nil?
2883
+ XMLHelper.add_element(cooling_system, 'CompressorType', @compressor_type, :string, @compressor_type_isdefaulted) unless @compressor_type.nil?
2884
+ XMLHelper.add_element(cooling_system, 'FractionCoolLoadServed', @fraction_cool_load_served, :float, @fraction_cool_load_served_isdefaulted) unless @fraction_cool_load_served.nil?
2688
2885
 
2689
2886
  efficiency_units = nil
2690
2887
  efficiency_value = nil
@@ -2700,53 +2897,57 @@ class HPXML < Object
2700
2897
  end
2701
2898
  if not efficiency_value.nil?
2702
2899
  annual_efficiency = XMLHelper.add_element(cooling_system, 'AnnualCoolingEfficiency')
2703
- XMLHelper.add_element(annual_efficiency, 'Units', efficiency_units)
2704
- XMLHelper.add_element(annual_efficiency, 'Value', to_float(efficiency_value))
2705
- end
2706
- XMLHelper.add_element(cooling_system, 'SensibleHeatFraction', to_float(@cooling_shr)) unless @cooling_shr.nil?
2707
- XMLHelper.add_extension(cooling_system, 'CoolingFlowRate', to_float(@cooling_cfm)) unless @cooling_cfm.nil?
2708
- XMLHelper.add_extension(cooling_system, 'SharedLoopWatts', to_float(@shared_loop_watts)) unless @shared_loop_watts.nil?
2709
- XMLHelper.add_extension(cooling_system, 'FanCoilWatts', to_float(@fan_coil_watts)) unless @fan_coil_watts.nil?
2710
- XMLHelper.add_extension(cooling_system, 'SeedId', @seed_id) unless @seed_id.nil?
2711
- if (not @wlhp_cooling_capacity.nil?) || (not @wlhp_cooling_efficiency_eer.nil?)
2712
- wlhp = XMLHelper.create_elements_as_needed(cooling_system, ['extension', 'WaterLoopHeatPump'])
2713
- XMLHelper.add_element(wlhp, 'CoolingCapacity', to_float(@wlhp_cooling_capacity)) unless @wlhp_cooling_capacity.nil?
2714
- if not @wlhp_cooling_efficiency_eer.nil?
2715
- annual_efficiency = XMLHelper.add_element(wlhp, 'AnnualCoolingEfficiency')
2716
- XMLHelper.add_element(annual_efficiency, 'Units', UnitsEER)
2717
- XMLHelper.add_element(annual_efficiency, 'Value', to_float(@wlhp_cooling_efficiency_eer))
2718
- end
2719
- end
2900
+ XMLHelper.add_element(annual_efficiency, 'Units', efficiency_units, :string)
2901
+ XMLHelper.add_element(annual_efficiency, 'Value', efficiency_value, :float)
2902
+ end
2903
+ XMLHelper.add_element(cooling_system, 'SensibleHeatFraction', @cooling_shr, :float, @cooling_shr_isdefaulted) unless @cooling_shr.nil?
2904
+ XMLHelper.add_extension(cooling_system, 'AirflowDefectRatio', @airflow_defect_ratio, :float, @airflow_defect_ratio_isdefaulted) unless @airflow_defect_ratio.nil?
2905
+ XMLHelper.add_extension(cooling_system, 'ChargeDefectRatio', @charge_defect_ratio, :float, @charge_defect_ratio_isdefaulted) unless @charge_defect_ratio.nil?
2906
+ XMLHelper.add_extension(cooling_system, 'ChargeNotTested', @charge_not_tested, :boolean) unless @charge_not_tested.nil?
2907
+ XMLHelper.add_extension(cooling_system, 'FanPowerWattsPerCFM', @fan_watts_per_cfm, :float, @fan_watts_per_cfm_isdefaulted) unless @fan_watts_per_cfm.nil?
2908
+ XMLHelper.add_extension(cooling_system, 'FanPowerNotTested', @fan_power_not_tested, :boolean) unless @fan_power_not_tested.nil?
2909
+ XMLHelper.add_extension(cooling_system, 'AirflowNotTested', @airflow_not_tested, :boolean) unless @airflow_not_tested.nil?
2910
+ XMLHelper.add_extension(cooling_system, 'CoolingAirflowCFM', @cooling_airflow_cfm, :float, @cooling_airflow_cfm_isdefaulted) unless @cooling_airflow_cfm.nil?
2911
+ XMLHelper.add_extension(cooling_system, 'SharedLoopWatts', @shared_loop_watts, :float) unless @shared_loop_watts.nil?
2912
+ XMLHelper.add_extension(cooling_system, 'SharedLoopMotorEfficiency', @shared_loop_motor_efficiency, :float) unless @shared_loop_motor_efficiency.nil?
2913
+ XMLHelper.add_extension(cooling_system, 'FanCoilWatts', @fan_coil_watts, :float) unless @fan_coil_watts.nil?
2914
+ XMLHelper.add_extension(cooling_system, 'SeedId', @seed_id, :string) unless @seed_id.nil?
2720
2915
  end
2721
2916
 
2722
2917
  def from_oga(cooling_system)
2723
2918
  return if cooling_system.nil?
2724
2919
 
2725
2920
  @id = HPXML::get_id(cooling_system)
2921
+ @location = XMLHelper.get_value(cooling_system, 'UnitLocation', :string)
2922
+ @year_installed = XMLHelper.get_value(cooling_system, 'YearInstalled', :integer)
2923
+ @third_party_certification = XMLHelper.get_value(cooling_system, 'ThirdPartyCertification', :string)
2726
2924
  @distribution_system_idref = HPXML::get_idref(XMLHelper.get_element(cooling_system, 'DistributionSystem'))
2727
- @year_installed = to_integer_or_nil(XMLHelper.get_value(cooling_system, 'YearInstalled'))
2728
- @is_shared_system = to_boolean_or_nil(XMLHelper.get_value(cooling_system, 'IsSharedSystem'))
2729
- @number_of_units_served = to_integer_or_nil(XMLHelper.get_value(cooling_system, 'NumberofUnitsServed'))
2730
- @cooling_system_type = XMLHelper.get_value(cooling_system, 'CoolingSystemType')
2731
- @cooling_system_fuel = XMLHelper.get_value(cooling_system, 'CoolingSystemFuel')
2732
- @cooling_capacity = to_float_or_nil(XMLHelper.get_value(cooling_system, 'CoolingCapacity'))
2733
- @compressor_type = XMLHelper.get_value(cooling_system, 'CompressorType')
2734
- @fraction_cool_load_served = to_float_or_nil(XMLHelper.get_value(cooling_system, 'FractionCoolLoadServed'))
2925
+ @is_shared_system = XMLHelper.get_value(cooling_system, 'IsSharedSystem', :boolean)
2926
+ @number_of_units_served = XMLHelper.get_value(cooling_system, 'NumberofUnitsServed', :integer)
2927
+ @cooling_system_type = XMLHelper.get_value(cooling_system, 'CoolingSystemType', :string)
2928
+ @cooling_system_fuel = XMLHelper.get_value(cooling_system, 'CoolingSystemFuel', :string)
2929
+ @cooling_capacity = XMLHelper.get_value(cooling_system, 'CoolingCapacity', :float)
2930
+ @compressor_type = XMLHelper.get_value(cooling_system, 'CompressorType', :string)
2931
+ @fraction_cool_load_served = XMLHelper.get_value(cooling_system, 'FractionCoolLoadServed', :float)
2735
2932
  if [HVACTypeCentralAirConditioner, HVACTypeMiniSplitAirConditioner].include? @cooling_system_type
2736
- @cooling_efficiency_seer = to_float_or_nil(XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value"))
2933
+ @cooling_efficiency_seer = XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value", :float)
2737
2934
  elsif [HVACTypeRoomAirConditioner].include? @cooling_system_type
2738
- @cooling_efficiency_eer = to_float_or_nil(XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value"))
2935
+ @cooling_efficiency_eer = XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value", :float)
2739
2936
  elsif [HVACTypeChiller].include? @cooling_system_type
2740
- @cooling_efficiency_kw_per_ton = to_float_or_nil(XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsKwPerTon}']/Value"))
2741
- end
2742
- @cooling_shr = to_float_or_nil(XMLHelper.get_value(cooling_system, 'SensibleHeatFraction'))
2743
- @cooling_cfm = to_float_or_nil(XMLHelper.get_value(cooling_system, 'extension/CoolingFlowRate'))
2744
- @energy_star = XMLHelper.get_values(cooling_system, 'ThirdPartyCertification').include?('Energy Star')
2745
- @seed_id = XMLHelper.get_value(cooling_system, 'extension/SeedId')
2746
- @shared_loop_watts = to_float_or_nil(XMLHelper.get_value(cooling_system, 'extension/SharedLoopWatts'))
2747
- @fan_coil_watts = to_float_or_nil(XMLHelper.get_value(cooling_system, 'extension/FanCoilWatts'))
2748
- @wlhp_cooling_capacity = to_float_or_nil(XMLHelper.get_value(cooling_system, 'extension/WaterLoopHeatPump/CoolingCapacity'))
2749
- @wlhp_cooling_efficiency_eer = to_float_or_nil(XMLHelper.get_value(cooling_system, "extension/WaterLoopHeatPump/AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value"))
2937
+ @cooling_efficiency_kw_per_ton = XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsKwPerTon}']/Value", :float)
2938
+ end
2939
+ @cooling_shr = XMLHelper.get_value(cooling_system, 'SensibleHeatFraction', :float)
2940
+ @airflow_defect_ratio = XMLHelper.get_value(cooling_system, 'extension/AirflowDefectRatio', :float)
2941
+ @charge_defect_ratio = XMLHelper.get_value(cooling_system, 'extension/ChargeDefectRatio', :float)
2942
+ @charge_not_tested = XMLHelper.get_value(cooling_system, 'extension/ChargeNotTested', :boolean)
2943
+ @fan_watts_per_cfm = XMLHelper.get_value(cooling_system, 'extension/FanPowerWattsPerCFM', :float)
2944
+ @fan_power_not_tested = XMLHelper.get_value(cooling_system, 'extension/FanPowerNotTested', :boolean)
2945
+ @airflow_not_tested = XMLHelper.get_value(cooling_system, 'extension/AirflowNotTested', :boolean)
2946
+ @cooling_airflow_cfm = XMLHelper.get_value(cooling_system, 'extension/CoolingAirflowCFM', :float)
2947
+ @shared_loop_watts = XMLHelper.get_value(cooling_system, 'extension/SharedLoopWatts', :float)
2948
+ @shared_loop_motor_efficiency = XMLHelper.get_value(cooling_system, 'extension/SharedLoopMotorEfficiency', :float)
2949
+ @fan_coil_watts = XMLHelper.get_value(cooling_system, 'extension/FanCoilWatts', :float)
2950
+ @seed_id = XMLHelper.get_value(cooling_system, 'extension/SeedId', :string)
2750
2951
  end
2751
2952
  end
2752
2953
 
@@ -2779,8 +2980,11 @@ class HPXML < Object
2779
2980
  :backup_heating_efficiency_percent, :backup_heating_efficiency_afue,
2780
2981
  :backup_heating_switchover_temp, :fraction_heat_load_served, :fraction_cool_load_served,
2781
2982
  :cooling_efficiency_seer, :cooling_efficiency_eer, :heating_efficiency_hspf,
2782
- :heating_efficiency_cop, :energy_star, :seed_id, :pump_watts_per_ton, :fan_watts_per_cfm,
2783
- :is_shared_system, :number_of_units_served, :shared_loop_watts]
2983
+ :heating_efficiency_cop, :third_party_certification, :seed_id, :pump_watts_per_ton,
2984
+ :fan_watts_per_cfm, :fan_power_not_tested, :is_shared_system, :number_of_units_served,
2985
+ :shared_loop_watts, :shared_loop_motor_efficiency, :airflow_defect_ratio, :airflow_not_tested,
2986
+ :charge_defect_ratio, :charge_not_tested, :heating_airflow_cfm, :cooling_airflow_cfm,
2987
+ :location]
2784
2988
  attr_accessor(*ATTRS)
2785
2989
 
2786
2990
  def distribution_system
@@ -2816,35 +3020,36 @@ class HPXML < Object
2816
3020
  heat_pump = XMLHelper.add_element(hvac_plant, 'HeatPump')
2817
3021
  sys_id = XMLHelper.add_element(heat_pump, 'SystemIdentifier')
2818
3022
  XMLHelper.add_attribute(sys_id, 'id', @id)
3023
+ XMLHelper.add_element(heat_pump, 'UnitLocation', @location, :string) unless @location.nil?
3024
+ XMLHelper.add_element(heat_pump, 'YearInstalled', @year_installed, :integer) unless @year_installed.nil?
3025
+ XMLHelper.add_element(heat_pump, 'ThirdPartyCertification', @third_party_certification, :string) unless @third_party_certification.nil?
2819
3026
  if not @distribution_system_idref.nil?
2820
3027
  distribution_system = XMLHelper.add_element(heat_pump, 'DistributionSystem')
2821
3028
  XMLHelper.add_attribute(distribution_system, 'idref', @distribution_system_idref)
2822
3029
  end
2823
- XMLHelper.add_element(heat_pump, 'IsSharedSystem', to_boolean(@is_shared_system)) unless @is_shared_system.nil?
2824
- XMLHelper.add_element(heat_pump, 'NumberofUnitsServed', to_integer(@number_of_units_served)) unless @number_of_units_served.nil?
2825
- XMLHelper.add_element(heat_pump, 'HeatPumpType', @heat_pump_type) unless @heat_pump_type.nil?
2826
- XMLHelper.add_element(heat_pump, 'HeatPumpFuel', @heat_pump_fuel) unless @heat_pump_fuel.nil?
2827
- XMLHelper.add_element(heat_pump, 'HeatingCapacity', to_float(@heating_capacity)) unless @heating_capacity.nil?
2828
- XMLHelper.add_element(heat_pump, 'HeatingCapacity17F', to_float(@heating_capacity_17F)) unless @heating_capacity_17F.nil?
2829
- XMLHelper.add_element(heat_pump, 'CoolingCapacity', to_float(@cooling_capacity)) unless @cooling_capacity.nil?
2830
- XMLHelper.add_element(heat_pump, 'CompressorType', @compressor_type) unless @compressor_type.nil?
2831
- XMLHelper.add_element(heat_pump, 'CoolingSensibleHeatFraction', to_float(@cooling_shr)) unless @cooling_shr.nil?
2832
- if not @backup_heating_fuel.nil?
2833
- XMLHelper.add_element(heat_pump, 'BackupSystemFuel', @backup_heating_fuel)
2834
- efficiencies = { 'Percent' => @backup_heating_efficiency_percent,
2835
- UnitsAFUE => @backup_heating_efficiency_afue }
2836
- efficiencies.each do |units, value|
2837
- next if value.nil?
2838
-
2839
- backup_eff = XMLHelper.add_element(heat_pump, 'BackupAnnualHeatingEfficiency')
2840
- XMLHelper.add_element(backup_eff, 'Units', units)
2841
- XMLHelper.add_element(backup_eff, 'Value', to_float(value))
2842
- end
2843
- XMLHelper.add_element(heat_pump, 'BackupHeatingCapacity', to_float(@backup_heating_capacity)) unless @backup_heating_capacity.nil?
2844
- XMLHelper.add_element(heat_pump, 'BackupHeatingSwitchoverTemperature', to_float(@backup_heating_switchover_temp)) unless @backup_heating_switchover_temp.nil?
2845
- end
2846
- XMLHelper.add_element(heat_pump, 'FractionHeatLoadServed', to_float(@fraction_heat_load_served)) unless @fraction_heat_load_served.nil?
2847
- XMLHelper.add_element(heat_pump, 'FractionCoolLoadServed', to_float(@fraction_cool_load_served)) unless @fraction_cool_load_served.nil?
3030
+ XMLHelper.add_element(heat_pump, 'IsSharedSystem', @is_shared_system, :boolean) unless @is_shared_system.nil?
3031
+ XMLHelper.add_element(heat_pump, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
3032
+ XMLHelper.add_element(heat_pump, 'HeatPumpType', @heat_pump_type, :string) unless @heat_pump_type.nil?
3033
+ XMLHelper.add_element(heat_pump, 'HeatPumpFuel', @heat_pump_fuel, :string) unless @heat_pump_fuel.nil?
3034
+ XMLHelper.add_element(heat_pump, 'HeatingCapacity', @heating_capacity, :float, @heating_capacity_isdefaulted) unless @heating_capacity.nil?
3035
+ XMLHelper.add_element(heat_pump, 'HeatingCapacity17F', @heating_capacity_17F, :float) unless @heating_capacity_17F.nil?
3036
+ XMLHelper.add_element(heat_pump, 'CoolingCapacity', @cooling_capacity, :float, @cooling_capacity_isdefaulted) unless @cooling_capacity.nil?
3037
+ XMLHelper.add_element(heat_pump, 'CompressorType', @compressor_type, :string, @compressor_type_isdefaulted) unless @compressor_type.nil?
3038
+ XMLHelper.add_element(heat_pump, 'CoolingSensibleHeatFraction', @cooling_shr, :float, @cooling_shr_isdefaulted) unless @cooling_shr.nil?
3039
+ XMLHelper.add_element(heat_pump, 'BackupSystemFuel', @backup_heating_fuel, :string) unless @backup_heating_fuel.nil?
3040
+ efficiencies = { 'Percent' => @backup_heating_efficiency_percent,
3041
+ UnitsAFUE => @backup_heating_efficiency_afue }
3042
+ efficiencies.each do |units, value|
3043
+ next if value.nil?
3044
+
3045
+ backup_eff = XMLHelper.add_element(heat_pump, 'BackupAnnualHeatingEfficiency')
3046
+ XMLHelper.add_element(backup_eff, 'Units', units, :string)
3047
+ XMLHelper.add_element(backup_eff, 'Value', value, :float)
3048
+ end
3049
+ XMLHelper.add_element(heat_pump, 'BackupHeatingCapacity', @backup_heating_capacity, :float, @backup_heating_capacity_isdefaulted) unless @backup_heating_capacity.nil?
3050
+ XMLHelper.add_element(heat_pump, 'BackupHeatingSwitchoverTemperature', @backup_heating_switchover_temp, :float) unless @backup_heating_switchover_temp.nil?
3051
+ XMLHelper.add_element(heat_pump, 'FractionHeatLoadServed', @fraction_heat_load_served, :float, @fraction_heat_load_served_isdefaulted) unless @fraction_heat_load_served.nil?
3052
+ XMLHelper.add_element(heat_pump, 'FractionCoolLoadServed', @fraction_cool_load_served, :float, @fraction_cool_load_served_isdefaulted) unless @fraction_cool_load_served.nil?
2848
3053
 
2849
3054
  clg_efficiency_units = nil
2850
3055
  clg_efficiency_value = nil
@@ -2855,7 +3060,7 @@ class HPXML < Object
2855
3060
  clg_efficiency_value = @cooling_efficiency_seer
2856
3061
  htg_efficiency_units = UnitsHSPF
2857
3062
  htg_efficiency_value = @heating_efficiency_hspf
2858
- elsif [HVACTypeHeatPumpGroundToAir].include? @heat_pump_type
3063
+ elsif [HVACTypeHeatPumpGroundToAir, HVACTypeHeatPumpWaterLoopToAir].include? @heat_pump_type
2859
3064
  clg_efficiency_units = UnitsEER
2860
3065
  clg_efficiency_value = @cooling_efficiency_eer
2861
3066
  htg_efficiency_units = UnitsCOP
@@ -2863,57 +3068,150 @@ class HPXML < Object
2863
3068
  end
2864
3069
  if not clg_efficiency_value.nil?
2865
3070
  annual_efficiency = XMLHelper.add_element(heat_pump, 'AnnualCoolingEfficiency')
2866
- XMLHelper.add_element(annual_efficiency, 'Units', clg_efficiency_units)
2867
- XMLHelper.add_element(annual_efficiency, 'Value', to_float(clg_efficiency_value))
3071
+ XMLHelper.add_element(annual_efficiency, 'Units', clg_efficiency_units, :string)
3072
+ XMLHelper.add_element(annual_efficiency, 'Value', clg_efficiency_value, :float)
2868
3073
  end
2869
3074
  if not htg_efficiency_value.nil?
2870
3075
  annual_efficiency = XMLHelper.add_element(heat_pump, 'AnnualHeatingEfficiency')
2871
- XMLHelper.add_element(annual_efficiency, 'Units', htg_efficiency_units)
2872
- XMLHelper.add_element(annual_efficiency, 'Value', to_float(htg_efficiency_value))
2873
- end
2874
- XMLHelper.add_extension(heat_pump, 'PumpPowerWattsPerTon', to_float(@pump_watts_per_ton)) unless @pump_watts_per_ton.nil?
2875
- XMLHelper.add_extension(heat_pump, 'FanPowerWattsPerCFM', to_float(@fan_watts_per_cfm)) unless @fan_watts_per_cfm.nil?
2876
- XMLHelper.add_extension(heat_pump, 'SharedLoopWatts', to_float(@shared_loop_watts)) unless @shared_loop_watts.nil?
2877
- XMLHelper.add_extension(heat_pump, 'SeedId', @seed_id) unless @seed_id.nil?
3076
+ XMLHelper.add_element(annual_efficiency, 'Units', htg_efficiency_units, :string)
3077
+ XMLHelper.add_element(annual_efficiency, 'Value', htg_efficiency_value, :float)
3078
+ end
3079
+ XMLHelper.add_extension(heat_pump, 'AirflowDefectRatio', @airflow_defect_ratio, :float, @airflow_defect_ratio_isdefaulted) unless @airflow_defect_ratio.nil?
3080
+ XMLHelper.add_extension(heat_pump, 'ChargeDefectRatio', @charge_defect_ratio, :float, @charge_defect_ratio_isdefaulted) unless @charge_defect_ratio.nil?
3081
+ XMLHelper.add_extension(heat_pump, 'ChargeNotTested', @charge_not_tested, :boolean) unless @charge_not_tested.nil?
3082
+ XMLHelper.add_extension(heat_pump, 'FanPowerWattsPerCFM', @fan_watts_per_cfm, :float, @fan_watts_per_cfm_isdefaulted) unless @fan_watts_per_cfm.nil?
3083
+ XMLHelper.add_extension(heat_pump, 'FanPowerNotTested', @fan_power_not_tested, :boolean) unless @fan_power_not_tested.nil?
3084
+ XMLHelper.add_extension(heat_pump, 'AirflowNotTested', @airflow_not_tested, :boolean) unless @airflow_not_tested.nil?
3085
+ XMLHelper.add_extension(heat_pump, 'HeatingAirflowCFM', @heating_airflow_cfm, :float, @heating_airflow_cfm_isdefaulted) unless @heating_airflow_cfm.nil?
3086
+ XMLHelper.add_extension(heat_pump, 'CoolingAirflowCFM', @cooling_airflow_cfm, :float, @cooling_airflow_cfm_isdefaulted) unless @cooling_airflow_cfm.nil?
3087
+ XMLHelper.add_extension(heat_pump, 'PumpPowerWattsPerTon', @pump_watts_per_ton, :float, @pump_watts_per_ton_isdefaulted) unless @pump_watts_per_ton.nil?
3088
+ XMLHelper.add_extension(heat_pump, 'SharedLoopWatts', @shared_loop_watts, :float) unless @shared_loop_watts.nil?
3089
+ XMLHelper.add_extension(heat_pump, 'SharedLoopMotorEfficiency', @shared_loop_motor_efficiency, :float) unless @shared_loop_motor_efficiency.nil?
3090
+ XMLHelper.add_extension(heat_pump, 'SeedId', @seed_id, :string) unless @seed_id.nil?
2878
3091
  end
2879
3092
 
2880
3093
  def from_oga(heat_pump)
2881
3094
  return if heat_pump.nil?
2882
3095
 
2883
3096
  @id = HPXML::get_id(heat_pump)
3097
+ @location = XMLHelper.get_value(heat_pump, 'UnitLocation', :string)
3098
+ @year_installed = XMLHelper.get_value(heat_pump, 'YearInstalled', :integer)
3099
+ @third_party_certification = XMLHelper.get_value(heat_pump, 'ThirdPartyCertification', :string)
2884
3100
  @distribution_system_idref = HPXML::get_idref(XMLHelper.get_element(heat_pump, 'DistributionSystem'))
2885
- @year_installed = to_integer_or_nil(XMLHelper.get_value(heat_pump, 'YearInstalled'))
2886
- @is_shared_system = to_boolean_or_nil(XMLHelper.get_value(heat_pump, 'IsSharedSystem'))
2887
- @number_of_units_served = to_integer_or_nil(XMLHelper.get_value(heat_pump, 'NumberofUnitsServed'))
2888
- @heat_pump_type = XMLHelper.get_value(heat_pump, 'HeatPumpType')
2889
- @heat_pump_fuel = XMLHelper.get_value(heat_pump, 'HeatPumpFuel')
2890
- @heating_capacity = to_float_or_nil(XMLHelper.get_value(heat_pump, 'HeatingCapacity'))
2891
- @heating_capacity_17F = to_float_or_nil(XMLHelper.get_value(heat_pump, 'HeatingCapacity17F'))
2892
- @cooling_capacity = to_float_or_nil(XMLHelper.get_value(heat_pump, 'CoolingCapacity'))
2893
- @compressor_type = XMLHelper.get_value(heat_pump, 'CompressorType')
2894
- @cooling_shr = to_float_or_nil(XMLHelper.get_value(heat_pump, 'CoolingSensibleHeatFraction'))
2895
- @backup_heating_fuel = XMLHelper.get_value(heat_pump, 'BackupSystemFuel')
2896
- @backup_heating_capacity = to_float_or_nil(XMLHelper.get_value(heat_pump, 'BackupHeatingCapacity'))
2897
- @backup_heating_efficiency_percent = to_float_or_nil(XMLHelper.get_value(heat_pump, "BackupAnnualHeatingEfficiency[Units='Percent']/Value"))
2898
- @backup_heating_efficiency_afue = to_float_or_nil(XMLHelper.get_value(heat_pump, "BackupAnnualHeatingEfficiency[Units='#{UnitsAFUE}']/Value"))
2899
- @backup_heating_switchover_temp = to_float_or_nil(XMLHelper.get_value(heat_pump, 'BackupHeatingSwitchoverTemperature'))
2900
- @fraction_heat_load_served = to_float_or_nil(XMLHelper.get_value(heat_pump, 'FractionHeatLoadServed'))
2901
- @fraction_cool_load_served = to_float_or_nil(XMLHelper.get_value(heat_pump, 'FractionCoolLoadServed'))
3101
+ @is_shared_system = XMLHelper.get_value(heat_pump, 'IsSharedSystem', :boolean)
3102
+ @number_of_units_served = XMLHelper.get_value(heat_pump, 'NumberofUnitsServed', :integer)
3103
+ @heat_pump_type = XMLHelper.get_value(heat_pump, 'HeatPumpType', :string)
3104
+ @heat_pump_fuel = XMLHelper.get_value(heat_pump, 'HeatPumpFuel', :string)
3105
+ @heating_capacity = XMLHelper.get_value(heat_pump, 'HeatingCapacity', :float)
3106
+ @heating_capacity_17F = XMLHelper.get_value(heat_pump, 'HeatingCapacity17F', :float)
3107
+ @cooling_capacity = XMLHelper.get_value(heat_pump, 'CoolingCapacity', :float)
3108
+ @compressor_type = XMLHelper.get_value(heat_pump, 'CompressorType', :string)
3109
+ @cooling_shr = XMLHelper.get_value(heat_pump, 'CoolingSensibleHeatFraction', :float)
3110
+ @backup_heating_fuel = XMLHelper.get_value(heat_pump, 'BackupSystemFuel', :string)
3111
+ @backup_heating_efficiency_percent = XMLHelper.get_value(heat_pump, "BackupAnnualHeatingEfficiency[Units='Percent']/Value", :float)
3112
+ @backup_heating_efficiency_afue = XMLHelper.get_value(heat_pump, "BackupAnnualHeatingEfficiency[Units='#{UnitsAFUE}']/Value", :float)
3113
+ @backup_heating_capacity = XMLHelper.get_value(heat_pump, 'BackupHeatingCapacity', :float)
3114
+ @backup_heating_switchover_temp = XMLHelper.get_value(heat_pump, 'BackupHeatingSwitchoverTemperature', :float)
3115
+ @fraction_heat_load_served = XMLHelper.get_value(heat_pump, 'FractionHeatLoadServed', :float)
3116
+ @fraction_cool_load_served = XMLHelper.get_value(heat_pump, 'FractionCoolLoadServed', :float)
2902
3117
  if [HVACTypeHeatPumpAirToAir, HVACTypeHeatPumpMiniSplit].include? @heat_pump_type
2903
- @cooling_efficiency_seer = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value"))
2904
- elsif [HVACTypeHeatPumpGroundToAir].include? @heat_pump_type
2905
- @cooling_efficiency_eer = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value"))
3118
+ @cooling_efficiency_seer = XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value", :float)
3119
+ elsif [HVACTypeHeatPumpGroundToAir, HVACTypeHeatPumpWaterLoopToAir].include? @heat_pump_type
3120
+ @cooling_efficiency_eer = XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value", :float)
2906
3121
  end
2907
3122
  if [HVACTypeHeatPumpAirToAir, HVACTypeHeatPumpMiniSplit].include? @heat_pump_type
2908
- @heating_efficiency_hspf = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsHSPF}']/Value"))
2909
- elsif [HVACTypeHeatPumpGroundToAir].include? @heat_pump_type
2910
- @heating_efficiency_cop = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value"))
3123
+ @heating_efficiency_hspf = XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsHSPF}']/Value", :float)
3124
+ elsif [HVACTypeHeatPumpGroundToAir, HVACTypeHeatPumpWaterLoopToAir].include? @heat_pump_type
3125
+ @heating_efficiency_cop = XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value", :float)
3126
+ end
3127
+ @airflow_defect_ratio = XMLHelper.get_value(heat_pump, 'extension/AirflowDefectRatio', :float)
3128
+ @charge_defect_ratio = XMLHelper.get_value(heat_pump, 'extension/ChargeDefectRatio', :float)
3129
+ @charge_not_tested = XMLHelper.get_value(heat_pump, 'extension/ChargeNotTested', :boolean)
3130
+ @fan_watts_per_cfm = XMLHelper.get_value(heat_pump, 'extension/FanPowerWattsPerCFM', :float)
3131
+ @fan_power_not_tested = XMLHelper.get_value(heat_pump, 'extension/FanPowerNotTested', :boolean)
3132
+ @airflow_not_tested = XMLHelper.get_value(heat_pump, 'extension/AirflowNotTested', :boolean)
3133
+ @heating_airflow_cfm = XMLHelper.get_value(heat_pump, 'extension/HeatingAirflowCFM', :float)
3134
+ @cooling_airflow_cfm = XMLHelper.get_value(heat_pump, 'extension/CoolingAirflowCFM', :float)
3135
+ @pump_watts_per_ton = XMLHelper.get_value(heat_pump, 'extension/PumpPowerWattsPerTon', :float)
3136
+ @shared_loop_watts = XMLHelper.get_value(heat_pump, 'extension/SharedLoopWatts', :float)
3137
+ @shared_loop_motor_efficiency = XMLHelper.get_value(heat_pump, 'extension/SharedLoopMotorEfficiency', :float)
3138
+ @seed_id = XMLHelper.get_value(heat_pump, 'extension/SeedId', :string)
3139
+ end
3140
+ end
3141
+
3142
+ class HVACPlant < BaseElement
3143
+ HDL_ATTRS = { hdl_total: 'Total',
3144
+ hdl_ducts: 'Ducts',
3145
+ hdl_windows: 'Windows',
3146
+ hdl_skylights: 'Skylights',
3147
+ hdl_doors: 'Doors',
3148
+ hdl_walls: 'Walls',
3149
+ hdl_roofs: 'Roofs',
3150
+ hdl_floors: 'Floors',
3151
+ hdl_slabs: 'Slabs',
3152
+ hdl_ceilings: 'Ceilings',
3153
+ hdl_infilvent: 'InfilVent' }
3154
+ CDL_SENS_ATTRS = { cdl_sens_total: 'Total',
3155
+ cdl_sens_ducts: 'Ducts',
3156
+ cdl_sens_windows: 'Windows',
3157
+ cdl_sens_skylights: 'Skylights',
3158
+ cdl_sens_doors: 'Doors',
3159
+ cdl_sens_walls: 'Walls',
3160
+ cdl_sens_roofs: 'Roofs',
3161
+ cdl_sens_floors: 'Floors',
3162
+ cdl_sens_slabs: 'Slabs',
3163
+ cdl_sens_ceilings: 'Ceilings',
3164
+ cdl_sens_infilvent: 'InfilVent',
3165
+ cdl_sens_intgains: 'InternalGains' }
3166
+ CDL_LAT_ATTRS = { cdl_lat_total: 'Total',
3167
+ cdl_lat_ducts: 'Ducts',
3168
+ cdl_lat_infilvent: 'InfilVent',
3169
+ cdl_lat_intgains: 'InternalGains' }
3170
+ ATTRS = HDL_ATTRS.keys + CDL_SENS_ATTRS.keys + CDL_LAT_ATTRS.keys
3171
+ attr_accessor(*ATTRS)
3172
+
3173
+ def check_for_errors
3174
+ errors = []
3175
+ return errors
3176
+ end
3177
+
3178
+ def to_oga(doc)
3179
+ return if nil?
3180
+
3181
+ hvac_plant = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'Systems', 'HVAC', 'HVACPlant'])
3182
+ if not @hdl_total.nil?
3183
+ dl_extension = XMLHelper.create_elements_as_needed(hvac_plant, ['extension', 'DesignLoads'])
3184
+ XMLHelper.add_attribute(dl_extension, 'dataSource', 'software')
3185
+ hdl = XMLHelper.add_element(dl_extension, 'Heating')
3186
+ HDL_ATTRS.each do |attr, element_name|
3187
+ XMLHelper.add_element(hdl, element_name, send(attr), :float)
3188
+ end
3189
+ cdl_sens = XMLHelper.add_element(dl_extension, 'CoolingSensible')
3190
+ CDL_SENS_ATTRS.each do |attr, element_name|
3191
+ XMLHelper.add_element(cdl_sens, element_name, send(attr), :float)
3192
+ end
3193
+ cdl_lat = XMLHelper.add_element(dl_extension, 'CoolingLatent')
3194
+ CDL_LAT_ATTRS.each do |attr, element_name|
3195
+ XMLHelper.add_element(cdl_lat, element_name, send(attr), :float)
3196
+ end
3197
+ end
3198
+ end
3199
+
3200
+ def from_oga(hpxml)
3201
+ return if hpxml.nil?
3202
+
3203
+ hvac_plant = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/Systems/HVAC/HVACPlant')
3204
+ return if hvac_plant.nil?
3205
+
3206
+ HDL_ATTRS.each do |attr, element_name|
3207
+ send("#{attr.to_s}=", XMLHelper.get_value(hvac_plant, "extension/DesignLoads/Heating/#{element_name}", :float))
3208
+ end
3209
+ CDL_SENS_ATTRS.each do |attr, element_name|
3210
+ send("#{attr.to_s}=", XMLHelper.get_value(hvac_plant, "extension/DesignLoads/CoolingSensible/#{element_name}", :float))
3211
+ end
3212
+ CDL_LAT_ATTRS.each do |attr, element_name|
3213
+ send("#{attr.to_s}=", XMLHelper.get_value(hvac_plant, "extension/DesignLoads/CoolingLatent/#{element_name}", :float))
2911
3214
  end
2912
- @energy_star = XMLHelper.get_values(heat_pump, 'ThirdPartyCertification').include?('Energy Star')
2913
- @pump_watts_per_ton = to_float_or_nil(XMLHelper.get_value(heat_pump, 'extension/PumpPowerWattsPerTon'))
2914
- @fan_watts_per_cfm = to_float_or_nil(XMLHelper.get_value(heat_pump, 'extension/FanPowerWattsPerCFM'))
2915
- @seed_id = XMLHelper.get_value(heat_pump, 'extension/SeedId')
2916
- @shared_loop_watts = to_float_or_nil(XMLHelper.get_value(heat_pump, 'extension/SharedLoopWatts'))
2917
3215
  end
2918
3216
  end
2919
3217
 
@@ -2935,7 +3233,9 @@ class HPXML < Object
2935
3233
  ATTRS = [:id, :control_type, :heating_setpoint_temp, :heating_setback_temp,
2936
3234
  :heating_setback_hours_per_week, :heating_setback_start_hour, :cooling_setpoint_temp,
2937
3235
  :cooling_setup_temp, :cooling_setup_hours_per_week, :cooling_setup_start_hour,
2938
- :ceiling_fan_cooling_setpoint_temp_offset]
3236
+ :ceiling_fan_cooling_setpoint_temp_offset,
3237
+ :weekday_heating_setpoints, :weekend_heating_setpoints,
3238
+ :weekday_cooling_setpoints, :weekend_cooling_setpoints]
2939
3239
  attr_accessor(*ATTRS)
2940
3240
 
2941
3241
  def delete
@@ -2954,32 +3254,40 @@ class HPXML < Object
2954
3254
  hvac_control = XMLHelper.add_element(hvac, 'HVACControl')
2955
3255
  sys_id = XMLHelper.add_element(hvac_control, 'SystemIdentifier')
2956
3256
  XMLHelper.add_attribute(sys_id, 'id', @id)
2957
- XMLHelper.add_element(hvac_control, 'ControlType', @control_type) unless @control_type.nil?
2958
- XMLHelper.add_element(hvac_control, 'SetpointTempHeatingSeason', to_float(@heating_setpoint_temp)) unless @heating_setpoint_temp.nil?
2959
- XMLHelper.add_element(hvac_control, 'SetbackTempHeatingSeason', to_float(@heating_setback_temp)) unless @heating_setback_temp.nil?
2960
- XMLHelper.add_element(hvac_control, 'TotalSetbackHoursperWeekHeating', to_integer(@heating_setback_hours_per_week)) unless @heating_setback_hours_per_week.nil?
2961
- XMLHelper.add_element(hvac_control, 'SetupTempCoolingSeason', to_float(@cooling_setup_temp)) unless @cooling_setup_temp.nil?
2962
- XMLHelper.add_element(hvac_control, 'SetpointTempCoolingSeason', to_float(@cooling_setpoint_temp)) unless @cooling_setpoint_temp.nil?
2963
- XMLHelper.add_element(hvac_control, 'TotalSetupHoursperWeekCooling', to_integer(@cooling_setup_hours_per_week)) unless @cooling_setup_hours_per_week.nil?
2964
- XMLHelper.add_extension(hvac_control, 'SetbackStartHourHeating', to_integer(@heating_setback_start_hour)) unless @heating_setback_start_hour.nil?
2965
- XMLHelper.add_extension(hvac_control, 'SetupStartHourCooling', to_integer(@cooling_setup_start_hour)) unless @cooling_setup_start_hour.nil?
2966
- XMLHelper.add_extension(hvac_control, 'CeilingFanSetpointTempCoolingSeasonOffset', to_float(@ceiling_fan_cooling_setpoint_temp_offset)) unless @ceiling_fan_cooling_setpoint_temp_offset.nil?
3257
+ XMLHelper.add_element(hvac_control, 'ControlType', @control_type, :string) unless @control_type.nil?
3258
+ XMLHelper.add_element(hvac_control, 'SetpointTempHeatingSeason', @heating_setpoint_temp, :float) unless @heating_setpoint_temp.nil?
3259
+ XMLHelper.add_element(hvac_control, 'SetbackTempHeatingSeason', @heating_setback_temp, :float) unless @heating_setback_temp.nil?
3260
+ XMLHelper.add_element(hvac_control, 'TotalSetbackHoursperWeekHeating', @heating_setback_hours_per_week, :integer) unless @heating_setback_hours_per_week.nil?
3261
+ XMLHelper.add_element(hvac_control, 'SetupTempCoolingSeason', @cooling_setup_temp, :float) unless @cooling_setup_temp.nil?
3262
+ XMLHelper.add_element(hvac_control, 'SetpointTempCoolingSeason', @cooling_setpoint_temp, :float) unless @cooling_setpoint_temp.nil?
3263
+ XMLHelper.add_element(hvac_control, 'TotalSetupHoursperWeekCooling', @cooling_setup_hours_per_week, :integer) unless @cooling_setup_hours_per_week.nil?
3264
+ XMLHelper.add_extension(hvac_control, 'SetbackStartHourHeating', @heating_setback_start_hour, :integer, @heating_setback_start_hour_isdefaulted) unless @heating_setback_start_hour.nil?
3265
+ XMLHelper.add_extension(hvac_control, 'SetupStartHourCooling', @cooling_setup_start_hour, :integer, @cooling_setup_start_hour_isdefaulted) unless @cooling_setup_start_hour.nil?
3266
+ XMLHelper.add_extension(hvac_control, 'CeilingFanSetpointTempCoolingSeasonOffset', @ceiling_fan_cooling_setpoint_temp_offset, :float) unless @ceiling_fan_cooling_setpoint_temp_offset.nil?
3267
+ XMLHelper.add_extension(hvac_control, 'WeekdaySetpointTempsHeatingSeason', @weekday_heating_setpoints, :string) unless @weekday_heating_setpoints.nil?
3268
+ XMLHelper.add_extension(hvac_control, 'WeekendSetpointTempsHeatingSeason', @weekend_heating_setpoints, :string) unless @weekend_heating_setpoints.nil?
3269
+ XMLHelper.add_extension(hvac_control, 'WeekdaySetpointTempsCoolingSeason', @weekday_cooling_setpoints, :string) unless @weekday_cooling_setpoints.nil?
3270
+ XMLHelper.add_extension(hvac_control, 'WeekendSetpointTempsCoolingSeason', @weekend_cooling_setpoints, :string) unless @weekend_cooling_setpoints.nil?
2967
3271
  end
2968
3272
 
2969
3273
  def from_oga(hvac_control)
2970
3274
  return if hvac_control.nil?
2971
3275
 
2972
3276
  @id = HPXML::get_id(hvac_control)
2973
- @control_type = XMLHelper.get_value(hvac_control, 'ControlType')
2974
- @heating_setpoint_temp = to_float_or_nil(XMLHelper.get_value(hvac_control, 'SetpointTempHeatingSeason'))
2975
- @heating_setback_temp = to_float_or_nil(XMLHelper.get_value(hvac_control, 'SetbackTempHeatingSeason'))
2976
- @heating_setback_hours_per_week = to_integer_or_nil(XMLHelper.get_value(hvac_control, 'TotalSetbackHoursperWeekHeating'))
2977
- @heating_setback_start_hour = to_integer_or_nil(XMLHelper.get_value(hvac_control, 'extension/SetbackStartHourHeating'))
2978
- @cooling_setpoint_temp = to_float_or_nil(XMLHelper.get_value(hvac_control, 'SetpointTempCoolingSeason'))
2979
- @cooling_setup_temp = to_float_or_nil(XMLHelper.get_value(hvac_control, 'SetupTempCoolingSeason'))
2980
- @cooling_setup_hours_per_week = to_integer_or_nil(XMLHelper.get_value(hvac_control, 'TotalSetupHoursperWeekCooling'))
2981
- @cooling_setup_start_hour = to_integer_or_nil(XMLHelper.get_value(hvac_control, 'extension/SetupStartHourCooling'))
2982
- @ceiling_fan_cooling_setpoint_temp_offset = to_float_or_nil(XMLHelper.get_value(hvac_control, 'extension/CeilingFanSetpointTempCoolingSeasonOffset'))
3277
+ @control_type = XMLHelper.get_value(hvac_control, 'ControlType', :string)
3278
+ @heating_setpoint_temp = XMLHelper.get_value(hvac_control, 'SetpointTempHeatingSeason', :float)
3279
+ @heating_setback_temp = XMLHelper.get_value(hvac_control, 'SetbackTempHeatingSeason', :float)
3280
+ @heating_setback_hours_per_week = XMLHelper.get_value(hvac_control, 'TotalSetbackHoursperWeekHeating', :integer)
3281
+ @cooling_setup_temp = XMLHelper.get_value(hvac_control, 'SetupTempCoolingSeason', :float)
3282
+ @cooling_setpoint_temp = XMLHelper.get_value(hvac_control, 'SetpointTempCoolingSeason', :float)
3283
+ @cooling_setup_hours_per_week = XMLHelper.get_value(hvac_control, 'TotalSetupHoursperWeekCooling', :integer)
3284
+ @heating_setback_start_hour = XMLHelper.get_value(hvac_control, 'extension/SetbackStartHourHeating', :integer)
3285
+ @cooling_setup_start_hour = XMLHelper.get_value(hvac_control, 'extension/SetupStartHourCooling', :integer)
3286
+ @ceiling_fan_cooling_setpoint_temp_offset = XMLHelper.get_value(hvac_control, 'extension/CeilingFanSetpointTempCoolingSeasonOffset', :float)
3287
+ @weekday_heating_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekdaySetpointTempsHeatingSeason', :string)
3288
+ @weekend_heating_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekendSetpointTempsHeatingSeason', :string)
3289
+ @weekday_cooling_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekdaySetpointTempsCoolingSeason', :string)
3290
+ @weekend_cooling_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekendSetpointTempsCoolingSeason', :string)
2983
3291
  end
2984
3292
  end
2985
3293
 
@@ -3005,13 +3313,13 @@ class HPXML < Object
3005
3313
  end
3006
3314
  ATTRS = [:id, :distribution_system_type, :annual_heating_dse, :annual_cooling_dse,
3007
3315
  :duct_system_sealed, :duct_leakage_to_outside_testing_exemption, :conditioned_floor_area_served,
3008
- :number_of_return_registers, :hydronic_type, :hydronic_and_air_type]
3316
+ :number_of_return_registers, :air_type, :hydronic_type]
3009
3317
  attr_accessor(*ATTRS)
3010
3318
  attr_reader(:duct_leakage_measurements, :ducts)
3011
3319
 
3012
3320
  def hvac_systems
3013
3321
  list = []
3014
- (@hpxml_object.heating_systems + @hpxml_object.cooling_systems + @hpxml_object.heat_pumps).each do |hvac_system|
3322
+ @hpxml_object.hvac_systems.each do |hvac_system|
3015
3323
  next if hvac_system.distribution_system_idref.nil?
3016
3324
  next unless hvac_system.distribution_system_idref == @id
3017
3325
 
@@ -3043,9 +3351,21 @@ class HPXML < Object
3043
3351
  return list
3044
3352
  end
3045
3353
 
3354
+ def total_unconditioned_duct_areas
3355
+ areas = { HPXML::DuctTypeSupply => 0,
3356
+ HPXML::DuctTypeReturn => 0 }
3357
+ @ducts.each do |duct|
3358
+ next if [HPXML::LocationLivingSpace, HPXML::LocationBasementConditioned].include? duct.duct_location
3359
+ next if duct.duct_type.nil?
3360
+
3361
+ areas[duct.duct_type] += duct.duct_surface_area
3362
+ end
3363
+ return areas
3364
+ end
3365
+
3046
3366
  def delete
3047
3367
  @hpxml_object.hvac_distributions.delete(self)
3048
- (@hpxml_object.heating_systems + @hpxml_object.cooling_systems + @hpxml_object.heat_pumps).each do |hvac_system|
3368
+ @hpxml_object.hvac_systems.each do |hvac_system|
3049
3369
  next if hvac_system.distribution_system_idref.nil?
3050
3370
  next unless hvac_system.distribution_system_idref == @id
3051
3371
 
@@ -3073,36 +3393,34 @@ class HPXML < Object
3073
3393
  hvac_distribution = XMLHelper.add_element(hvac, 'HVACDistribution')
3074
3394
  sys_id = XMLHelper.add_element(hvac_distribution, 'SystemIdentifier')
3075
3395
  XMLHelper.add_attribute(sys_id, 'id', @id)
3076
- distribution_system_type_e = XMLHelper.add_element(hvac_distribution, 'DistributionSystemType')
3077
- if [HVACDistributionTypeAir, HVACDistributionTypeHydronic, HVACDistributionTypeHydronicAndAir].include? @distribution_system_type
3078
- XMLHelper.add_element(distribution_system_type_e, @distribution_system_type)
3079
- XMLHelper.add_element(hvac_distribution, 'ConditionedFloorAreaServed', Float(@conditioned_floor_area_served)) unless @conditioned_floor_area_served.nil?
3396
+ distribution_system_type_el = XMLHelper.add_element(hvac_distribution, 'DistributionSystemType')
3397
+ if [HVACDistributionTypeAir, HVACDistributionTypeHydronic].include? @distribution_system_type
3398
+ XMLHelper.add_element(distribution_system_type_el, @distribution_system_type)
3399
+ XMLHelper.add_element(hvac_distribution, 'ConditionedFloorAreaServed', @conditioned_floor_area_served, :float) unless @conditioned_floor_area_served.nil?
3080
3400
  elsif [HVACDistributionTypeDSE].include? @distribution_system_type
3081
- XMLHelper.add_element(distribution_system_type_e, 'Other', @distribution_system_type)
3082
- XMLHelper.add_element(hvac_distribution, 'AnnualHeatingDistributionSystemEfficiency', to_float(@annual_heating_dse)) unless @annual_heating_dse.nil?
3083
- XMLHelper.add_element(hvac_distribution, 'AnnualCoolingDistributionSystemEfficiency', to_float(@annual_cooling_dse)) unless @annual_cooling_dse.nil?
3401
+ XMLHelper.add_element(distribution_system_type_el, 'Other', @distribution_system_type, :string)
3402
+ XMLHelper.add_element(hvac_distribution, 'AnnualHeatingDistributionSystemEfficiency', @annual_heating_dse, :float) unless @annual_heating_dse.nil?
3403
+ XMLHelper.add_element(hvac_distribution, 'AnnualCoolingDistributionSystemEfficiency', @annual_cooling_dse, :float) unless @annual_cooling_dse.nil?
3084
3404
  else
3085
3405
  fail "Unexpected distribution_system_type '#{@distribution_system_type}'."
3086
3406
  end
3087
3407
 
3088
3408
  if [HPXML::HVACDistributionTypeHydronic].include? @distribution_system_type
3089
3409
  distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicDistribution')
3090
- XMLHelper.add_element(distribution, 'HydronicDistributionType', @hydronic_type) unless @hydronic_type.nil?
3091
- end
3092
- if [HPXML::HVACDistributionTypeHydronicAndAir].include? @distribution_system_type
3093
- distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicAndAirDistribution')
3094
- XMLHelper.add_element(distribution, 'HydronicAndAirDistributionType', @hydronic_and_air_type) unless @hydronic_and_air_type.nil?
3410
+ XMLHelper.add_element(distribution, 'HydronicDistributionType', @hydronic_type, :string) unless @hydronic_type.nil?
3095
3411
  end
3096
- if [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeHydronicAndAir].include? @distribution_system_type
3097
- if @distribution_system_type == HPXML::HVACDistributionTypeAir
3098
- distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/AirDistribution')
3099
- elsif @distribution_system_type == HPXML::HVACDistributionTypeHydronicAndAir
3100
- distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicAndAirDistribution')
3101
- end
3412
+ if [HPXML::HVACDistributionTypeAir].include? @distribution_system_type
3413
+ distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/AirDistribution')
3414
+ XMLHelper.add_element(distribution, 'AirDistributionType', @air_type, :string) unless @air_type.nil?
3102
3415
  @duct_leakage_measurements.to_oga(distribution)
3103
3416
  @ducts.to_oga(distribution)
3104
- XMLHelper.add_element(distribution, 'NumberofReturnRegisters', Integer(@number_of_return_registers)) unless @number_of_return_registers.nil?
3105
- XMLHelper.add_extension(distribution, 'DuctLeakageToOutsideTestingExemption', to_boolean(@duct_leakage_to_outside_testing_exemption)) unless @duct_leakage_to_outside_testing_exemption.nil?
3417
+ XMLHelper.add_element(distribution, 'NumberofReturnRegisters', @number_of_return_registers, :integer, @number_of_return_registers_isdefaulted) unless @number_of_return_registers.nil?
3418
+ XMLHelper.add_extension(distribution, 'DuctLeakageToOutsideTestingExemption', @duct_leakage_to_outside_testing_exemption, :boolean) unless @duct_leakage_to_outside_testing_exemption.nil?
3419
+ end
3420
+
3421
+ if not @duct_system_sealed.nil?
3422
+ dist_impr_el = XMLHelper.add_element(hvac_distribution, 'HVACDistributionImprovement')
3423
+ XMLHelper.add_element(dist_impr_el, 'DuctSystemSealed', @duct_system_sealed, :boolean)
3106
3424
  end
3107
3425
  end
3108
3426
 
@@ -3112,30 +3430,25 @@ class HPXML < Object
3112
3430
  @id = HPXML::get_id(hvac_distribution)
3113
3431
  @distribution_system_type = XMLHelper.get_child_name(hvac_distribution, 'DistributionSystemType')
3114
3432
  if @distribution_system_type == 'Other'
3115
- @distribution_system_type = XMLHelper.get_value(XMLHelper.get_element(hvac_distribution, 'DistributionSystemType'), 'Other')
3433
+ @distribution_system_type = XMLHelper.get_value(XMLHelper.get_element(hvac_distribution, 'DistributionSystemType'), 'Other', :string)
3116
3434
  end
3117
- @annual_heating_dse = to_float_or_nil(XMLHelper.get_value(hvac_distribution, 'AnnualHeatingDistributionSystemEfficiency'))
3118
- @annual_cooling_dse = to_float_or_nil(XMLHelper.get_value(hvac_distribution, 'AnnualCoolingDistributionSystemEfficiency'))
3119
- @duct_system_sealed = to_boolean_or_nil(XMLHelper.get_value(hvac_distribution, 'HVACDistributionImprovement/DuctSystemSealed'))
3120
- @conditioned_floor_area_served = to_float_or_nil(XMLHelper.get_value(hvac_distribution, 'ConditionedFloorAreaServed'))
3435
+ @annual_heating_dse = XMLHelper.get_value(hvac_distribution, 'AnnualHeatingDistributionSystemEfficiency', :float)
3436
+ @annual_cooling_dse = XMLHelper.get_value(hvac_distribution, 'AnnualCoolingDistributionSystemEfficiency', :float)
3437
+ @duct_system_sealed = XMLHelper.get_value(hvac_distribution, 'HVACDistributionImprovement/DuctSystemSealed', :boolean)
3438
+ @conditioned_floor_area_served = XMLHelper.get_value(hvac_distribution, 'ConditionedFloorAreaServed', :float)
3121
3439
 
3122
3440
  air_distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/AirDistribution')
3123
3441
  hydronic_distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicDistribution')
3124
- hydronic_and_air_distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicAndAirDistribution')
3125
3442
 
3126
3443
  if not hydronic_distribution.nil?
3127
- @hydronic_type = XMLHelper.get_value(hydronic_distribution, 'HydronicDistributionType')
3128
- end
3129
- if not hydronic_and_air_distribution.nil?
3130
- @hydronic_and_air_type = XMLHelper.get_value(hydronic_and_air_distribution, 'HydronicAndAirDistributionType')
3444
+ @hydronic_type = XMLHelper.get_value(hydronic_distribution, 'HydronicDistributionType', :string)
3131
3445
  end
3132
- if (not air_distribution.nil?) || (not hydronic_and_air_distribution.nil?)
3133
- distribution = air_distribution
3134
- distribution = hydronic_and_air_distribution if distribution.nil?
3135
- @number_of_return_registers = to_integer_or_nil(XMLHelper.get_value(distribution, 'NumberofReturnRegisters'))
3136
- @duct_leakage_to_outside_testing_exemption = to_boolean_or_nil(XMLHelper.get_value(distribution, 'extension/DuctLeakageToOutsideTestingExemption'))
3137
- @duct_leakage_measurements.from_oga(distribution)
3138
- @ducts.from_oga(distribution)
3446
+ if not air_distribution.nil?
3447
+ @air_type = XMLHelper.get_value(air_distribution, 'AirDistributionType', :string)
3448
+ @number_of_return_registers = XMLHelper.get_value(air_distribution, 'NumberofReturnRegisters', :integer)
3449
+ @duct_leakage_to_outside_testing_exemption = XMLHelper.get_value(air_distribution, 'extension/DuctLeakageToOutsideTestingExemption', :boolean)
3450
+ @duct_leakage_measurements.from_oga(air_distribution)
3451
+ @ducts.from_oga(air_distribution)
3139
3452
  end
3140
3453
  end
3141
3454
  end
@@ -3174,23 +3487,24 @@ class HPXML < Object
3174
3487
 
3175
3488
  def to_oga(air_distribution)
3176
3489
  duct_leakage_measurement_el = XMLHelper.add_element(air_distribution, 'DuctLeakageMeasurement')
3177
- XMLHelper.add_element(duct_leakage_measurement_el, 'DuctType', @duct_type) unless @duct_type.nil?
3490
+ XMLHelper.add_element(duct_leakage_measurement_el, 'DuctType', @duct_type, :string) unless @duct_type.nil?
3491
+ XMLHelper.add_element(duct_leakage_measurement_el, 'DuctLeakageTestMethod', @duct_leakage_test_method, :string) unless @duct_leakage_test_method.nil?
3178
3492
  if not @duct_leakage_value.nil?
3179
3493
  duct_leakage_el = XMLHelper.add_element(duct_leakage_measurement_el, 'DuctLeakage')
3180
- XMLHelper.add_element(duct_leakage_el, 'Units', @duct_leakage_units) unless @duct_leakage_units.nil?
3181
- XMLHelper.add_element(duct_leakage_el, 'Value', to_float(@duct_leakage_value))
3182
- XMLHelper.add_element(duct_leakage_el, 'TotalOrToOutside', @duct_leakage_total_or_to_outside) unless @duct_leakage_total_or_to_outside.nil?
3494
+ XMLHelper.add_element(duct_leakage_el, 'Units', @duct_leakage_units, :string) unless @duct_leakage_units.nil?
3495
+ XMLHelper.add_element(duct_leakage_el, 'Value', @duct_leakage_value, :float)
3496
+ XMLHelper.add_element(duct_leakage_el, 'TotalOrToOutside', @duct_leakage_total_or_to_outside, :string) unless @duct_leakage_total_or_to_outside.nil?
3183
3497
  end
3184
3498
  end
3185
3499
 
3186
3500
  def from_oga(duct_leakage_measurement)
3187
3501
  return if duct_leakage_measurement.nil?
3188
3502
 
3189
- @duct_type = XMLHelper.get_value(duct_leakage_measurement, 'DuctType')
3190
- @duct_leakage_test_method = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakageTestMethod')
3191
- @duct_leakage_units = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/Units')
3192
- @duct_leakage_value = to_float_or_nil(XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/Value'))
3193
- @duct_leakage_total_or_to_outside = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/TotalOrToOutside')
3503
+ @duct_type = XMLHelper.get_value(duct_leakage_measurement, 'DuctType', :string)
3504
+ @duct_leakage_test_method = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakageTestMethod', :string)
3505
+ @duct_leakage_units = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/Units', :string)
3506
+ @duct_leakage_value = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/Value', :float)
3507
+ @duct_leakage_total_or_to_outside = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/TotalOrToOutside', :string)
3194
3508
  end
3195
3509
  end
3196
3510
 
@@ -3228,21 +3542,26 @@ class HPXML < Object
3228
3542
 
3229
3543
  def to_oga(air_distribution)
3230
3544
  ducts_el = XMLHelper.add_element(air_distribution, 'Ducts')
3231
- XMLHelper.add_element(ducts_el, 'DuctType', @duct_type) unless @duct_type.nil?
3232
- XMLHelper.add_element(ducts_el, 'DuctInsulationRValue', to_float(@duct_insulation_r_value)) unless @duct_insulation_r_value.nil?
3233
- XMLHelper.add_element(ducts_el, 'DuctLocation', @duct_location) unless @duct_location.nil?
3234
- XMLHelper.add_element(ducts_el, 'DuctSurfaceArea', to_float(@duct_surface_area)) unless @duct_surface_area.nil?
3545
+ XMLHelper.add_element(ducts_el, 'DuctType', @duct_type, :string) unless @duct_type.nil?
3546
+ if not @duct_insulation_material.nil?
3547
+ ins_material_el = XMLHelper.add_element(ducts_el, 'DuctInsulationMaterial')
3548
+ XMLHelper.add_element(ins_material_el, @duct_insulation_material)
3549
+ end
3550
+ XMLHelper.add_element(ducts_el, 'DuctInsulationRValue', @duct_insulation_r_value, :float) unless @duct_insulation_r_value.nil?
3551
+ XMLHelper.add_element(ducts_el, 'DuctLocation', @duct_location, :string, @duct_location_isdefaulted) unless @duct_location.nil?
3552
+ XMLHelper.add_element(ducts_el, 'FractionDuctArea', @duct_fraction_area, :float) unless @duct_fraction_area.nil?
3553
+ XMLHelper.add_element(ducts_el, 'DuctSurfaceArea', @duct_surface_area, :float, @duct_surface_area_isdefaulted) unless @duct_surface_area.nil?
3235
3554
  end
3236
3555
 
3237
3556
  def from_oga(duct)
3238
3557
  return if duct.nil?
3239
3558
 
3240
- @duct_type = XMLHelper.get_value(duct, 'DuctType')
3241
- @duct_insulation_r_value = to_float_or_nil(XMLHelper.get_value(duct, 'DuctInsulationRValue'))
3559
+ @duct_type = XMLHelper.get_value(duct, 'DuctType', :string)
3242
3560
  @duct_insulation_material = XMLHelper.get_child_name(duct, 'DuctInsulationMaterial')
3243
- @duct_location = XMLHelper.get_value(duct, 'DuctLocation')
3244
- @duct_fraction_area = to_float_or_nil(XMLHelper.get_value(duct, 'FractionDuctArea'))
3245
- @duct_surface_area = to_float_or_nil(XMLHelper.get_value(duct, 'DuctSurfaceArea'))
3561
+ @duct_insulation_r_value = XMLHelper.get_value(duct, 'DuctInsulationRValue', :float)
3562
+ @duct_location = XMLHelper.get_value(duct, 'DuctLocation', :string)
3563
+ @duct_fraction_area = XMLHelper.get_value(duct, 'FractionDuctArea', :float)
3564
+ @duct_surface_area = XMLHelper.get_value(duct, 'DuctSurfaceArea', :float)
3246
3565
  end
3247
3566
  end
3248
3567
 
@@ -3268,7 +3587,7 @@ class HPXML < Object
3268
3587
  :fan_power, :fan_power_defaulted, :quantity, :fan_location, :distribution_system_idref, :start_hour,
3269
3588
  :is_shared_system, :in_unit_flow_rate, :fraction_recirculation,
3270
3589
  :preheating_fuel, :preheating_efficiency_cop, :preheating_fraction_load_served, :precooling_fuel,
3271
- :precooling_efficiency_cop, :precooling_fraction_load_served,]
3590
+ :precooling_efficiency_cop, :precooling_fraction_load_served]
3272
3591
  attr_accessor(*ATTRS)
3273
3592
 
3274
3593
  def distribution_system
@@ -3316,6 +3635,7 @@ class HPXML < Object
3316
3635
  # Daily-average outdoor air (cfm) associated with the unit
3317
3636
  return if oa_unit_flow_rate.nil?
3318
3637
  return if @hours_in_operation.nil?
3638
+
3319
3639
  return oa_unit_flow_rate * (@hours_in_operation / 24.0)
3320
3640
  end
3321
3641
 
@@ -3323,28 +3643,30 @@ class HPXML < Object
3323
3643
  # Daily-average total air (cfm) associated with the unit
3324
3644
  return if total_unit_flow_rate.nil?
3325
3645
  return if @hours_in_operation.nil?
3646
+
3326
3647
  return total_unit_flow_rate * (@hours_in_operation / 24.0)
3327
3648
  end
3328
3649
 
3329
3650
  def unit_flow_rate_ratio
3330
3651
  return 1.0 unless @is_shared_system
3331
3652
  return if @in_unit_flow_rate.nil?
3653
+
3332
3654
  if not @tested_flow_rate.nil?
3333
3655
  ratio = @in_unit_flow_rate / @tested_flow_rate
3334
3656
  elsif not @rated_flow_rate.nil?
3335
3657
  ratio = @in_unit_flow_rate / @rated_flow_rate
3336
3658
  end
3337
3659
  return if ratio.nil?
3338
- if ratio >= 1.0
3339
- fail "The in-unit flow rate of shared fan '#{@id}' must be less than the system flow rate."
3340
- end
3660
+
3341
3661
  return ratio
3342
3662
  end
3343
3663
 
3344
3664
  def unit_fan_power
3345
3665
  return if @fan_power.nil?
3666
+
3346
3667
  if @is_shared_system
3347
3668
  return if unit_flow_rate_ratio.nil?
3669
+
3348
3670
  return @fan_power * unit_flow_rate_ratio
3349
3671
  else
3350
3672
  return @fan_power
@@ -3354,6 +3676,7 @@ class HPXML < Object
3354
3676
  def average_unit_fan_power
3355
3677
  return if unit_fan_power.nil?
3356
3678
  return if @hours_in_operation.nil?
3679
+
3357
3680
  return unit_fan_power * (@hours_in_operation / 24.0)
3358
3681
  end
3359
3682
 
@@ -3400,85 +3723,79 @@ class HPXML < Object
3400
3723
  ventilation_fan = XMLHelper.add_element(ventilation_fans, 'VentilationFan')
3401
3724
  sys_id = XMLHelper.add_element(ventilation_fan, 'SystemIdentifier')
3402
3725
  XMLHelper.add_attribute(sys_id, 'id', @id)
3403
- XMLHelper.add_element(ventilation_fan, 'Quantity', to_integer(@quantity)) unless @quantity.nil?
3404
- XMLHelper.add_element(ventilation_fan, 'FanType', @fan_type) unless @fan_type.nil?
3405
- XMLHelper.add_element(ventilation_fan, 'RatedFlowRate', to_float(@rated_flow_rate)) unless @rated_flow_rate.nil?
3406
- XMLHelper.add_element(ventilation_fan, 'TestedFlowRate', to_float(@tested_flow_rate)) unless @tested_flow_rate.nil?
3407
- XMLHelper.add_element(ventilation_fan, 'HoursInOperation', to_float(@hours_in_operation)) unless @hours_in_operation.nil?
3408
- XMLHelper.add_element(ventilation_fan, 'FanLocation', @fan_location) unless @fan_location.nil?
3409
- XMLHelper.add_element(ventilation_fan, 'UsedForLocalVentilation', to_boolean(@used_for_local_ventilation)) unless @used_for_local_ventilation.nil?
3410
- XMLHelper.add_element(ventilation_fan, 'UsedForWholeBuildingVentilation', to_boolean(@used_for_whole_building_ventilation)) unless @used_for_whole_building_ventilation.nil?
3411
- XMLHelper.add_element(ventilation_fan, 'UsedForSeasonalCoolingLoadReduction', to_boolean(@used_for_seasonal_cooling_load_reduction)) unless @used_for_seasonal_cooling_load_reduction.nil?
3412
- XMLHelper.add_element(ventilation_fan, 'IsSharedSystem', to_boolean(@is_shared_system)) unless @is_shared_system.nil?
3413
- if @is_shared_system
3414
- XMLHelper.add_element(ventilation_fan, 'FractionRecirculation', to_float(@fraction_recirculation)) unless @fraction_recirculation.nil?
3415
- end
3416
- XMLHelper.add_element(ventilation_fan, 'TotalRecoveryEfficiency', to_float(@total_recovery_efficiency)) unless @total_recovery_efficiency.nil?
3417
- XMLHelper.add_element(ventilation_fan, 'SensibleRecoveryEfficiency', to_float(@sensible_recovery_efficiency)) unless @sensible_recovery_efficiency.nil?
3418
- XMLHelper.add_element(ventilation_fan, 'AdjustedTotalRecoveryEfficiency', to_float(@total_recovery_efficiency_adjusted)) unless @total_recovery_efficiency_adjusted.nil?
3419
- XMLHelper.add_element(ventilation_fan, 'AdjustedSensibleRecoveryEfficiency', to_float(@sensible_recovery_efficiency_adjusted)) unless @sensible_recovery_efficiency_adjusted.nil?
3420
- XMLHelper.add_element(ventilation_fan, 'FanPower', to_float(@fan_power)) unless @fan_power.nil?
3726
+ XMLHelper.add_element(ventilation_fan, 'Quantity', @quantity, :integer, @quantity_isdefaulted) unless @quantity.nil?
3727
+ XMLHelper.add_element(ventilation_fan, 'FanType', @fan_type, :string) unless @fan_type.nil?
3728
+ XMLHelper.add_element(ventilation_fan, 'RatedFlowRate', @rated_flow_rate, :float, @rated_flow_rate_isdefaulted) unless @rated_flow_rate.nil?
3729
+ XMLHelper.add_element(ventilation_fan, 'TestedFlowRate', @tested_flow_rate, :float) unless @tested_flow_rate.nil?
3730
+ XMLHelper.add_element(ventilation_fan, 'HoursInOperation', @hours_in_operation, :float, @hours_in_operation_isdefaulted) unless @hours_in_operation.nil?
3731
+ XMLHelper.add_element(ventilation_fan, 'FanLocation', @fan_location, :string) unless @fan_location.nil?
3732
+ XMLHelper.add_element(ventilation_fan, 'UsedForLocalVentilation', @used_for_local_ventilation, :boolean) unless @used_for_local_ventilation.nil?
3733
+ XMLHelper.add_element(ventilation_fan, 'UsedForWholeBuildingVentilation', @used_for_whole_building_ventilation, :boolean) unless @used_for_whole_building_ventilation.nil?
3734
+ XMLHelper.add_element(ventilation_fan, 'UsedForSeasonalCoolingLoadReduction', @used_for_seasonal_cooling_load_reduction, :boolean) unless @used_for_seasonal_cooling_load_reduction.nil?
3735
+ XMLHelper.add_element(ventilation_fan, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
3736
+ XMLHelper.add_element(ventilation_fan, 'FractionRecirculation', @fraction_recirculation, :float) unless @fraction_recirculation.nil?
3737
+ XMLHelper.add_element(ventilation_fan, 'TotalRecoveryEfficiency', @total_recovery_efficiency, :float) unless @total_recovery_efficiency.nil?
3738
+ XMLHelper.add_element(ventilation_fan, 'SensibleRecoveryEfficiency', @sensible_recovery_efficiency, :float) unless @sensible_recovery_efficiency.nil?
3739
+ XMLHelper.add_element(ventilation_fan, 'AdjustedTotalRecoveryEfficiency', @total_recovery_efficiency_adjusted, :float) unless @total_recovery_efficiency_adjusted.nil?
3740
+ XMLHelper.add_element(ventilation_fan, 'AdjustedSensibleRecoveryEfficiency', @sensible_recovery_efficiency_adjusted, :float) unless @sensible_recovery_efficiency_adjusted.nil?
3741
+ XMLHelper.add_element(ventilation_fan, 'FanPower', @fan_power, :float, @fan_power_isdefaulted) unless @fan_power.nil?
3421
3742
  if not @distribution_system_idref.nil?
3422
3743
  attached_to_hvac_distribution_system = XMLHelper.add_element(ventilation_fan, 'AttachedToHVACDistributionSystem')
3423
3744
  XMLHelper.add_attribute(attached_to_hvac_distribution_system, 'idref', @distribution_system_idref)
3424
3745
  end
3425
- XMLHelper.add_extension(ventilation_fan, 'StartHour', to_integer(@start_hour)) unless @start_hour.nil?
3426
- if @is_shared_system
3427
- XMLHelper.add_extension(ventilation_fan, 'InUnitFlowRate', to_float(@in_unit_flow_rate)) unless @in_unit_flow_rate.nil?
3428
- if (not @preheating_fuel.nil?) && (not @preheating_efficiency_cop.nil?)
3429
- precond_htg = XMLHelper.create_elements_as_needed(ventilation_fan, ['extension', 'PreHeating'])
3430
- XMLHelper.add_element(precond_htg, 'Fuel', @preheating_fuel) unless @preheating_fuel.nil?
3431
- eff = XMLHelper.add_element(precond_htg, 'AnnualHeatingEfficiency') unless @preheating_efficiency_cop.nil?
3432
- XMLHelper.add_element(eff, 'Value', to_float(@preheating_efficiency_cop)) unless eff.nil?
3433
- XMLHelper.add_element(eff, 'Units', UnitsCOP) unless eff.nil?
3434
- XMLHelper.add_element(precond_htg, 'FractionVentilationHeatLoadServed', to_float(@preheating_fraction_load_served)) unless @preheating_fraction_load_served.nil?
3435
- end
3436
- if (not @precooling_fuel.nil?) && (not @precooling_efficiency_cop.nil?)
3437
- precond_clg = XMLHelper.create_elements_as_needed(ventilation_fan, ['extension', 'PreCooling'])
3438
- XMLHelper.add_element(precond_clg, 'Fuel', @precooling_fuel) unless @precooling_fuel.nil?
3439
- eff = XMLHelper.add_element(precond_clg, 'AnnualCoolingEfficiency') unless @precooling_efficiency_cop.nil?
3440
- XMLHelper.add_element(eff, 'Value', to_float(@precooling_efficiency_cop)) unless eff.nil?
3441
- XMLHelper.add_element(eff, 'Units', UnitsCOP) unless eff.nil?
3442
- XMLHelper.add_element(precond_clg, 'FractionVentilationCoolLoadServed', to_float(@precooling_fraction_load_served)) unless @precooling_fraction_load_served.nil?
3443
- end
3746
+ XMLHelper.add_extension(ventilation_fan, 'StartHour', @start_hour, :integer, @start_hour_isdefaulted) unless @start_hour.nil?
3747
+ XMLHelper.add_extension(ventilation_fan, 'InUnitFlowRate', @in_unit_flow_rate, :float) unless @in_unit_flow_rate.nil?
3748
+ if (not @preheating_fuel.nil?) && (not @preheating_efficiency_cop.nil?)
3749
+ precond_htg = XMLHelper.create_elements_as_needed(ventilation_fan, ['extension', 'PreHeating'])
3750
+ XMLHelper.add_element(precond_htg, 'Fuel', @preheating_fuel, :string) unless @preheating_fuel.nil?
3751
+ eff = XMLHelper.add_element(precond_htg, 'AnnualHeatingEfficiency') unless @preheating_efficiency_cop.nil?
3752
+ XMLHelper.add_element(eff, 'Value', @preheating_efficiency_cop, :float) unless eff.nil?
3753
+ XMLHelper.add_element(eff, 'Units', UnitsCOP, :string) unless eff.nil?
3754
+ XMLHelper.add_element(precond_htg, 'FractionVentilationHeatLoadServed', @preheating_fraction_load_served, :float) unless @preheating_fraction_load_served.nil?
3755
+ end
3756
+ if (not @precooling_fuel.nil?) && (not @precooling_efficiency_cop.nil?)
3757
+ precond_clg = XMLHelper.create_elements_as_needed(ventilation_fan, ['extension', 'PreCooling'])
3758
+ XMLHelper.add_element(precond_clg, 'Fuel', @precooling_fuel, :string) unless @precooling_fuel.nil?
3759
+ eff = XMLHelper.add_element(precond_clg, 'AnnualCoolingEfficiency') unless @precooling_efficiency_cop.nil?
3760
+ XMLHelper.add_element(eff, 'Value', @precooling_efficiency_cop, :float) unless eff.nil?
3761
+ XMLHelper.add_element(eff, 'Units', UnitsCOP, :string) unless eff.nil?
3762
+ XMLHelper.add_element(precond_clg, 'FractionVentilationCoolLoadServed', @precooling_fraction_load_served, :float) unless @precooling_fraction_load_served.nil?
3444
3763
  end
3445
- XMLHelper.add_extension(ventilation_fan, 'FlowRateNotTested', @flow_rate_not_tested) unless @flow_rate_not_tested.nil?
3446
- XMLHelper.add_extension(ventilation_fan, 'FanPowerDefaulted', @fan_power_defaulted) unless @fan_power_defaulted.nil?
3764
+ XMLHelper.add_extension(ventilation_fan, 'FlowRateNotTested', @flow_rate_not_tested, :boolean) unless @flow_rate_not_tested.nil?
3765
+ XMLHelper.add_extension(ventilation_fan, 'FanPowerDefaulted', @fan_power_defaulted, :boolean) unless @fan_power_defaulted.nil?
3447
3766
  end
3448
3767
 
3449
3768
  def from_oga(ventilation_fan)
3450
3769
  return if ventilation_fan.nil?
3451
3770
 
3452
3771
  @id = HPXML::get_id(ventilation_fan)
3453
- @quantity = to_integer_or_nil(XMLHelper.get_value(ventilation_fan, 'Quantity'))
3454
- @fan_type = XMLHelper.get_value(ventilation_fan, 'FanType')
3455
- @is_shared_system = to_boolean_or_nil(XMLHelper.get_value(ventilation_fan, 'IsSharedSystem'))
3456
- @rated_flow_rate = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'RatedFlowRate'))
3457
- @tested_flow_rate = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'TestedFlowRate'))
3458
- @flow_rate_not_tested = to_boolean_or_nil(XMLHelper.get_value(ventilation_fan, 'extension/FlowRateNotTested'))
3459
- @fan_power = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'FanPower'))
3460
- @fan_power_defaulted = to_boolean_or_nil(XMLHelper.get_value(ventilation_fan, 'extension/FanPowerDefaulted'))
3461
- if @is_shared_system
3462
- @fraction_recirculation = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'FractionRecirculation'))
3463
- @in_unit_flow_rate = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'extension/InUnitFlowRate'))
3464
- @preheating_fuel = XMLHelper.get_value(ventilation_fan, 'extension/PreHeating/Fuel')
3465
- @preheating_efficiency_cop = to_float_or_nil(XMLHelper.get_value(ventilation_fan, "extension/PreHeating/AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value"))
3466
- @preheating_fraction_load_served = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'extension/PreHeating/FractionVentilationHeatLoadServed'))
3467
- @precooling_fuel = XMLHelper.get_value(ventilation_fan, 'extension/PreCooling/Fuel')
3468
- @precooling_efficiency_cop = to_float_or_nil(XMLHelper.get_value(ventilation_fan, "extension/PreCooling/AnnualCoolingEfficiency[Units='#{UnitsCOP}']/Value"))
3469
- @precooling_fraction_load_served = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'extension/PreCooling/FractionVentilationCoolLoadServed'))
3470
- end
3471
- @hours_in_operation = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'HoursInOperation'))
3472
- @fan_location = XMLHelper.get_value(ventilation_fan, 'FanLocation')
3473
- @used_for_local_ventilation = to_boolean_or_nil(XMLHelper.get_value(ventilation_fan, 'UsedForLocalVentilation'))
3474
- @used_for_whole_building_ventilation = to_boolean_or_nil(XMLHelper.get_value(ventilation_fan, 'UsedForWholeBuildingVentilation'))
3475
- @used_for_seasonal_cooling_load_reduction = to_boolean_or_nil(XMLHelper.get_value(ventilation_fan, 'UsedForSeasonalCoolingLoadReduction'))
3476
- @total_recovery_efficiency = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'TotalRecoveryEfficiency'))
3477
- @total_recovery_efficiency_adjusted = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'AdjustedTotalRecoveryEfficiency'))
3478
- @sensible_recovery_efficiency = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'SensibleRecoveryEfficiency'))
3479
- @sensible_recovery_efficiency_adjusted = to_float_or_nil(XMLHelper.get_value(ventilation_fan, 'AdjustedSensibleRecoveryEfficiency'))
3772
+ @quantity = XMLHelper.get_value(ventilation_fan, 'Quantity', :integer)
3773
+ @fan_type = XMLHelper.get_value(ventilation_fan, 'FanType', :string)
3774
+ @rated_flow_rate = XMLHelper.get_value(ventilation_fan, 'RatedFlowRate', :float)
3775
+ @tested_flow_rate = XMLHelper.get_value(ventilation_fan, 'TestedFlowRate', :float)
3776
+ @hours_in_operation = XMLHelper.get_value(ventilation_fan, 'HoursInOperation', :float)
3777
+ @fan_location = XMLHelper.get_value(ventilation_fan, 'FanLocation', :string)
3778
+ @used_for_local_ventilation = XMLHelper.get_value(ventilation_fan, 'UsedForLocalVentilation', :boolean)
3779
+ @used_for_whole_building_ventilation = XMLHelper.get_value(ventilation_fan, 'UsedForWholeBuildingVentilation', :boolean)
3780
+ @used_for_seasonal_cooling_load_reduction = XMLHelper.get_value(ventilation_fan, 'UsedForSeasonalCoolingLoadReduction', :boolean)
3781
+ @is_shared_system = XMLHelper.get_value(ventilation_fan, 'IsSharedSystem', :boolean)
3782
+ @fraction_recirculation = XMLHelper.get_value(ventilation_fan, 'FractionRecirculation', :float)
3783
+ @total_recovery_efficiency = XMLHelper.get_value(ventilation_fan, 'TotalRecoveryEfficiency', :float)
3784
+ @sensible_recovery_efficiency = XMLHelper.get_value(ventilation_fan, 'SensibleRecoveryEfficiency', :float)
3785
+ @total_recovery_efficiency_adjusted = XMLHelper.get_value(ventilation_fan, 'AdjustedTotalRecoveryEfficiency', :float)
3786
+ @sensible_recovery_efficiency_adjusted = XMLHelper.get_value(ventilation_fan, 'AdjustedSensibleRecoveryEfficiency', :float)
3787
+ @fan_power = XMLHelper.get_value(ventilation_fan, 'FanPower', :float)
3480
3788
  @distribution_system_idref = HPXML::get_idref(XMLHelper.get_element(ventilation_fan, 'AttachedToHVACDistributionSystem'))
3481
- @start_hour = to_integer_or_nil(XMLHelper.get_value(ventilation_fan, 'extension/StartHour'))
3789
+ @start_hour = XMLHelper.get_value(ventilation_fan, 'extension/StartHour', :integer)
3790
+ @in_unit_flow_rate = XMLHelper.get_value(ventilation_fan, 'extension/InUnitFlowRate', :float)
3791
+ @preheating_fuel = XMLHelper.get_value(ventilation_fan, 'extension/PreHeating/Fuel', :string)
3792
+ @preheating_efficiency_cop = XMLHelper.get_value(ventilation_fan, "extension/PreHeating/AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value", :float)
3793
+ @preheating_fraction_load_served = XMLHelper.get_value(ventilation_fan, 'extension/PreHeating/FractionVentilationHeatLoadServed', :float)
3794
+ @precooling_fuel = XMLHelper.get_value(ventilation_fan, 'extension/PreCooling/Fuel', :string)
3795
+ @precooling_efficiency_cop = XMLHelper.get_value(ventilation_fan, "extension/PreCooling/AnnualCoolingEfficiency[Units='#{UnitsCOP}']/Value", :float)
3796
+ @precooling_fraction_load_served = XMLHelper.get_value(ventilation_fan, 'extension/PreCooling/FractionVentilationCoolLoadServed', :float)
3797
+ @flow_rate_not_tested = XMLHelper.get_value(ventilation_fan, 'extension/FlowRateNotTested', :boolean)
3798
+ @fan_power_defaulted = XMLHelper.get_value(ventilation_fan, 'extension/FanPowerDefaulted', :boolean)
3482
3799
  end
3483
3800
  end
3484
3801
 
@@ -3499,15 +3816,15 @@ class HPXML < Object
3499
3816
  class WaterHeatingSystem < BaseElement
3500
3817
  ATTRS = [:id, :year_installed, :fuel_type, :water_heater_type, :location, :performance_adjustment,
3501
3818
  :tank_volume, :fraction_dhw_load_served, :heating_capacity, :energy_factor,
3502
- :uniform_energy_factor, :recovery_efficiency, :uses_desuperheater, :jacket_r_value,
3503
- :related_hvac_idref, :energy_star, :standby_loss, :temperature, :is_shared_system,
3819
+ :uniform_energy_factor, :first_hour_rating, :recovery_efficiency, :uses_desuperheater, :jacket_r_value,
3820
+ :related_hvac_idref, :third_party_certification, :standby_loss, :temperature, :is_shared_system,
3504
3821
  :number_of_units_served]
3505
3822
  attr_accessor(*ATTRS)
3506
3823
 
3507
3824
  def related_hvac_system
3508
3825
  return if @related_hvac_idref.nil?
3509
3826
 
3510
- (@hpxml_object.heating_systems + @hpxml_object.cooling_systems + @hpxml_object.heat_pumps).each do |hvac_system|
3827
+ @hpxml_object.hvac_systems.each do |hvac_system|
3511
3828
  next unless hvac_system.id == @related_hvac_idref
3512
3829
 
3513
3830
  return hvac_system
@@ -3537,26 +3854,29 @@ class HPXML < Object
3537
3854
  water_heating_system = XMLHelper.add_element(water_heating, 'WaterHeatingSystem')
3538
3855
  sys_id = XMLHelper.add_element(water_heating_system, 'SystemIdentifier')
3539
3856
  XMLHelper.add_attribute(sys_id, 'id', @id)
3540
- XMLHelper.add_element(water_heating_system, 'FuelType', @fuel_type) unless @fuel_type.nil?
3541
- XMLHelper.add_element(water_heating_system, 'WaterHeaterType', @water_heater_type) unless @water_heater_type.nil?
3542
- XMLHelper.add_element(water_heating_system, 'Location', @location) unless @location.nil?
3543
- XMLHelper.add_element(water_heating_system, 'IsSharedSystem', to_boolean(@is_shared_system)) unless @is_shared_system.nil?
3544
- XMLHelper.add_element(water_heating_system, 'NumberofUnitsServed', to_integer(@number_of_units_served)) unless @number_of_units_served.nil?
3545
- XMLHelper.add_element(water_heating_system, 'PerformanceAdjustment', to_float(@performance_adjustment)) unless @performance_adjustment.nil?
3546
- XMLHelper.add_element(water_heating_system, 'TankVolume', to_float(@tank_volume)) unless @tank_volume.nil?
3547
- XMLHelper.add_element(water_heating_system, 'FractionDHWLoadServed', to_float(@fraction_dhw_load_served)) unless @fraction_dhw_load_served.nil?
3548
- XMLHelper.add_element(water_heating_system, 'HeatingCapacity', to_float(@heating_capacity)) unless @heating_capacity.nil?
3549
- XMLHelper.add_element(water_heating_system, 'EnergyFactor', to_float(@energy_factor)) unless @energy_factor.nil?
3550
- XMLHelper.add_element(water_heating_system, 'UniformEnergyFactor', to_float(@uniform_energy_factor)) unless @uniform_energy_factor.nil?
3551
- XMLHelper.add_element(water_heating_system, 'RecoveryEfficiency', to_float(@recovery_efficiency)) unless @recovery_efficiency.nil?
3857
+ XMLHelper.add_element(water_heating_system, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
3858
+ XMLHelper.add_element(water_heating_system, 'WaterHeaterType', @water_heater_type, :string) unless @water_heater_type.nil?
3859
+ XMLHelper.add_element(water_heating_system, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
3860
+ XMLHelper.add_element(water_heating_system, 'YearInstalled', @year_installed, :integer) unless @year_installed.nil?
3861
+ XMLHelper.add_element(water_heating_system, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
3862
+ XMLHelper.add_element(water_heating_system, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
3863
+ XMLHelper.add_element(water_heating_system, 'PerformanceAdjustment', @performance_adjustment, :float, @performance_adjustment_isdefaulted) unless @performance_adjustment.nil?
3864
+ XMLHelper.add_element(water_heating_system, 'ThirdPartyCertification', @third_party_certification, :string) unless @third_party_certification.nil?
3865
+ XMLHelper.add_element(water_heating_system, 'TankVolume', @tank_volume, :float, @tank_volume_isdefaulted) unless @tank_volume.nil?
3866
+ XMLHelper.add_element(water_heating_system, 'FractionDHWLoadServed', @fraction_dhw_load_served, :float) unless @fraction_dhw_load_served.nil?
3867
+ XMLHelper.add_element(water_heating_system, 'HeatingCapacity', @heating_capacity, :float, @heating_capacity_isdefaulted) unless @heating_capacity.nil?
3868
+ XMLHelper.add_element(water_heating_system, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
3869
+ XMLHelper.add_element(water_heating_system, 'UniformEnergyFactor', @uniform_energy_factor, :float) unless @uniform_energy_factor.nil?
3870
+ XMLHelper.add_element(water_heating_system, 'FirstHourRating', @first_hour_rating, :float) unless @first_hour_rating.nil?
3871
+ XMLHelper.add_element(water_heating_system, 'RecoveryEfficiency', @recovery_efficiency, :float, @recovery_efficiency_isdefaulted) unless @recovery_efficiency.nil?
3552
3872
  if not @jacket_r_value.nil?
3553
3873
  water_heater_insulation = XMLHelper.add_element(water_heating_system, 'WaterHeaterInsulation')
3554
3874
  jacket = XMLHelper.add_element(water_heater_insulation, 'Jacket')
3555
- XMLHelper.add_element(jacket, 'JacketRValue', @jacket_r_value)
3875
+ XMLHelper.add_element(jacket, 'JacketRValue', @jacket_r_value, :float)
3556
3876
  end
3557
- XMLHelper.add_element(water_heating_system, 'StandbyLoss', to_float(@standby_loss)) unless @standby_loss.nil?
3558
- XMLHelper.add_element(water_heating_system, 'HotWaterTemperature', to_float(@temperature)) unless @temperature.nil?
3559
- XMLHelper.add_element(water_heating_system, 'UsesDesuperheater', to_boolean(@uses_desuperheater)) unless @uses_desuperheater.nil?
3877
+ XMLHelper.add_element(water_heating_system, 'StandbyLoss', @standby_loss, :float, @standby_loss_isdefaulted) unless @standby_loss.nil?
3878
+ XMLHelper.add_element(water_heating_system, 'HotWaterTemperature', @temperature, :float, @temperature_isdefaulted) unless @temperature.nil?
3879
+ XMLHelper.add_element(water_heating_system, 'UsesDesuperheater', @uses_desuperheater, :boolean) unless @uses_desuperheater.nil?
3560
3880
  if not @related_hvac_idref.nil?
3561
3881
  related_hvac_idref_el = XMLHelper.add_element(water_heating_system, 'RelatedHVACSystem')
3562
3882
  XMLHelper.add_attribute(related_hvac_idref_el, 'idref', @related_hvac_idref)
@@ -3567,25 +3887,26 @@ class HPXML < Object
3567
3887
  return if water_heating_system.nil?
3568
3888
 
3569
3889
  @id = HPXML::get_id(water_heating_system)
3570
- @year_installed = to_integer_or_nil(XMLHelper.get_value(water_heating_system, 'YearInstalled'))
3571
- @fuel_type = XMLHelper.get_value(water_heating_system, 'FuelType')
3572
- @water_heater_type = XMLHelper.get_value(water_heating_system, 'WaterHeaterType')
3573
- @location = XMLHelper.get_value(water_heating_system, 'Location')
3574
- @is_shared_system = to_boolean_or_nil(XMLHelper.get_value(water_heating_system, 'IsSharedSystem'))
3575
- @number_of_units_served = to_integer_or_nil(XMLHelper.get_value(water_heating_system, 'NumberofUnitsServed'))
3576
- @performance_adjustment = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'PerformanceAdjustment'))
3577
- @tank_volume = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'TankVolume'))
3578
- @fraction_dhw_load_served = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'FractionDHWLoadServed'))
3579
- @heating_capacity = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'HeatingCapacity'))
3580
- @energy_factor = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'EnergyFactor'))
3581
- @uniform_energy_factor = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'UniformEnergyFactor'))
3582
- @recovery_efficiency = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'RecoveryEfficiency'))
3583
- @uses_desuperheater = to_boolean_or_nil(XMLHelper.get_value(water_heating_system, 'UsesDesuperheater'))
3584
- @jacket_r_value = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'WaterHeaterInsulation/Jacket/JacketRValue'))
3890
+ @fuel_type = XMLHelper.get_value(water_heating_system, 'FuelType', :string)
3891
+ @water_heater_type = XMLHelper.get_value(water_heating_system, 'WaterHeaterType', :string)
3892
+ @location = XMLHelper.get_value(water_heating_system, 'Location', :string)
3893
+ @year_installed = XMLHelper.get_value(water_heating_system, 'YearInstalled', :integer)
3894
+ @is_shared_system = XMLHelper.get_value(water_heating_system, 'IsSharedSystem', :boolean)
3895
+ @number_of_units_served = XMLHelper.get_value(water_heating_system, 'NumberofUnitsServed', :integer)
3896
+ @performance_adjustment = XMLHelper.get_value(water_heating_system, 'PerformanceAdjustment', :float)
3897
+ @third_party_certification = XMLHelper.get_value(water_heating_system, 'ThirdPartyCertification', :string)
3898
+ @tank_volume = XMLHelper.get_value(water_heating_system, 'TankVolume', :float)
3899
+ @fraction_dhw_load_served = XMLHelper.get_value(water_heating_system, 'FractionDHWLoadServed', :float)
3900
+ @heating_capacity = XMLHelper.get_value(water_heating_system, 'HeatingCapacity', :float)
3901
+ @energy_factor = XMLHelper.get_value(water_heating_system, 'EnergyFactor', :float)
3902
+ @uniform_energy_factor = XMLHelper.get_value(water_heating_system, 'UniformEnergyFactor', :float)
3903
+ @first_hour_rating = XMLHelper.get_value(water_heating_system, 'FirstHourRating', :float)
3904
+ @recovery_efficiency = XMLHelper.get_value(water_heating_system, 'RecoveryEfficiency', :float)
3905
+ @jacket_r_value = XMLHelper.get_value(water_heating_system, 'WaterHeaterInsulation/Jacket/JacketRValue', :float)
3906
+ @standby_loss = XMLHelper.get_value(water_heating_system, 'StandbyLoss', :float)
3907
+ @temperature = XMLHelper.get_value(water_heating_system, 'HotWaterTemperature', :float)
3908
+ @uses_desuperheater = XMLHelper.get_value(water_heating_system, 'UsesDesuperheater', :boolean)
3585
3909
  @related_hvac_idref = HPXML::get_idref(XMLHelper.get_element(water_heating_system, 'RelatedHVACSystem'))
3586
- @energy_star = XMLHelper.get_values(water_heating_system, 'ThirdPartyCertification').include?('Energy Star')
3587
- @standby_loss = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'StandbyLoss'))
3588
- @temperature = to_float_or_nil(XMLHelper.get_value(water_heating_system, 'HotWaterTemperature'))
3589
3910
  end
3590
3911
  end
3591
3912
 
@@ -3608,7 +3929,8 @@ class HPXML < Object
3608
3929
  :recirculation_piping_length, :recirculation_branch_piping_length,
3609
3930
  :recirculation_pump_power, :dwhr_facilities_connected, :dwhr_equal_flow,
3610
3931
  :dwhr_efficiency, :has_shared_recirculation, :shared_recirculation_number_of_units_served,
3611
- :shared_recirculation_pump_power, :shared_recirculation_control_type]
3932
+ :shared_recirculation_pump_power, :shared_recirculation_control_type,
3933
+ :shared_recirculation_motor_efficiency]
3612
3934
  attr_accessor(*ATTRS)
3613
3935
 
3614
3936
  def delete
@@ -3628,36 +3950,37 @@ class HPXML < Object
3628
3950
  sys_id = XMLHelper.add_element(hot_water_distribution, 'SystemIdentifier')
3629
3951
  XMLHelper.add_attribute(sys_id, 'id', @id)
3630
3952
  if not @system_type.nil?
3631
- system_type_e = XMLHelper.add_element(hot_water_distribution, 'SystemType')
3953
+ system_type_el = XMLHelper.add_element(hot_water_distribution, 'SystemType')
3632
3954
  if @system_type == DHWDistTypeStandard
3633
- standard = XMLHelper.add_element(system_type_e, @system_type)
3634
- XMLHelper.add_element(standard, 'PipingLength', to_float(@standard_piping_length)) unless @standard_piping_length.nil?
3955
+ standard = XMLHelper.add_element(system_type_el, @system_type)
3956
+ XMLHelper.add_element(standard, 'PipingLength', @standard_piping_length, :float, @standard_piping_length_isdefaulted) unless @standard_piping_length.nil?
3635
3957
  elsif system_type == DHWDistTypeRecirc
3636
- recirculation = XMLHelper.add_element(system_type_e, @system_type)
3637
- XMLHelper.add_element(recirculation, 'ControlType', @recirculation_control_type) unless @recirculation_control_type.nil?
3638
- XMLHelper.add_element(recirculation, 'RecirculationPipingLoopLength', to_float(@recirculation_piping_length)) unless @recirculation_piping_length.nil?
3639
- XMLHelper.add_element(recirculation, 'BranchPipingLoopLength', to_float(@recirculation_branch_piping_length)) unless @recirculation_branch_piping_length.nil?
3640
- XMLHelper.add_element(recirculation, 'PumpPower', to_float(@recirculation_pump_power)) unless @recirculation_pump_power.nil?
3958
+ recirculation = XMLHelper.add_element(system_type_el, @system_type)
3959
+ XMLHelper.add_element(recirculation, 'ControlType', @recirculation_control_type, :string) unless @recirculation_control_type.nil?
3960
+ XMLHelper.add_element(recirculation, 'RecirculationPipingLoopLength', @recirculation_piping_length, :float, @recirculation_piping_length_isdefaulted) unless @recirculation_piping_length.nil?
3961
+ XMLHelper.add_element(recirculation, 'BranchPipingLoopLength', @recirculation_branch_piping_length, :float, @recirculation_branch_piping_length_isdefaulted) unless @recirculation_branch_piping_length.nil?
3962
+ XMLHelper.add_element(recirculation, 'PumpPower', @recirculation_pump_power, :float, @recirculation_pump_power_isdefaulted) unless @recirculation_pump_power.nil?
3641
3963
  else
3642
3964
  fail "Unhandled hot water distribution type '#{@system_type}'."
3643
3965
  end
3644
3966
  end
3645
3967
  if not @pipe_r_value.nil?
3646
3968
  pipe_insulation = XMLHelper.add_element(hot_water_distribution, 'PipeInsulation')
3647
- XMLHelper.add_element(pipe_insulation, 'PipeRValue', to_float(@pipe_r_value))
3969
+ XMLHelper.add_element(pipe_insulation, 'PipeRValue', @pipe_r_value, :float, @pipe_r_value_isdefaulted)
3648
3970
  end
3649
3971
  if (not @dwhr_facilities_connected.nil?) || (not @dwhr_equal_flow.nil?) || (not @dwhr_efficiency.nil?)
3650
3972
  drain_water_heat_recovery = XMLHelper.add_element(hot_water_distribution, 'DrainWaterHeatRecovery')
3651
- XMLHelper.add_element(drain_water_heat_recovery, 'FacilitiesConnected', @dwhr_facilities_connected) unless @dwhr_facilities_connected.nil?
3652
- XMLHelper.add_element(drain_water_heat_recovery, 'EqualFlow', to_boolean(@dwhr_equal_flow)) unless @dwhr_equal_flow.nil?
3653
- XMLHelper.add_element(drain_water_heat_recovery, 'Efficiency', to_float(@dwhr_efficiency)) unless @dwhr_efficiency.nil?
3973
+ XMLHelper.add_element(drain_water_heat_recovery, 'FacilitiesConnected', @dwhr_facilities_connected, :string) unless @dwhr_facilities_connected.nil?
3974
+ XMLHelper.add_element(drain_water_heat_recovery, 'EqualFlow', @dwhr_equal_flow, :boolean) unless @dwhr_equal_flow.nil?
3975
+ XMLHelper.add_element(drain_water_heat_recovery, 'Efficiency', @dwhr_efficiency, :float) unless @dwhr_efficiency.nil?
3654
3976
  end
3655
3977
  if @has_shared_recirculation
3656
3978
  extension = XMLHelper.create_elements_as_needed(hot_water_distribution, ['extension'])
3657
3979
  shared_recirculation = XMLHelper.add_element(extension, 'SharedRecirculation')
3658
- XMLHelper.add_element(shared_recirculation, 'NumberofUnitsServed', to_integer(@shared_recirculation_number_of_units_served)) unless @shared_recirculation_number_of_units_served.nil?
3659
- XMLHelper.add_element(shared_recirculation, 'PumpPower', to_float(@shared_recirculation_pump_power)) unless @shared_recirculation_pump_power.nil?
3660
- XMLHelper.add_element(shared_recirculation, 'ControlType', @shared_recirculation_control_type) unless @shared_recirculation_control_type.nil?
3980
+ XMLHelper.add_element(shared_recirculation, 'NumberofUnitsServed', @shared_recirculation_number_of_units_served, :integer) unless @shared_recirculation_number_of_units_served.nil?
3981
+ XMLHelper.add_element(shared_recirculation, 'PumpPower', @shared_recirculation_pump_power, :float, @shared_recirculation_pump_power_isdefaulted) unless @shared_recirculation_pump_power.nil?
3982
+ XMLHelper.add_element(shared_recirculation, 'MotorEfficiency', @shared_recirculation_motor_efficiency, :float) unless @shared_recirculation_motor_efficiency.nil?
3983
+ XMLHelper.add_element(shared_recirculation, 'ControlType', @shared_recirculation_control_type, :string) unless @shared_recirculation_control_type.nil?
3661
3984
  end
3662
3985
  end
3663
3986
 
@@ -3666,23 +3989,24 @@ class HPXML < Object
3666
3989
 
3667
3990
  @id = HPXML::get_id(hot_water_distribution)
3668
3991
  @system_type = XMLHelper.get_child_name(hot_water_distribution, 'SystemType')
3669
- @pipe_r_value = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'PipeInsulation/PipeRValue'))
3670
3992
  if @system_type == 'Standard'
3671
- @standard_piping_length = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'SystemType/Standard/PipingLength'))
3993
+ @standard_piping_length = XMLHelper.get_value(hot_water_distribution, 'SystemType/Standard/PipingLength', :float)
3672
3994
  elsif @system_type == 'Recirculation'
3673
- @recirculation_control_type = XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/ControlType')
3674
- @recirculation_piping_length = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/RecirculationPipingLoopLength'))
3675
- @recirculation_branch_piping_length = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/BranchPipingLoopLength'))
3676
- @recirculation_pump_power = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/PumpPower'))
3677
- end
3678
- @dwhr_facilities_connected = XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/FacilitiesConnected')
3679
- @dwhr_equal_flow = to_boolean_or_nil(XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/EqualFlow'))
3680
- @dwhr_efficiency = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/Efficiency'))
3995
+ @recirculation_control_type = XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/ControlType', :string)
3996
+ @recirculation_piping_length = XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/RecirculationPipingLoopLength', :float)
3997
+ @recirculation_branch_piping_length = XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/BranchPipingLoopLength', :float)
3998
+ @recirculation_pump_power = XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/PumpPower', :float)
3999
+ end
4000
+ @pipe_r_value = XMLHelper.get_value(hot_water_distribution, 'PipeInsulation/PipeRValue', :float)
4001
+ @dwhr_facilities_connected = XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/FacilitiesConnected', :string)
4002
+ @dwhr_equal_flow = XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/EqualFlow', :boolean)
4003
+ @dwhr_efficiency = XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/Efficiency', :float)
3681
4004
  @has_shared_recirculation = XMLHelper.has_element(hot_water_distribution, 'extension/SharedRecirculation')
3682
4005
  if @has_shared_recirculation
3683
- @shared_recirculation_number_of_units_served = to_integer_or_nil(XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/NumberofUnitsServed'))
3684
- @shared_recirculation_pump_power = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/PumpPower'))
3685
- @shared_recirculation_control_type = XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/ControlType')
4006
+ @shared_recirculation_number_of_units_served = XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/NumberofUnitsServed', :integer)
4007
+ @shared_recirculation_pump_power = XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/PumpPower', :float)
4008
+ @shared_recirculation_motor_efficiency = XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/MotorEfficiency', :float)
4009
+ @shared_recirculation_control_type = XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/ControlType', :string)
3686
4010
  end
3687
4011
  end
3688
4012
  end
@@ -3721,16 +4045,16 @@ class HPXML < Object
3721
4045
  water_fixture = XMLHelper.add_element(water_heating, 'WaterFixture')
3722
4046
  sys_id = XMLHelper.add_element(water_fixture, 'SystemIdentifier')
3723
4047
  XMLHelper.add_attribute(sys_id, 'id', @id)
3724
- XMLHelper.add_element(water_fixture, 'WaterFixtureType', @water_fixture_type) unless @water_fixture_type.nil?
3725
- XMLHelper.add_element(water_fixture, 'LowFlow', to_boolean(@low_flow)) unless @low_flow.nil?
4048
+ XMLHelper.add_element(water_fixture, 'WaterFixtureType', @water_fixture_type, :string) unless @water_fixture_type.nil?
4049
+ XMLHelper.add_element(water_fixture, 'LowFlow', @low_flow, :boolean) unless @low_flow.nil?
3726
4050
  end
3727
4051
 
3728
4052
  def from_oga(water_fixture)
3729
4053
  return if water_fixture.nil?
3730
4054
 
3731
4055
  @id = HPXML::get_id(water_fixture)
3732
- @water_fixture_type = XMLHelper.get_value(water_fixture, 'WaterFixtureType')
3733
- @low_flow = to_boolean_or_nil(XMLHelper.get_value(water_fixture, 'LowFlow'))
4056
+ @water_fixture_type = XMLHelper.get_value(water_fixture, 'WaterFixtureType', :string)
4057
+ @low_flow = XMLHelper.get_value(water_fixture, 'LowFlow', :boolean)
3734
4058
  end
3735
4059
  end
3736
4060
 
@@ -3747,7 +4071,7 @@ class HPXML < Object
3747
4071
  return if nil?
3748
4072
 
3749
4073
  water_heating = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'Systems', 'WaterHeating'])
3750
- XMLHelper.add_extension(water_heating, 'WaterFixturesUsageMultiplier', to_float(@water_fixtures_usage_multiplier)) unless @water_fixtures_usage_multiplier.nil?
4074
+ XMLHelper.add_extension(water_heating, 'WaterFixturesUsageMultiplier', @water_fixtures_usage_multiplier, :float, @water_fixtures_usage_multiplier_isdefaulted) unless @water_fixtures_usage_multiplier.nil?
3751
4075
  end
3752
4076
 
3753
4077
  def from_oga(hpxml)
@@ -3756,7 +4080,7 @@ class HPXML < Object
3756
4080
  water_heating = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/Systems/WaterHeating')
3757
4081
  return if water_heating.nil?
3758
4082
 
3759
- @water_fixtures_usage_multiplier = to_float_or_nil(XMLHelper.get_value(water_heating, 'extension/WaterFixturesUsageMultiplier'))
4083
+ @water_fixtures_usage_multiplier = XMLHelper.get_value(water_heating, 'extension/WaterFixturesUsageMultiplier', :float)
3760
4084
  end
3761
4085
  end
3762
4086
 
@@ -3808,37 +4132,37 @@ class HPXML < Object
3808
4132
  solar_thermal_system = XMLHelper.add_element(solar_thermal, 'SolarThermalSystem')
3809
4133
  sys_id = XMLHelper.add_element(solar_thermal_system, 'SystemIdentifier')
3810
4134
  XMLHelper.add_attribute(sys_id, 'id', @id)
3811
- XMLHelper.add_element(solar_thermal_system, 'SystemType', @system_type) unless @system_type.nil?
3812
- XMLHelper.add_element(solar_thermal_system, 'CollectorArea', to_float(@collector_area)) unless @collector_area.nil?
3813
- XMLHelper.add_element(solar_thermal_system, 'CollectorLoopType', @collector_loop_type) unless @collector_loop_type.nil?
3814
- XMLHelper.add_element(solar_thermal_system, 'CollectorType', @collector_type) unless @collector_type.nil?
3815
- XMLHelper.add_element(solar_thermal_system, 'CollectorAzimuth', to_integer(@collector_azimuth)) unless @collector_azimuth.nil?
3816
- XMLHelper.add_element(solar_thermal_system, 'CollectorTilt', to_float(@collector_tilt)) unless @collector_tilt.nil?
3817
- XMLHelper.add_element(solar_thermal_system, 'CollectorRatedOpticalEfficiency', to_float(@collector_frta)) unless @collector_frta.nil?
3818
- XMLHelper.add_element(solar_thermal_system, 'CollectorRatedThermalLosses', to_float(@collector_frul)) unless @collector_frul.nil?
3819
- XMLHelper.add_element(solar_thermal_system, 'StorageVolume', to_float(@storage_volume)) unless @storage_volume.nil?
4135
+ XMLHelper.add_element(solar_thermal_system, 'SystemType', @system_type, :string) unless @system_type.nil?
4136
+ XMLHelper.add_element(solar_thermal_system, 'CollectorArea', @collector_area, :float) unless @collector_area.nil?
4137
+ XMLHelper.add_element(solar_thermal_system, 'CollectorLoopType', @collector_loop_type, :string) unless @collector_loop_type.nil?
4138
+ XMLHelper.add_element(solar_thermal_system, 'CollectorType', @collector_type, :string) unless @collector_type.nil?
4139
+ XMLHelper.add_element(solar_thermal_system, 'CollectorAzimuth', @collector_azimuth, :integer) unless @collector_azimuth.nil?
4140
+ XMLHelper.add_element(solar_thermal_system, 'CollectorTilt', @collector_tilt, :float) unless @collector_tilt.nil?
4141
+ XMLHelper.add_element(solar_thermal_system, 'CollectorRatedOpticalEfficiency', @collector_frta, :float) unless @collector_frta.nil?
4142
+ XMLHelper.add_element(solar_thermal_system, 'CollectorRatedThermalLosses', @collector_frul, :float) unless @collector_frul.nil?
4143
+ XMLHelper.add_element(solar_thermal_system, 'StorageVolume', @storage_volume, :float, @storage_volume_isdefaulted) unless @storage_volume.nil?
3820
4144
  if not @water_heating_system_idref.nil?
3821
4145
  connected_to = XMLHelper.add_element(solar_thermal_system, 'ConnectedTo')
3822
4146
  XMLHelper.add_attribute(connected_to, 'idref', @water_heating_system_idref)
3823
4147
  end
3824
- XMLHelper.add_element(solar_thermal_system, 'SolarFraction', to_float(@solar_fraction)) unless @solar_fraction.nil?
4148
+ XMLHelper.add_element(solar_thermal_system, 'SolarFraction', @solar_fraction, :float) unless @solar_fraction.nil?
3825
4149
  end
3826
4150
 
3827
4151
  def from_oga(solar_thermal_system)
3828
4152
  return if solar_thermal_system.nil?
3829
4153
 
3830
4154
  @id = HPXML::get_id(solar_thermal_system)
3831
- @system_type = XMLHelper.get_value(solar_thermal_system, 'SystemType')
3832
- @collector_area = to_float_or_nil(XMLHelper.get_value(solar_thermal_system, 'CollectorArea'))
3833
- @collector_loop_type = XMLHelper.get_value(solar_thermal_system, 'CollectorLoopType')
3834
- @collector_azimuth = to_integer_or_nil(XMLHelper.get_value(solar_thermal_system, 'CollectorAzimuth'))
3835
- @collector_type = XMLHelper.get_value(solar_thermal_system, 'CollectorType')
3836
- @collector_tilt = to_float_or_nil(XMLHelper.get_value(solar_thermal_system, 'CollectorTilt'))
3837
- @collector_frta = to_float_or_nil(XMLHelper.get_value(solar_thermal_system, 'CollectorRatedOpticalEfficiency'))
3838
- @collector_frul = to_float_or_nil(XMLHelper.get_value(solar_thermal_system, 'CollectorRatedThermalLosses'))
3839
- @storage_volume = to_float_or_nil(XMLHelper.get_value(solar_thermal_system, 'StorageVolume'))
4155
+ @system_type = XMLHelper.get_value(solar_thermal_system, 'SystemType', :string)
4156
+ @collector_area = XMLHelper.get_value(solar_thermal_system, 'CollectorArea', :float)
4157
+ @collector_loop_type = XMLHelper.get_value(solar_thermal_system, 'CollectorLoopType', :string)
4158
+ @collector_type = XMLHelper.get_value(solar_thermal_system, 'CollectorType', :string)
4159
+ @collector_azimuth = XMLHelper.get_value(solar_thermal_system, 'CollectorAzimuth', :integer)
4160
+ @collector_tilt = XMLHelper.get_value(solar_thermal_system, 'CollectorTilt', :float)
4161
+ @collector_frta = XMLHelper.get_value(solar_thermal_system, 'CollectorRatedOpticalEfficiency', :float)
4162
+ @collector_frul = XMLHelper.get_value(solar_thermal_system, 'CollectorRatedThermalLosses', :float)
4163
+ @storage_volume = XMLHelper.get_value(solar_thermal_system, 'StorageVolume', :float)
3840
4164
  @water_heating_system_idref = HPXML::get_idref(XMLHelper.get_element(solar_thermal_system, 'ConnectedTo'))
3841
- @solar_fraction = to_float_or_nil(XMLHelper.get_value(solar_thermal_system, 'SolarFraction'))
4165
+ @solar_fraction = XMLHelper.get_value(solar_thermal_system, 'SolarFraction', :float)
3842
4166
  end
3843
4167
  end
3844
4168
 
@@ -3878,36 +4202,91 @@ class HPXML < Object
3878
4202
  pv_system = XMLHelper.add_element(photovoltaics, 'PVSystem')
3879
4203
  sys_id = XMLHelper.add_element(pv_system, 'SystemIdentifier')
3880
4204
  XMLHelper.add_attribute(sys_id, 'id', @id)
3881
- XMLHelper.add_element(pv_system, 'IsSharedSystem', to_boolean(@is_shared_system)) unless @is_shared_system.nil?
3882
- XMLHelper.add_element(pv_system, 'Location', @location) unless @location.nil?
3883
- XMLHelper.add_element(pv_system, 'ModuleType', @module_type) unless @module_type.nil?
3884
- XMLHelper.add_element(pv_system, 'Tracking', @tracking) unless @tracking.nil?
3885
- XMLHelper.add_element(pv_system, 'ArrayAzimuth', to_integer(@array_azimuth)) unless @array_azimuth.nil?
3886
- XMLHelper.add_element(pv_system, 'ArrayTilt', to_float(@array_tilt)) unless @array_tilt.nil?
3887
- XMLHelper.add_element(pv_system, 'MaxPowerOutput', to_float(@max_power_output)) unless @max_power_output.nil?
3888
- XMLHelper.add_element(pv_system, 'InverterEfficiency', to_float(@inverter_efficiency)) unless @inverter_efficiency.nil?
3889
- XMLHelper.add_element(pv_system, 'SystemLossesFraction', to_float(@system_losses_fraction)) unless @system_losses_fraction.nil?
3890
- XMLHelper.add_element(pv_system, 'YearModulesManufactured', to_integer(@year_modules_manufactured)) unless @year_modules_manufactured.nil?
3891
- XMLHelper.add_extension(pv_system, 'NumberofBedroomsServed', to_integer(@number_of_bedrooms_served)) unless @number_of_bedrooms_served.nil?
4205
+ XMLHelper.add_element(pv_system, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
4206
+ XMLHelper.add_element(pv_system, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4207
+ XMLHelper.add_element(pv_system, 'ModuleType', @module_type, :string, @module_type_isdefaulted) unless @module_type.nil?
4208
+ XMLHelper.add_element(pv_system, 'Tracking', @tracking, :string, @tracking_isdefaulted) unless @tracking.nil?
4209
+ XMLHelper.add_element(pv_system, 'ArrayOrientation', @array_orientation, :string) unless @array_orientation.nil?
4210
+ XMLHelper.add_element(pv_system, 'ArrayAzimuth', @array_azimuth, :integer) unless @array_azimuth.nil?
4211
+ XMLHelper.add_element(pv_system, 'ArrayTilt', @array_tilt, :float) unless @array_tilt.nil?
4212
+ XMLHelper.add_element(pv_system, 'MaxPowerOutput', @max_power_output, :float) unless @max_power_output.nil?
4213
+ XMLHelper.add_element(pv_system, 'NumberOfPanels', @number_of_panels, :integer) unless @number_of_panels.nil?
4214
+ XMLHelper.add_element(pv_system, 'InverterEfficiency', @inverter_efficiency, :float, @inverter_efficiency_isdefaulted) unless @inverter_efficiency.nil?
4215
+ XMLHelper.add_element(pv_system, 'SystemLossesFraction', @system_losses_fraction, :float, @system_losses_fraction_isdefaulted) unless @system_losses_fraction.nil?
4216
+ XMLHelper.add_element(pv_system, 'YearModulesManufactured', @year_modules_manufactured, :integer) unless @year_modules_manufactured.nil?
4217
+ XMLHelper.add_extension(pv_system, 'NumberofBedroomsServed', @number_of_bedrooms_served, :integer) unless @number_of_bedrooms_served.nil?
3892
4218
  end
3893
4219
 
3894
4220
  def from_oga(pv_system)
3895
4221
  return if pv_system.nil?
3896
4222
 
3897
4223
  @id = HPXML::get_id(pv_system)
3898
- @is_shared_system = to_boolean_or_nil(XMLHelper.get_value(pv_system, 'IsSharedSystem'))
3899
- @location = XMLHelper.get_value(pv_system, 'Location')
3900
- @module_type = XMLHelper.get_value(pv_system, 'ModuleType')
3901
- @tracking = XMLHelper.get_value(pv_system, 'Tracking')
3902
- @array_orientation = XMLHelper.get_value(pv_system, 'ArrayOrientation')
3903
- @array_azimuth = to_integer_or_nil(XMLHelper.get_value(pv_system, 'ArrayAzimuth'))
3904
- @array_tilt = to_float_or_nil(XMLHelper.get_value(pv_system, 'ArrayTilt'))
3905
- @max_power_output = to_float_or_nil(XMLHelper.get_value(pv_system, 'MaxPowerOutput'))
3906
- @inverter_efficiency = to_float_or_nil(XMLHelper.get_value(pv_system, 'InverterEfficiency'))
3907
- @system_losses_fraction = to_float_or_nil(XMLHelper.get_value(pv_system, 'SystemLossesFraction'))
3908
- @number_of_panels = to_integer_or_nil(XMLHelper.get_value(pv_system, 'NumberOfPanels'))
3909
- @year_modules_manufactured = to_integer_or_nil(XMLHelper.get_value(pv_system, 'YearModulesManufactured'))
3910
- @number_of_bedrooms_served = to_integer_or_nil(XMLHelper.get_value(pv_system, 'extension/NumberofBedroomsServed'))
4224
+ @is_shared_system = XMLHelper.get_value(pv_system, 'IsSharedSystem', :boolean)
4225
+ @location = XMLHelper.get_value(pv_system, 'Location', :string)
4226
+ @module_type = XMLHelper.get_value(pv_system, 'ModuleType', :string)
4227
+ @tracking = XMLHelper.get_value(pv_system, 'Tracking', :string)
4228
+ @array_orientation = XMLHelper.get_value(pv_system, 'ArrayOrientation', :string)
4229
+ @array_azimuth = XMLHelper.get_value(pv_system, 'ArrayAzimuth', :integer)
4230
+ @array_tilt = XMLHelper.get_value(pv_system, 'ArrayTilt', :float)
4231
+ @max_power_output = XMLHelper.get_value(pv_system, 'MaxPowerOutput', :float)
4232
+ @number_of_panels = XMLHelper.get_value(pv_system, 'NumberOfPanels', :integer)
4233
+ @inverter_efficiency = XMLHelper.get_value(pv_system, 'InverterEfficiency', :float)
4234
+ @system_losses_fraction = XMLHelper.get_value(pv_system, 'SystemLossesFraction', :float)
4235
+ @year_modules_manufactured = XMLHelper.get_value(pv_system, 'YearModulesManufactured', :integer)
4236
+ @number_of_bedrooms_served = XMLHelper.get_value(pv_system, 'extension/NumberofBedroomsServed', :integer)
4237
+ end
4238
+ end
4239
+
4240
+ class Generators < BaseArrayElement
4241
+ def add(**kwargs)
4242
+ self << Generator.new(@hpxml_object, **kwargs)
4243
+ end
4244
+
4245
+ def from_oga(hpxml)
4246
+ return if hpxml.nil?
4247
+
4248
+ XMLHelper.get_elements(hpxml, 'Building/BuildingDetails/Systems/extension/Generators/Generator').each do |generator|
4249
+ self << Generator.new(@hpxml_object, generator)
4250
+ end
4251
+ end
4252
+ end
4253
+
4254
+ class Generator < BaseElement
4255
+ ATTRS = [:id, :fuel_type, :annual_consumption_kbtu, :annual_output_kwh, :is_shared_system, :number_of_bedrooms_served]
4256
+ attr_accessor(*ATTRS)
4257
+
4258
+ def delete
4259
+ @hpxml_object.generators.delete(self)
4260
+ end
4261
+
4262
+ def check_for_errors
4263
+ errors = []
4264
+ return errors
4265
+ end
4266
+
4267
+ def to_oga(doc)
4268
+ return if nil?
4269
+
4270
+ generators = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'Systems', 'extension', 'Generators'])
4271
+ generator = XMLHelper.add_element(generators, 'Generator')
4272
+ sys_id = XMLHelper.add_element(generator, 'SystemIdentifier')
4273
+ XMLHelper.add_attribute(sys_id, 'id', @id)
4274
+ XMLHelper.add_element(generator, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
4275
+ XMLHelper.add_element(generator, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
4276
+ XMLHelper.add_element(generator, 'AnnualConsumptionkBtu', @annual_consumption_kbtu, :float) unless @annual_consumption_kbtu.nil?
4277
+ XMLHelper.add_element(generator, 'AnnualOutputkWh', @annual_output_kwh, :float) unless @annual_output_kwh.nil?
4278
+ XMLHelper.add_element(generator, 'NumberofBedroomsServed', @number_of_bedrooms_served, :integer) unless @number_of_bedrooms_served.nil?
4279
+ end
4280
+
4281
+ def from_oga(generator)
4282
+ return if generator.nil?
4283
+
4284
+ @id = HPXML::get_id(generator)
4285
+ @is_shared_system = XMLHelper.get_value(generator, 'IsSharedSystem', :boolean)
4286
+ @fuel_type = XMLHelper.get_value(generator, 'FuelType', :string)
4287
+ @annual_consumption_kbtu = XMLHelper.get_value(generator, 'AnnualConsumptionkBtu', :float)
4288
+ @annual_output_kwh = XMLHelper.get_value(generator, 'AnnualOutputkWh', :float)
4289
+ @number_of_bedrooms_served = XMLHelper.get_value(generator, 'NumberofBedroomsServed', :integer)
3911
4290
  end
3912
4291
  end
3913
4292
 
@@ -3960,43 +4339,43 @@ class HPXML < Object
3960
4339
  clothes_washer = XMLHelper.add_element(appliances, 'ClothesWasher')
3961
4340
  sys_id = XMLHelper.add_element(clothes_washer, 'SystemIdentifier')
3962
4341
  XMLHelper.add_attribute(sys_id, 'id', @id)
3963
- XMLHelper.add_element(clothes_washer, 'NumberofUnits', to_integer(@number_of_units)) unless @number_of_units.nil?
3964
- XMLHelper.add_element(clothes_washer, 'IsSharedAppliance', to_boolean(@is_shared_appliance)) unless @is_shared_appliance.nil?
3965
- XMLHelper.add_element(clothes_washer, 'NumberofUnitsServed', to_integer(@number_of_units_served)) unless @number_of_units_served.nil?
4342
+ XMLHelper.add_element(clothes_washer, 'NumberofUnits', @number_of_units, :integer) unless @number_of_units.nil?
4343
+ XMLHelper.add_element(clothes_washer, 'IsSharedAppliance', @is_shared_appliance, :boolean, @is_shared_appliance_isdefaulted) unless @is_shared_appliance.nil?
4344
+ XMLHelper.add_element(clothes_washer, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
3966
4345
  if not @water_heating_system_idref.nil?
3967
4346
  attached_water_heater = XMLHelper.add_element(clothes_washer, 'AttachedToWaterHeatingSystem')
3968
4347
  XMLHelper.add_attribute(attached_water_heater, 'idref', @water_heating_system_idref)
3969
4348
  end
3970
- XMLHelper.add_element(clothes_washer, 'Location', @location) unless @location.nil?
3971
- XMLHelper.add_element(clothes_washer, 'ModifiedEnergyFactor', to_float(@modified_energy_factor)) unless @modified_energy_factor.nil?
3972
- XMLHelper.add_element(clothes_washer, 'IntegratedModifiedEnergyFactor', to_float(@integrated_modified_energy_factor)) unless @integrated_modified_energy_factor.nil?
3973
- XMLHelper.add_element(clothes_washer, 'RatedAnnualkWh', to_float(@rated_annual_kwh)) unless @rated_annual_kwh.nil?
3974
- XMLHelper.add_element(clothes_washer, 'LabelElectricRate', to_float(@label_electric_rate)) unless @label_electric_rate.nil?
3975
- XMLHelper.add_element(clothes_washer, 'LabelGasRate', to_float(@label_gas_rate)) unless @label_gas_rate.nil?
3976
- XMLHelper.add_element(clothes_washer, 'LabelAnnualGasCost', to_float(@label_annual_gas_cost)) unless @label_annual_gas_cost.nil?
3977
- XMLHelper.add_element(clothes_washer, 'LabelUsage', to_float(@label_usage)) unless @label_usage.nil?
3978
- XMLHelper.add_element(clothes_washer, 'Capacity', to_float(@capacity)) unless @capacity.nil?
3979
- XMLHelper.add_extension(clothes_washer, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4349
+ XMLHelper.add_element(clothes_washer, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4350
+ XMLHelper.add_element(clothes_washer, 'ModifiedEnergyFactor', @modified_energy_factor, :float) unless @modified_energy_factor.nil?
4351
+ XMLHelper.add_element(clothes_washer, 'IntegratedModifiedEnergyFactor', @integrated_modified_energy_factor, :float, @integrated_modified_energy_factor_isdefaulted) unless @integrated_modified_energy_factor.nil?
4352
+ XMLHelper.add_element(clothes_washer, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4353
+ XMLHelper.add_element(clothes_washer, 'LabelElectricRate', @label_electric_rate, :float, @label_electric_rate_isdefaulted) unless @label_electric_rate.nil?
4354
+ XMLHelper.add_element(clothes_washer, 'LabelGasRate', @label_gas_rate, :float, @label_gas_rate_isdefaulted) unless @label_gas_rate.nil?
4355
+ XMLHelper.add_element(clothes_washer, 'LabelAnnualGasCost', @label_annual_gas_cost, :float, @label_annual_gas_cost_isdefaulted) unless @label_annual_gas_cost.nil?
4356
+ XMLHelper.add_element(clothes_washer, 'LabelUsage', @label_usage, :float, @label_usage_isdefaulted) unless @label_usage.nil?
4357
+ XMLHelper.add_element(clothes_washer, 'Capacity', @capacity, :float, @capacity_isdefaulted) unless @capacity.nil?
4358
+ XMLHelper.add_extension(clothes_washer, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
3980
4359
  end
3981
4360
 
3982
4361
  def from_oga(clothes_washer)
3983
4362
  return if clothes_washer.nil?
3984
4363
 
3985
4364
  @id = HPXML::get_id(clothes_washer)
3986
- @number_of_units = to_integer_or_nil(XMLHelper.get_value(clothes_washer, 'NumberofUnits'))
3987
- @is_shared_appliance = to_boolean_or_nil(XMLHelper.get_value(clothes_washer, 'IsSharedAppliance'))
3988
- @number_of_units_served = to_integer_or_nil(XMLHelper.get_value(clothes_washer, 'NumberofUnitsServed'))
3989
- @location = XMLHelper.get_value(clothes_washer, 'Location')
3990
- @modified_energy_factor = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'ModifiedEnergyFactor'))
3991
- @integrated_modified_energy_factor = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'IntegratedModifiedEnergyFactor'))
3992
- @rated_annual_kwh = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'RatedAnnualkWh'))
3993
- @label_electric_rate = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'LabelElectricRate'))
3994
- @label_gas_rate = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'LabelGasRate'))
3995
- @label_annual_gas_cost = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'LabelAnnualGasCost'))
3996
- @label_usage = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'LabelUsage'))
3997
- @capacity = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'Capacity'))
3998
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(clothes_washer, 'extension/UsageMultiplier'))
4365
+ @number_of_units = XMLHelper.get_value(clothes_washer, 'NumberofUnits', :integer)
4366
+ @is_shared_appliance = XMLHelper.get_value(clothes_washer, 'IsSharedAppliance', :boolean)
4367
+ @number_of_units_served = XMLHelper.get_value(clothes_washer, 'NumberofUnitsServed', :integer)
3999
4368
  @water_heating_system_idref = HPXML::get_idref(XMLHelper.get_element(clothes_washer, 'AttachedToWaterHeatingSystem'))
4369
+ @location = XMLHelper.get_value(clothes_washer, 'Location', :string)
4370
+ @modified_energy_factor = XMLHelper.get_value(clothes_washer, 'ModifiedEnergyFactor', :float)
4371
+ @integrated_modified_energy_factor = XMLHelper.get_value(clothes_washer, 'IntegratedModifiedEnergyFactor', :float)
4372
+ @rated_annual_kwh = XMLHelper.get_value(clothes_washer, 'RatedAnnualkWh', :float)
4373
+ @label_electric_rate = XMLHelper.get_value(clothes_washer, 'LabelElectricRate', :float)
4374
+ @label_gas_rate = XMLHelper.get_value(clothes_washer, 'LabelGasRate', :float)
4375
+ @label_annual_gas_cost = XMLHelper.get_value(clothes_washer, 'LabelAnnualGasCost', :float)
4376
+ @label_usage = XMLHelper.get_value(clothes_washer, 'LabelUsage', :float)
4377
+ @capacity = XMLHelper.get_value(clothes_washer, 'Capacity', :float)
4378
+ @usage_multiplier = XMLHelper.get_value(clothes_washer, 'extension/UsageMultiplier', :float)
4000
4379
  end
4001
4380
  end
4002
4381
 
@@ -4036,34 +4415,34 @@ class HPXML < Object
4036
4415
  clothes_dryer = XMLHelper.add_element(appliances, 'ClothesDryer')
4037
4416
  sys_id = XMLHelper.add_element(clothes_dryer, 'SystemIdentifier')
4038
4417
  XMLHelper.add_attribute(sys_id, 'id', @id)
4039
- XMLHelper.add_element(clothes_dryer, 'NumberofUnits', to_integer(@number_of_units)) unless @number_of_units.nil?
4040
- XMLHelper.add_element(clothes_dryer, 'IsSharedAppliance', to_boolean(@is_shared_appliance)) unless @is_shared_appliance.nil?
4041
- XMLHelper.add_element(clothes_dryer, 'NumberofUnitsServed', to_integer(@number_of_units_served)) unless @number_of_units_served.nil?
4042
- XMLHelper.add_element(clothes_dryer, 'Location', @location) unless @location.nil?
4043
- XMLHelper.add_element(clothes_dryer, 'FuelType', @fuel_type) unless @fuel_type.nil?
4044
- XMLHelper.add_element(clothes_dryer, 'EnergyFactor', to_float(@energy_factor)) unless @energy_factor.nil?
4045
- XMLHelper.add_element(clothes_dryer, 'CombinedEnergyFactor', to_float(@combined_energy_factor)) unless @combined_energy_factor.nil?
4046
- XMLHelper.add_element(clothes_dryer, 'ControlType', @control_type) unless @control_type.nil?
4047
- XMLHelper.add_extension(clothes_dryer, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4048
- XMLHelper.add_extension(clothes_dryer, 'IsVented', to_boolean(@is_vented)) unless @is_vented.nil?
4049
- XMLHelper.add_extension(clothes_dryer, 'VentedFlowRate', to_float(@vented_flow_rate)) unless @vented_flow_rate.nil?
4418
+ XMLHelper.add_element(clothes_dryer, 'NumberofUnits', @number_of_units, :integer) unless @number_of_units.nil?
4419
+ XMLHelper.add_element(clothes_dryer, 'IsSharedAppliance', @is_shared_appliance, :boolean, @is_shared_appliance_isdefaulted) unless @is_shared_appliance.nil?
4420
+ XMLHelper.add_element(clothes_dryer, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
4421
+ XMLHelper.add_element(clothes_dryer, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4422
+ XMLHelper.add_element(clothes_dryer, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
4423
+ XMLHelper.add_element(clothes_dryer, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
4424
+ XMLHelper.add_element(clothes_dryer, 'CombinedEnergyFactor', @combined_energy_factor, :float, @combined_energy_factor_isdefaulted) unless @combined_energy_factor.nil?
4425
+ XMLHelper.add_element(clothes_dryer, 'ControlType', @control_type, :string, @control_type_isdefaulted) unless @control_type.nil?
4426
+ XMLHelper.add_extension(clothes_dryer, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4427
+ XMLHelper.add_extension(clothes_dryer, 'IsVented', @is_vented, :boolean, @is_vented_isdefaulted) unless @is_vented.nil?
4428
+ XMLHelper.add_extension(clothes_dryer, 'VentedFlowRate', @vented_flow_rate, :float, @vented_flow_rate_isdefaulted) unless @vented_flow_rate.nil?
4050
4429
  end
4051
4430
 
4052
4431
  def from_oga(clothes_dryer)
4053
4432
  return if clothes_dryer.nil?
4054
4433
 
4055
4434
  @id = HPXML::get_id(clothes_dryer)
4056
- @number_of_units = to_integer_or_nil(XMLHelper.get_value(clothes_dryer, 'NumberofUnits'))
4057
- @is_shared_appliance = to_boolean_or_nil(XMLHelper.get_value(clothes_dryer, 'IsSharedAppliance'))
4058
- @number_of_units_served = to_integer_or_nil(XMLHelper.get_value(clothes_dryer, 'NumberofUnitsServed'))
4059
- @location = XMLHelper.get_value(clothes_dryer, 'Location')
4060
- @fuel_type = XMLHelper.get_value(clothes_dryer, 'FuelType')
4061
- @energy_factor = to_float_or_nil(XMLHelper.get_value(clothes_dryer, 'EnergyFactor'))
4062
- @combined_energy_factor = to_float_or_nil(XMLHelper.get_value(clothes_dryer, 'CombinedEnergyFactor'))
4063
- @control_type = XMLHelper.get_value(clothes_dryer, 'ControlType')
4064
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(clothes_dryer, 'extension/UsageMultiplier'))
4065
- @is_vented = to_boolean_or_nil(XMLHelper.get_value(clothes_dryer, 'extension/IsVented'))
4066
- @vented_flow_rate = to_float_or_nil(XMLHelper.get_value(clothes_dryer, 'extension/VentedFlowRate'))
4435
+ @number_of_units = XMLHelper.get_value(clothes_dryer, 'NumberofUnits', :integer)
4436
+ @is_shared_appliance = XMLHelper.get_value(clothes_dryer, 'IsSharedAppliance', :boolean)
4437
+ @number_of_units_served = XMLHelper.get_value(clothes_dryer, 'NumberofUnitsServed', :integer)
4438
+ @location = XMLHelper.get_value(clothes_dryer, 'Location', :string)
4439
+ @fuel_type = XMLHelper.get_value(clothes_dryer, 'FuelType', :string)
4440
+ @energy_factor = XMLHelper.get_value(clothes_dryer, 'EnergyFactor', :float)
4441
+ @combined_energy_factor = XMLHelper.get_value(clothes_dryer, 'CombinedEnergyFactor', :float)
4442
+ @control_type = XMLHelper.get_value(clothes_dryer, 'ControlType', :string)
4443
+ @usage_multiplier = XMLHelper.get_value(clothes_dryer, 'extension/UsageMultiplier', :float)
4444
+ @is_vented = XMLHelper.get_value(clothes_dryer, 'extension/IsVented', :boolean)
4445
+ @vented_flow_rate = XMLHelper.get_value(clothes_dryer, 'extension/VentedFlowRate', :float)
4067
4446
  end
4068
4447
  end
4069
4448
 
@@ -4115,37 +4494,37 @@ class HPXML < Object
4115
4494
  dishwasher = XMLHelper.add_element(appliances, 'Dishwasher')
4116
4495
  sys_id = XMLHelper.add_element(dishwasher, 'SystemIdentifier')
4117
4496
  XMLHelper.add_attribute(sys_id, 'id', @id)
4118
- XMLHelper.add_element(dishwasher, 'IsSharedAppliance', to_boolean(@is_shared_appliance)) unless @is_shared_appliance.nil?
4497
+ XMLHelper.add_element(dishwasher, 'IsSharedAppliance', @is_shared_appliance, :boolean, @is_shared_appliance_isdefaulted) unless @is_shared_appliance.nil?
4119
4498
  if not @water_heating_system_idref.nil?
4120
4499
  attached_water_heater = XMLHelper.add_element(dishwasher, 'AttachedToWaterHeatingSystem')
4121
4500
  XMLHelper.add_attribute(attached_water_heater, 'idref', @water_heating_system_idref)
4122
4501
  end
4123
- XMLHelper.add_element(dishwasher, 'Location', @location) unless @location.nil?
4124
- XMLHelper.add_element(dishwasher, 'RatedAnnualkWh', to_float(@rated_annual_kwh)) unless @rated_annual_kwh.nil?
4125
- XMLHelper.add_element(dishwasher, 'EnergyFactor', to_float(@energy_factor)) unless @energy_factor.nil?
4126
- XMLHelper.add_element(dishwasher, 'PlaceSettingCapacity', to_integer(@place_setting_capacity)) unless @place_setting_capacity.nil?
4127
- XMLHelper.add_element(dishwasher, 'LabelElectricRate', to_float(@label_electric_rate)) unless @label_electric_rate.nil?
4128
- XMLHelper.add_element(dishwasher, 'LabelGasRate', to_float(@label_gas_rate)) unless @label_gas_rate.nil?
4129
- XMLHelper.add_element(dishwasher, 'LabelAnnualGasCost', to_float(@label_annual_gas_cost)) unless @label_annual_gas_cost.nil?
4130
- XMLHelper.add_element(dishwasher, 'LabelUsage', to_float(@label_usage)) unless @label_usage.nil?
4131
- XMLHelper.add_extension(dishwasher, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4502
+ XMLHelper.add_element(dishwasher, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4503
+ XMLHelper.add_element(dishwasher, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4504
+ XMLHelper.add_element(dishwasher, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
4505
+ XMLHelper.add_element(dishwasher, 'PlaceSettingCapacity', @place_setting_capacity, :integer, @place_setting_capacity_isdefaulted) unless @place_setting_capacity.nil?
4506
+ XMLHelper.add_element(dishwasher, 'LabelElectricRate', @label_electric_rate, :float, @label_electric_rate_isdefaulted) unless @label_electric_rate.nil?
4507
+ XMLHelper.add_element(dishwasher, 'LabelGasRate', @label_gas_rate, :float, @label_gas_rate_isdefaulted) unless @label_gas_rate.nil?
4508
+ XMLHelper.add_element(dishwasher, 'LabelAnnualGasCost', @label_annual_gas_cost, :float, @label_annual_gas_cost_isdefaulted) unless @label_annual_gas_cost.nil?
4509
+ XMLHelper.add_element(dishwasher, 'LabelUsage', @label_usage, :float, @label_usage_isdefaulted) unless @label_usage.nil?
4510
+ XMLHelper.add_extension(dishwasher, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4132
4511
  end
4133
4512
 
4134
4513
  def from_oga(dishwasher)
4135
4514
  return if dishwasher.nil?
4136
4515
 
4137
4516
  @id = HPXML::get_id(dishwasher)
4138
- @is_shared_appliance = to_boolean_or_nil(XMLHelper.get_value(dishwasher, 'IsSharedAppliance'))
4139
- @location = XMLHelper.get_value(dishwasher, 'Location')
4140
- @rated_annual_kwh = to_float_or_nil(XMLHelper.get_value(dishwasher, 'RatedAnnualkWh'))
4141
- @energy_factor = to_float_or_nil(XMLHelper.get_value(dishwasher, 'EnergyFactor'))
4142
- @place_setting_capacity = to_integer_or_nil(XMLHelper.get_value(dishwasher, 'PlaceSettingCapacity'))
4143
- @label_electric_rate = to_float_or_nil(XMLHelper.get_value(dishwasher, 'LabelElectricRate'))
4144
- @label_gas_rate = to_float_or_nil(XMLHelper.get_value(dishwasher, 'LabelGasRate'))
4145
- @label_annual_gas_cost = to_float_or_nil(XMLHelper.get_value(dishwasher, 'LabelAnnualGasCost'))
4146
- @label_usage = to_float_or_nil(XMLHelper.get_value(dishwasher, 'LabelUsage'))
4147
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(dishwasher, 'extension/UsageMultiplier'))
4517
+ @is_shared_appliance = XMLHelper.get_value(dishwasher, 'IsSharedAppliance', :boolean)
4148
4518
  @water_heating_system_idref = HPXML::get_idref(XMLHelper.get_element(dishwasher, 'AttachedToWaterHeatingSystem'))
4519
+ @location = XMLHelper.get_value(dishwasher, 'Location', :string)
4520
+ @rated_annual_kwh = XMLHelper.get_value(dishwasher, 'RatedAnnualkWh', :float)
4521
+ @energy_factor = XMLHelper.get_value(dishwasher, 'EnergyFactor', :float)
4522
+ @place_setting_capacity = XMLHelper.get_value(dishwasher, 'PlaceSettingCapacity', :integer)
4523
+ @label_electric_rate = XMLHelper.get_value(dishwasher, 'LabelElectricRate', :float)
4524
+ @label_gas_rate = XMLHelper.get_value(dishwasher, 'LabelGasRate', :float)
4525
+ @label_annual_gas_cost = XMLHelper.get_value(dishwasher, 'LabelAnnualGasCost', :float)
4526
+ @label_usage = XMLHelper.get_value(dishwasher, 'LabelUsage', :float)
4527
+ @usage_multiplier = XMLHelper.get_value(dishwasher, 'extension/UsageMultiplier', :float)
4149
4528
  end
4150
4529
  end
4151
4530
 
@@ -4174,18 +4553,6 @@ class HPXML < Object
4174
4553
 
4175
4554
  def check_for_errors
4176
4555
  errors = []
4177
-
4178
- if @hpxml_object.refrigerators.size > 1
4179
- primary_indicator = false
4180
- @hpxml_object.refrigerators.each do |refrigerator|
4181
- next unless not refrigerator.primary_indicator.nil?
4182
- fail 'More than one refrigerator designated as the primary.' if refrigerator.primary_indicator && primary_indicator
4183
-
4184
- primary_indicator = true if refrigerator.primary_indicator
4185
- end
4186
- fail 'Could not find a primary refrigerator.' if not primary_indicator
4187
- end
4188
-
4189
4556
  return errors
4190
4557
  end
4191
4558
 
@@ -4196,28 +4563,28 @@ class HPXML < Object
4196
4563
  refrigerator = XMLHelper.add_element(appliances, 'Refrigerator')
4197
4564
  sys_id = XMLHelper.add_element(refrigerator, 'SystemIdentifier')
4198
4565
  XMLHelper.add_attribute(sys_id, 'id', @id)
4199
- XMLHelper.add_element(refrigerator, 'Location', @location) unless @location.nil?
4200
- XMLHelper.add_element(refrigerator, 'RatedAnnualkWh', to_float(@rated_annual_kwh)) unless @rated_annual_kwh.nil?
4201
- XMLHelper.add_element(refrigerator, 'PrimaryIndicator', to_boolean(@primary_indicator)) unless @primary_indicator.nil?
4202
- XMLHelper.add_extension(refrigerator, 'AdjustedAnnualkWh', to_float(@adjusted_annual_kwh)) unless @adjusted_annual_kwh.nil?
4203
- XMLHelper.add_extension(refrigerator, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4204
- XMLHelper.add_extension(refrigerator, 'WeekdayScheduleFractions', @weekday_fractions) unless @weekday_fractions.nil?
4205
- XMLHelper.add_extension(refrigerator, 'WeekendScheduleFractions', @weekend_fractions) unless @weekend_fractions.nil?
4206
- XMLHelper.add_extension(refrigerator, 'MonthlyScheduleMultipliers', @monthly_multipliers) unless @monthly_multipliers.nil?
4566
+ XMLHelper.add_element(refrigerator, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4567
+ XMLHelper.add_element(refrigerator, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4568
+ XMLHelper.add_element(refrigerator, 'PrimaryIndicator', @primary_indicator, :boolean, @primary_indicator_isdefaulted) unless @primary_indicator.nil?
4569
+ XMLHelper.add_extension(refrigerator, 'AdjustedAnnualkWh', @adjusted_annual_kwh, :float) unless @adjusted_annual_kwh.nil?
4570
+ XMLHelper.add_extension(refrigerator, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4571
+ XMLHelper.add_extension(refrigerator, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
4572
+ XMLHelper.add_extension(refrigerator, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
4573
+ XMLHelper.add_extension(refrigerator, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4207
4574
  end
4208
4575
 
4209
4576
  def from_oga(refrigerator)
4210
4577
  return if refrigerator.nil?
4211
4578
 
4212
4579
  @id = HPXML::get_id(refrigerator)
4213
- @location = XMLHelper.get_value(refrigerator, 'Location')
4214
- @rated_annual_kwh = to_float_or_nil(XMLHelper.get_value(refrigerator, 'RatedAnnualkWh'))
4215
- @primary_indicator = to_boolean_or_nil(XMLHelper.get_value(refrigerator, 'PrimaryIndicator'))
4216
- @adjusted_annual_kwh = to_float_or_nil(XMLHelper.get_value(refrigerator, 'extension/AdjustedAnnualkWh'))
4217
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(refrigerator, 'extension/UsageMultiplier'))
4218
- @weekday_fractions = XMLHelper.get_value(refrigerator, 'extension/WeekdayScheduleFractions')
4219
- @weekend_fractions = XMLHelper.get_value(refrigerator, 'extension/WeekendScheduleFractions')
4220
- @monthly_multipliers = XMLHelper.get_value(refrigerator, 'extension/MonthlyScheduleMultipliers')
4580
+ @location = XMLHelper.get_value(refrigerator, 'Location', :string)
4581
+ @rated_annual_kwh = XMLHelper.get_value(refrigerator, 'RatedAnnualkWh', :float)
4582
+ @primary_indicator = XMLHelper.get_value(refrigerator, 'PrimaryIndicator', :boolean)
4583
+ @adjusted_annual_kwh = XMLHelper.get_value(refrigerator, 'extension/AdjustedAnnualkWh', :float)
4584
+ @usage_multiplier = XMLHelper.get_value(refrigerator, 'extension/UsageMultiplier', :float)
4585
+ @weekday_fractions = XMLHelper.get_value(refrigerator, 'extension/WeekdayScheduleFractions', :string)
4586
+ @weekend_fractions = XMLHelper.get_value(refrigerator, 'extension/WeekendScheduleFractions', :string)
4587
+ @monthly_multipliers = XMLHelper.get_value(refrigerator, 'extension/MonthlyScheduleMultipliers', :string)
4221
4588
  end
4222
4589
  end
4223
4590
 
@@ -4256,26 +4623,26 @@ class HPXML < Object
4256
4623
  freezer = XMLHelper.add_element(appliances, 'Freezer')
4257
4624
  sys_id = XMLHelper.add_element(freezer, 'SystemIdentifier')
4258
4625
  XMLHelper.add_attribute(sys_id, 'id', @id)
4259
- XMLHelper.add_element(freezer, 'Location', @location) unless @location.nil?
4260
- XMLHelper.add_element(freezer, 'RatedAnnualkWh', to_float(@rated_annual_kwh)) unless @rated_annual_kwh.nil?
4261
- XMLHelper.add_extension(freezer, 'AdjustedAnnualkWh', to_float(@adjusted_annual_kwh)) unless @adjusted_annual_kwh.nil?
4262
- XMLHelper.add_extension(freezer, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4263
- XMLHelper.add_extension(freezer, 'WeekdayScheduleFractions', @weekday_fractions) unless @weekday_fractions.nil?
4264
- XMLHelper.add_extension(freezer, 'WeekendScheduleFractions', @weekend_fractions) unless @weekend_fractions.nil?
4265
- XMLHelper.add_extension(freezer, 'MonthlyScheduleMultipliers', @monthly_multipliers) unless @monthly_multipliers.nil?
4626
+ XMLHelper.add_element(freezer, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4627
+ XMLHelper.add_element(freezer, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4628
+ XMLHelper.add_extension(freezer, 'AdjustedAnnualkWh', @adjusted_annual_kwh, :float) unless @adjusted_annual_kwh.nil?
4629
+ XMLHelper.add_extension(freezer, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4630
+ XMLHelper.add_extension(freezer, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
4631
+ XMLHelper.add_extension(freezer, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
4632
+ XMLHelper.add_extension(freezer, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4266
4633
  end
4267
4634
 
4268
4635
  def from_oga(freezer)
4269
4636
  return if freezer.nil?
4270
4637
 
4271
4638
  @id = HPXML::get_id(freezer)
4272
- @location = XMLHelper.get_value(freezer, 'Location')
4273
- @rated_annual_kwh = to_float_or_nil(XMLHelper.get_value(freezer, 'RatedAnnualkWh'))
4274
- @adjusted_annual_kwh = to_float_or_nil(XMLHelper.get_value(freezer, 'extension/AdjustedAnnualkWh'))
4275
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(freezer, 'extension/UsageMultiplier'))
4276
- @weekday_fractions = XMLHelper.get_value(freezer, 'extension/WeekdayScheduleFractions')
4277
- @weekend_fractions = XMLHelper.get_value(freezer, 'extension/WeekendScheduleFractions')
4278
- @monthly_multipliers = XMLHelper.get_value(freezer, 'extension/MonthlyScheduleMultipliers')
4639
+ @location = XMLHelper.get_value(freezer, 'Location', :string)
4640
+ @rated_annual_kwh = XMLHelper.get_value(freezer, 'RatedAnnualkWh', :float)
4641
+ @adjusted_annual_kwh = XMLHelper.get_value(freezer, 'extension/AdjustedAnnualkWh', :float)
4642
+ @usage_multiplier = XMLHelper.get_value(freezer, 'extension/UsageMultiplier', :float)
4643
+ @weekday_fractions = XMLHelper.get_value(freezer, 'extension/WeekdayScheduleFractions', :string)
4644
+ @weekend_fractions = XMLHelper.get_value(freezer, 'extension/WeekendScheduleFractions', :string)
4645
+ @monthly_multipliers = XMLHelper.get_value(freezer, 'extension/MonthlyScheduleMultipliers', :string)
4279
4646
  end
4280
4647
  end
4281
4648
 
@@ -4294,7 +4661,8 @@ class HPXML < Object
4294
4661
  end
4295
4662
 
4296
4663
  class Dehumidifier < BaseElement
4297
- ATTRS = [:id, :capacity, :energy_factor, :integrated_energy_factor, :rh_setpoint, :fraction_served]
4664
+ ATTRS = [:id, :type, :capacity, :energy_factor, :integrated_energy_factor, :rh_setpoint, :fraction_served,
4665
+ :location]
4298
4666
  attr_accessor(*ATTRS)
4299
4667
 
4300
4668
  def delete
@@ -4313,22 +4681,26 @@ class HPXML < Object
4313
4681
  dehumidifier = XMLHelper.add_element(appliances, 'Dehumidifier')
4314
4682
  sys_id = XMLHelper.add_element(dehumidifier, 'SystemIdentifier')
4315
4683
  XMLHelper.add_attribute(sys_id, 'id', @id)
4316
- XMLHelper.add_element(dehumidifier, 'Capacity', to_float(@capacity)) unless @capacity.nil?
4317
- XMLHelper.add_element(dehumidifier, 'EnergyFactor', to_float(@energy_factor)) unless @energy_factor.nil?
4318
- XMLHelper.add_element(dehumidifier, 'IntegratedEnergyFactor', to_float(@integrated_energy_factor)) unless @integrated_energy_factor.nil?
4319
- XMLHelper.add_element(dehumidifier, 'DehumidistatSetpoint', to_float(@rh_setpoint)) unless @rh_setpoint.nil?
4320
- XMLHelper.add_element(dehumidifier, 'FractionDehumidificationLoadServed', to_float(@fraction_served)) unless @fraction_served.nil?
4684
+ XMLHelper.add_element(dehumidifier, 'Type', @type, :string) unless @type.nil?
4685
+ XMLHelper.add_element(dehumidifier, 'Location', @location, :string) unless @location.nil?
4686
+ XMLHelper.add_element(dehumidifier, 'Capacity', @capacity, :float) unless @capacity.nil?
4687
+ XMLHelper.add_element(dehumidifier, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
4688
+ XMLHelper.add_element(dehumidifier, 'IntegratedEnergyFactor', @integrated_energy_factor, :float) unless @integrated_energy_factor.nil?
4689
+ XMLHelper.add_element(dehumidifier, 'DehumidistatSetpoint', @rh_setpoint, :float) unless @rh_setpoint.nil?
4690
+ XMLHelper.add_element(dehumidifier, 'FractionDehumidificationLoadServed', @fraction_served, :float) unless @fraction_served.nil?
4321
4691
  end
4322
4692
 
4323
4693
  def from_oga(dehumidifier)
4324
4694
  return if dehumidifier.nil?
4325
4695
 
4326
4696
  @id = HPXML::get_id(dehumidifier)
4327
- @capacity = to_float_or_nil(XMLHelper.get_value(dehumidifier, 'Capacity'))
4328
- @energy_factor = to_float_or_nil(XMLHelper.get_value(dehumidifier, 'EnergyFactor'))
4329
- @integrated_energy_factor = to_float_or_nil(XMLHelper.get_value(dehumidifier, 'IntegratedEnergyFactor'))
4330
- @rh_setpoint = to_float_or_nil(XMLHelper.get_value(dehumidifier, 'DehumidistatSetpoint'))
4331
- @fraction_served = to_float_or_nil(XMLHelper.get_value(dehumidifier, 'FractionDehumidificationLoadServed'))
4697
+ @type = XMLHelper.get_value(dehumidifier, 'Type', :string)
4698
+ @location = XMLHelper.get_value(dehumidifier, 'Location', :string)
4699
+ @capacity = XMLHelper.get_value(dehumidifier, 'Capacity', :float)
4700
+ @energy_factor = XMLHelper.get_value(dehumidifier, 'EnergyFactor', :float)
4701
+ @integrated_energy_factor = XMLHelper.get_value(dehumidifier, 'IntegratedEnergyFactor', :float)
4702
+ @rh_setpoint = XMLHelper.get_value(dehumidifier, 'DehumidistatSetpoint', :float)
4703
+ @fraction_served = XMLHelper.get_value(dehumidifier, 'FractionDehumidificationLoadServed', :float)
4332
4704
  end
4333
4705
  end
4334
4706
 
@@ -4367,26 +4739,26 @@ class HPXML < Object
4367
4739
  cooking_range = XMLHelper.add_element(appliances, 'CookingRange')
4368
4740
  sys_id = XMLHelper.add_element(cooking_range, 'SystemIdentifier')
4369
4741
  XMLHelper.add_attribute(sys_id, 'id', @id)
4370
- XMLHelper.add_element(cooking_range, 'Location', @location) unless @location.nil?
4371
- XMLHelper.add_element(cooking_range, 'FuelType', @fuel_type) unless @fuel_type.nil?
4372
- XMLHelper.add_element(cooking_range, 'IsInduction', to_boolean(@is_induction)) unless @is_induction.nil?
4373
- XMLHelper.add_extension(cooking_range, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4374
- XMLHelper.add_extension(cooking_range, 'WeekdayScheduleFractions', @weekday_fractions) unless @weekday_fractions.nil?
4375
- XMLHelper.add_extension(cooking_range, 'WeekendScheduleFractions', @weekend_fractions) unless @weekend_fractions.nil?
4376
- XMLHelper.add_extension(cooking_range, 'MonthlyScheduleMultipliers', @monthly_multipliers) unless @monthly_multipliers.nil?
4742
+ XMLHelper.add_element(cooking_range, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4743
+ XMLHelper.add_element(cooking_range, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
4744
+ XMLHelper.add_element(cooking_range, 'IsInduction', @is_induction, :boolean, @is_induction_isdefaulted) unless @is_induction.nil?
4745
+ XMLHelper.add_extension(cooking_range, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4746
+ XMLHelper.add_extension(cooking_range, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
4747
+ XMLHelper.add_extension(cooking_range, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
4748
+ XMLHelper.add_extension(cooking_range, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4377
4749
  end
4378
4750
 
4379
4751
  def from_oga(cooking_range)
4380
4752
  return if cooking_range.nil?
4381
4753
 
4382
4754
  @id = HPXML::get_id(cooking_range)
4383
- @location = XMLHelper.get_value(cooking_range, 'Location')
4384
- @fuel_type = XMLHelper.get_value(cooking_range, 'FuelType')
4385
- @is_induction = to_boolean_or_nil(XMLHelper.get_value(cooking_range, 'IsInduction'))
4386
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(cooking_range, 'extension/UsageMultiplier'))
4387
- @weekday_fractions = XMLHelper.get_value(cooking_range, 'extension/WeekdayScheduleFractions')
4388
- @weekend_fractions = XMLHelper.get_value(cooking_range, 'extension/WeekendScheduleFractions')
4389
- @monthly_multipliers = XMLHelper.get_value(cooking_range, 'extension/MonthlyScheduleMultipliers')
4755
+ @location = XMLHelper.get_value(cooking_range, 'Location', :string)
4756
+ @fuel_type = XMLHelper.get_value(cooking_range, 'FuelType', :string)
4757
+ @is_induction = XMLHelper.get_value(cooking_range, 'IsInduction', :boolean)
4758
+ @usage_multiplier = XMLHelper.get_value(cooking_range, 'extension/UsageMultiplier', :float)
4759
+ @weekday_fractions = XMLHelper.get_value(cooking_range, 'extension/WeekdayScheduleFractions', :string)
4760
+ @weekend_fractions = XMLHelper.get_value(cooking_range, 'extension/WeekendScheduleFractions', :string)
4761
+ @monthly_multipliers = XMLHelper.get_value(cooking_range, 'extension/MonthlyScheduleMultipliers', :string)
4390
4762
  end
4391
4763
  end
4392
4764
 
@@ -4424,14 +4796,14 @@ class HPXML < Object
4424
4796
  oven = XMLHelper.add_element(appliances, 'Oven')
4425
4797
  sys_id = XMLHelper.add_element(oven, 'SystemIdentifier')
4426
4798
  XMLHelper.add_attribute(sys_id, 'id', @id)
4427
- XMLHelper.add_element(oven, 'IsConvection', to_boolean(@is_convection)) unless @is_convection.nil?
4799
+ XMLHelper.add_element(oven, 'IsConvection', @is_convection, :boolean, @is_convection_isdefaulted) unless @is_convection.nil?
4428
4800
  end
4429
4801
 
4430
4802
  def from_oga(oven)
4431
4803
  return if oven.nil?
4432
4804
 
4433
4805
  @id = HPXML::get_id(oven)
4434
- @is_convection = to_boolean_or_nil(XMLHelper.get_value(oven, 'IsConvection'))
4806
+ @is_convection = XMLHelper.get_value(oven, 'IsConvection', :boolean)
4435
4807
  end
4436
4808
  end
4437
4809
 
@@ -4469,8 +4841,8 @@ class HPXML < Object
4469
4841
  lighting_group = XMLHelper.add_element(lighting, 'LightingGroup')
4470
4842
  sys_id = XMLHelper.add_element(lighting_group, 'SystemIdentifier')
4471
4843
  XMLHelper.add_attribute(sys_id, 'id', @id)
4472
- XMLHelper.add_element(lighting_group, 'Location', @location) unless @location.nil?
4473
- XMLHelper.add_element(lighting_group, 'FractionofUnitsInLocation', to_float(@fraction_of_units_in_location)) unless @fraction_of_units_in_location.nil?
4844
+ XMLHelper.add_element(lighting_group, 'Location', @location, :string) unless @location.nil?
4845
+ XMLHelper.add_element(lighting_group, 'FractionofUnitsInLocation', @fraction_of_units_in_location, :float) unless @fraction_of_units_in_location.nil?
4474
4846
  if not @lighting_type.nil?
4475
4847
  lighting_type = XMLHelper.add_element(lighting_group, 'LightingType')
4476
4848
  XMLHelper.add_element(lighting_type, @lighting_type)
@@ -4481,8 +4853,8 @@ class HPXML < Object
4481
4853
  return if lighting_group.nil?
4482
4854
 
4483
4855
  @id = HPXML::get_id(lighting_group)
4484
- @location = XMLHelper.get_value(lighting_group, 'Location')
4485
- @fraction_of_units_in_location = to_float_or_nil(XMLHelper.get_value(lighting_group, 'FractionofUnitsInLocation'))
4856
+ @location = XMLHelper.get_value(lighting_group, 'Location', :string)
4857
+ @fraction_of_units_in_location = XMLHelper.get_value(lighting_group, 'FractionofUnitsInLocation', :float)
4486
4858
  @lighting_type = XMLHelper.get_child_name(lighting_group, 'LightingType')
4487
4859
  end
4488
4860
  end
@@ -4492,8 +4864,8 @@ class HPXML < Object
4492
4864
  :interior_weekday_fractions, :interior_weekend_fractions, :interior_monthly_multipliers,
4493
4865
  :garage_weekday_fractions, :garage_weekend_fractions, :garage_monthly_multipliers,
4494
4866
  :exterior_weekday_fractions, :exterior_weekend_fractions, :exterior_monthly_multipliers,
4495
- :holiday_exists, :holiday_kwh_per_day, :holiday_period_begin_month, :holiday_period_begin_day_of_month,
4496
- :holiday_period_end_month, :holiday_period_end_day_of_month, :holiday_weekday_fractions, :holiday_weekend_fractions]
4867
+ :holiday_exists, :holiday_kwh_per_day, :holiday_period_begin_month, :holiday_period_begin_day,
4868
+ :holiday_period_end_month, :holiday_period_end_day, :holiday_weekday_fractions, :holiday_weekend_fractions]
4497
4869
  attr_accessor(*ATTRS)
4498
4870
 
4499
4871
  def check_for_errors
@@ -4505,31 +4877,31 @@ class HPXML < Object
4505
4877
  return if nil?
4506
4878
 
4507
4879
  lighting = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'Lighting'])
4508
- XMLHelper.add_extension(lighting, 'InteriorUsageMultiplier', to_float(@interior_usage_multiplier)) unless @interior_usage_multiplier.nil?
4509
- XMLHelper.add_extension(lighting, 'GarageUsageMultiplier', to_float(@garage_usage_multiplier)) unless @garage_usage_multiplier.nil?
4510
- XMLHelper.add_extension(lighting, 'ExteriorUsageMultiplier', to_float(@exterior_usage_multiplier)) unless @exterior_usage_multiplier.nil?
4511
- XMLHelper.add_extension(lighting, 'InteriorWeekdayScheduleFractions', @interior_weekday_fractions) unless @interior_weekday_fractions.nil?
4512
- XMLHelper.add_extension(lighting, 'InteriorWeekendScheduleFractions', @interior_weekend_fractions) unless @interior_weekend_fractions.nil?
4513
- XMLHelper.add_extension(lighting, 'InteriorMonthlyScheduleMultipliers', @interior_monthly_multipliers) unless @interior_monthly_multipliers.nil?
4514
- XMLHelper.add_extension(lighting, 'GarageWeekdayScheduleFractions', @garage_weekday_fractions) unless @garage_weekday_fractions.nil?
4515
- XMLHelper.add_extension(lighting, 'GarageWeekendScheduleFractions', @garage_weekend_fractions) unless @garage_weekend_fractions.nil?
4516
- XMLHelper.add_extension(lighting, 'GarageMonthlyScheduleMultipliers', @garage_monthly_multipliers) unless @garage_monthly_multipliers.nil?
4517
- XMLHelper.add_extension(lighting, 'ExteriorWeekdayScheduleFractions', @exterior_weekday_fractions) unless @exterior_weekday_fractions.nil?
4518
- XMLHelper.add_extension(lighting, 'ExteriorWeekendScheduleFractions', @exterior_weekend_fractions) unless @exterior_weekend_fractions.nil?
4519
- XMLHelper.add_extension(lighting, 'ExteriorMonthlyScheduleMultipliers', @exterior_monthly_multipliers) unless @exterior_monthly_multipliers.nil?
4880
+ XMLHelper.add_extension(lighting, 'InteriorUsageMultiplier', @interior_usage_multiplier, :float, @interior_usage_multiplier_isdefaulted) unless @interior_usage_multiplier.nil?
4881
+ XMLHelper.add_extension(lighting, 'GarageUsageMultiplier', @garage_usage_multiplier, :float, @garage_usage_multiplier_isdefaulted) unless @garage_usage_multiplier.nil?
4882
+ XMLHelper.add_extension(lighting, 'ExteriorUsageMultiplier', @exterior_usage_multiplier, :float, @exterior_usage_multiplier_isdefaulted) unless @exterior_usage_multiplier.nil?
4883
+ XMLHelper.add_extension(lighting, 'InteriorWeekdayScheduleFractions', @interior_weekday_fractions, :string, @interior_weekday_fractions_isdefaulted) unless @interior_weekday_fractions.nil?
4884
+ XMLHelper.add_extension(lighting, 'InteriorWeekendScheduleFractions', @interior_weekend_fractions, :string, @interior_weekend_fractions_isdefaulted) unless @interior_weekend_fractions.nil?
4885
+ XMLHelper.add_extension(lighting, 'InteriorMonthlyScheduleMultipliers', @interior_monthly_multipliers, :string, @interior_monthly_multipliers_isdefaulted) unless @interior_monthly_multipliers.nil?
4886
+ XMLHelper.add_extension(lighting, 'GarageWeekdayScheduleFractions', @garage_weekday_fractions, :string, @garage_weekday_fractions_isdefaulted) unless @garage_weekday_fractions.nil?
4887
+ XMLHelper.add_extension(lighting, 'GarageWeekendScheduleFractions', @garage_weekend_fractions, :string, @garage_weekend_fractions_isdefaulted) unless @garage_weekend_fractions.nil?
4888
+ XMLHelper.add_extension(lighting, 'GarageMonthlyScheduleMultipliers', @garage_monthly_multipliers, :string, @garage_monthly_multipliers_isdefaulted) unless @garage_monthly_multipliers.nil?
4889
+ XMLHelper.add_extension(lighting, 'ExteriorWeekdayScheduleFractions', @exterior_weekday_fractions, :string, @exterior_weekday_fractions_isdefaulted) unless @exterior_weekday_fractions.nil?
4890
+ XMLHelper.add_extension(lighting, 'ExteriorWeekendScheduleFractions', @exterior_weekend_fractions, :string, @exterior_weekend_fractions_isdefaulted) unless @exterior_weekend_fractions.nil?
4891
+ XMLHelper.add_extension(lighting, 'ExteriorMonthlyScheduleMultipliers', @exterior_monthly_multipliers, :string, @exterior_monthly_multipliers_isdefaulted) unless @exterior_monthly_multipliers.nil?
4520
4892
  if @holiday_exists
4521
4893
  exterior_holiday_lighting = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'Lighting', 'extension', 'ExteriorHolidayLighting'])
4522
4894
  if not @holiday_kwh_per_day.nil?
4523
4895
  holiday_lighting_load = XMLHelper.add_element(exterior_holiday_lighting, 'Load')
4524
- XMLHelper.add_element(holiday_lighting_load, 'Units', 'kWh/day')
4525
- XMLHelper.add_element(holiday_lighting_load, 'Value', to_float(@holiday_kwh_per_day))
4896
+ XMLHelper.add_element(holiday_lighting_load, 'Units', 'kWh/day', :string)
4897
+ XMLHelper.add_element(holiday_lighting_load, 'Value', @holiday_kwh_per_day, :float, @holiday_kwh_per_day_isdefaulted)
4526
4898
  end
4527
- XMLHelper.add_element(exterior_holiday_lighting, 'PeriodBeginMonth', to_integer(@holiday_period_begin_month)) unless @holiday_period_begin_month.nil?
4528
- XMLHelper.add_element(exterior_holiday_lighting, 'PeriodBeginDayOfMonth', to_integer(@holiday_period_begin_day_of_month)) unless @holiday_period_begin_day_of_month.nil?
4529
- XMLHelper.add_element(exterior_holiday_lighting, 'PeriodEndMonth', to_integer(@holiday_period_end_month)) unless @holiday_period_end_month.nil?
4530
- XMLHelper.add_element(exterior_holiday_lighting, 'PeriodEndDayOfMonth', to_integer(@holiday_period_end_day_of_month)) unless @holiday_period_end_day_of_month.nil?
4531
- XMLHelper.add_element(exterior_holiday_lighting, 'WeekdayScheduleFractions', @holiday_weekday_fractions) unless @holiday_weekday_fractions.nil?
4532
- XMLHelper.add_element(exterior_holiday_lighting, 'WeekendScheduleFractions', @holiday_weekend_fractions) unless @holiday_weekend_fractions.nil?
4899
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodBeginMonth', @holiday_period_begin_month, :integer, @holiday_period_begin_month_isdefaulted) unless @holiday_period_begin_month.nil?
4900
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodBeginDayOfMonth', @holiday_period_begin_day, :integer, @holiday_period_begin_day_isdefaulted) unless @holiday_period_begin_day.nil?
4901
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodEndMonth', @holiday_period_end_month, :integer, @holiday_period_end_month_isdefaulted) unless @holiday_period_end_month.nil?
4902
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodEndDayOfMonth', @holiday_period_end_day, :integer, @holiday_period_end_day_isdefaulted) unless @holiday_period_end_day.nil?
4903
+ XMLHelper.add_element(exterior_holiday_lighting, 'WeekdayScheduleFractions', @holiday_weekday_fractions, :string, @holiday_weekday_fractions_isdefaulted) unless @holiday_weekday_fractions.nil?
4904
+ XMLHelper.add_element(exterior_holiday_lighting, 'WeekendScheduleFractions', @holiday_weekend_fractions, :string, @holiday_weekend_fractions_isdefaulted) unless @holiday_weekend_fractions.nil?
4533
4905
  end
4534
4906
  end
4535
4907
 
@@ -4539,27 +4911,27 @@ class HPXML < Object
4539
4911
  lighting = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/Lighting')
4540
4912
  return if lighting.nil?
4541
4913
 
4542
- @interior_usage_multiplier = to_float_or_nil(XMLHelper.get_value(lighting, 'extension/InteriorUsageMultiplier'))
4543
- @garage_usage_multiplier = to_float_or_nil(XMLHelper.get_value(lighting, 'extension/GarageUsageMultiplier'))
4544
- @exterior_usage_multiplier = to_float_or_nil(XMLHelper.get_value(lighting, 'extension/ExteriorUsageMultiplier'))
4545
- @interior_weekday_fractions = XMLHelper.get_value(lighting, 'extension/InteriorWeekdayScheduleFractions')
4546
- @interior_weekend_fractions = XMLHelper.get_value(lighting, 'extension/InteriorWeekendScheduleFractions')
4547
- @interior_monthly_multipliers = XMLHelper.get_value(lighting, 'extension/InteriorMonthlyScheduleMultipliers')
4548
- @garage_weekday_fractions = XMLHelper.get_value(lighting, 'extension/GarageWeekdayScheduleFractions')
4549
- @garage_weekend_fractions = XMLHelper.get_value(lighting, 'extension/GarageWeekendScheduleFractions')
4550
- @garage_monthly_multipliers = XMLHelper.get_value(lighting, 'extension/GarageMonthlyScheduleMultipliers')
4551
- @exterior_weekday_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorWeekdayScheduleFractions')
4552
- @exterior_weekend_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorWeekendScheduleFractions')
4553
- @exterior_monthly_multipliers = XMLHelper.get_value(lighting, 'extension/ExteriorMonthlyScheduleMultipliers')
4914
+ @interior_usage_multiplier = XMLHelper.get_value(lighting, 'extension/InteriorUsageMultiplier', :float)
4915
+ @garage_usage_multiplier = XMLHelper.get_value(lighting, 'extension/GarageUsageMultiplier', :float)
4916
+ @exterior_usage_multiplier = XMLHelper.get_value(lighting, 'extension/ExteriorUsageMultiplier', :float)
4917
+ @interior_weekday_fractions = XMLHelper.get_value(lighting, 'extension/InteriorWeekdayScheduleFractions', :string)
4918
+ @interior_weekend_fractions = XMLHelper.get_value(lighting, 'extension/InteriorWeekendScheduleFractions', :string)
4919
+ @interior_monthly_multipliers = XMLHelper.get_value(lighting, 'extension/InteriorMonthlyScheduleMultipliers', :string)
4920
+ @garage_weekday_fractions = XMLHelper.get_value(lighting, 'extension/GarageWeekdayScheduleFractions', :string)
4921
+ @garage_weekend_fractions = XMLHelper.get_value(lighting, 'extension/GarageWeekendScheduleFractions', :string)
4922
+ @garage_monthly_multipliers = XMLHelper.get_value(lighting, 'extension/GarageMonthlyScheduleMultipliers', :string)
4923
+ @exterior_weekday_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorWeekdayScheduleFractions', :string)
4924
+ @exterior_weekend_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorWeekendScheduleFractions', :string)
4925
+ @exterior_monthly_multipliers = XMLHelper.get_value(lighting, 'extension/ExteriorMonthlyScheduleMultipliers', :string)
4554
4926
  if not XMLHelper.get_element(hpxml, 'Building/BuildingDetails/Lighting/extension/ExteriorHolidayLighting').nil?
4555
4927
  @holiday_exists = true
4556
- @holiday_kwh_per_day = to_float_or_nil(XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/Load[Units="kWh/day"]/Value'))
4557
- @holiday_period_begin_month = to_integer_or_nil(XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodBeginMonth'))
4558
- @holiday_period_begin_day_of_month = to_integer_or_nil(XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodBeginDayOfMonth'))
4559
- @holiday_period_end_month = to_integer_or_nil(XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodEndMonth'))
4560
- @holiday_period_end_day_of_month = to_integer_or_nil(XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodEndDayOfMonth'))
4561
- @holiday_weekday_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/WeekdayScheduleFractions')
4562
- @holiday_weekend_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/WeekendScheduleFractions')
4928
+ @holiday_kwh_per_day = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/Load[Units="kWh/day"]/Value', :float)
4929
+ @holiday_period_begin_month = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodBeginMonth', :integer)
4930
+ @holiday_period_begin_day = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodBeginDayOfMonth', :integer)
4931
+ @holiday_period_end_month = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodEndMonth', :integer)
4932
+ @holiday_period_end_day = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/PeriodEndDayOfMonth', :integer)
4933
+ @holiday_weekday_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/WeekdayScheduleFractions', :string)
4934
+ @holiday_weekend_fractions = XMLHelper.get_value(lighting, 'extension/ExteriorHolidayLighting/WeekendScheduleFractions', :string)
4563
4935
  else
4564
4936
  @holiday_exists = false
4565
4937
  end
@@ -4602,16 +4974,16 @@ class HPXML < Object
4602
4974
  XMLHelper.add_attribute(sys_id, 'id', @id)
4603
4975
  if not @efficiency.nil?
4604
4976
  airflow = XMLHelper.add_element(ceiling_fan, 'Airflow')
4605
- XMLHelper.add_element(airflow, 'FanSpeed', 'medium')
4606
- XMLHelper.add_element(airflow, 'Efficiency', to_float(@efficiency))
4977
+ XMLHelper.add_element(airflow, 'FanSpeed', 'medium', :string)
4978
+ XMLHelper.add_element(airflow, 'Efficiency', @efficiency, :float, @efficiency_isdefaulted)
4607
4979
  end
4608
- XMLHelper.add_element(ceiling_fan, 'Quantity', to_integer(@quantity)) unless @quantity.nil?
4980
+ XMLHelper.add_element(ceiling_fan, 'Quantity', @quantity, :integer, @quantity_isdefaulted) unless @quantity.nil?
4609
4981
  end
4610
4982
 
4611
4983
  def from_oga(ceiling_fan)
4612
4984
  @id = HPXML::get_id(ceiling_fan)
4613
- @efficiency = to_float_or_nil(XMLHelper.get_value(ceiling_fan, "Airflow[FanSpeed='medium']/Efficiency"))
4614
- @quantity = to_integer_or_nil(XMLHelper.get_value(ceiling_fan, 'Quantity'))
4985
+ @efficiency = XMLHelper.get_value(ceiling_fan, "Airflow[FanSpeed='medium']/Efficiency", :float)
4986
+ @quantity = XMLHelper.get_value(ceiling_fan, 'Quantity', :integer)
4615
4987
  end
4616
4988
  end
4617
4989
 
@@ -4630,8 +5002,8 @@ class HPXML < Object
4630
5002
  end
4631
5003
 
4632
5004
  class Pool < BaseElement
4633
- ATTRS = [:id, :heater_id, :heater_type, :heater_load_units, :heater_load_value, :heater_usage_multiplier,
4634
- :pump_id, :pump_kwh_per_year, :pump_usage_multiplier,
5005
+ ATTRS = [:id, :type, :heater_id, :heater_type, :heater_load_units, :heater_load_value, :heater_usage_multiplier,
5006
+ :pump_id, :pump_type, :pump_kwh_per_year, :pump_usage_multiplier,
4635
5007
  :heater_weekday_fractions, :heater_weekend_fractions, :heater_monthly_multipliers,
4636
5008
  :pump_weekday_fractions, :pump_weekend_fractions, :pump_monthly_multipliers]
4637
5009
  attr_accessor(*ATTRS)
@@ -4652,24 +5024,28 @@ class HPXML < Object
4652
5024
  pool = XMLHelper.add_element(pools, 'Pool')
4653
5025
  sys_id = XMLHelper.add_element(pool, 'SystemIdentifier')
4654
5026
  XMLHelper.add_attribute(sys_id, 'id', @id)
4655
- pumps = XMLHelper.add_element(pool, 'PoolPumps')
4656
- pool_pump = XMLHelper.add_element(pumps, 'PoolPump')
4657
- sys_id = XMLHelper.add_element(pool_pump, 'SystemIdentifier')
4658
- if not @pump_id.nil?
4659
- XMLHelper.add_attribute(sys_id, 'id', @pump_id)
4660
- else
4661
- XMLHelper.add_attribute(sys_id, 'id', @id + 'Pump')
4662
- end
4663
- if not @pump_kwh_per_year.nil?
4664
- load = XMLHelper.add_element(pool_pump, 'Load')
4665
- XMLHelper.add_element(load, 'Units', UnitsKwhPerYear)
4666
- XMLHelper.add_element(load, 'Value', to_float(@pump_kwh_per_year))
4667
- XMLHelper.add_extension(pool_pump, 'UsageMultiplier', to_float(@pump_usage_multiplier)) unless @pump_usage_multiplier.nil?
4668
- XMLHelper.add_extension(pool_pump, 'WeekdayScheduleFractions', @pump_weekday_fractions) unless @pump_weekday_fractions.nil?
4669
- XMLHelper.add_extension(pool_pump, 'WeekendScheduleFractions', @pump_weekend_fractions) unless @pump_weekend_fractions.nil?
4670
- XMLHelper.add_extension(pool_pump, 'MonthlyScheduleMultipliers', @pump_monthly_multipliers) unless @pump_monthly_multipliers.nil?
4671
- end
4672
- if not @heater_type.nil?
5027
+ XMLHelper.add_element(pool, 'Type', @type, :string) unless @type.nil?
5028
+ if @type != HPXML::TypeNone
5029
+ pumps = XMLHelper.add_element(pool, 'PoolPumps')
5030
+ pool_pump = XMLHelper.add_element(pumps, 'PoolPump')
5031
+ sys_id = XMLHelper.add_element(pool_pump, 'SystemIdentifier')
5032
+ if not @pump_id.nil?
5033
+ XMLHelper.add_attribute(sys_id, 'id', @pump_id)
5034
+ else
5035
+ XMLHelper.add_attribute(sys_id, 'id', @id + 'Pump')
5036
+ end
5037
+ XMLHelper.add_element(pool_pump, 'Type', @pump_type, :string)
5038
+ if @pump_type != HPXML::TypeNone
5039
+ if not @pump_kwh_per_year.nil?
5040
+ load = XMLHelper.add_element(pool_pump, 'Load')
5041
+ XMLHelper.add_element(load, 'Units', UnitsKwhPerYear, :string)
5042
+ XMLHelper.add_element(load, 'Value', @pump_kwh_per_year, :float, @pump_kwh_per_year_isdefaulted)
5043
+ end
5044
+ XMLHelper.add_extension(pool_pump, 'UsageMultiplier', @pump_usage_multiplier, :float, @pump_usage_multiplier_isdefaulted) unless @pump_usage_multiplier.nil?
5045
+ XMLHelper.add_extension(pool_pump, 'WeekdayScheduleFractions', @pump_weekday_fractions, :string, @pump_weekday_fractions_isdefaulted) unless @pump_weekday_fractions.nil?
5046
+ XMLHelper.add_extension(pool_pump, 'WeekendScheduleFractions', @pump_weekend_fractions, :string, @pump_weekend_fractions_isdefaulted) unless @pump_weekend_fractions.nil?
5047
+ XMLHelper.add_extension(pool_pump, 'MonthlyScheduleMultipliers', @pump_monthly_multipliers, :string, @pump_monthly_multipliers_isdefaulted) unless @pump_monthly_multipliers.nil?
5048
+ end
4673
5049
  heater = XMLHelper.add_element(pool, 'Heater')
4674
5050
  sys_id = XMLHelper.add_element(heater, 'SystemIdentifier')
4675
5051
  if not @heater_id.nil?
@@ -4677,38 +5053,44 @@ class HPXML < Object
4677
5053
  else
4678
5054
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Heater')
4679
5055
  end
4680
- XMLHelper.add_element(heater, 'Type', @heater_type)
4681
- if (not @heater_load_units.nil?) && (not @heater_load_value.nil?)
4682
- load = XMLHelper.add_element(heater, 'Load')
4683
- XMLHelper.add_element(load, 'Units', @heater_load_units)
4684
- XMLHelper.add_element(load, 'Value', to_float(@heater_load_value))
5056
+ XMLHelper.add_element(heater, 'Type', @heater_type, :string)
5057
+ if @heater_type != HPXML::TypeNone
5058
+ if (not @heater_load_units.nil?) && (not @heater_load_value.nil?)
5059
+ load = XMLHelper.add_element(heater, 'Load')
5060
+ XMLHelper.add_element(load, 'Units', @heater_load_units, :string)
5061
+ XMLHelper.add_element(load, 'Value', @heater_load_value, :float, @heater_load_value_isdefaulted)
5062
+ end
5063
+ XMLHelper.add_extension(heater, 'UsageMultiplier', @heater_usage_multiplier, :float, @heater_usage_multiplier_isdefaulted) unless @heater_usage_multiplier.nil?
5064
+ XMLHelper.add_extension(heater, 'WeekdayScheduleFractions', @heater_weekday_fractions, :string, @heater_weekday_fractions_isdefaulted) unless @heater_weekday_fractions.nil?
5065
+ XMLHelper.add_extension(heater, 'WeekendScheduleFractions', @heater_weekend_fractions, :string, @heater_weekend_fractions_isdefaulted) unless @heater_weekend_fractions.nil?
5066
+ XMLHelper.add_extension(heater, 'MonthlyScheduleMultipliers', @heater_monthly_multipliers, :string, @heater_monthly_multipliers_isdefaulted) unless @heater_monthly_multipliers.nil?
4685
5067
  end
4686
- XMLHelper.add_extension(heater, 'UsageMultiplier', to_float(@heater_usage_multiplier)) unless @heater_usage_multiplier.nil?
4687
- XMLHelper.add_extension(heater, 'WeekdayScheduleFractions', @heater_weekday_fractions) unless @heater_weekday_fractions.nil?
4688
- XMLHelper.add_extension(heater, 'WeekendScheduleFractions', @heater_weekend_fractions) unless @heater_weekend_fractions.nil?
4689
- XMLHelper.add_extension(heater, 'MonthlyScheduleMultipliers', @heater_monthly_multipliers) unless @heater_monthly_multipliers.nil?
4690
5068
  end
4691
5069
  end
4692
5070
 
4693
5071
  def from_oga(pool)
4694
5072
  @id = HPXML::get_id(pool)
5073
+ @type = XMLHelper.get_value(pool, 'Type', :string)
4695
5074
  pool_pump = XMLHelper.get_element(pool, 'PoolPumps/PoolPump')
4696
- @pump_id = HPXML::get_id(pool_pump)
4697
- @pump_kwh_per_year = to_float_or_nil(XMLHelper.get_value(pool_pump, "Load[Units='#{UnitsKwhPerYear}']/Value"))
4698
- @pump_usage_multiplier = to_float_or_nil(XMLHelper.get_value(pool_pump, 'extension/UsageMultiplier'))
4699
- @pump_weekday_fractions = XMLHelper.get_value(pool_pump, 'extension/WeekdayScheduleFractions')
4700
- @pump_weekend_fractions = XMLHelper.get_value(pool_pump, 'extension/WeekendScheduleFractions')
4701
- @pump_monthly_multipliers = XMLHelper.get_value(pool_pump, 'extension/MonthlyScheduleMultipliers')
5075
+ if not pool_pump.nil?
5076
+ @pump_id = HPXML::get_id(pool_pump)
5077
+ @pump_type = XMLHelper.get_value(pool_pump, 'Type', :string)
5078
+ @pump_kwh_per_year = XMLHelper.get_value(pool_pump, "Load[Units='#{UnitsKwhPerYear}']/Value", :float)
5079
+ @pump_usage_multiplier = XMLHelper.get_value(pool_pump, 'extension/UsageMultiplier', :float)
5080
+ @pump_weekday_fractions = XMLHelper.get_value(pool_pump, 'extension/WeekdayScheduleFractions', :string)
5081
+ @pump_weekend_fractions = XMLHelper.get_value(pool_pump, 'extension/WeekendScheduleFractions', :string)
5082
+ @pump_monthly_multipliers = XMLHelper.get_value(pool_pump, 'extension/MonthlyScheduleMultipliers', :string)
5083
+ end
4702
5084
  heater = XMLHelper.get_element(pool, 'Heater')
4703
5085
  if not heater.nil?
4704
5086
  @heater_id = HPXML::get_id(heater)
4705
- @heater_type = XMLHelper.get_value(heater, 'Type')
4706
- @heater_load_units = XMLHelper.get_value(heater, 'Load/Units')
4707
- @heater_load_value = to_float_or_nil(XMLHelper.get_value(heater, 'Load/Value'))
4708
- @heater_usage_multiplier = to_float_or_nil(XMLHelper.get_value(heater, 'extension/UsageMultiplier'))
4709
- @heater_weekday_fractions = XMLHelper.get_value(heater, 'extension/WeekdayScheduleFractions')
4710
- @heater_weekend_fractions = XMLHelper.get_value(heater, 'extension/WeekendScheduleFractions')
4711
- @heater_monthly_multipliers = XMLHelper.get_value(heater, 'extension/MonthlyScheduleMultipliers')
5087
+ @heater_type = XMLHelper.get_value(heater, 'Type', :string)
5088
+ @heater_load_units = XMLHelper.get_value(heater, 'Load/Units', :string)
5089
+ @heater_load_value = XMLHelper.get_value(heater, 'Load/Value', :float)
5090
+ @heater_usage_multiplier = XMLHelper.get_value(heater, 'extension/UsageMultiplier', :float)
5091
+ @heater_weekday_fractions = XMLHelper.get_value(heater, 'extension/WeekdayScheduleFractions', :string)
5092
+ @heater_weekend_fractions = XMLHelper.get_value(heater, 'extension/WeekendScheduleFractions', :string)
5093
+ @heater_monthly_multipliers = XMLHelper.get_value(heater, 'extension/MonthlyScheduleMultipliers', :string)
4712
5094
  end
4713
5095
  end
4714
5096
  end
@@ -4728,8 +5110,8 @@ class HPXML < Object
4728
5110
  end
4729
5111
 
4730
5112
  class HotTub < BaseElement
4731
- ATTRS = [:id, :heater_id, :heater_type, :heater_load_units, :heater_load_value, :heater_usage_multiplier,
4732
- :pump_id, :pump_kwh_per_year, :pump_usage_multiplier,
5113
+ ATTRS = [:id, :type, :heater_id, :heater_type, :heater_load_units, :heater_load_value, :heater_usage_multiplier,
5114
+ :pump_id, :pump_type, :pump_kwh_per_year, :pump_usage_multiplier,
4733
5115
  :heater_weekday_fractions, :heater_weekend_fractions, :heater_monthly_multipliers,
4734
5116
  :pump_weekday_fractions, :pump_weekend_fractions, :pump_monthly_multipliers]
4735
5117
  attr_accessor(*ATTRS)
@@ -4750,24 +5132,28 @@ class HPXML < Object
4750
5132
  hot_tub = XMLHelper.add_element(hot_tubs, 'HotTub')
4751
5133
  sys_id = XMLHelper.add_element(hot_tub, 'SystemIdentifier')
4752
5134
  XMLHelper.add_attribute(sys_id, 'id', @id)
4753
- pumps = XMLHelper.add_element(hot_tub, 'HotTubPumps')
4754
- hot_tub_pump = XMLHelper.add_element(pumps, 'HotTubPump')
4755
- sys_id = XMLHelper.add_element(hot_tub_pump, 'SystemIdentifier')
4756
- if not @pump_id.nil?
4757
- XMLHelper.add_attribute(sys_id, 'id', @pump_id)
4758
- else
4759
- XMLHelper.add_attribute(sys_id, 'id', @id + 'Pump')
4760
- end
4761
- if not @pump_kwh_per_year.nil?
4762
- load = XMLHelper.add_element(hot_tub_pump, 'Load')
4763
- XMLHelper.add_element(load, 'Units', UnitsKwhPerYear)
4764
- XMLHelper.add_element(load, 'Value', to_float(@pump_kwh_per_year))
4765
- XMLHelper.add_extension(hot_tub_pump, 'UsageMultiplier', to_float(@pump_usage_multiplier)) unless @pump_usage_multiplier.nil?
4766
- XMLHelper.add_extension(hot_tub_pump, 'WeekdayScheduleFractions', @pump_weekday_fractions) unless @pump_weekday_fractions.nil?
4767
- XMLHelper.add_extension(hot_tub_pump, 'WeekendScheduleFractions', @pump_weekend_fractions) unless @pump_weekend_fractions.nil?
4768
- XMLHelper.add_extension(hot_tub_pump, 'MonthlyScheduleMultipliers', @pump_monthly_multipliers) unless @pump_monthly_multipliers.nil?
4769
- end
4770
- if not @heater_type.nil?
5135
+ XMLHelper.add_element(hot_tub, 'Type', @type, :string) unless @type.nil?
5136
+ if @type != HPXML::TypeNone
5137
+ pumps = XMLHelper.add_element(hot_tub, 'HotTubPumps')
5138
+ hot_tub_pump = XMLHelper.add_element(pumps, 'HotTubPump')
5139
+ sys_id = XMLHelper.add_element(hot_tub_pump, 'SystemIdentifier')
5140
+ if not @pump_id.nil?
5141
+ XMLHelper.add_attribute(sys_id, 'id', @pump_id)
5142
+ else
5143
+ XMLHelper.add_attribute(sys_id, 'id', @id + 'Pump')
5144
+ end
5145
+ XMLHelper.add_element(hot_tub_pump, 'Type', @pump_type, :string)
5146
+ if @pump_type != HPXML::TypeNone
5147
+ if not @pump_kwh_per_year.nil?
5148
+ load = XMLHelper.add_element(hot_tub_pump, 'Load')
5149
+ XMLHelper.add_element(load, 'Units', UnitsKwhPerYear, :string)
5150
+ XMLHelper.add_element(load, 'Value', @pump_kwh_per_year, :float, @pump_kwh_per_year_isdefaulted)
5151
+ end
5152
+ XMLHelper.add_extension(hot_tub_pump, 'UsageMultiplier', @pump_usage_multiplier, :float, @pump_usage_multiplier_isdefaulted) unless @pump_usage_multiplier.nil?
5153
+ XMLHelper.add_extension(hot_tub_pump, 'WeekdayScheduleFractions', @pump_weekday_fractions, :string, @pump_weekday_fractions_isdefaulted) unless @pump_weekday_fractions.nil?
5154
+ XMLHelper.add_extension(hot_tub_pump, 'WeekendScheduleFractions', @pump_weekend_fractions, :string, @pump_weekend_fractions_isdefaulted) unless @pump_weekend_fractions.nil?
5155
+ XMLHelper.add_extension(hot_tub_pump, 'MonthlyScheduleMultipliers', @pump_monthly_multipliers, :string, @pump_monthly_multipliers_isdefaulted) unless @pump_monthly_multipliers.nil?
5156
+ end
4771
5157
  heater = XMLHelper.add_element(hot_tub, 'Heater')
4772
5158
  sys_id = XMLHelper.add_element(heater, 'SystemIdentifier')
4773
5159
  if not @heater_id.nil?
@@ -4775,38 +5161,44 @@ class HPXML < Object
4775
5161
  else
4776
5162
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Heater')
4777
5163
  end
4778
- XMLHelper.add_element(heater, 'Type', @heater_type)
4779
- if (not @heater_load_units.nil?) && (not @heater_load_value.nil?)
4780
- load = XMLHelper.add_element(heater, 'Load')
4781
- XMLHelper.add_element(load, 'Units', @heater_load_units)
4782
- XMLHelper.add_element(load, 'Value', to_float(@heater_load_value))
5164
+ XMLHelper.add_element(heater, 'Type', @heater_type, :string)
5165
+ if @heater_type != HPXML::TypeNone
5166
+ if (not @heater_load_units.nil?) && (not @heater_load_value.nil?)
5167
+ load = XMLHelper.add_element(heater, 'Load')
5168
+ XMLHelper.add_element(load, 'Units', @heater_load_units, :string)
5169
+ XMLHelper.add_element(load, 'Value', @heater_load_value, :float, @heater_load_value_isdefaulted)
5170
+ end
5171
+ XMLHelper.add_extension(heater, 'UsageMultiplier', @heater_usage_multiplier, :float, @heater_usage_multiplier_isdefaulted) unless @heater_usage_multiplier.nil?
5172
+ XMLHelper.add_extension(heater, 'WeekdayScheduleFractions', @heater_weekday_fractions, :string, @heater_weekday_fractions_isdefaulted) unless @heater_weekday_fractions.nil?
5173
+ XMLHelper.add_extension(heater, 'WeekendScheduleFractions', @heater_weekend_fractions, :string, @heater_weekend_fractions_isdefaulted) unless @heater_weekend_fractions.nil?
5174
+ XMLHelper.add_extension(heater, 'MonthlyScheduleMultipliers', @heater_monthly_multipliers, :string, @heater_monthly_multipliers_isdefaulted) unless @heater_monthly_multipliers.nil?
4783
5175
  end
4784
- XMLHelper.add_extension(heater, 'UsageMultiplier', to_float(@heater_usage_multiplier)) unless @heater_usage_multiplier.nil?
4785
- XMLHelper.add_extension(heater, 'WeekdayScheduleFractions', @heater_weekday_fractions) unless @heater_weekday_fractions.nil?
4786
- XMLHelper.add_extension(heater, 'WeekendScheduleFractions', @heater_weekend_fractions) unless @heater_weekend_fractions.nil?
4787
- XMLHelper.add_extension(heater, 'MonthlyScheduleMultipliers', @heater_monthly_multipliers) unless @heater_monthly_multipliers.nil?
4788
5176
  end
4789
5177
  end
4790
5178
 
4791
5179
  def from_oga(hot_tub)
4792
5180
  @id = HPXML::get_id(hot_tub)
5181
+ @type = XMLHelper.get_value(hot_tub, 'Type', :string)
4793
5182
  hot_tub_pump = XMLHelper.get_element(hot_tub, 'HotTubPumps/HotTubPump')
4794
- @pump_id = HPXML::get_id(hot_tub_pump)
4795
- @pump_kwh_per_year = to_float_or_nil(XMLHelper.get_value(hot_tub_pump, "Load[Units='#{UnitsKwhPerYear}']/Value"))
4796
- @pump_usage_multiplier = to_float_or_nil(XMLHelper.get_value(hot_tub_pump, 'extension/UsageMultiplier'))
4797
- @pump_weekday_fractions = XMLHelper.get_value(hot_tub_pump, 'extension/WeekdayScheduleFractions')
4798
- @pump_weekend_fractions = XMLHelper.get_value(hot_tub_pump, 'extension/WeekendScheduleFractions')
4799
- @pump_monthly_multipliers = XMLHelper.get_value(hot_tub_pump, 'extension/MonthlyScheduleMultipliers')
5183
+ if not hot_tub_pump.nil?
5184
+ @pump_id = HPXML::get_id(hot_tub_pump)
5185
+ @pump_type = XMLHelper.get_value(hot_tub_pump, 'Type', :string)
5186
+ @pump_kwh_per_year = XMLHelper.get_value(hot_tub_pump, "Load[Units='#{UnitsKwhPerYear}']/Value", :float)
5187
+ @pump_usage_multiplier = XMLHelper.get_value(hot_tub_pump, 'extension/UsageMultiplier', :float)
5188
+ @pump_weekday_fractions = XMLHelper.get_value(hot_tub_pump, 'extension/WeekdayScheduleFractions', :string)
5189
+ @pump_weekend_fractions = XMLHelper.get_value(hot_tub_pump, 'extension/WeekendScheduleFractions', :string)
5190
+ @pump_monthly_multipliers = XMLHelper.get_value(hot_tub_pump, 'extension/MonthlyScheduleMultipliers', :string)
5191
+ end
4800
5192
  heater = XMLHelper.get_element(hot_tub, 'Heater')
4801
5193
  if not heater.nil?
4802
5194
  @heater_id = HPXML::get_id(heater)
4803
- @heater_type = XMLHelper.get_value(heater, 'Type')
4804
- @heater_load_units = XMLHelper.get_value(heater, 'Load/Units')
4805
- @heater_load_value = to_float_or_nil(XMLHelper.get_value(heater, 'Load/Value'))
4806
- @heater_usage_multiplier = to_float_or_nil(XMLHelper.get_value(heater, 'extension/UsageMultiplier'))
4807
- @heater_weekday_fractions = XMLHelper.get_value(heater, 'extension/WeekdayScheduleFractions')
4808
- @heater_weekend_fractions = XMLHelper.get_value(heater, 'extension/WeekendScheduleFractions')
4809
- @heater_monthly_multipliers = XMLHelper.get_value(heater, 'extension/MonthlyScheduleMultipliers')
5195
+ @heater_type = XMLHelper.get_value(heater, 'Type', :string)
5196
+ @heater_load_units = XMLHelper.get_value(heater, 'Load/Units', :string)
5197
+ @heater_load_value = XMLHelper.get_value(heater, 'Load/Value', :float)
5198
+ @heater_usage_multiplier = XMLHelper.get_value(heater, 'extension/UsageMultiplier', :float)
5199
+ @heater_weekday_fractions = XMLHelper.get_value(heater, 'extension/WeekdayScheduleFractions', :string)
5200
+ @heater_weekend_fractions = XMLHelper.get_value(heater, 'extension/WeekendScheduleFractions', :string)
5201
+ @heater_monthly_multipliers = XMLHelper.get_value(heater, 'extension/MonthlyScheduleMultipliers', :string)
4810
5202
  end
4811
5203
  end
4812
5204
  end
@@ -4827,7 +5219,7 @@ class HPXML < Object
4827
5219
 
4828
5220
  class PlugLoad < BaseElement
4829
5221
  ATTRS = [:id, :plug_load_type, :kWh_per_year, :frac_sensible, :frac_latent, :usage_multiplier,
4830
- :weekday_fractions, :weekend_fractions, :monthly_multipliers, :location]
5222
+ :weekday_fractions, :weekend_fractions, :monthly_multipliers]
4831
5223
  attr_accessor(*ATTRS)
4832
5224
 
4833
5225
  def delete
@@ -4846,32 +5238,30 @@ class HPXML < Object
4846
5238
  plug_load = XMLHelper.add_element(misc_loads, 'PlugLoad')
4847
5239
  sys_id = XMLHelper.add_element(plug_load, 'SystemIdentifier')
4848
5240
  XMLHelper.add_attribute(sys_id, 'id', @id)
4849
- XMLHelper.add_element(plug_load, 'PlugLoadType', @plug_load_type) unless @plug_load_type.nil?
4850
- XMLHelper.add_element(plug_load, 'Location', @location) unless @location.nil?
5241
+ XMLHelper.add_element(plug_load, 'PlugLoadType', @plug_load_type, :string) unless @plug_load_type.nil?
4851
5242
  if not @kWh_per_year.nil?
4852
5243
  load = XMLHelper.add_element(plug_load, 'Load')
4853
- XMLHelper.add_element(load, 'Units', UnitsKwhPerYear)
4854
- XMLHelper.add_element(load, 'Value', to_float(@kWh_per_year))
5244
+ XMLHelper.add_element(load, 'Units', UnitsKwhPerYear, :string)
5245
+ XMLHelper.add_element(load, 'Value', @kWh_per_year, :float, @kWh_per_year_isdefaulted)
4855
5246
  end
4856
- XMLHelper.add_extension(plug_load, 'FracSensible', to_float(@frac_sensible)) unless @frac_sensible.nil?
4857
- XMLHelper.add_extension(plug_load, 'FracLatent', to_float(@frac_latent)) unless @frac_latent.nil?
4858
- XMLHelper.add_extension(plug_load, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4859
- XMLHelper.add_extension(plug_load, 'WeekdayScheduleFractions', @weekday_fractions) unless @weekday_fractions.nil?
4860
- XMLHelper.add_extension(plug_load, 'WeekendScheduleFractions', @weekend_fractions) unless @weekend_fractions.nil?
4861
- XMLHelper.add_extension(plug_load, 'MonthlyScheduleMultipliers', @monthly_multipliers) unless @monthly_multipliers.nil?
5247
+ XMLHelper.add_extension(plug_load, 'FracSensible', @frac_sensible, :float, @frac_sensible_isdefaulted) unless @frac_sensible.nil?
5248
+ XMLHelper.add_extension(plug_load, 'FracLatent', @frac_latent, :float, @frac_latent_isdefaulted) unless @frac_latent.nil?
5249
+ XMLHelper.add_extension(plug_load, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
5250
+ XMLHelper.add_extension(plug_load, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
5251
+ XMLHelper.add_extension(plug_load, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
5252
+ XMLHelper.add_extension(plug_load, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4862
5253
  end
4863
5254
 
4864
5255
  def from_oga(plug_load)
4865
5256
  @id = HPXML::get_id(plug_load)
4866
- @plug_load_type = XMLHelper.get_value(plug_load, 'PlugLoadType')
4867
- @location = XMLHelper.get_value(plug_load, 'Location')
4868
- @kWh_per_year = to_float_or_nil(XMLHelper.get_value(plug_load, "Load[Units='#{UnitsKwhPerYear}']/Value"))
4869
- @frac_sensible = to_float_or_nil(XMLHelper.get_value(plug_load, 'extension/FracSensible'))
4870
- @frac_latent = to_float_or_nil(XMLHelper.get_value(plug_load, 'extension/FracLatent'))
4871
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(plug_load, 'extension/UsageMultiplier'))
4872
- @weekday_fractions = XMLHelper.get_value(plug_load, 'extension/WeekdayScheduleFractions')
4873
- @weekend_fractions = XMLHelper.get_value(plug_load, 'extension/WeekendScheduleFractions')
4874
- @monthly_multipliers = XMLHelper.get_value(plug_load, 'extension/MonthlyScheduleMultipliers')
5257
+ @plug_load_type = XMLHelper.get_value(plug_load, 'PlugLoadType', :string)
5258
+ @kWh_per_year = XMLHelper.get_value(plug_load, "Load[Units='#{UnitsKwhPerYear}']/Value", :float)
5259
+ @frac_sensible = XMLHelper.get_value(plug_load, 'extension/FracSensible', :float)
5260
+ @frac_latent = XMLHelper.get_value(plug_load, 'extension/FracLatent', :float)
5261
+ @usage_multiplier = XMLHelper.get_value(plug_load, 'extension/UsageMultiplier', :float)
5262
+ @weekday_fractions = XMLHelper.get_value(plug_load, 'extension/WeekdayScheduleFractions', :string)
5263
+ @weekend_fractions = XMLHelper.get_value(plug_load, 'extension/WeekendScheduleFractions', :string)
5264
+ @monthly_multipliers = XMLHelper.get_value(plug_load, 'extension/MonthlyScheduleMultipliers', :string)
4875
5265
  end
4876
5266
  end
4877
5267
 
@@ -4891,7 +5281,7 @@ class HPXML < Object
4891
5281
 
4892
5282
  class FuelLoad < BaseElement
4893
5283
  ATTRS = [:id, :fuel_load_type, :fuel_type, :therm_per_year, :frac_sensible, :frac_latent, :usage_multiplier,
4894
- :weekday_fractions, :weekend_fractions, :monthly_multipliers, :location]
5284
+ :weekday_fractions, :weekend_fractions, :monthly_multipliers]
4895
5285
  attr_accessor(*ATTRS)
4896
5286
 
4897
5287
  def delete
@@ -4910,34 +5300,32 @@ class HPXML < Object
4910
5300
  fuel_load = XMLHelper.add_element(misc_loads, 'FuelLoad')
4911
5301
  sys_id = XMLHelper.add_element(fuel_load, 'SystemIdentifier')
4912
5302
  XMLHelper.add_attribute(sys_id, 'id', @id)
4913
- XMLHelper.add_element(fuel_load, 'FuelLoadType', @fuel_load_type) unless @fuel_load_type.nil?
4914
- XMLHelper.add_element(fuel_load, 'Location', @location) unless @location.nil?
5303
+ XMLHelper.add_element(fuel_load, 'FuelLoadType', @fuel_load_type, :string) unless @fuel_load_type.nil?
4915
5304
  if not @therm_per_year.nil?
4916
5305
  load = XMLHelper.add_element(fuel_load, 'Load')
4917
- XMLHelper.add_element(load, 'Units', UnitsThermPerYear)
4918
- XMLHelper.add_element(load, 'Value', to_float(@therm_per_year))
5306
+ XMLHelper.add_element(load, 'Units', UnitsThermPerYear, :string)
5307
+ XMLHelper.add_element(load, 'Value', @therm_per_year, :float, @therm_per_year_isdefaulted)
4919
5308
  end
4920
- XMLHelper.add_element(fuel_load, 'FuelType', @fuel_type) unless @fuel_type.nil?
4921
- XMLHelper.add_extension(fuel_load, 'FracSensible', to_float(@frac_sensible)) unless @frac_sensible.nil?
4922
- XMLHelper.add_extension(fuel_load, 'FracLatent', to_float(@frac_latent)) unless @frac_latent.nil?
4923
- XMLHelper.add_extension(fuel_load, 'UsageMultiplier', to_float(@usage_multiplier)) unless @usage_multiplier.nil?
4924
- XMLHelper.add_extension(fuel_load, 'WeekdayScheduleFractions', @weekday_fractions) unless @weekday_fractions.nil?
4925
- XMLHelper.add_extension(fuel_load, 'WeekendScheduleFractions', @weekend_fractions) unless @weekend_fractions.nil?
4926
- XMLHelper.add_extension(fuel_load, 'MonthlyScheduleMultipliers', @monthly_multipliers) unless @monthly_multipliers.nil?
5309
+ XMLHelper.add_element(fuel_load, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
5310
+ XMLHelper.add_extension(fuel_load, 'FracSensible', @frac_sensible, :float, @frac_sensible_isdefaulted) unless @frac_sensible.nil?
5311
+ XMLHelper.add_extension(fuel_load, 'FracLatent', @frac_latent, :float, @frac_latent_isdefaulted) unless @frac_latent.nil?
5312
+ XMLHelper.add_extension(fuel_load, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
5313
+ XMLHelper.add_extension(fuel_load, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
5314
+ XMLHelper.add_extension(fuel_load, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
5315
+ XMLHelper.add_extension(fuel_load, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4927
5316
  end
4928
5317
 
4929
5318
  def from_oga(fuel_load)
4930
5319
  @id = HPXML::get_id(fuel_load)
4931
- @fuel_load_type = XMLHelper.get_value(fuel_load, 'FuelLoadType')
4932
- @location = XMLHelper.get_value(fuel_load, 'Location')
4933
- @therm_per_year = to_float_or_nil(XMLHelper.get_value(fuel_load, "Load[Units='#{UnitsThermPerYear}']/Value"))
4934
- @fuel_type = XMLHelper.get_value(fuel_load, 'FuelType')
4935
- @frac_sensible = to_float_or_nil(XMLHelper.get_value(fuel_load, 'extension/FracSensible'))
4936
- @frac_latent = to_float_or_nil(XMLHelper.get_value(fuel_load, 'extension/FracLatent'))
4937
- @usage_multiplier = to_float_or_nil(XMLHelper.get_value(fuel_load, 'extension/UsageMultiplier'))
4938
- @weekday_fractions = XMLHelper.get_value(fuel_load, 'extension/WeekdayScheduleFractions')
4939
- @weekend_fractions = XMLHelper.get_value(fuel_load, 'extension/WeekendScheduleFractions')
4940
- @monthly_multipliers = XMLHelper.get_value(fuel_load, 'extension/MonthlyScheduleMultipliers')
5320
+ @fuel_load_type = XMLHelper.get_value(fuel_load, 'FuelLoadType', :string)
5321
+ @therm_per_year = XMLHelper.get_value(fuel_load, "Load[Units='#{UnitsThermPerYear}']/Value", :float)
5322
+ @fuel_type = XMLHelper.get_value(fuel_load, 'FuelType', :string)
5323
+ @frac_sensible = XMLHelper.get_value(fuel_load, 'extension/FracSensible', :float)
5324
+ @frac_latent = XMLHelper.get_value(fuel_load, 'extension/FracLatent', :float)
5325
+ @usage_multiplier = XMLHelper.get_value(fuel_load, 'extension/UsageMultiplier', :float)
5326
+ @weekday_fractions = XMLHelper.get_value(fuel_load, 'extension/WeekdayScheduleFractions', :string)
5327
+ @weekend_fractions = XMLHelper.get_value(fuel_load, 'extension/WeekendScheduleFractions', :string)
5328
+ @monthly_multipliers = XMLHelper.get_value(fuel_load, 'extension/MonthlyScheduleMultipliers', :string)
4941
5329
  end
4942
5330
  end
4943
5331
 
@@ -4985,11 +5373,13 @@ class HPXML < Object
4985
5373
 
4986
5374
  match = true
4987
5375
  surf.class::ATTRS.each do |attribute|
5376
+ next if attribute.to_s.end_with? '_isdefaulted'
4988
5377
  next if attrs_to_ignore.include? attribute
4989
5378
  next if (surf_type == :foundation_walls) && (attribute == :azimuth) # Azimuth of foundation walls is irrelevant
4990
5379
  next if surf.send(attribute) == surf2.send(attribute)
4991
5380
 
4992
5381
  match = false
5382
+ break
4993
5383
  end
4994
5384
  next unless match
4995
5385
 
@@ -5022,7 +5412,7 @@ class HPXML < Object
5022
5412
 
5023
5413
  def delete_tiny_surfaces()
5024
5414
  (@rim_joists + @walls + @foundation_walls + @frame_floors + @roofs + @windows + @skylights + @doors + @slabs).reverse_each do |surface|
5025
- next if surface.area.nil? || (surface.area > 0.1)
5415
+ next if surface.area.nil? || (surface.area > 1.0)
5026
5416
 
5027
5417
  surface.delete
5028
5418
  end
@@ -5030,25 +5420,59 @@ class HPXML < Object
5030
5420
 
5031
5421
  def delete_adiabatic_subsurfaces()
5032
5422
  @doors.reverse_each do |door|
5423
+ next if door.wall.nil?
5033
5424
  next if door.wall.exterior_adjacent_to != HPXML::LocationOtherHousingUnit
5034
5425
 
5035
5426
  door.delete
5036
5427
  end
5037
5428
  @windows.reverse_each do |window|
5429
+ next if window.wall.nil?
5038
5430
  next if window.wall.exterior_adjacent_to != HPXML::LocationOtherHousingUnit
5039
5431
 
5040
5432
  window.delete
5041
5433
  end
5042
5434
  end
5043
5435
 
5436
+ def validate_against_schematron(schematron_validators: [])
5437
+ # ----------------------------- #
5438
+ # Perform Schematron validation #
5439
+ # ----------------------------- #
5440
+
5441
+ if not schematron_validators.empty?
5442
+ errors, warnings = Validator.run_validators(@doc, schematron_validators)
5443
+ else
5444
+ errors = []
5445
+ warnings = []
5446
+ end
5447
+
5448
+ errors.map! { |e| "#{@hpxml_path}: #{e}" }
5449
+ warnings.map! { |w| "#{@hpxml_path}: #{w}" }
5450
+
5451
+ return errors, warnings
5452
+ end
5453
+
5044
5454
  def check_for_errors()
5045
5455
  errors = []
5046
5456
 
5457
+ # ------------------------------- #
5458
+ # Check for errors within objects #
5459
+ # ------------------------------- #
5460
+
5461
+ # Ask objects to check for errors
5462
+ self.class::HPXML_ATTRS.each do |attribute|
5463
+ hpxml_obj = send(attribute)
5464
+ if not hpxml_obj.respond_to? :check_for_errors
5465
+ fail "Need to add 'check_for_errors' method to #{hpxml_obj.class} class."
5466
+ end
5467
+
5468
+ errors += hpxml_obj.check_for_errors
5469
+ end
5470
+
5047
5471
  # ------------------------------- #
5048
5472
  # Check for errors across objects #
5049
5473
  # ------------------------------- #
5050
5474
 
5051
- # Check for globally unique SystemIdentifier IDs
5475
+ # Check for globally unique SystemIdentifier IDs and empty IDs
5052
5476
  sys_ids = {}
5053
5477
  self.class::HPXML_ATTRS.each do |attribute|
5054
5478
  hpxml_obj = send(attribute)
@@ -5059,6 +5483,8 @@ class HPXML < Object
5059
5483
 
5060
5484
  sys_ids[obj.id] = 0 if sys_ids[obj.id].nil?
5061
5485
  sys_ids[obj.id] += 1
5486
+
5487
+ errors << "Empty SystemIdentifier ID ('#{obj.id}') detected for #{attribute}." if !obj.id || obj.id.size == 0
5062
5488
  end
5063
5489
  end
5064
5490
  sys_ids.each do |sys_id, cnt|
@@ -5075,6 +5501,12 @@ class HPXML < Object
5075
5501
  errors << "Expected FractionHeatLoadServed to sum to <= 1, but calculated sum is #{total_fraction_heat_load_served.round(2)}."
5076
5502
  end
5077
5503
 
5504
+ # Check sum of dehumidifier FractionDehumidificationLoadServed <= 1
5505
+ total_fraction_dehum_load_served = @dehumidifiers.map { |d| d.fraction_served }.sum(0.0)
5506
+ if total_fraction_dehum_load_served > 1.01 # Use 1.01 in case of rounding
5507
+ errors << "Expected FractionDehumidificationLoadServed to sum to <= 1, but calculated sum is #{total_fraction_dehum_load_served.round(2)}."
5508
+ end
5509
+
5078
5510
  # Check sum of HVAC FractionDHWLoadServed == 1
5079
5511
  frac_dhw_load = @water_heating_systems.map { |dhw| dhw.fraction_dhw_load_served.to_f }.sum(0.0)
5080
5512
  if (frac_dhw_load > 0) && ((frac_dhw_load < 0.99) || (frac_dhw_load > 1.01)) # Use 0.99/1.01 in case of rounding
@@ -5090,13 +5522,13 @@ class HPXML < Object
5090
5522
  ltg_fracs[lighting_group.location] += lighting_group.fraction_of_units_in_location
5091
5523
  end
5092
5524
  ltg_fracs.each do |location, sum|
5093
- next if sum <= 1
5525
+ next if sum <= 1.01 # Use 1.01 in case of rounding
5094
5526
 
5095
- fail "Sum of fractions of #{location} lighting (#{sum}) is greater than 1."
5527
+ errors << "Sum of fractions of #{location} lighting (#{sum}) is greater than 1."
5096
5528
  end
5097
5529
 
5098
5530
  # Check for HVAC systems referenced by multiple water heating systems
5099
- (@heating_systems + @cooling_systems + @heat_pumps).each do |hvac_system|
5531
+ hvac_systems.each do |hvac_system|
5100
5532
  num_attached = 0
5101
5533
  @water_heating_systems.each do |water_heating_system|
5102
5534
  next if water_heating_system.related_hvac_idref.nil?
@@ -5110,26 +5542,28 @@ class HPXML < Object
5110
5542
  end
5111
5543
 
5112
5544
  # Check for the sum of CFA served by distribution systems <= CFA
5113
- air_distributions = @hvac_distributions.select { |dist| dist if [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeHydronicAndAir].include? dist.distribution_system_type }
5114
- heating_dist = []
5115
- cooling_dist = []
5116
- air_distributions.each do |dist|
5117
- heating_systems = dist.hvac_systems.select { |sys| sys if (sys.respond_to? :fraction_heat_load_served) && (sys.fraction_heat_load_served.to_f > 0) }
5118
- cooling_systems = dist.hvac_systems.select { |sys| sys if (sys.respond_to? :fraction_cool_load_served) && (sys.fraction_cool_load_served.to_f > 0) }
5119
- if heating_systems.size > 0
5120
- heating_dist << dist
5545
+ if not @building_construction.conditioned_floor_area.nil?
5546
+ air_distributions = @hvac_distributions.select { |dist| dist if HPXML::HVACDistributionTypeAir == dist.distribution_system_type }
5547
+ heating_dist = []
5548
+ cooling_dist = []
5549
+ air_distributions.each do |dist|
5550
+ heating_systems = dist.hvac_systems.select { |sys| sys if (sys.respond_to? :fraction_heat_load_served) && (sys.fraction_heat_load_served.to_f > 0) }
5551
+ cooling_systems = dist.hvac_systems.select { |sys| sys if (sys.respond_to? :fraction_cool_load_served) && (sys.fraction_cool_load_served.to_f > 0) }
5552
+ if heating_systems.size > 0
5553
+ heating_dist << dist
5554
+ end
5555
+ if cooling_systems.size > 0
5556
+ cooling_dist << dist
5557
+ end
5121
5558
  end
5122
- if cooling_systems.size > 0
5123
- cooling_dist << dist
5559
+ heating_total_dist_cfa_served = heating_dist.map { |htg_dist| htg_dist.conditioned_floor_area_served.to_f }.sum(0.0)
5560
+ cooling_total_dist_cfa_served = cooling_dist.map { |clg_dist| clg_dist.conditioned_floor_area_served.to_f }.sum(0.0)
5561
+ if (heating_total_dist_cfa_served > @building_construction.conditioned_floor_area + 1.0) # Allow 1 ft2 of tolerance
5562
+ errors << 'The total conditioned floor area served by the HVAC distribution system(s) for heating is larger than the conditioned floor area of the building.'
5563
+ end
5564
+ if (cooling_total_dist_cfa_served > @building_construction.conditioned_floor_area + 1.0) # Allow 1 ft2 of tolerance
5565
+ errors << 'The total conditioned floor area served by the HVAC distribution system(s) for cooling is larger than the conditioned floor area of the building.'
5124
5566
  end
5125
- end
5126
- heating_total_dist_cfa_served = heating_dist.map { |htg_dist| htg_dist.conditioned_floor_area_served.to_f }.sum(0.0)
5127
- cooling_total_dist_cfa_served = cooling_dist.map { |clg_dist| clg_dist.conditioned_floor_area_served.to_f }.sum(0.0)
5128
- if (heating_total_dist_cfa_served > @building_construction.conditioned_floor_area.to_f)
5129
- errors << 'The total conditioned floor area served by the HVAC distribution system(s) for heating is larger than the conditioned floor area of the building.'
5130
- end
5131
- if (cooling_total_dist_cfa_served > @building_construction.conditioned_floor_area.to_f)
5132
- errors << 'The total conditioned floor area served by the HVAC distribution system(s) for cooling is larger than the conditioned floor area of the building.'
5133
5567
  end
5134
5568
 
5135
5569
  # Check for objects referencing SFA/MF spaces where the building type is not SFA/MF
@@ -5157,19 +5591,37 @@ class HPXML < Object
5157
5591
  end
5158
5592
  end
5159
5593
 
5160
- # ------------------------------- #
5161
- # Check for errors within objects #
5162
- # ------------------------------- #
5163
-
5164
- # Ask objects to check for errors
5165
- self.class::HPXML_ATTRS.each do |attribute|
5166
- hpxml_obj = send(attribute)
5167
- if not hpxml_obj.respond_to? :check_for_errors
5168
- fail "Need to add 'check_for_errors' method to #{hpxml_obj.class} class."
5594
+ # Check for correct PrimaryIndicator values across all refrigerators
5595
+ if @refrigerators.size > 1
5596
+ primary_indicators = @refrigerators.select { |r| r.primary_indicator }.size
5597
+ if primary_indicators > 1
5598
+ errors << 'More than one refrigerator designated as the primary.'
5599
+ elsif primary_indicators == 0
5600
+ errors << 'Could not find a primary refrigerator.'
5169
5601
  end
5602
+ end
5170
5603
 
5171
- errors += hpxml_obj.check_for_errors
5604
+ # Check for at most 1 shared heating system and 1 shared cooling system
5605
+ num_htg_shared = 0
5606
+ num_clg_shared = 0
5607
+ (@heating_systems + @heat_pumps).each do |hvac_system|
5608
+ next unless hvac_system.is_shared_system
5609
+
5610
+ num_htg_shared += 1
5611
+ end
5612
+ (@cooling_systems + @heat_pumps).each do |hvac_system|
5613
+ next unless hvac_system.is_shared_system
5614
+
5615
+ num_clg_shared += 1
5616
+ end
5617
+ if num_htg_shared > 1
5618
+ errors << 'More than one shared heating system found.'
5172
5619
  end
5620
+ if num_clg_shared > 1
5621
+ errors << 'More than one shared cooling system found.'
5622
+ end
5623
+
5624
+ errors.map! { |e| "#{@hpxml_path}: #{e}" }
5173
5625
 
5174
5626
  return errors
5175
5627
  end
@@ -5190,6 +5642,7 @@ class HPXML < Object
5190
5642
  # wall between living space and "other housing unit"
5191
5643
  return true
5192
5644
  end
5645
+
5193
5646
  return false
5194
5647
  end
5195
5648
 
@@ -5210,56 +5663,3 @@ class HPXML < Object
5210
5663
  return XMLHelper.get_attribute_value(element, 'idref')
5211
5664
  end
5212
5665
  end
5213
-
5214
- def to_float(value)
5215
- begin
5216
- return Float(value)
5217
- rescue
5218
- fail "Cannot convert '#{value}' to float."
5219
- end
5220
- end
5221
-
5222
- def to_integer(value)
5223
- begin
5224
- value = Float(value)
5225
- rescue
5226
- fail "Cannot convert '#{value}' to integer."
5227
- end
5228
- if value % 1 == 0
5229
- return Integer(value)
5230
- else
5231
- fail "Cannot convert '#{value}' to integer."
5232
- end
5233
- end
5234
-
5235
- def to_boolean(value)
5236
- if value.is_a? TrueClass
5237
- return true
5238
- elsif value.is_a? FalseClass
5239
- return false
5240
- elsif (value.downcase.to_s == 'true') || (value == '1') || (value == 1)
5241
- return true
5242
- elsif (value.downcase.to_s == 'false') || (value == '0') || (value == 0)
5243
- return false
5244
- end
5245
-
5246
- fail "Cannot convert '#{value}' to boolean."
5247
- end
5248
-
5249
- def to_float_or_nil(value)
5250
- return if value.nil?
5251
-
5252
- return to_float(value)
5253
- end
5254
-
5255
- def to_integer_or_nil(value)
5256
- return if value.nil?
5257
-
5258
- return to_integer(value)
5259
- end
5260
-
5261
- def to_boolean_or_nil(value)
5262
- return if value.nil?
5263
-
5264
- return to_boolean(value)
5265
- end