urbanopt-cli 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (691) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/CMakeLists.txt +9 -9
  4. data/Gemfile +10 -12
  5. data/README.md +1 -0
  6. data/example_files/Gemfile +26 -10
  7. data/example_files/mappers/Baseline.rb +9 -0
  8. data/example_files/mappers/CreateBar.rb +2 -0
  9. data/example_files/mappers/Floorspace.rb +12 -10
  10. data/example_files/mappers/floorspace_workflow.osw +9 -0
  11. data/example_files/residential/clothes_washer.tsv +1 -1
  12. data/example_files/residential/water_heater.tsv +1 -1
  13. data/example_files/resources/hpxml-measures/.circleci/config.yml +20 -0
  14. data/example_files/resources/hpxml-measures/.github/pull_request_template.md +13 -0
  15. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/measure.rb +583 -334
  16. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/measure.xml +687 -586
  17. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/geometry.rb +21 -22
  18. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules.rb +34 -24
  19. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/schedules_config.yml +14 -1
  20. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-coal.osw +33 -35
  21. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-dehumidifier-50percent.osw +33 -35
  22. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-appliances-dehumidifier-ief.osw → base-appliances-dehumidifier-ief-portable.osw} +34 -36
  23. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-dehumidifier-ief-whole-home.osw +361 -0
  24. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-dehumidifier.osw +33 -35
  25. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-gas.osw +33 -35
  26. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-modified.osw +33 -35
  27. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-none.osw +33 -35
  28. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-oil.osw +33 -35
  29. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-propane.osw +33 -35
  30. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-appliances-wood.osw +33 -35
  31. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-flat.osw +33 -35
  32. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-radiant-barrier.osw +33 -35
  33. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-unvented-insulated-roof.osw +33 -35
  34. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-atticroof-vented.osw +33 -35
  35. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-mechvent-shared-preconditioning.osw → base-bldgtype-multifamily-shared-mechvent-preconditioning.osw} +47 -48
  36. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-mechvent-shared.osw → base-bldgtype-multifamily-shared-mechvent.osw} +47 -48
  37. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-pv-shared.osw → base-bldgtype-multifamily-shared-pv.osw} +49 -50
  38. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-bldgtype-multifamily-shared-water-heater.osw +365 -0
  39. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-multifamily.osw → base-bldgtype-multifamily.osw} +43 -44
  40. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-single-family-attached.osw → base-bldgtype-single-family-attached.osw} +36 -38
  41. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-combi-tankless-outside.osw +33 -34
  42. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-combi-tankless.osw +33 -34
  43. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-dwhr.osw +33 -35
  44. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect-outside.osw +33 -34
  45. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect-standbyloss.osw +33 -34
  46. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect-with-solar-fraction.osw +33 -34
  47. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-indirect.osw +33 -34
  48. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-electric.osw +33 -35
  49. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-gas.osw +33 -35
  50. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-hpwh.osw +33 -35
  51. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-jacket-indirect.osw +33 -34
  52. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-low-flow-fixtures.osw +33 -35
  53. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-none.osw +33 -35
  54. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-demand.osw +33 -35
  55. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-manual.osw +33 -35
  56. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-nocontrol.osw +33 -35
  57. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-temperature.osw +33 -35
  58. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-recirc-timer.osw +33 -35
  59. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-direct-evacuated-tube.osw +33 -35
  60. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-direct-flat-plate.osw +33 -35
  61. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-direct-ics.osw +33 -35
  62. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-fraction.osw +33 -35
  63. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-indirect-flat-plate.osw +33 -35
  64. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-solar-thermosyphon-flat-plate.osw +33 -35
  65. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-coal.osw +33 -35
  66. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-elec-uef.osw +362 -0
  67. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-gas-outside.osw +33 -35
  68. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-gas-uef.osw +362 -0
  69. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-gas.osw +33 -35
  70. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-outside.osw +33 -35
  71. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-uef.osw +362 -0
  72. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-with-solar-fraction.osw +33 -35
  73. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump-with-solar.osw +33 -35
  74. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-heat-pump.osw +33 -35
  75. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-oil.osw +33 -35
  76. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tank-wood.osw +33 -35
  77. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-electric-outside.osw +33 -36
  78. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-electric-uef.osw +361 -0
  79. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-electric.osw +33 -35
  80. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas-uef.osw +361 -0
  81. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas-with-solar-fraction.osw +33 -35
  82. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas-with-solar.osw +33 -35
  83. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-gas.osw +33 -35
  84. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-dhw-tankless-propane.osw +33 -35
  85. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-2stories-garage.osw +33 -35
  86. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-2stories.osw +33 -35
  87. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-1.osw +33 -35
  88. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-2.osw +33 -35
  89. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-4.osw +33 -35
  90. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-beds-5.osw +33 -35
  91. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-garage.osw +33 -35
  92. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-ach-house-pressure.osw +33 -35
  93. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-cfm-house-pressure.osw +33 -35
  94. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-cfm50.osw +33 -35
  95. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-flue.osw +33 -35
  96. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-infil-natural-ach.osw +33 -35
  97. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-overhangs.osw +33 -35
  98. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-enclosure-windows-none.osw +33 -35
  99. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-ambient.osw +33 -35
  100. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-conditioned-basement-slab-insulation.osw +33 -35
  101. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-slab.osw +33 -35
  102. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unconditioned-basement-assembly-r.osw +33 -35
  103. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unconditioned-basement-wall-insulation.osw +33 -35
  104. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unconditioned-basement.osw +33 -35
  105. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-unvented-crawlspace.osw +33 -35
  106. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-foundation-vented-crawlspace.osw +33 -35
  107. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-1-speed.osw +34 -35
  108. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-2-speed.osw +33 -35
  109. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-air-to-air-heat-pump-var-speed.osw +33 -35
  110. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-coal-only.osw +33 -35
  111. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-elec-only.osw +33 -35
  112. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-gas-central-ac-1-speed.osw +33 -34
  113. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-gas-only.osw +33 -34
  114. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-oil-only.osw +33 -35
  115. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-propane-only.osw +33 -35
  116. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-boiler-wood-only.osw +33 -35
  117. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-only-1-speed.osw +34 -35
  118. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-only-2-speed.osw +33 -35
  119. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-only-var-speed.osw +33 -35
  120. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-central-ac-plus-air-to-air-heat-pump-heating.osw +35 -35
  121. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-electric.osw +34 -35
  122. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed.osw +34 -35
  123. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-2-speed.osw +33 -35
  124. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-air-to-air-heat-pump-var-speed.osw +33 -35
  125. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-dual-fuel-mini-split-heat-pump-ducted.osw +34 -35
  126. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-ducts-leakage-percent.osw +33 -35
  127. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-elec-resistance-only.osw +33 -35
  128. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-evap-cooler-furnace-gas.osw +33 -35
  129. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-evap-cooler-only-ducted.osw +33 -35
  130. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-evap-cooler-only.osw +34 -35
  131. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-fireplace-wood-only.osw +34 -35
  132. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-fixed-heater-gas-only.osw +34 -35
  133. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-floor-furnace-propane-only.osw +34 -35
  134. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-elec-central-ac-1-speed.osw +33 -35
  135. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-elec-only.osw +33 -35
  136. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-central-ac-2-speed.osw +33 -35
  137. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-central-ac-var-speed.osw +33 -35
  138. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-only.osw +34 -35
  139. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-gas-room-ac.osw +33 -35
  140. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-oil-only.osw +33 -35
  141. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-propane-only.osw +33 -35
  142. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-furnace-wood-only.osw +33 -35
  143. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-ground-to-air-heat-pump.osw +35 -37
  144. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-air-conditioner-only-ducted.osw +34 -35
  145. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-air-conditioner-only-ductless.osw +34 -35
  146. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ducted-cooling-only.osw +34 -35
  147. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ducted-heating-only.osw +34 -35
  148. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ducted.osw +34 -35
  149. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-mini-split-heat-pump-ductless.osw +34 -35
  150. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-none.osw +33 -35
  151. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-portable-heater-gas-only.osw +34 -35
  152. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-room-ac-only-33percent.osw +33 -35
  153. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-room-ac-only.osw +33 -35
  154. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-setpoints.osw +33 -35
  155. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-stove-oil-only.osw +34 -35
  156. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-stove-wood-pellets-only.osw +34 -35
  157. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-undersized.osw +33 -35
  158. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-hvac-wall-furnace-elec-only.osw +34 -35
  159. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-lighting-ceiling-fans.osw +34 -36
  160. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-lighting-detailed.osw +33 -35
  161. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-AMY-2012.osw +33 -35
  162. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-baltimore-md.osw +33 -35
  163. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-dallas-tx.osw +33 -35
  164. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-duluth-mn.osw +33 -35
  165. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-location-miami-fl.osw +33 -35
  166. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-balanced.osw +33 -35
  167. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-bath-kitchen-fans.osw +33 -35
  168. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-cfis-evap-cooler-only-ducted.osw +33 -35
  169. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-cfis.osw +33 -35
  170. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-erv-atre-asre.osw +33 -35
  171. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-erv.osw +33 -35
  172. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-exhaust.osw +33 -35
  173. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-hrv-asre.osw +33 -35
  174. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-hrv.osw +33 -35
  175. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-supply.osw +33 -35
  176. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-mechvent-whole-house-fan.osw +33 -35
  177. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-defaults.osw +36 -38
  178. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-loads-large-uncommon.osw +39 -41
  179. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-loads-large-uncommon2.osw +39 -41
  180. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-neighbor-shading.osw +33 -35
  181. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-misc-usage-multiplier.osw +30 -32
  182. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-pv.osw +29 -31
  183. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-schedules-stochastic.osw +33 -35
  184. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-schedules-user-specified.osw +33 -35
  185. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-calendar-year-custom.osw +33 -35
  186. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-daylight-saving-custom.osw +33 -35
  187. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-daylight-saving-disabled.osw +33 -35
  188. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-runperiod-1-month.osw +33 -35
  189. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base-simcontrol-timestep-10-mins.osw +33 -35
  190. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/base.osw +33 -35
  191. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/build_residential_hpxml_test.rb +19 -8
  192. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-auto.osw +33 -35
  193. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-dhw-solar-latitude.osw +33 -35
  194. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-enclosure-garage-partially-protruded.osw +33 -35
  195. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-hvac-programmable-thermostat.osw +369 -0
  196. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-plug-loads-additional-multipliers.osw +361 -0
  197. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-pv-roofpitch.osw +33 -35
  198. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{extra-dhw-shared-water-heater.osw → extra-schedules-random-seed.osw} +47 -50
  199. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-heating-system-fireplace.osw +33 -35
  200. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-heating-system-portable-heater.osw +33 -35
  201. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-second-refrigerator.osw +33 -35
  202. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/extra-vacancy-6-months.osw +33 -35
  203. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/conditioned-attic-with-floor-insulation.osw +33 -35
  204. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/conditioned-basement-with-ceiling-insulation.osw +33 -35
  205. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/cooling-system-and-heat-pump.osw +33 -35
  206. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/dhw-indirect-without-boiler.osw +33 -35
  207. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/ducts-location-and-areas-not-same-type.osw +33 -35
  208. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/heating-system-and-heat-pump.osw +33 -35
  209. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multifamily-bottom-crawlspace-zero-foundation-height.osw +41 -42
  210. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multifamily-bottom-slab-non-zero-foundation-height.osw +41 -42
  211. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/multifamily-no-building-orientation.osw +40 -41
  212. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-hvac-programmable-thermostat.osw → invalid_files/multipliers-without-fuel-loads.osw} +31 -33
  213. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/{base-dhw-uef.osw → invalid_files/multipliers-without-plug-loads.osw} +35 -37
  214. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/non-electric-heat-pump-water-heater.osw +33 -35
  215. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/non-integer-ceiling-fan-quantity.osw +33 -35
  216. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/non-integer-geometry-num-bathrooms.osw +33 -35
  217. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/second-heating-system-serves-majority-heat.osw +33 -35
  218. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-attached-ambient.osw +35 -37
  219. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-attached-no-building-orientation.osw +35 -37
  220. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-detached-finished-basement-zero-foundation-height.osw +33 -35
  221. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/single-family-detached-slab-non-zero-foundation-height.osw +33 -35
  222. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/slab-non-zero-foundation-height-above-grade.osw +33 -35
  223. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/unconditioned-basement-with-wall-and-ceiling-insulation.osw +33 -35
  224. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/unvented-attic-with-floor-and-roof-insulation.osw +33 -35
  225. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/unvented-crawlspace-with-wall-and-ceiling-insulation.osw +36 -38
  226. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/vented-attic-with-floor-and-roof-insulation.osw +33 -35
  227. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/invalid_files/vented-crawlspace-with-wall-and-ceiling-insulation.osw +33 -35
  228. data/example_files/resources/hpxml-measures/Gemfile +0 -2
  229. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/measure.rb +141 -129
  230. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/measure.xml +183 -153
  231. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/BaseElements.xsd +4 -4
  232. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/EPvalidator.xml +247 -121
  233. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/HPXMLDataTypes.xsd +0 -10
  234. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/HPXMLvalidator.xml +434 -0
  235. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/airflow.rb +28 -35
  236. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/constants.rb +4 -12
  237. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/constructions.rb +60 -53
  238. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/energyplus.rb +11 -15
  239. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/generator.rb +81 -0
  240. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/geometry.rb +3 -1
  241. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hotwater_appliances.rb +21 -12
  242. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml.rb +1150 -1072
  243. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_defaults.rb +799 -389
  244. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hvac.rb +227 -351
  245. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hvac_sizing.rb +122 -89
  246. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/lighting.rb +1 -1
  247. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/location.rb +2 -3
  248. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/meta_measure.rb +0 -6
  249. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/misc_loads.rb +8 -13
  250. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/pv.rb +23 -21
  251. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedules.rb +8 -7
  252. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/simcontrols.rb +2 -2
  253. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/validator.rb +80 -19
  254. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/version.rb +9 -2
  255. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/waterheater.rb +103 -72
  256. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/xmlhelper.rb +110 -37
  257. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_airflow.rb +16 -7
  258. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_constructions.rb +109 -0
  259. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_defaults.rb +1747 -838
  260. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_generator.rb +99 -0
  261. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hotwater_appliance.rb +5 -16
  262. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hvac.rb +23 -25
  263. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hvac_sizing.rb +54 -0
  264. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_lighting.rb +1 -1
  265. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_location.rb +10 -10
  266. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_miscloads.rb +1 -1
  267. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_pv.rb +2 -2
  268. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_simcontrols.rb +10 -10
  269. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_validation.rb +77 -60
  270. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_water_heater.rb +186 -34
  271. data/example_files/resources/hpxml-measures/README.md +1 -0
  272. data/example_files/resources/hpxml-measures/Rakefile +2 -9
  273. data/example_files/resources/hpxml-measures/SimulationOutputReport/measure.rb +278 -254
  274. data/example_files/resources/hpxml-measures/SimulationOutputReport/measure.xml +32 -5
  275. data/example_files/resources/hpxml-measures/SimulationOutputReport/resources/constants.rb +1 -2
  276. data/example_files/resources/hpxml-measures/SimulationOutputReport/tests/output_report_test.rb +73 -137
  277. data/example_files/resources/hpxml-measures/docs/source/build_residential_hpxml.rst +3 -3
  278. data/example_files/resources/hpxml-measures/docs/source/conf.py +7 -4
  279. data/example_files/resources/hpxml-measures/docs/source/getting_started.rst +4 -4
  280. data/example_files/resources/hpxml-measures/docs/source/index.rst +2 -2
  281. data/example_files/resources/hpxml-measures/docs/source/intro.rst +4 -5
  282. data/example_files/resources/hpxml-measures/docs/source/nstatic/stylesheet.css +13 -1
  283. data/example_files/resources/hpxml-measures/docs/source/workflow_inputs.rst +2340 -0
  284. data/example_files/resources/hpxml-measures/docs/source/{simulation_output_report.rst → workflow_outputs.rst} +18 -16
  285. data/example_files/resources/hpxml-measures/tasks.rb +1154 -669
  286. data/example_files/resources/hpxml-measures/workflow/run_simulation.rb +64 -20
  287. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-coal.xml +557 -559
  288. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier-50percent.xml +523 -524
  289. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-appliances-dehumidifier-ief.xml → base-appliances-dehumidifier-ief-portable.xml} +3 -4
  290. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier-ief-whole-home.xml +524 -0
  291. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier.xml +523 -524
  292. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-gas.xml +557 -559
  293. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-modified.xml +563 -565
  294. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-none.xml +511 -513
  295. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-oil.xml +557 -559
  296. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-propane.xml +557 -559
  297. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-wood.xml +557 -559
  298. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-cathedral.xml +564 -566
  299. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-conditioned.xml +632 -634
  300. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-flat.xml +530 -532
  301. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-radiant-barrier.xml +516 -518
  302. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-unvented-insulated-roof.xml +561 -563
  303. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-vented.xml +564 -566
  304. 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} +30 -59
  305. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-adjacent-to-multiple.xml +553 -0
  306. 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} +30 -59
  307. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-enclosure-other-heated-space.xml → base-bldgtype-multifamily-adjacent-to-other-heated-space.xml} +30 -59
  308. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-enclosure-other-housing-unit.xml → base-bldgtype-multifamily-adjacent-to-other-housing-unit.xml} +30 -59
  309. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-baseboard.xml +426 -0
  310. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-fan-coil-ducted.xml +457 -0
  311. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-fan-coil.xml +429 -0
  312. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-water-loop-heat-pump.xml +469 -0
  313. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-cooling-tower-water-loop-heat-pump.xml +464 -0
  314. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-baseboard.xml +409 -0
  315. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil-ducted.xml +439 -0
  316. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil-eae.xml +408 -0
  317. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil.xml +411 -0
  318. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-water-loop-heat-pump.xml +445 -0
  319. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-baseboard.xml +408 -0
  320. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-fan-coil-ducted.xml +438 -0
  321. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-fan-coil.xml +410 -0
  322. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-water-loop-heat-pump.xml +445 -0
  323. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-cooling-tower-only-water-loop-heat-pump.xml +440 -0
  324. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-generator.xml +459 -0
  325. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-ground-loop-ground-to-air-heat-pump.xml +451 -0
  326. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-laundry-room.xml +465 -0
  327. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-mechvent-shared-multiple.xml → base-bldgtype-multifamily-shared-mechvent-multiple.xml} +35 -410
  328. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-mechvent-preconditioning.xml +488 -0
  329. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-mechvent.xml +472 -0
  330. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-pv.xml +464 -0
  331. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-water-heater-recirc.xml +457 -0
  332. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-water-heater.xml +450 -0
  333. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily.xml +447 -0
  334. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-single-family-attached.xml +606 -0
  335. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-combi-tankless-outside.xml +517 -519
  336. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-combi-tankless.xml +517 -519
  337. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-2-speed.xml +549 -551
  338. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-gshp.xml +564 -566
  339. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-hpwh.xml +562 -564
  340. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-tankless.xml +550 -549
  341. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-var-speed.xml +549 -551
  342. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater.xml +552 -551
  343. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-dwhr.xml +566 -568
  344. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-dse.xml +518 -520
  345. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-outside.xml +518 -520
  346. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-standbyloss.xml +519 -521
  347. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-with-solar-fraction.xml +526 -528
  348. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect.xml +518 -520
  349. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-electric.xml +566 -568
  350. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-gas.xml +567 -569
  351. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-hpwh.xml +565 -567
  352. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-indirect.xml +523 -525
  353. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-low-flow-fixtures.xml +561 -563
  354. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-multiple.xml +576 -578
  355. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-none.xml +495 -497
  356. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-demand.xml +564 -566
  357. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-manual.xml +564 -566
  358. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-nocontrol.xml +564 -566
  359. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-temperature.xml +564 -566
  360. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-timer.xml +564 -566
  361. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-evacuated-tube.xml +576 -578
  362. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-flat-plate.xml +576 -578
  363. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-ics.xml +576 -578
  364. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-fraction.xml +569 -571
  365. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-indirect-flat-plate.xml +576 -578
  366. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-thermosyphon-flat-plate.xml +576 -578
  367. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-coal.xml +562 -564
  368. data/example_files/resources/hpxml-measures/workflow/sample_files/{invalid_files/invalid-window-interior-shading.xml → base-dhw-tank-elec-uef.xml} +8 -9
  369. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas-outside.xml +562 -564
  370. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas-uef.xml +564 -0
  371. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas.xml +562 -564
  372. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-outside.xml +560 -562
  373. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-hvac-flowrate.xml → base-dhw-tank-heat-pump-uef.xml} +6 -13
  374. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-with-solar-fraction.xml +568 -570
  375. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-with-solar.xml +575 -577
  376. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump.xml +560 -562
  377. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-oil.xml +562 -564
  378. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-wood.xml +562 -564
  379. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric-outside.xml +560 -562
  380. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric-uef.xml +560 -0
  381. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric.xml +559 -561
  382. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-uef.xml +560 -0
  383. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-with-solar-fraction.xml +567 -569
  384. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-with-solar.xml +574 -576
  385. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas.xml +559 -561
  386. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-propane.xml +559 -561
  387. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-2stories-garage.xml +660 -664
  388. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-2stories.xml +574 -576
  389. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-1.xml +561 -563
  390. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-2.xml +561 -563
  391. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-4.xml +561 -563
  392. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-5.xml +561 -563
  393. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-garage.xml +635 -639
  394. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-ach-house-pressure.xml +561 -563
  395. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-cfm-house-pressure.xml +561 -563
  396. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-cfm50.xml +561 -563
  397. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-flue.xml +564 -566
  398. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-natural-ach.xml +560 -562
  399. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-overhangs.xml +576 -578
  400. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-rooftypes.xml +589 -591
  401. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-skylights.xml +589 -591
  402. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-level.xml +516 -0
  403. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-surfaces.xml +2473 -2493
  404. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-walltypes.xml +753 -755
  405. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-interior-shading.xml +561 -563
  406. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-none.xml +503 -505
  407. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-ambient.xml +497 -497
  408. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-complex.xml +723 -729
  409. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-conditioned-basement-slab-insulation.xml +561 -563
  410. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-conditioned-basement-wall-interior-insulation.xml +561 -563
  411. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-multiple.xml +684 -688
  412. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-slab.xml +515 -517
  413. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-above-grade.xml +608 -610
  414. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-assembly-r.xml +557 -559
  415. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-wall-insulation.xml +572 -574
  416. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement.xml +572 -574
  417. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unvented-crawlspace.xml +572 -574
  418. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-vented-crawlspace.xml +575 -577
  419. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-walkout-basement.xml +626 -628
  420. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-1-speed.xml +563 -562
  421. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-2-speed.xml +560 -562
  422. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-var-speed.xml +560 -562
  423. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-coal-only.xml +519 -521
  424. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-elec-only.xml +519 -521
  425. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-gas-central-ac-1-speed.xml +571 -573
  426. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-gas-only.xml +520 -522
  427. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-oil-only.xml +519 -521
  428. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-propane-only.xml +519 -521
  429. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-wood-only.xml +519 -521
  430. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-1-speed.xml +550 -549
  431. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-2-speed.xml +547 -549
  432. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-var-speed.xml +547 -549
  433. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-plus-air-to-air-heat-pump-heating.xml +580 -576
  434. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dse.xml +533 -535
  435. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-electric.xml +564 -563
  436. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed.xml +564 -563
  437. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-2-speed.xml +561 -563
  438. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-var-speed.xml +561 -563
  439. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-mini-split-heat-pump-ducted.xml +563 -562
  440. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-leakage-percent.xml +561 -563
  441. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-elec-resistance-only.xml +510 -512
  442. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-furnace-gas.xml +553 -555
  443. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-only-ducted.xml +526 -528
  444. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-only.xml +506 -505
  445. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-fireplace-wood-only.xml +513 -513
  446. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-fixed-heater-gas-only.xml +563 -563
  447. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-floor-furnace-propane-only.xml +513 -513
  448. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-coal-only.xml +548 -0
  449. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-elec-central-ac-1-speed.xml +561 -563
  450. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-elec-only.xml +547 -549
  451. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-central-ac-2-speed.xml +561 -563
  452. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-central-ac-var-speed.xml +561 -563
  453. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-only.xml +550 -550
  454. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-room-ac.xml +559 -561
  455. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-oil-only.xml +547 -549
  456. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-propane-only.xml +547 -549
  457. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-wood-only.xml +547 -549
  458. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-x3-dse.xml +577 -579
  459. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ground-to-air-heat-pump.xml +562 -564
  460. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ideal-air.xml +498 -500
  461. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-air-conditioner-only-ducted.xml +549 -548
  462. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-air-conditioner-only-ductless.xml +512 -511
  463. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted-cooling-only.xml +556 -555
  464. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted-heating-only.xml +562 -561
  465. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted.xml +562 -561
  466. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ductless.xml +519 -518
  467. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-multiple.xml +913 -912
  468. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-multiple2.xml +834 -837
  469. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-none.xml +487 -489
  470. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-portable-heater-gas-only.xml +563 -563
  471. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-programmable-thermostat-detailed.xml +566 -0
  472. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-programmable-thermostat.xml +569 -571
  473. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only-33percent.xml +509 -511
  474. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only.xml +509 -511
  475. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-setpoints.xml +561 -563
  476. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-stove-oil-only.xml +513 -513
  477. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-stove-wood-pellets-only.xml +513 -513
  478. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-undersized-allow-increased-fixed-capacities.xml +564 -566
  479. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-undersized.xml +561 -563
  480. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-wall-furnace-elec-only.xml +513 -513
  481. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-ceiling-fans.xml +572 -574
  482. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-detailed.xml +584 -586
  483. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-none.xml +487 -489
  484. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-AMY-2012.xml +561 -563
  485. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-baltimore-md.xml +561 -563
  486. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-dallas-tx.xml +515 -517
  487. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-duluth-mn.xml +561 -563
  488. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-miami-fl.xml +515 -517
  489. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-balanced.xml +573 -575
  490. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-bath-kitchen-fans.xml +589 -591
  491. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-dse.xml +546 -548
  492. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-evap-cooler-only-ducted.xml +539 -541
  493. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis.xml +574 -576
  494. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-erv-atre-asre.xml +575 -577
  495. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-erv.xml +575 -577
  496. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-exhaust-rated-flow-rate.xml +573 -575
  497. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-exhaust.xml +573 -575
  498. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-hrv-asre.xml +574 -576
  499. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-hrv.xml +574 -576
  500. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-multiple.xml +793 -795
  501. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-supply.xml +573 -575
  502. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-whole-house-fan.xml +571 -573
  503. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-defaults.xml +476 -495
  504. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-generators.xml +578 -0
  505. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-large-uncommon.xml +753 -833
  506. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-large-uncommon2.xml +740 -820
  507. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-none.xml +549 -559
  508. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-neighbor-shading.xml +574 -576
  509. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-shelter-coefficient.xml +564 -566
  510. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-usage-multiplier.xml +723 -725
  511. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv.xml +2 -4
  512. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-stochastic.xml +2 -4
  513. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-user-specified.xml +2 -4
  514. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-calendar-year-custom.xml +562 -564
  515. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-daylight-saving-custom.xml +568 -570
  516. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-daylight-saving-disabled.xml +564 -566
  517. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-runperiod-1-month.xml +565 -567
  518. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-timestep-10-mins.xml +561 -563
  519. data/example_files/resources/hpxml-measures/workflow/sample_files/base.xml +561 -563
  520. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-autosize.xml +559 -561
  521. 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 +562 -561
  522. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-air-to-air-heat-pump-1-speed-autosize.xml +559 -558
  523. 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 +559 -561
  524. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-air-to-air-heat-pump-2-speed-autosize.xml +556 -558
  525. 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 +559 -561
  526. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-air-to-air-heat-pump-var-speed-autosize.xml +556 -558
  527. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-boiler-elec-only-autosize.xml +518 -520
  528. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-boiler-gas-central-ac-1-speed-autosize.xml +569 -571
  529. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-boiler-gas-only-autosize.xml +519 -521
  530. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-central-ac-only-1-speed-autosize.xml +549 -548
  531. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-central-ac-only-2-speed-autosize.xml +546 -548
  532. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-central-ac-only-var-speed-autosize.xml +546 -548
  533. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-central-ac-plus-air-to-air-heat-pump-heating-autosize.xml +575 -571
  534. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-autosize.xml +560 -559
  535. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-dual-fuel-mini-split-heat-pump-ducted-autosize.xml +559 -558
  536. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-elec-resistance-only-autosize.xml +509 -511
  537. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-evap-cooler-furnace-gas-autosize.xml +552 -554
  538. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-floor-furnace-propane-only-autosize.xml +512 -512
  539. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-furnace-elec-only-autosize.xml +546 -548
  540. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-furnace-gas-central-ac-2-speed-autosize.xml +559 -561
  541. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-furnace-gas-central-ac-var-speed-autosize.xml +559 -561
  542. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-furnace-gas-only-autosize.xml +549 -549
  543. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-furnace-gas-room-ac-autosize.xml +557 -559
  544. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-ground-to-air-heat-pump-autosize-manual-s-oversize-allowances.xml +562 -564
  545. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-ground-to-air-heat-pump-autosize.xml +559 -561
  546. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-mini-split-air-conditioner-only-ducted-autosize.xml +548 -547
  547. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-autosize-manual-s-oversize-allowances.xml +561 -560
  548. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-autosize.xml +558 -557
  549. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-cooling-only-autosize.xml +553 -552
  550. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-mini-split-heat-pump-ducted-heating-only-autosize.xml +558 -557
  551. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-room-ac-only-autosize.xml +508 -510
  552. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-stove-oil-only-autosize.xml +512 -512
  553. data/example_files/resources/hpxml-measures/workflow/sample_files/hvac_autosizing/base-hvac-wall-furnace-elec-only-autosize.xml +512 -512
  554. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/cfis-with-hydronic-distribution.xml +533 -535
  555. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/clothes-dryer-location.xml +561 -563
  556. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/clothes-washer-location.xml +561 -563
  557. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/cooking-range-location.xml +561 -563
  558. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dhw-frac-load-served.xml +576 -578
  559. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-dhw-uef.xml → invalid_files/dhw-invalid-ef-tank.xml} +3 -5
  560. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dhw-invalid-uef-tank-heat-pump.xml +563 -0
  561. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/dishwasher-location.xml +561 -563
  562. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duct-location-unconditioned-space.xml +561 -563
  563. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duct-location.xml +561 -563
  564. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/duplicate-id.xml +561 -563
  565. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-attic-missing-roof.xml +545 -547
  566. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-basement-missing-exterior-foundation-wall.xml +542 -544
  567. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-basement-missing-slab.xml +545 -545
  568. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-floor-area-exceeds-cfa.xml +562 -0
  569. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-garage-missing-exterior-wall.xml +612 -616
  570. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-garage-missing-roof-ceiling.xml +625 -629
  571. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-garage-missing-slab.xml +609 -611
  572. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-living-missing-ceiling-roof.xml +549 -551
  573. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-living-missing-exterior-wall.xml +471 -473
  574. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/enclosure-living-missing-floor-slab.xml +534 -534
  575. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/heat-pump-mixed-fixed-and-autosize-capacities.xml +561 -560
  576. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/heat-pump-mixed-fixed-and-autosize-capacities2.xml +562 -561
  577. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-distribution-multiple-attached-cooling.xml +913 -912
  578. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-distribution-multiple-attached-heating.xml +913 -912
  579. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-distribution-return-duct-leakage-missing.xml +532 -534
  580. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-dse-multiple-attached-cooling.xml +547 -549
  581. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-dse-multiple-attached-heating.xml +547 -549
  582. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-frac-load-served.xml +913 -912
  583. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/{invalid-calendar-year.xml → hvac-inconsistent-fan-powers.xml} +8 -5
  584. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/hvac-invalid-distribution-system-type.xml +569 -571
  585. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-datatype-boolean.xml +562 -0
  586. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-datatype-float.xml +562 -0
  587. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-datatype-integer.xml +562 -0
  588. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-daylight-saving.xml +568 -567
  589. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-distribution-cfa-served.xml +561 -563
  590. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-epw-filepath.xml +561 -563
  591. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-facility-type-equipment.xml +465 -0
  592. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-facility-type-surfaces.xml +643 -0
  593. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-input-parameters.xml +564 -0
  594. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-neighbor-shading-azimuth.xml +574 -576
  595. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-relatedhvac-desuperheater.xml +552 -551
  596. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-relatedhvac-dhw-indirect.xml +518 -520
  597. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-runperiod.xml +563 -565
  598. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-schema-version.xml +562 -0
  599. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-timestep.xml +561 -563
  600. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-window-height.xml +576 -578
  601. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/lighting-fractions.xml +561 -563
  602. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/missing-duct-location.xml +909 -908
  603. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/missing-elements.xml +559 -561
  604. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-appliance.xml +561 -563
  605. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-duct.xml +561 -563
  606. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-surface.xml +564 -566
  607. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/multifamily-reference-water-heater.xml +561 -563
  608. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/net-area-negative-roof.xml +589 -591
  609. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/net-area-negative-wall.xml +561 -563
  610. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/num-bedrooms-exceeds-limit.xml +562 -0
  611. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/orphaned-hvac-distribution.xml +545 -547
  612. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/refrigerator-location.xml +561 -563
  613. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/refrigerators-multiple-primary.xml +567 -569
  614. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/refrigerators-no-primary.xml +567 -569
  615. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/repeated-relatedhvac-desuperheater.xml +565 -564
  616. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/repeated-relatedhvac-dhw-indirect.xml +527 -529
  617. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/slab-zero-exposed-perimeter.xml +561 -563
  618. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/solar-thermal-system-with-combi-tankless.xml +532 -534
  619. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/solar-thermal-system-with-desuperheater.xml +567 -566
  620. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/solar-thermal-system-with-dhw-indirect.xml +532 -534
  621. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-cfis.xml +574 -576
  622. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-door.xml +561 -563
  623. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-hvac-distribution.xml +561 -563
  624. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-shared-clothes-washer-water-heater.xml +464 -827
  625. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-shared-dishwasher-water-heater.xml +464 -827
  626. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-skylight.xml +589 -591
  627. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-solar-thermal-system.xml +576 -578
  628. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/unattached-window.xml +561 -563
  629. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/water-heater-location-other.xml +561 -563
  630. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/water-heater-location.xml +561 -563
  631. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L100AC.xml +6 -14
  632. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L100AL.xml +6 -14
  633. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L110AC.xml +6 -14
  634. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L110AL.xml +6 -14
  635. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L120AC.xml +6 -14
  636. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L120AL.xml +6 -14
  637. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L130AC.xml +6 -14
  638. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L130AL.xml +6 -14
  639. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L140AC.xml +6 -14
  640. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L140AL.xml +6 -14
  641. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L150AC.xml +6 -14
  642. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L150AL.xml +6 -14
  643. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L155AC.xml +6 -14
  644. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L155AL.xml +6 -14
  645. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L160AC.xml +6 -14
  646. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L160AL.xml +6 -14
  647. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L170AC.xml +6 -14
  648. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L170AL.xml +6 -14
  649. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L200AC.xml +6 -14
  650. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L200AL.xml +6 -14
  651. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L202AC.xml +6 -14
  652. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L202AL.xml +6 -14
  653. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L302XC.xml +6 -16
  654. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L304XC.xml +6 -16
  655. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L322XC.xml +6 -16
  656. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L324XC.xml +6 -16
  657. data/example_files/resources/hpxml-measures/workflow/tests/hpxml_translator_test.rb +277 -224
  658. data/lib/uo_cli/version.rb +1 -1
  659. data/scripts/setup-env-gitbash.sh +4 -4
  660. data/scripts/setup-env.bat +14 -11
  661. data/scripts/setup-env.ps1 +13 -10
  662. data/uo_cli.gemspec +6 -4
  663. metadata +106 -57
  664. data/example_files/resources/hpxml-measures/docs/source/hpxml_to_openstudio.rst +0 -1386
  665. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-shared-laundry-room.xml +0 -828
  666. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-shared-water-heater-recirc.xml +0 -820
  667. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-shared-water-heater.xml +0 -813
  668. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-attached-multifamily.xml +0 -810
  669. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-common-surfaces.xml +0 -928
  670. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-baseboard.xml +0 -777
  671. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-fan-coil-ducted.xml +0 -808
  672. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-fan-coil.xml +0 -780
  673. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-chiller-water-loop-heat-pump.xml +0 -820
  674. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-cooling-tower-water-loop-heat-pump.xml +0 -815
  675. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-baseboard.xml +0 -760
  676. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-fan-coil-ducted.xml +0 -790
  677. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-fan-coil-eae.xml +0 -759
  678. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-fan-coil.xml +0 -762
  679. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-boiler-only-water-loop-heat-pump.xml +0 -796
  680. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-baseboard.xml +0 -759
  681. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-fan-coil-ducted.xml +0 -789
  682. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-fan-coil.xml +0 -761
  683. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-chiller-only-water-loop-heat-pump.xml +0 -796
  684. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-cooling-tower-only-water-loop-heat-pump.xml +0 -791
  685. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-shared-ground-loop-ground-to-air-heat-pump.xml +0 -814
  686. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-shared-preconditioning.xml +0 -851
  687. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-shared.xml +0 -835
  688. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-shared.xml +0 -827
  689. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/appliances-location-unconditioned-space.xml +0 -564
  690. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/coal-for-non-boiler-heating.xml +0 -514
  691. data/example_files/resources/hpxml-measures/workflow/sample_files/invalid_files/invalid-facility-type.xml +0 -828
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Generator
4
+ def self.apply(model, nbeds, generator)
5
+ obj_name = generator.id
6
+
7
+ if not generator.is_shared_system
8
+ annual_consumption_kbtu = generator.annual_consumption_kbtu
9
+ annual_output_kwh = generator.annual_output_kwh
10
+ else
11
+ # Apportion to single dwelling unit by # bedrooms
12
+ if generator.number_of_bedrooms_served.to_f <= nbeds.to_f
13
+ fail "Shared Generator number of bedrooms served (#{generator.number_of_bedrooms_served}) must be greater than the number of bedrooms in the dwelling unit (#{nbeds})."
14
+ end
15
+ annual_consumption_kbtu = generator.annual_consumption_kbtu * nbeds.to_f / generator.number_of_bedrooms_served.to_f
16
+ annual_output_kwh = generator.annual_output_kwh * nbeds.to_f / generator.number_of_bedrooms_served.to_f
17
+ end
18
+
19
+ input_w = UnitConversions.convert(annual_consumption_kbtu, 'kBtu', 'Wh') / 8760.0
20
+ output_w = UnitConversions.convert(annual_output_kwh, 'kWh', 'Wh') / 8760.0
21
+ efficiency = output_w / input_w
22
+ if efficiency > 1.0
23
+ fail 'Generator Annual Consumption must be greater than Annual Output.'
24
+ end
25
+
26
+ curve_biquadratic_constant = create_curve_biquadratic_constant(model)
27
+ curve_cubic_constant = create_curve_cubic_constant(model)
28
+
29
+ gmt = OpenStudio::Model::GeneratorMicroTurbine.new(model)
30
+ gmt.setName("#{obj_name} generator")
31
+ gmt.setFuelType(EPlus.fuel_type(generator.fuel_type))
32
+ gmt.setReferenceElectricalPowerOutput(output_w)
33
+ gmt.setMinimumFullLoadElectricalPowerOutput(output_w - 0.001)
34
+ gmt.setMaximumFullLoadElectricalPowerOutput(output_w)
35
+ gmt.setReferenceElectricalEfficiencyUsingLowerHeatingValue(efficiency)
36
+ gmt.setFuelHigherHeatingValue(50000)
37
+ gmt.setFuelLowerHeatingValue(50000)
38
+ gmt.setStandbyPower(0.0)
39
+ gmt.setAncillaryPower(0.0)
40
+ gmt.electricalPowerFunctionofTemperatureandElevationCurve.remove
41
+ gmt.electricalEfficiencyFunctionofTemperatureCurve.remove
42
+ gmt.electricalEfficiencyFunctionofPartLoadRatioCurve.remove
43
+ gmt.setElectricalPowerFunctionofTemperatureandElevationCurve(curve_biquadratic_constant)
44
+ gmt.setElectricalEfficiencyFunctionofTemperatureCurve(curve_cubic_constant)
45
+ gmt.setElectricalEfficiencyFunctionofPartLoadRatioCurve(curve_cubic_constant)
46
+
47
+ elcd = gmt.electricLoadCenterDistribution.get
48
+ elcd.setName("#{obj_name} elec load center dist")
49
+ elcd.setGeneratorOperationSchemeType('Baseload')
50
+ elcd.addGenerator(gmt)
51
+ elcd.setElectricalBussType('AlternatingCurrent')
52
+ end
53
+
54
+ def self.create_curve_cubic_constant(model)
55
+ constant_cubic = OpenStudio::Model::CurveCubic.new(model)
56
+ constant_cubic.setName('ConstantCubic')
57
+ constant_cubic.setCoefficient1Constant(1)
58
+ constant_cubic.setCoefficient2x(0)
59
+ constant_cubic.setCoefficient3xPOW2(0)
60
+ constant_cubic.setCoefficient4xPOW3(0)
61
+ # constant_cubic.setMinimumValueofx(-100)
62
+ # constant_cubic.setMaximumValueofx(100)
63
+ return constant_cubic
64
+ end
65
+
66
+ def self.create_curve_biquadratic_constant(model)
67
+ const_biquadratic = OpenStudio::Model::CurveBiquadratic.new(model)
68
+ const_biquadratic.setName('ConstantBiquadratic')
69
+ const_biquadratic.setCoefficient1Constant(1)
70
+ const_biquadratic.setCoefficient2x(0)
71
+ const_biquadratic.setCoefficient3xPOW2(0)
72
+ const_biquadratic.setCoefficient4y(0)
73
+ const_biquadratic.setCoefficient5yPOW2(0)
74
+ const_biquadratic.setCoefficient6xTIMESY(0)
75
+ # const_biquadratic.setMinimumValueofx(-100)
76
+ # const_biquadratic.setMaximumValueofx(100)
77
+ # const_biquadratic.setMinimumValueofy(-100)
78
+ # const_biquadratic.setMaximumValueofy(100)
79
+ return const_biquadratic
80
+ end
81
+ end
@@ -172,7 +172,9 @@ class Geometry
172
172
  end
173
173
 
174
174
  # Create schedule
175
- activity_sch = OpenStudio::Model::ScheduleRuleset.new(model, activity_per_person)
175
+ activity_sch = OpenStudio::Model::ScheduleConstant.new(model)
176
+ activity_sch.setValue(activity_per_person)
177
+ activity_sch.setName(Constants.ObjectNameOccupants + ' activity schedule')
176
178
 
177
179
  # Add people definition for the occ
178
180
  occ_def = OpenStudio::Model::PeopleDefinition.new(model)
@@ -350,13 +350,22 @@ class HotWaterAndAppliances
350
350
  return annual_kwh, annual_therm, frac_sens, frac_lat
351
351
  end
352
352
 
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 }
353
+ def self.get_dishwasher_default_values(eri_version)
354
+ if Constants.ERIVersions.index(eri_version) >= Constants.ERIVersions.index('2019A')
355
+ return { rated_annual_kwh: 467.0, # kWh/yr
356
+ label_electric_rate: 0.12, # $/kWh
357
+ label_gas_rate: 1.09, # $/therm
358
+ label_annual_gas_cost: 33.12, # $
359
+ label_usage: 4.0, # cyc/week
360
+ place_setting_capacity: 12.0 }
361
+ else
362
+ return { rated_annual_kwh: 467.0, # kWh/yr
363
+ label_electric_rate: 999, # unused
364
+ label_gas_rate: 999, # unused
365
+ label_annual_gas_cost: 999, # unused
366
+ label_usage: 999, # unused
367
+ place_setting_capacity: 12.0 }
368
+ end
360
369
  end
361
370
 
362
371
  def self.calc_dishwasher_energy_gpd(eri_version, nbeds, dishwasher, is_outside = false)
@@ -526,11 +535,11 @@ class HotWaterAndAppliances
526
535
  else
527
536
  return { integrated_modified_energy_factor: 0.331, # ft3/(kWh/cyc)
528
537
  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
538
+ label_electric_rate: 0.08, # $/kWh
539
+ label_gas_rate: 0.58, # $/therm
540
+ label_annual_gas_cost: 23.0, # $
532
541
  capacity: 2.874, # ft^3
533
- label_usage: 6.0 } # cyc/week, unused
542
+ label_usage: 999 } # unused
534
543
  end
535
544
  end
536
545
 
@@ -693,7 +702,7 @@ class HotWaterAndAppliances
693
702
  if fuel_type.nil?
694
703
  oe.setFuelType('None')
695
704
  else
696
- oe.setFuelType(EPlus.input_fuel_map(fuel_type))
705
+ oe.setFuelType(EPlus.fuel_type(fuel_type))
697
706
  end
698
707
  oe.setSpace(space)
699
708
  oe_def.setName(obj_name)
@@ -42,6 +42,8 @@ XMLHelper.write_file(hpxml.to_oga, "out.xml")
42
42
 
43
43
  '''
44
44
 
45
+ require_relative 'version'
46
+
45
47
  # FUTURE: Remove all idref attributes, make object attributes instead
46
48
  # E.g., in class Window, :wall_idref => :wall
47
49
 
@@ -51,10 +53,11 @@ class HPXML < Object
51
53
  :roofs, :rim_joists, :walls, :foundation_walls, :frame_floors, :slabs, :windows,
52
54
  :skylights, :doors, :heating_systems, :cooling_systems, :heat_pumps, :hvac_controls,
53
55
  :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)
56
+ :water_fixtures, :water_heating, :solar_thermal_systems, :pv_systems, :generators,
57
+ :clothes_washers, :clothes_dryers, :dishwashers, :refrigerators, :freezers, :dehumidifiers,
58
+ :cooking_ranges, :ovens, :lighting_groups, :lighting, :ceiling_fans, :pools, :hot_tubs,
59
+ :plug_loads, :fuel_loads]
60
+ attr_reader(*HPXML_ATTRS, :doc, :errors, :warnings)
58
61
 
59
62
  # Constants
60
63
  AtticTypeCathedral = 'CathedralCeiling'
@@ -69,6 +72,8 @@ class HPXML < Object
69
72
  ColorMedium = 'medium'
70
73
  ColorMediumDark = 'medium dark'
71
74
  ColorReflective = 'reflective'
75
+ DehumidifierTypePortable = 'portable'
76
+ DehumidifierTypeWholeHome = 'whole-home'
72
77
  DHWRecirControlTypeManual = 'manual demand control'
73
78
  DHWRecirControlTypeNone = 'no control'
74
79
  DHWRecirControlTypeSensor = 'presence sensor demand control'
@@ -272,18 +277,32 @@ class HPXML < Object
272
277
  WindowLayersSinglePane = 'single-pane'
273
278
  WindowLayersTriplePane = 'triple-pane'
274
279
 
275
- def initialize(hpxml_path: nil, collapse_enclosure: true)
280
+ def initialize(hpxml_path: nil, schematron_validators: [], collapse_enclosure: true)
276
281
  @doc = nil
277
282
  @hpxml_path = hpxml_path
283
+ @errors = []
284
+ @warnings = []
278
285
 
279
- # Create/populate child objects
280
286
  hpxml = nil
281
287
  if not hpxml_path.nil?
282
288
  @doc = XMLHelper.parse_file(hpxml_path)
289
+
290
+ # Check HPXML version
283
291
  hpxml = XMLHelper.get_element(@doc, '/HPXML')
292
+ Version.check_hpxml_version(XMLHelper.get_attribute_value(hpxml, 'schemaVersion'))
293
+
294
+ # Validate against Schematron docs
295
+ @errors, @warnings = validate_against_schematron(schematron_validators: schematron_validators)
296
+ return unless @errors.empty?
284
297
  end
298
+
299
+ # Create/populate child objects
285
300
  from_oga(hpxml)
286
301
 
302
+ # Check for additional errors (those hard to check via Schematron)
303
+ @errors += check_for_errors()
304
+ return unless @errors.empty?
305
+
287
306
  # Clean up
288
307
  delete_tiny_surfaces()
289
308
  delete_adiabatic_subsurfaces()
@@ -448,10 +467,9 @@ class HPXML < Object
448
467
  # The WithinInfiltrationVolume properties are intentionally ignored for now.
449
468
  # FUTURE: Move into AirInfiltrationMeasurement class?
450
469
  cfa = @building_construction.conditioned_floor_area
451
- ncfl = @building_construction.number_of_conditioned_floors
452
470
  ncfl_ag = @building_construction.number_of_conditioned_floors_above_grade
453
471
  if has_walkout_basement()
454
- infil_height = Float(ncfl_ag) * infil_volume / cfa
472
+ infil_height = ncfl_ag * infil_volume / cfa
455
473
  else
456
474
  # Calculate maximum above-grade height of conditioned basement walls
457
475
  max_cond_bsmt_wall_height_ag = 0.0
@@ -470,7 +488,7 @@ class HPXML < Object
470
488
 
471
489
  cond_bsmt_rim_joist_height = UnitConversions.convert(9, 'in', 'ft')
472
490
  end
473
- infil_height = Float(ncfl_ag) * infil_volume / cfa + max_cond_bsmt_wall_height_ag + cond_bsmt_rim_joist_height
491
+ infil_height = ncfl_ag * infil_volume / cfa + max_cond_bsmt_wall_height_ag + cond_bsmt_rim_joist_height
474
492
  end
475
493
  return infil_height
476
494
  end
@@ -507,6 +525,7 @@ class HPXML < Object
507
525
  @water_heating.to_oga(@doc)
508
526
  @solar_thermal_systems.to_oga(@doc)
509
527
  @pv_systems.to_oga(@doc)
528
+ @generators.to_oga(@doc)
510
529
  @clothes_washers.to_oga(@doc)
511
530
  @clothes_dryers.to_oga(@doc)
512
531
  @dishwashers.to_oga(@doc)
@@ -556,6 +575,7 @@ class HPXML < Object
556
575
  @water_heating = WaterHeating.new(self, hpxml)
557
576
  @solar_thermal_systems = SolarThermalSystems.new(self, hpxml)
558
577
  @pv_systems = PVSystems.new(self, hpxml)
578
+ @generators = Generators.new(self, hpxml)
559
579
  @clothes_washers = ClothesWashers.new(self, hpxml)
560
580
  @clothes_dryers = ClothesDryers.new(self, hpxml)
561
581
  @dishwashers = Dishwashers.new(self, hpxml)
@@ -592,6 +612,19 @@ class HPXML < Object
592
612
  def initialize(hpxml_object, oga_element = nil, **kwargs)
593
613
  @hpxml_object = hpxml_object
594
614
  @additional_properties = AdditionalProperties.new
615
+
616
+ # Automatically add :foo_isdefaulted attributes to class
617
+ self.class::ATTRS.each do |attribute|
618
+ next if attribute.to_s.end_with? '_isdefaulted'
619
+
620
+ attr = "#{attribute}_isdefaulted".to_sym
621
+ next if self.class::ATTRS.include? attr
622
+
623
+ # Add attribute to ATTRS and class
624
+ self.class::ATTRS << attr
625
+ create_attr(attr.to_s) # From https://stackoverflow.com/a/4082937
626
+ end
627
+
595
628
  if not oga_element.nil?
596
629
  # Set values from HPXML Oga element
597
630
  from_oga(oga_element)
@@ -603,6 +636,15 @@ class HPXML < Object
603
636
  end
604
637
  end
605
638
 
639
+ def create_method(name, &block)
640
+ self.class.send(:define_method, name, &block)
641
+ end
642
+
643
+ def create_attr(name)
644
+ create_method("#{name}=".to_sym) { |val| instance_variable_set('@' + name, val) }
645
+ create_method(name.to_sym) { instance_variable_get('@' + name) }
646
+ end
647
+
606
648
  def to_h
607
649
  h = {}
608
650
  self.class::ATTRS.each do |attribute|
@@ -618,6 +660,7 @@ class HPXML < Object
618
660
  def nil?
619
661
  # Returns true if all attributes are nil
620
662
  to_h.each do |k, v|
663
+ next if k.to_s.end_with? '_isdefaulted'
621
664
  return false if not v.nil?
622
665
  end
623
666
  return true
@@ -631,6 +674,7 @@ class HPXML < Object
631
674
  def initialize(hpxml_object, oga_element = nil)
632
675
  @hpxml_object = hpxml_object
633
676
  @additional_properties = AdditionalProperties.new
677
+
634
678
  if not oga_element.nil?
635
679
  # Set values from HPXML Oga element
636
680
  from_oga(oga_element)
@@ -664,8 +708,8 @@ class HPXML < Object
664
708
  ATTRS = [:xml_type, :xml_generated_by, :created_date_and_time, :transaction,
665
709
  :software_program_used, :software_program_version, :eri_calculation_version,
666
710
  :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,
711
+ :sim_begin_month, :sim_begin_day, :sim_end_month, :sim_end_day, :sim_calendar_year,
712
+ :dst_enabled, :dst_begin_month, :dst_begin_day, :dst_end_month, :dst_end_day,
669
713
  :use_max_load_for_heat_pumps, :allow_increased_fixed_capacities,
670
714
  :apply_ashrae140_assumptions, :schedules_path]
671
715
  attr_accessor(*ATTRS)
@@ -676,7 +720,7 @@ class HPXML < Object
676
720
  if not @timestep.nil?
677
721
  valid_tsteps = [60, 30, 20, 15, 12, 10, 6, 5, 4, 3, 2, 1]
678
722
  if not valid_tsteps.include? @timestep
679
- fail "Timestep (#{@timestep}) must be one of: #{valid_tsteps.join(', ')}."
723
+ errors << "Timestep (#{@timestep}) must be one of: #{valid_tsteps.join(', ')}."
680
724
  end
681
725
  end
682
726
 
@@ -685,7 +729,7 @@ class HPXML < Object
685
729
 
686
730
  valid_months = (1..12).to_a
687
731
  if not valid_months.include? begin_month
688
- fail "#{sim_ctl} Begin Month (#{begin_month}) must be one of: #{valid_months.join(', ')}."
732
+ errors << "#{sim_ctl} Begin Month (#{begin_month}) must be one of: #{valid_months.join(', ')}."
689
733
  end
690
734
  end
691
735
 
@@ -694,43 +738,37 @@ class HPXML < Object
694
738
 
695
739
  valid_months = (1..12).to_a
696
740
  if not valid_months.include? end_month
697
- fail "#{sim_ctl} End Month (#{end_month}) must be one of: #{valid_months.join(', ')}."
741
+ errors << "#{sim_ctl} End Month (#{end_month}) must be one of: #{valid_months.join(', ')}."
698
742
  end
699
743
  end
700
744
 
701
745
  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
746
  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(', ')}."
747
+ { '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|
748
+ begin_month, begin_day, end_month, end_day = months_and_days
749
+ if (not begin_day.nil?) && (months.include? begin_month)
750
+ if not valid_days.include? begin_day
751
+ errors << "#{sim_ctl} Begin Day of Month (#{begin_day}) must be one of: #{valid_days.join(', ')}."
708
752
  end
709
753
  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(', ')}."
754
+ next unless (not end_day.nil?) && (months.include? end_month)
755
+ if not valid_days.include? end_day
756
+ errors << "#{sim_ctl} End Day of Month (#{end_day}) must be one of: #{valid_days.join(', ')}."
713
757
  end
714
758
  end
715
759
  end
716
760
 
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
761
+ { 'Run Period' => [@sim_begin_month, @sim_begin_day, @sim_end_month, @sim_end_day] }.each do |sim_ctl, months_and_days|
762
+ begin_month, begin_day, end_month, end_day = months_and_days
719
763
  next unless (not begin_month.nil?) && (not end_month.nil?)
720
764
  if begin_month > end_month
721
- fail "#{sim_ctl} Begin Month (#{begin_month}) cannot come after #{sim_ctl} End Month (#{end_month})."
765
+ errors << "#{sim_ctl} Begin Month (#{begin_month}) cannot come after #{sim_ctl} End Month (#{end_month})."
722
766
  end
723
767
 
724
- next unless (not begin_day_of_month.nil?) && (not end_day_of_month.nil?)
768
+ next unless (not begin_day.nil?) && (not end_day.nil?)
725
769
  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
-
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."
770
+ if begin_day > end_day
771
+ 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
772
  end
735
773
  end
736
774
 
@@ -742,55 +780,55 @@ class HPXML < Object
742
780
 
743
781
  hpxml = XMLHelper.get_element(doc, '/HPXML')
744
782
  header = XMLHelper.add_element(hpxml, 'XMLTransactionHeaderInformation')
745
- XMLHelper.add_element(header, 'XMLType', @xml_type)
746
- XMLHelper.add_element(header, 'XMLGeneratedBy', @xml_generated_by)
783
+ XMLHelper.add_element(header, 'XMLType', @xml_type, :string)
784
+ XMLHelper.add_element(header, 'XMLGeneratedBy', @xml_generated_by, :string)
747
785
  if not @created_date_and_time.nil?
748
- XMLHelper.add_element(header, 'CreatedDateAndTime', @created_date_and_time)
786
+ XMLHelper.add_element(header, 'CreatedDateAndTime', @created_date_and_time, :string)
749
787
  else
750
- XMLHelper.add_element(header, 'CreatedDateAndTime', Time.now.strftime('%Y-%m-%dT%H:%M:%S%:z'))
788
+ XMLHelper.add_element(header, 'CreatedDateAndTime', Time.now.strftime('%Y-%m-%dT%H:%M:%S%:z'), :string)
751
789
  end
752
- XMLHelper.add_element(header, 'Transaction', @transaction)
790
+ XMLHelper.add_element(header, 'Transaction', @transaction, :string)
753
791
 
754
792
  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?
793
+ XMLHelper.add_element(software_info, 'SoftwareProgramUsed', @software_program_used, :string) unless @software_program_used.nil?
794
+ XMLHelper.add_element(software_info, 'SoftwareProgramVersion', @software_program_version, :string) unless @software_program_version.nil?
757
795
  if not @apply_ashrae140_assumptions.nil?
758
796
  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?
797
+ XMLHelper.add_element(extension, 'ApplyASHRAE140Assumptions', @apply_ashrae140_assumptions, :boolean) unless @apply_ashrae140_assumptions.nil?
760
798
  end
761
799
  if (not @eri_calculation_version.nil?) || (not @eri_design.nil?)
762
800
  extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
763
801
  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?
802
+ XMLHelper.add_element(eri_calculation, 'Version', @eri_calculation_version, :string) unless @eri_calculation_version.nil?
803
+ XMLHelper.add_element(eri_calculation, 'Design', @eri_design, :string) unless @eri_design.nil?
766
804
  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?)
805
+ 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
806
  extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
769
807
  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?)
808
+ XMLHelper.add_element(simulation_control, 'Timestep', @timestep, :integer, @timestep_isdefaulted) unless @timestep.nil?
809
+ XMLHelper.add_element(simulation_control, 'BeginMonth', @sim_begin_month, :integer, @sim_begin_month_isdefaulted) unless @sim_begin_month.nil?
810
+ XMLHelper.add_element(simulation_control, 'BeginDayOfMonth', @sim_begin_day, :integer, @sim_begin_day_isdefaulted) unless @sim_begin_day.nil?
811
+ XMLHelper.add_element(simulation_control, 'EndMonth', @sim_end_month, :integer, @sim_end_month_isdefaulted) unless @sim_end_month.nil?
812
+ XMLHelper.add_element(simulation_control, 'EndDayOfMonth', @sim_end_day, :integer, @sim_end_day_isdefaulted) unless @sim_end_day.nil?
813
+ XMLHelper.add_element(simulation_control, 'CalendarYear', @sim_calendar_year, :integer, @sim_calendar_year_isdefaulted) unless @sim_calendar_year.nil?
814
+ 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
815
  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?
816
+ XMLHelper.add_element(daylight_saving, 'Enabled', @dst_enabled, :boolean, @dst_enabled_isdefaulted) unless @dst_enabled.nil?
817
+ XMLHelper.add_element(daylight_saving, 'BeginMonth', @dst_begin_month, :integer, @dst_begin_month_isdefaulted) unless @dst_begin_month.nil?
818
+ XMLHelper.add_element(daylight_saving, 'BeginDayOfMonth', @dst_begin_day, :integer, @dst_begin_day_isdefaulted) unless @dst_begin_day.nil?
819
+ XMLHelper.add_element(daylight_saving, 'EndMonth', @dst_end_month, :integer, @dst_end_month_isdefaulted) unless @dst_end_month.nil?
820
+ XMLHelper.add_element(daylight_saving, 'EndDayOfMonth', @dst_end_day, :integer, @dst_end_day_isdefaulted) unless @dst_end_day.nil?
783
821
  end
784
822
  end
785
823
  if (not @use_max_load_for_heat_pumps.nil?) || (not @allow_increased_fixed_capacities.nil?)
786
824
  extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
787
825
  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?
826
+ 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?
827
+ XMLHelper.add_element(hvac_sizing_control, 'AllowIncreasedFixedCapacities', @allow_increased_fixed_capacities, :boolean, @allow_increased_fixed_capacities_isdefaulted) unless @allow_increased_fixed_capacities.nil?
790
828
  end
791
-
792
829
  if not @schedules_path.nil?
793
- XMLHelper.add_element(extension, 'OccupancySchedulesCSVPath', @schedules_path) unless @schedules_path.nil?
830
+ extension = XMLHelper.create_elements_as_needed(software_info, ['extension'])
831
+ XMLHelper.add_element(extension, 'OccupancySchedulesCSVPath', @schedules_path, :string) unless @schedules_path.nil?
794
832
  end
795
833
 
796
834
  building = XMLHelper.add_element(hpxml, 'Building')
@@ -801,41 +839,41 @@ class HPXML < Object
801
839
  site_id = XMLHelper.add_element(site, 'SiteID')
802
840
  XMLHelper.add_attribute(site_id, 'id', 'SiteID')
803
841
  address = XMLHelper.add_element(site, 'Address')
804
- XMLHelper.add_element(address, 'StateCode', @state_code)
842
+ XMLHelper.add_element(address, 'StateCode', @state_code, :string)
805
843
  end
806
844
  project_status = XMLHelper.add_element(building, 'ProjectStatus')
807
- XMLHelper.add_element(project_status, 'EventType', @event_type)
845
+ XMLHelper.add_element(project_status, 'EventType', @event_type, :string)
808
846
  end
809
847
 
810
848
  def from_oga(hpxml)
811
849
  return if hpxml.nil?
812
850
 
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')
851
+ @xml_type = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/XMLType', :string)
852
+ @xml_generated_by = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/XMLGeneratedBy', :string)
853
+ @created_date_and_time = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/CreatedDateAndTime', :string)
854
+ @transaction = XMLHelper.get_value(hpxml, 'XMLTransactionHeaderInformation/Transaction', :string)
855
+ @software_program_used = XMLHelper.get_value(hpxml, 'SoftwareInfo/SoftwareProgramUsed', :string)
856
+ @software_program_version = XMLHelper.get_value(hpxml, 'SoftwareInfo/SoftwareProgramVersion', :string)
857
+ @eri_calculation_version = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ERICalculation/Version', :string)
858
+ @eri_design = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ERICalculation/Design', :string)
859
+ @timestep, @timestep_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/Timestep', :integer)
860
+ @sim_begin_month, @sim_begin_month_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/BeginMonth', :integer)
861
+ @sim_begin_day, @sim_begin_day_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/BeginDayOfMonth', :integer)
862
+ @sim_end_month, @sim_end_month_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/EndMonth', :integer)
863
+ @sim_end_day, @sim_end_day_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/EndDayOfMonth', :integer)
864
+ @sim_calendar_year, @sim_calendar_year_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/CalendarYear', :integer)
865
+ @dst_enabled, @dst_enabled_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/Enabled', :boolean)
866
+ @dst_begin_month, @dst_begin_month_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/BeginMonth', :integer)
867
+ @dst_begin_day, @dst_begin_day_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/BeginDayOfMonth', :integer)
868
+ @dst_end_month, @dst_end_month_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/EndMonth', :integer)
869
+ @dst_end_day, @dst_end_day_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/SimulationControl/DaylightSaving/EndDayOfMonth', :integer)
870
+ @apply_ashrae140_assumptions = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/ApplyASHRAE140Assumptions', :boolean)
871
+ @use_max_load_for_heat_pumps, @use_max_load_for_heat_pumps_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/HVACSizingControl/UseMaxLoadForHeatPumps', :boolean)
872
+ @allow_increased_fixed_capacities, @allow_increased_fixed_capacities_isdefaulted = XMLHelper.get_value_and_defaulted(hpxml, 'SoftwareInfo/extension/HVACSizingControl/AllowIncreasedFixedCapacities', :boolean)
873
+ @schedules_path = XMLHelper.get_value(hpxml, 'SoftwareInfo/extension/OccupancySchedulesCSVPath', :string)
836
874
  @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')
875
+ @event_type = XMLHelper.get_value(hpxml, 'Building/ProjectStatus/EventType', :string)
876
+ @state_code = XMLHelper.get_value(hpxml, 'Building/Site/Address/StateCode', :string)
839
877
  end
840
878
  end
841
879
 
@@ -852,16 +890,16 @@ class HPXML < Object
852
890
  return if nil?
853
891
 
854
892
  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?
893
+ XMLHelper.add_element(site, 'SiteType', @site_type, :string, @site_type_isdefaulted) unless @site_type.nil?
894
+ XMLHelper.add_element(site, 'Surroundings', @surroundings, :string) unless @surroundings.nil?
895
+ XMLHelper.add_element(site, 'OrientationOfFrontOfHome', @orientation_of_front_of_home, :string) unless @orientation_of_front_of_home.nil?
858
896
  if (not @fuels.nil?) && (not @fuels.empty?)
859
897
  fuel_types_available = XMLHelper.add_element(site, 'FuelTypesAvailable')
860
898
  @fuels.each do |fuel|
861
- XMLHelper.add_element(fuel_types_available, 'Fuel', fuel)
899
+ XMLHelper.add_element(fuel_types_available, 'Fuel', fuel, :string)
862
900
  end
863
901
  end
864
- XMLHelper.add_extension(site, 'ShelterCoefficient', to_float(@shelter_coefficient)) unless @shelter_coefficient.nil?
902
+ XMLHelper.add_extension(site, 'ShelterCoefficient', @shelter_coefficient, :float, shelter_coefficient_isdefaulted) unless @shelter_coefficient.nil?
865
903
  end
866
904
 
867
905
  def from_oga(hpxml)
@@ -870,11 +908,11 @@ class HPXML < Object
870
908
  site = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/BuildingSummary/Site')
871
909
  return if site.nil?
872
910
 
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'))
911
+ @site_type, @site_type_isdefaulted = XMLHelper.get_value_and_defaulted(site, 'SiteType', :string)
912
+ @surroundings = XMLHelper.get_value(site, 'Surroundings', :string)
913
+ @orientation_of_front_of_home = XMLHelper.get_value(site, 'OrientationOfFrontOfHome', :string)
914
+ @fuels = XMLHelper.get_values(site, 'FuelTypesAvailable/Fuel', :string)
915
+ @shelter_coefficient, @shelter_coefficient_isdefaulted = XMLHelper.get_value_and_defaulted(site, 'extension/ShelterCoefficient', :float)
878
916
  end
879
917
  end
880
918
 
@@ -906,17 +944,17 @@ class HPXML < Object
906
944
 
907
945
  neighbors = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'BuildingSummary', 'Site', 'extension', 'Neighbors'])
908
946
  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?
947
+ XMLHelper.add_element(neighbor_building, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
948
+ XMLHelper.add_element(neighbor_building, 'Distance', @distance, :float) unless @distance.nil?
949
+ XMLHelper.add_element(neighbor_building, 'Height', @height, :float) unless @height.nil?
912
950
  end
913
951
 
914
952
  def from_oga(neighbor_building)
915
953
  return if neighbor_building.nil?
916
954
 
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'))
955
+ @azimuth = XMLHelper.get_value(neighbor_building, 'Azimuth', :integer)
956
+ @distance = XMLHelper.get_value(neighbor_building, 'Distance', :float)
957
+ @height = XMLHelper.get_value(neighbor_building, 'Height', :float)
920
958
  end
921
959
  end
922
960
 
@@ -933,7 +971,7 @@ class HPXML < Object
933
971
  return if nil?
934
972
 
935
973
  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?
974
+ XMLHelper.add_element(building_occupancy, 'NumberofResidents', @number_of_residents, :float, @number_of_residents_isdefaulted) unless @number_of_residents.nil?
937
975
  end
938
976
 
939
977
  def from_oga(hpxml)
@@ -942,7 +980,7 @@ class HPXML < Object
942
980
  building_occupancy = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/BuildingSummary/BuildingOccupancy')
943
981
  return if building_occupancy.nil?
944
982
 
945
- @number_of_residents = to_float_or_nil(XMLHelper.get_value(building_occupancy, 'NumberofResidents'))
983
+ @number_of_residents, @number_of_residents_isdefaulted = XMLHelper.get_value_and_defaulted(building_occupancy, 'NumberofResidents', :float)
946
984
  end
947
985
  end
948
986
 
@@ -962,16 +1000,16 @@ class HPXML < Object
962
1000
  return if nil?
963
1001
 
964
1002
  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?
1003
+ XMLHelper.add_element(building_construction, 'ResidentialFacilityType', @residential_facility_type, :string) unless @residential_facility_type.nil?
1004
+ XMLHelper.add_element(building_construction, 'NumberofConditionedFloors', @number_of_conditioned_floors, :float) unless @number_of_conditioned_floors.nil?
1005
+ XMLHelper.add_element(building_construction, 'NumberofConditionedFloorsAboveGrade', @number_of_conditioned_floors_above_grade, :float) unless @number_of_conditioned_floors_above_grade.nil?
1006
+ XMLHelper.add_element(building_construction, 'AverageCeilingHeight', @average_ceiling_height, :float, @average_ceiling_height_isdefaulted) unless @average_ceiling_height.nil?
1007
+ XMLHelper.add_element(building_construction, 'NumberofBedrooms', @number_of_bedrooms, :integer) unless @number_of_bedrooms.nil?
1008
+ XMLHelper.add_element(building_construction, 'NumberofBathrooms', @number_of_bathrooms, :integer, @number_of_bathrooms_isdefaulted) unless @number_of_bathrooms.nil?
1009
+ XMLHelper.add_element(building_construction, 'ConditionedFloorArea', @conditioned_floor_area, :float) unless @conditioned_floor_area.nil?
1010
+ XMLHelper.add_element(building_construction, 'ConditionedBuildingVolume', @conditioned_building_volume, :float, @conditioned_building_volume_isdefaulted) unless @conditioned_building_volume.nil?
1011
+ XMLHelper.add_extension(building_construction, 'UseOnlyIdealAirSystem', @use_only_ideal_air_system, :boolean) unless @use_only_ideal_air_system.nil?
1012
+ XMLHelper.add_extension(building_construction, 'HasFlueOrChimney', @has_flue_or_chimney, :boolean, @has_flue_or_chimney_isdefaulted) unless @has_flue_or_chimney.nil?
975
1013
  end
976
1014
 
977
1015
  def from_oga(hpxml)
@@ -980,17 +1018,17 @@ class HPXML < Object
980
1018
  building_construction = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/BuildingSummary/BuildingConstruction')
981
1019
  return if building_construction.nil?
982
1020
 
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'))
1021
+ @year_built = XMLHelper.get_value(building_construction, 'YearBuilt', :integer)
1022
+ @number_of_conditioned_floors = XMLHelper.get_value(building_construction, 'NumberofConditionedFloors', :float)
1023
+ @number_of_conditioned_floors_above_grade = XMLHelper.get_value(building_construction, 'NumberofConditionedFloorsAboveGrade', :float)
1024
+ @average_ceiling_height, @average_ceiling_height_isdefaulted = XMLHelper.get_value_and_defaulted(building_construction, 'AverageCeilingHeight', :float)
1025
+ @number_of_bedrooms = XMLHelper.get_value(building_construction, 'NumberofBedrooms', :integer)
1026
+ @number_of_bathrooms, @number_of_bathrooms_isdefaulted = XMLHelper.get_value_and_defaulted(building_construction, 'NumberofBathrooms', :integer)
1027
+ @conditioned_floor_area = XMLHelper.get_value(building_construction, 'ConditionedFloorArea', :float)
1028
+ @conditioned_building_volume, @conditioned_building_volume_isdefaulted = XMLHelper.get_value_and_defaulted(building_construction, 'ConditionedBuildingVolume', :float)
1029
+ @use_only_ideal_air_system = XMLHelper.get_value(building_construction, 'extension/UseOnlyIdealAirSystem', :boolean)
1030
+ @residential_facility_type = XMLHelper.get_value(building_construction, 'ResidentialFacilityType', :string)
1031
+ @has_flue_or_chimney, @has_flue_or_chimney_isdefaulted = XMLHelper.get_value_and_defaulted(building_construction, 'extension/HasFlueOrChimney', :boolean)
994
1032
  end
995
1033
  end
996
1034
 
@@ -1011,17 +1049,17 @@ class HPXML < Object
1011
1049
 
1012
1050
  if (not @iecc_year.nil?) && (not @iecc_zone.nil?)
1013
1051
  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?
1052
+ XMLHelper.add_element(climate_zone_iecc, 'Year', @iecc_year, :integer) unless @iecc_year.nil?
1053
+ XMLHelper.add_element(climate_zone_iecc, 'ClimateZone', @iecc_zone, :string) unless @iecc_zone.nil?
1016
1054
  end
1017
1055
 
1018
1056
  if not @weather_station_id.nil?
1019
1057
  weather_station = XMLHelper.add_element(climate_and_risk_zones, 'WeatherStation')
1020
1058
  sys_id = XMLHelper.add_element(weather_station, 'SystemIdentifier')
1021
1059
  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?
1060
+ XMLHelper.add_element(weather_station, 'Name', @weather_station_name, :string) unless @weather_station_name.nil?
1061
+ XMLHelper.add_element(weather_station, 'WMO', @weather_station_wmo, :string) unless @weather_station_wmo.nil?
1062
+ XMLHelper.add_extension(weather_station, 'EPWFilePath', @weather_station_epw_filepath, :string) unless @weather_station_epw_filepath.nil?
1025
1063
  end
1026
1064
  end
1027
1065
 
@@ -1031,14 +1069,14 @@ class HPXML < Object
1031
1069
  climate_and_risk_zones = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/ClimateandRiskZones')
1032
1070
  return if climate_and_risk_zones.nil?
1033
1071
 
1034
- @iecc_year = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/Year')
1035
- @iecc_zone = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/ClimateZone')
1072
+ @iecc_year = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/Year', :integer)
1073
+ @iecc_zone = XMLHelper.get_value(climate_and_risk_zones, 'ClimateZoneIECC/ClimateZone', :string)
1036
1074
  weather_station = XMLHelper.get_element(climate_and_risk_zones, 'WeatherStation')
1037
1075
  if not weather_station.nil?
1038
1076
  @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')
1077
+ @weather_station_name = XMLHelper.get_value(weather_station, 'Name', :string)
1078
+ @weather_station_wmo = XMLHelper.get_value(weather_station, 'WMO', :string)
1079
+ @weather_station_epw_filepath = XMLHelper.get_value(weather_station, 'extension/EPWFilePath', :string)
1042
1080
  end
1043
1081
  end
1044
1082
  end
@@ -1074,30 +1112,30 @@ class HPXML < Object
1074
1112
  air_infiltration_measurement = XMLHelper.add_element(air_infiltration, 'AirInfiltrationMeasurement')
1075
1113
  sys_id = XMLHelper.add_element(air_infiltration_measurement, 'SystemIdentifier')
1076
1114
  XMLHelper.add_attribute(sys_id, 'id', @id)
1077
- XMLHelper.add_element(air_infiltration_measurement, 'HousePressure', to_float(@house_pressure)) unless @house_pressure.nil?
1115
+ XMLHelper.add_element(air_infiltration_measurement, 'HousePressure', @house_pressure, :float) unless @house_pressure.nil?
1078
1116
  if (not @unit_of_measure.nil?) && (not @air_leakage.nil?)
1079
1117
  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))
1118
+ XMLHelper.add_element(building_air_leakage, 'UnitofMeasure', @unit_of_measure, :string)
1119
+ XMLHelper.add_element(building_air_leakage, 'AirLeakage', @air_leakage, :float)
1082
1120
  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?
1121
+ XMLHelper.add_element(air_infiltration_measurement, 'EffectiveLeakageArea', @effective_leakage_area, :float) unless @effective_leakage_area.nil?
1122
+ XMLHelper.add_element(air_infiltration_measurement, 'InfiltrationVolume', @infiltration_volume, :float, @infiltration_volume_isdefaulted) unless @infiltration_volume.nil?
1123
+ XMLHelper.add_extension(air_infiltration_measurement, 'InfiltrationHeight', @infiltration_height, :float) unless @infiltration_height.nil?
1124
+ XMLHelper.add_extension(air_infiltration_measurement, 'Aext', @a_ext, :float) unless @a_ext.nil?
1087
1125
  end
1088
1126
 
1089
1127
  def from_oga(air_infiltration_measurement)
1090
1128
  return if air_infiltration_measurement.nil?
1091
1129
 
1092
1130
  @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'))
1131
+ @house_pressure = XMLHelper.get_value(air_infiltration_measurement, 'HousePressure', :float)
1132
+ @unit_of_measure = XMLHelper.get_value(air_infiltration_measurement, 'BuildingAirLeakage/UnitofMeasure', :string)
1133
+ @air_leakage = XMLHelper.get_value(air_infiltration_measurement, 'BuildingAirLeakage/AirLeakage', :float)
1134
+ @effective_leakage_area = XMLHelper.get_value(air_infiltration_measurement, 'EffectiveLeakageArea', :float)
1135
+ @infiltration_volume, @infiltration_volume_isdefaulted = XMLHelper.get_value_and_defaulted(air_infiltration_measurement, 'InfiltrationVolume', :float)
1136
+ @leakiness_description = XMLHelper.get_value(air_infiltration_measurement, 'LeakinessDescription', :string)
1137
+ @infiltration_height = XMLHelper.get_value(air_infiltration_measurement, 'extension/InfiltrationHeight', :float)
1138
+ @a_ext = XMLHelper.get_value(air_infiltration_measurement, 'extension/Aext', :float)
1101
1139
  end
1102
1140
  end
1103
1141
 
@@ -1179,29 +1217,29 @@ class HPXML < Object
1179
1217
  attic_type_e = XMLHelper.add_element(attic, 'AtticType')
1180
1218
  if @attic_type == AtticTypeUnvented
1181
1219
  attic_type_attic = XMLHelper.add_element(attic_type_e, 'Attic')
1182
- XMLHelper.add_element(attic_type_attic, 'Vented', false)
1220
+ XMLHelper.add_element(attic_type_attic, 'Vented', false, :boolean)
1183
1221
  elsif @attic_type == AtticTypeVented
1184
1222
  attic_type_attic = XMLHelper.add_element(attic_type_e, 'Attic')
1185
- XMLHelper.add_element(attic_type_attic, 'Vented', true)
1223
+ XMLHelper.add_element(attic_type_attic, 'Vented', true, :boolean)
1186
1224
  if not @vented_attic_sla.nil?
1187
1225
  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))
1226
+ XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsSLA, :string)
1227
+ XMLHelper.add_element(ventilation_rate, 'Value', @vented_attic_sla, :float, @vented_attic_sla_isdefaulted)
1190
1228
  elsif not @vented_attic_ach.nil?
1191
1229
  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))
1230
+ XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsACHNatural, :string)
1231
+ XMLHelper.add_element(ventilation_rate, 'Value', @vented_attic_ach, :float)
1194
1232
  end
1195
1233
  elsif @attic_type == AtticTypeConditioned
1196
1234
  attic_type_attic = XMLHelper.add_element(attic_type_e, 'Attic')
1197
- XMLHelper.add_element(attic_type_attic, 'Conditioned', true)
1235
+ XMLHelper.add_element(attic_type_attic, 'Conditioned', true, :boolean)
1198
1236
  elsif (@attic_type == AtticTypeFlatRoof) || (@attic_type == AtticTypeCathedral)
1199
1237
  XMLHelper.add_element(attic_type_e, @attic_type)
1200
1238
  else
1201
1239
  fail "Unhandled attic type '#{@attic_type}'."
1202
1240
  end
1203
1241
  end
1204
- XMLHelper.add_element(attic, 'WithinInfiltrationVolume', to_boolean(@within_infiltration_volume)) unless @within_infiltration_volume.nil?
1242
+ XMLHelper.add_element(attic, 'WithinInfiltrationVolume', within_infiltration_volume, :boolean) unless @within_infiltration_volume.nil?
1205
1243
  end
1206
1244
 
1207
1245
  def from_oga(attic)
@@ -1220,10 +1258,10 @@ class HPXML < Object
1220
1258
  @attic_type = AtticTypeCathedral
1221
1259
  end
1222
1260
  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"))
1261
+ @vented_attic_sla, @vented_attic_sla_isdefaulted = XMLHelper.get_value_and_defaulted(attic, "VentilationRate[UnitofMeasure='#{UnitsSLA}']/Value", :float)
1262
+ @vented_attic_ach = XMLHelper.get_value(attic, "VentilationRate[UnitofMeasure='#{UnitsACHNatural}']/Value", :float)
1225
1263
  end
1226
- @within_infiltration_volume = to_boolean_or_nil(XMLHelper.get_value(attic, 'WithinInfiltrationVolume'))
1264
+ @within_infiltration_volume = XMLHelper.get_value(attic, 'WithinInfiltrationVolume', :boolean)
1227
1265
  @attached_to_roof_idrefs = []
1228
1266
  XMLHelper.get_elements(attic, 'AttachedToRoof').each do |roof|
1229
1267
  @attached_to_roof_idrefs << HPXML::get_idref(roof)
@@ -1344,26 +1382,26 @@ class HPXML < Object
1344
1382
  XMLHelper.add_element(foundation_type_e, @foundation_type)
1345
1383
  elsif @foundation_type == FoundationTypeBasementConditioned
1346
1384
  basement = XMLHelper.add_element(foundation_type_e, 'Basement')
1347
- XMLHelper.add_element(basement, 'Conditioned', true)
1385
+ XMLHelper.add_element(basement, 'Conditioned', true, :boolean)
1348
1386
  elsif @foundation_type == FoundationTypeBasementUnconditioned
1349
1387
  basement = XMLHelper.add_element(foundation_type_e, 'Basement')
1350
- XMLHelper.add_element(basement, 'Conditioned', false)
1388
+ XMLHelper.add_element(basement, 'Conditioned', false, :boolean)
1351
1389
  elsif @foundation_type == FoundationTypeCrawlspaceVented
1352
1390
  crawlspace = XMLHelper.add_element(foundation_type_e, 'Crawlspace')
1353
- XMLHelper.add_element(crawlspace, 'Vented', true)
1391
+ XMLHelper.add_element(crawlspace, 'Vented', true, :boolean)
1354
1392
  if not @vented_crawlspace_sla.nil?
1355
1393
  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))
1394
+ XMLHelper.add_element(ventilation_rate, 'UnitofMeasure', UnitsSLA, :string)
1395
+ XMLHelper.add_element(ventilation_rate, 'Value', @vented_crawlspace_sla, :float, @vented_crawlspace_sla_isdefaulted)
1358
1396
  end
1359
1397
  elsif @foundation_type == FoundationTypeCrawlspaceUnvented
1360
1398
  crawlspace = XMLHelper.add_element(foundation_type_e, 'Crawlspace')
1361
- XMLHelper.add_element(crawlspace, 'Vented', false)
1399
+ XMLHelper.add_element(crawlspace, 'Vented', false, :boolean)
1362
1400
  else
1363
1401
  fail "Unhandled foundation type '#{@foundation_type}'."
1364
1402
  end
1365
1403
  end
1366
- XMLHelper.add_element(foundation, 'WithinInfiltrationVolume', to_boolean(@within_infiltration_volume)) unless @within_infiltration_volume.nil?
1404
+ XMLHelper.add_element(foundation, 'WithinInfiltrationVolume', @within_infiltration_volume, :boolean) unless @within_infiltration_volume.nil?
1367
1405
  end
1368
1406
 
1369
1407
  def from_oga(foundation)
@@ -1384,9 +1422,9 @@ class HPXML < Object
1384
1422
  @foundation_type = FoundationTypeAmbient
1385
1423
  end
1386
1424
  if @foundation_type == FoundationTypeCrawlspaceVented
1387
- @vented_crawlspace_sla = to_float_or_nil(XMLHelper.get_value(foundation, "VentilationRate[UnitofMeasure='SLA']/Value"))
1425
+ @vented_crawlspace_sla, @vented_crawlspace_sla_isdefaulted = XMLHelper.get_value_and_defaulted(foundation, "VentilationRate[UnitofMeasure='#{UnitsSLA}']/Value", :float)
1388
1426
  end
1389
- @within_infiltration_volume = to_boolean_or_nil(XMLHelper.get_value(foundation, 'WithinInfiltrationVolume'))
1427
+ @within_infiltration_volume = XMLHelper.get_value(foundation, 'WithinInfiltrationVolume', :boolean)
1390
1428
  @attached_to_slab_idrefs = []
1391
1429
  XMLHelper.get_elements(foundation, 'AttachedToSlab').each do |slab|
1392
1430
  @attached_to_slab_idrefs << HPXML::get_idref(slab)
@@ -1429,6 +1467,7 @@ class HPXML < Object
1429
1467
 
1430
1468
  def net_area
1431
1469
  return if nil?
1470
+ return if @area.nil?
1432
1471
 
1433
1472
  val = @area
1434
1473
  skylights.each do |skylight|
@@ -1482,16 +1521,16 @@ class HPXML < Object
1482
1521
  roof = XMLHelper.add_element(roofs, 'Roof')
1483
1522
  sys_id = XMLHelper.add_element(roof, 'SystemIdentifier')
1484
1523
  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?
1524
+ XMLHelper.add_element(roof, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1525
+ XMLHelper.add_element(roof, 'Area', @area, :float) unless @area.nil?
1526
+ XMLHelper.add_element(roof, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1527
+ XMLHelper.add_element(roof, 'RoofType', @roof_type, :string, @roof_type_isdefaulted) unless @roof_type.nil?
1528
+ XMLHelper.add_element(roof, 'RoofColor', @roof_color, :string, @roof_color_isdefaulted) unless @roof_color.nil?
1529
+ XMLHelper.add_element(roof, 'SolarAbsorptance', @solar_absorptance, :float, @solar_absorptance_isdefaulted) unless @solar_absorptance.nil?
1530
+ XMLHelper.add_element(roof, 'Emittance', @emittance, :float, @emittance_isdefaulted) unless @emittance.nil?
1531
+ XMLHelper.add_element(roof, 'Pitch', @pitch, :float) unless @pitch.nil?
1532
+ XMLHelper.add_element(roof, 'RadiantBarrier', @radiant_barrier, :boolean, @radiant_barrier_isdefaulted) unless @radiant_barrier.nil?
1533
+ XMLHelper.add_element(roof, 'RadiantBarrierGrade', @radiant_barrier_grade, :integer) unless @radiant_barrier_grade.nil?
1495
1534
  insulation = XMLHelper.add_element(roof, 'Insulation')
1496
1535
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1497
1536
  if not @insulation_id.nil?
@@ -1499,29 +1538,29 @@ class HPXML < Object
1499
1538
  else
1500
1539
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1501
1540
  end
1502
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
1541
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1503
1542
  end
1504
1543
 
1505
1544
  def from_oga(roof)
1506
1545
  return if roof.nil?
1507
1546
 
1508
1547
  @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'))
1548
+ @interior_adjacent_to = XMLHelper.get_value(roof, 'InteriorAdjacentTo', :string)
1549
+ @area = XMLHelper.get_value(roof, 'Area', :float)
1550
+ @azimuth = XMLHelper.get_value(roof, 'Azimuth', :integer)
1551
+ @roof_type, @roof_type_isdefaulted = XMLHelper.get_value_and_defaulted(roof, 'RoofType', :string)
1552
+ @roof_color, @roof_color_isdefaulted = XMLHelper.get_value_and_defaulted(roof, 'RoofColor', :string)
1553
+ @solar_absorptance, @solar_absorptance_isdefaulted = XMLHelper.get_value_and_defaulted(roof, 'SolarAbsorptance', :float)
1554
+ @emittance, @emittance_isdefaulted = XMLHelper.get_value_and_defaulted(roof, 'Emittance', :float)
1555
+ @pitch = XMLHelper.get_value(roof, 'Pitch', :float)
1556
+ @radiant_barrier, @radiant_barrier_isdefaulted = XMLHelper.get_value_and_defaulted(roof, 'RadiantBarrier', :boolean)
1557
+ @radiant_barrier_grade = XMLHelper.get_value(roof, 'RadiantBarrierGrade', :integer)
1519
1558
  insulation = XMLHelper.get_element(roof, 'Insulation')
1520
1559
  if not insulation.nil?
1521
1560
  @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"))
1561
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
1562
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
1563
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1525
1564
  end
1526
1565
  end
1527
1566
  end
@@ -1586,14 +1625,14 @@ class HPXML < Object
1586
1625
  rim_joist = XMLHelper.add_element(rim_joists, 'RimJoist')
1587
1626
  sys_id = XMLHelper.add_element(rim_joist, 'SystemIdentifier')
1588
1627
  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?
1628
+ XMLHelper.add_element(rim_joist, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
1629
+ XMLHelper.add_element(rim_joist, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1630
+ XMLHelper.add_element(rim_joist, 'Area', @area, :float) unless @area.nil?
1631
+ XMLHelper.add_element(rim_joist, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1632
+ XMLHelper.add_element(rim_joist, 'Siding', @siding, :string, @siding_isdefaulted) unless @siding.nil?
1633
+ XMLHelper.add_element(rim_joist, 'Color', @color, :string, @color_isdefaulted) unless @color.nil?
1634
+ XMLHelper.add_element(rim_joist, 'SolarAbsorptance', @solar_absorptance, :float, @solar_absorptance_isdefaulted) unless @solar_absorptance.nil?
1635
+ XMLHelper.add_element(rim_joist, 'Emittance', @emittance, :float, @emittance_isdefaulted) unless @emittance.nil?
1597
1636
  insulation = XMLHelper.add_element(rim_joist, 'Insulation')
1598
1637
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1599
1638
  if not @insulation_id.nil?
@@ -1601,27 +1640,27 @@ class HPXML < Object
1601
1640
  else
1602
1641
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1603
1642
  end
1604
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
1643
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1605
1644
  end
1606
1645
 
1607
1646
  def from_oga(rim_joist)
1608
1647
  return if rim_joist.nil?
1609
1648
 
1610
1649
  @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'))
1650
+ @exterior_adjacent_to = XMLHelper.get_value(rim_joist, 'ExteriorAdjacentTo', :string)
1651
+ @interior_adjacent_to = XMLHelper.get_value(rim_joist, 'InteriorAdjacentTo', :string)
1652
+ @area = XMLHelper.get_value(rim_joist, 'Area', :float)
1653
+ @azimuth = XMLHelper.get_value(rim_joist, 'Azimuth', :integer)
1654
+ @siding, @siding_isdefaulted = XMLHelper.get_value_and_defaulted(rim_joist, 'Siding', :string)
1655
+ @color, @color_isdefaulted = XMLHelper.get_value_and_defaulted(rim_joist, 'Color', :string)
1656
+ @solar_absorptance, @solar_absorptance_isdefaulted = XMLHelper.get_value_and_defaulted(rim_joist, 'SolarAbsorptance', :float)
1657
+ @emittance, @emittance_isdefaulted = XMLHelper.get_value_and_defaulted(rim_joist, 'Emittance', :float)
1619
1658
  insulation = XMLHelper.get_element(rim_joist, 'Insulation')
1620
1659
  if not insulation.nil?
1621
1660
  @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"))
1661
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
1662
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
1663
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1625
1664
  end
1626
1665
  end
1627
1666
  end
@@ -1656,6 +1695,7 @@ class HPXML < Object
1656
1695
 
1657
1696
  def net_area
1658
1697
  return if nil?
1698
+ return if @area.nil?
1659
1699
 
1660
1700
  val = @area
1661
1701
  (windows + doors).each do |subsurface|
@@ -1713,18 +1753,18 @@ class HPXML < Object
1713
1753
  wall = XMLHelper.add_element(walls, 'Wall')
1714
1754
  sys_id = XMLHelper.add_element(wall, 'SystemIdentifier')
1715
1755
  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?
1756
+ XMLHelper.add_element(wall, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
1757
+ XMLHelper.add_element(wall, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1718
1758
  if not @wall_type.nil?
1719
1759
  wall_type_e = XMLHelper.add_element(wall, 'WallType')
1720
1760
  XMLHelper.add_element(wall_type_e, @wall_type)
1721
1761
  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?
1762
+ XMLHelper.add_element(wall, 'Area', @area, :float) unless @area.nil?
1763
+ XMLHelper.add_element(wall, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1764
+ XMLHelper.add_element(wall, 'Siding', @siding, :string, @siding_isdefaulted) unless @siding.nil?
1765
+ XMLHelper.add_element(wall, 'Color', @color, :string, @color_isdefaulted) unless @color.nil?
1766
+ XMLHelper.add_element(wall, 'SolarAbsorptance', @solar_absorptance, :float, @solar_absorptance_isdefaulted) unless @solar_absorptance.nil?
1767
+ XMLHelper.add_element(wall, 'Emittance', @emittance, :float, @emittance_isdefaulted) unless @emittance.nil?
1728
1768
  insulation = XMLHelper.add_element(wall, 'Insulation')
1729
1769
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1730
1770
  if not @insulation_id.nil?
@@ -1732,30 +1772,30 @@ class HPXML < Object
1732
1772
  else
1733
1773
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1734
1774
  end
1735
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
1775
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1736
1776
  end
1737
1777
 
1738
1778
  def from_oga(wall)
1739
1779
  return if wall.nil?
1740
1780
 
1741
1781
  @id = HPXML::get_id(wall)
1742
- @exterior_adjacent_to = XMLHelper.get_value(wall, 'ExteriorAdjacentTo')
1743
- @interior_adjacent_to = XMLHelper.get_value(wall, 'InteriorAdjacentTo')
1782
+ @exterior_adjacent_to = XMLHelper.get_value(wall, 'ExteriorAdjacentTo', :string)
1783
+ @interior_adjacent_to = XMLHelper.get_value(wall, 'InteriorAdjacentTo', :string)
1744
1784
  @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'))
1785
+ @optimum_value_engineering = XMLHelper.get_value(wall, 'WallType/WoodStud/OptimumValueEngineering', :boolean)
1786
+ @area = XMLHelper.get_value(wall, 'Area', :float)
1787
+ @orientation = XMLHelper.get_value(wall, 'Orientation', :string)
1788
+ @azimuth = XMLHelper.get_value(wall, 'Azimuth', :integer)
1789
+ @siding, @siding_isdefaulted = XMLHelper.get_value_and_defaulted(wall, 'Siding', :string)
1790
+ @color, @color_isdefaulted = XMLHelper.get_value_and_defaulted(wall, 'Color', :string)
1791
+ @solar_absorptance, @solar_absorptance_isdefaulted = XMLHelper.get_value_and_defaulted(wall, 'SolarAbsorptance', :float)
1792
+ @emittance, @emittance_isdefaulted = XMLHelper.get_value_and_defaulted(wall, 'Emittance', :float)
1753
1793
  insulation = XMLHelper.get_element(wall, 'Insulation')
1754
1794
  if not insulation.nil?
1755
1795
  @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"))
1796
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
1797
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
1798
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1759
1799
  end
1760
1800
  end
1761
1801
  end
@@ -1793,6 +1833,7 @@ class HPXML < Object
1793
1833
 
1794
1834
  def net_area
1795
1835
  return if nil?
1836
+ return if @area.nil?
1796
1837
 
1797
1838
  val = @area
1798
1839
  (@hpxml_object.windows + @hpxml_object.doors).each do |subsurface|
@@ -1855,13 +1896,13 @@ class HPXML < Object
1855
1896
  foundation_wall = XMLHelper.add_element(foundation_walls, 'FoundationWall')
1856
1897
  sys_id = XMLHelper.add_element(foundation_wall, 'SystemIdentifier')
1857
1898
  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?
1899
+ XMLHelper.add_element(foundation_wall, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
1900
+ XMLHelper.add_element(foundation_wall, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
1901
+ XMLHelper.add_element(foundation_wall, 'Height', @height, :float) unless @height.nil?
1902
+ XMLHelper.add_element(foundation_wall, 'Area', @area, :float) unless @area.nil?
1903
+ XMLHelper.add_element(foundation_wall, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
1904
+ XMLHelper.add_element(foundation_wall, 'Thickness', @thickness, :float, @thickness_isdefaulted) unless @thickness.nil?
1905
+ XMLHelper.add_element(foundation_wall, 'DepthBelowGrade', @depth_below_grade, :float) unless @depth_below_grade.nil?
1865
1906
  insulation = XMLHelper.add_element(foundation_wall, 'Insulation')
1866
1907
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
1867
1908
  if not @insulation_id.nil?
@@ -1869,20 +1910,20 @@ class HPXML < Object
1869
1910
  else
1870
1911
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
1871
1912
  end
1872
- XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', to_float(@insulation_assembly_r_value)) unless @insulation_assembly_r_value.nil?
1913
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
1873
1914
  if not @insulation_exterior_r_value.nil?
1874
1915
  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?
1916
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous - exterior', :string)
1917
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_exterior_r_value, :float)
1918
+ XMLHelper.add_extension(layer, 'DistanceToTopOfInsulation', @insulation_exterior_distance_to_top, :float) unless @insulation_exterior_distance_to_top.nil?
1919
+ XMLHelper.add_extension(layer, 'DistanceToBottomOfInsulation', @insulation_exterior_distance_to_bottom, :float) unless @insulation_exterior_distance_to_bottom.nil?
1879
1920
  end
1880
1921
  if not @insulation_interior_r_value.nil?
1881
1922
  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?
1923
+ XMLHelper.add_element(layer, 'InstallationType', 'continuous - interior', :string)
1924
+ XMLHelper.add_element(layer, 'NominalRValue', @insulation_interior_r_value, :float)
1925
+ XMLHelper.add_extension(layer, 'DistanceToTopOfInsulation', @insulation_interior_distance_to_top, :float) unless @insulation_interior_distance_to_top.nil?
1926
+ XMLHelper.add_extension(layer, 'DistanceToBottomOfInsulation', @insulation_interior_distance_to_bottom, :float) unless @insulation_interior_distance_to_bottom.nil?
1886
1927
  end
1887
1928
  end
1888
1929
 
@@ -1890,25 +1931,25 @@ class HPXML < Object
1890
1931
  return if foundation_wall.nil?
1891
1932
 
1892
1933
  @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'))
1934
+ @exterior_adjacent_to = XMLHelper.get_value(foundation_wall, 'ExteriorAdjacentTo', :string)
1935
+ @interior_adjacent_to = XMLHelper.get_value(foundation_wall, 'InteriorAdjacentTo', :string)
1936
+ @height = XMLHelper.get_value(foundation_wall, 'Height', :float)
1937
+ @area = XMLHelper.get_value(foundation_wall, 'Area', :float)
1938
+ @azimuth = XMLHelper.get_value(foundation_wall, 'Azimuth', :integer)
1939
+ @thickness, @thickness_isdefaulted = XMLHelper.get_value_and_defaulted(foundation_wall, 'Thickness', :float)
1940
+ @depth_below_grade = XMLHelper.get_value(foundation_wall, 'DepthBelowGrade', :float)
1900
1941
  insulation = XMLHelper.get_element(foundation_wall, 'Insulation')
1901
1942
  if not insulation.nil?
1902
1943
  @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'))
1944
+ @insulation_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1945
+ @insulation_interior_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/NominalRValue", :float)
1946
+ @insulation_interior_distance_to_top = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/extension/DistanceToTopOfInsulation", :float)
1947
+ @insulation_interior_distance_to_bottom = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - interior']/extension/DistanceToBottomOfInsulation", :float)
1948
+ @insulation_exterior_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/NominalRValue", :float)
1949
+ @insulation_exterior_distance_to_top = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/extension/DistanceToTopOfInsulation", :float)
1950
+ @insulation_exterior_distance_to_bottom = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous - exterior']/extension/DistanceToBottomOfInsulation", :float)
1951
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
1952
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
1912
1953
  end
1913
1954
  end
1914
1955
  end
@@ -1995,9 +2036,9 @@ class HPXML < Object
1995
2036
  frame_floor = XMLHelper.add_element(frame_floors, 'FrameFloor')
1996
2037
  sys_id = XMLHelper.add_element(frame_floor, 'SystemIdentifier')
1997
2038
  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?
2039
+ XMLHelper.add_element(frame_floor, 'ExteriorAdjacentTo', @exterior_adjacent_to, :string) unless @exterior_adjacent_to.nil?
2040
+ XMLHelper.add_element(frame_floor, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
2041
+ XMLHelper.add_element(frame_floor, 'Area', @area, :float) unless @area.nil?
2001
2042
  insulation = XMLHelper.add_element(frame_floor, 'Insulation')
2002
2043
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
2003
2044
  if not @insulation_id.nil?
@@ -2005,25 +2046,25 @@ class HPXML < Object
2005
2046
  else
2006
2047
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Insulation')
2007
2048
  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?
2049
+ XMLHelper.add_element(insulation, 'AssemblyEffectiveRValue', @insulation_assembly_r_value, :float) unless @insulation_assembly_r_value.nil?
2050
+ XMLHelper.add_extension(frame_floor, 'OtherSpaceAboveOrBelow', @other_space_above_or_below, :string) unless @other_space_above_or_below.nil?
2010
2051
  end
2011
2052
 
2012
2053
  def from_oga(frame_floor)
2013
2054
  return if frame_floor.nil?
2014
2055
 
2015
2056
  @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'))
2057
+ @exterior_adjacent_to = XMLHelper.get_value(frame_floor, 'ExteriorAdjacentTo', :string)
2058
+ @interior_adjacent_to = XMLHelper.get_value(frame_floor, 'InteriorAdjacentTo', :string)
2059
+ @area = XMLHelper.get_value(frame_floor, 'Area', :float)
2019
2060
  insulation = XMLHelper.get_element(frame_floor, 'Insulation')
2020
2061
  if not insulation.nil?
2021
2062
  @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"))
2063
+ @insulation_assembly_r_value = XMLHelper.get_value(insulation, 'AssemblyEffectiveRValue', :float)
2064
+ @insulation_cavity_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='cavity']/NominalRValue", :float)
2065
+ @insulation_continuous_r_value = XMLHelper.get_value(insulation, "Layer[InstallationType='continuous']/NominalRValue", :float)
2025
2066
  end
2026
- @other_space_above_or_below = XMLHelper.get_value(frame_floor, 'extension/OtherSpaceAboveOrBelow')
2067
+ @other_space_above_or_below = XMLHelper.get_value(frame_floor, 'extension/OtherSpaceAboveOrBelow', :string)
2027
2068
  end
2028
2069
  end
2029
2070
 
@@ -2081,7 +2122,7 @@ class HPXML < Object
2081
2122
 
2082
2123
  if not @exposed_perimeter.nil?
2083
2124
  if @exposed_perimeter <= 0
2084
- fail "Exposed perimeter for Slab '#{@id}' must be greater than zero."
2125
+ errors << "Exposed perimeter for Slab '#{@id}' must be greater than zero."
2085
2126
  end
2086
2127
  end
2087
2128
 
@@ -2095,14 +2136,14 @@ class HPXML < Object
2095
2136
  slab = XMLHelper.add_element(slabs, 'Slab')
2096
2137
  sys_id = XMLHelper.add_element(slab, 'SystemIdentifier')
2097
2138
  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?
2139
+ XMLHelper.add_element(slab, 'InteriorAdjacentTo', @interior_adjacent_to, :string) unless @interior_adjacent_to.nil?
2140
+ XMLHelper.add_element(slab, 'Area', @area, :float) unless @area.nil?
2141
+ XMLHelper.add_element(slab, 'Thickness', @thickness, :float, @thickness_isdefaulted) unless @thickness.nil?
2142
+ XMLHelper.add_element(slab, 'ExposedPerimeter', @exposed_perimeter, :float) unless @exposed_perimeter.nil?
2143
+ XMLHelper.add_element(slab, 'PerimeterInsulationDepth', @perimeter_insulation_depth, :float) unless @perimeter_insulation_depth.nil?
2144
+ XMLHelper.add_element(slab, 'UnderSlabInsulationWidth', @under_slab_insulation_width, :float) unless @under_slab_insulation_width.nil?
2145
+ XMLHelper.add_element(slab, 'UnderSlabInsulationSpansEntireSlab', @under_slab_insulation_spans_entire_slab, :boolean) unless @under_slab_insulation_spans_entire_slab.nil?
2146
+ XMLHelper.add_element(slab, 'DepthBelowGrade', @depth_below_grade, :float) unless @depth_below_grade.nil?
2106
2147
  insulation = XMLHelper.add_element(slab, 'PerimeterInsulation')
2107
2148
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
2108
2149
  if not @perimeter_insulation_id.nil?
@@ -2111,8 +2152,7 @@ class HPXML < Object
2111
2152
  XMLHelper.add_attribute(sys_id, 'id', @id + 'PerimeterInsulation')
2112
2153
  end
2113
2154
  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?
2155
+ XMLHelper.add_element(layer, 'NominalRValue', @perimeter_insulation_r_value, :float) unless @perimeter_insulation_r_value.nil?
2116
2156
  insulation = XMLHelper.add_element(slab, 'UnderSlabInsulation')
2117
2157
  sys_id = XMLHelper.add_element(insulation, 'SystemIdentifier')
2118
2158
  if not @under_slab_insulation_id.nil?
@@ -2121,35 +2161,34 @@ class HPXML < Object
2121
2161
  XMLHelper.add_attribute(sys_id, 'id', @id + 'UnderSlabInsulation')
2122
2162
  end
2123
2163
  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?
2164
+ XMLHelper.add_element(layer, 'NominalRValue', @under_slab_insulation_r_value, :float) unless @under_slab_insulation_r_value.nil?
2165
+ XMLHelper.add_extension(slab, 'CarpetFraction', @carpet_fraction, :float, @carpet_fraction_isdefaulted) unless @carpet_fraction.nil?
2166
+ XMLHelper.add_extension(slab, 'CarpetRValue', @carpet_r_value, :float, @carpet_r_value_isdefaulted) unless @carpet_r_value.nil?
2128
2167
  end
2129
2168
 
2130
2169
  def from_oga(slab)
2131
2170
  return if slab.nil?
2132
2171
 
2133
2172
  @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'))
2173
+ @interior_adjacent_to = XMLHelper.get_value(slab, 'InteriorAdjacentTo', :string)
2174
+ @area = XMLHelper.get_value(slab, 'Area', :float)
2175
+ @thickness, @thickness_isdefaulted = XMLHelper.get_value_and_defaulted(slab, 'Thickness', :float)
2176
+ @exposed_perimeter = XMLHelper.get_value(slab, 'ExposedPerimeter', :float)
2177
+ @perimeter_insulation_depth = XMLHelper.get_value(slab, 'PerimeterInsulationDepth', :float)
2178
+ @under_slab_insulation_width = XMLHelper.get_value(slab, 'UnderSlabInsulationWidth', :float)
2179
+ @under_slab_insulation_spans_entire_slab = XMLHelper.get_value(slab, 'UnderSlabInsulationSpansEntireSlab', :boolean)
2180
+ @depth_below_grade = XMLHelper.get_value(slab, 'DepthBelowGrade', :float)
2181
+ @carpet_fraction, @carpet_fraction_isdefaulted = XMLHelper.get_value_and_defaulted(slab, 'extension/CarpetFraction', :float)
2182
+ @carpet_r_value, @carpet_r_value_isdefaulted = XMLHelper.get_value_and_defaulted(slab, 'extension/CarpetRValue', :float)
2144
2183
  perimeter_insulation = XMLHelper.get_element(slab, 'PerimeterInsulation')
2145
2184
  if not perimeter_insulation.nil?
2146
2185
  @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"))
2186
+ @perimeter_insulation_r_value = XMLHelper.get_value(perimeter_insulation, 'Layer/NominalRValue', :float)
2148
2187
  end
2149
2188
  under_slab_insulation = XMLHelper.get_element(slab, 'UnderSlabInsulation')
2150
2189
  if not under_slab_insulation.nil?
2151
2190
  @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"))
2191
+ @under_slab_insulation_r_value = XMLHelper.get_value(under_slab_insulation, 'Layer/NominalRValue', :float)
2153
2192
  end
2154
2193
  end
2155
2194
  end
@@ -2212,13 +2251,7 @@ class HPXML < Object
2212
2251
  begin; wall; rescue StandardError => e; errors << e.message; end
2213
2252
  if (not @overhangs_distance_to_top_of_window.nil?) && (not @overhangs_distance_to_bottom_of_window.nil?)
2214
2253
  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}'."
2254
+ errors << "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})."
2222
2255
  end
2223
2256
  end
2224
2257
 
@@ -2232,24 +2265,24 @@ class HPXML < Object
2232
2265
  window = XMLHelper.add_element(windows, 'Window')
2233
2266
  sys_id = XMLHelper.add_element(window, 'SystemIdentifier')
2234
2267
  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?
2268
+ XMLHelper.add_element(window, 'Area', @area, :float) unless @area.nil?
2269
+ XMLHelper.add_element(window, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
2270
+ XMLHelper.add_element(window, 'UFactor', @ufactor, :float) unless @ufactor.nil?
2271
+ XMLHelper.add_element(window, 'SHGC', @shgc, :float) unless @shgc.nil?
2239
2272
  if (not @interior_shading_factor_summer.nil?) || (not @interior_shading_factor_winter.nil?)
2240
2273
  interior_shading = XMLHelper.add_element(window, 'InteriorShading')
2241
2274
  sys_id = XMLHelper.add_element(interior_shading, 'SystemIdentifier')
2242
2275
  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?
2276
+ XMLHelper.add_element(interior_shading, 'SummerShadingCoefficient', @interior_shading_factor_summer, :float, @interior_shading_factor_summer_isdefaulted) unless @interior_shading_factor_summer.nil?
2277
+ XMLHelper.add_element(interior_shading, 'WinterShadingCoefficient', @interior_shading_factor_winter, :float, @interior_shading_factor_winter_isdefaulted) unless @interior_shading_factor_winter.nil?
2245
2278
  end
2246
2279
  if (not @overhangs_depth.nil?) || (not @overhangs_distance_to_top_of_window.nil?) || (not @overhangs_distance_to_bottom_of_window.nil?)
2247
2280
  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?
2281
+ XMLHelper.add_element(overhangs, 'Depth', @overhangs_depth, :float) unless @overhangs_depth.nil?
2282
+ XMLHelper.add_element(overhangs, 'DistanceToTopOfWindow', @overhangs_distance_to_top_of_window, :float) unless @overhangs_distance_to_top_of_window.nil?
2283
+ XMLHelper.add_element(overhangs, 'DistanceToBottomOfWindow', @overhangs_distance_to_bottom_of_window, :float) unless @overhangs_distance_to_bottom_of_window.nil?
2251
2284
  end
2252
- XMLHelper.add_element(window, 'FractionOperable', to_float(@fraction_operable)) unless @fraction_operable.nil?
2285
+ XMLHelper.add_element(window, 'FractionOperable', @fraction_operable, :float, @fraction_operable_isdefaulted) unless @fraction_operable.nil?
2253
2286
  if not @wall_idref.nil?
2254
2287
  attached_to_wall = XMLHelper.add_element(window, 'AttachedToWall')
2255
2288
  XMLHelper.add_attribute(attached_to_wall, 'idref', @wall_idref)
@@ -2260,23 +2293,23 @@ class HPXML < Object
2260
2293
  return if window.nil?
2261
2294
 
2262
2295
  @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')
2296
+ @area = XMLHelper.get_value(window, 'Area', :float)
2297
+ @azimuth = XMLHelper.get_value(window, 'Azimuth', :integer)
2298
+ @orientation = XMLHelper.get_value(window, 'Orientation', :string)
2266
2299
  @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'))
2300
+ @aluminum_thermal_break = XMLHelper.get_value(window, 'FrameType/Aluminum/ThermalBreak', :boolean)
2301
+ @glass_layers = XMLHelper.get_value(window, 'GlassLayers', :string)
2302
+ @glass_type = XMLHelper.get_value(window, 'GlassType', :string)
2303
+ @gas_fill = XMLHelper.get_value(window, 'GasFill', :string)
2304
+ @ufactor = XMLHelper.get_value(window, 'UFactor', :float)
2305
+ @shgc = XMLHelper.get_value(window, 'SHGC', :float)
2306
+ @interior_shading_factor_summer, @interior_shading_factor_summer_isdefaulted = XMLHelper.get_value_and_defaulted(window, 'InteriorShading/SummerShadingCoefficient', :float)
2307
+ @interior_shading_factor_winter, @interior_shading_factor_winter_isdefaulted = XMLHelper.get_value_and_defaulted(window, 'InteriorShading/WinterShadingCoefficient', :float)
2308
+ @exterior_shading = XMLHelper.get_value(window, 'ExteriorShading/Type', :string)
2309
+ @overhangs_depth = XMLHelper.get_value(window, 'Overhangs/Depth', :float)
2310
+ @overhangs_distance_to_top_of_window = XMLHelper.get_value(window, 'Overhangs/DistanceToTopOfWindow', :float)
2311
+ @overhangs_distance_to_bottom_of_window = XMLHelper.get_value(window, 'Overhangs/DistanceToBottomOfWindow', :float)
2312
+ @fraction_operable, @fraction_operable_isdefaulted = XMLHelper.get_value_and_defaulted(window, 'FractionOperable', :float)
2280
2313
  @wall_idref = HPXML::get_idref(XMLHelper.get_element(window, 'AttachedToWall'))
2281
2314
  end
2282
2315
  end
@@ -2345,16 +2378,16 @@ class HPXML < Object
2345
2378
  skylight = XMLHelper.add_element(skylights, 'Skylight')
2346
2379
  sys_id = XMLHelper.add_element(skylight, 'SystemIdentifier')
2347
2380
  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?
2381
+ XMLHelper.add_element(skylight, 'Area', @area, :float) unless @area.nil?
2382
+ XMLHelper.add_element(skylight, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
2383
+ XMLHelper.add_element(skylight, 'UFactor', @ufactor, :float) unless @ufactor.nil?
2384
+ XMLHelper.add_element(skylight, 'SHGC', @shgc, :float) unless @shgc.nil?
2352
2385
  if (not @interior_shading_factor_summer.nil?) || (not @interior_shading_factor_winter.nil?)
2353
2386
  interior_shading = XMLHelper.add_element(skylight, 'InteriorShading')
2354
2387
  sys_id = XMLHelper.add_element(interior_shading, 'SystemIdentifier')
2355
2388
  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?
2389
+ XMLHelper.add_element(interior_shading, 'SummerShadingCoefficient', @interior_shading_factor_summer, :float, @interior_shading_factor_summer_isdefaulted) unless @interior_shading_factor_summer.nil?
2390
+ XMLHelper.add_element(interior_shading, 'WinterShadingCoefficient', @interior_shading_factor_winter, :float, @interior_shading_factor_winter_isdefaulted) unless @interior_shading_factor_winter.nil?
2358
2391
  end
2359
2392
  if not @roof_idref.nil?
2360
2393
  attached_to_roof = XMLHelper.add_element(skylight, 'AttachedToRoof')
@@ -2366,19 +2399,19 @@ class HPXML < Object
2366
2399
  return if skylight.nil?
2367
2400
 
2368
2401
  @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')
2402
+ @area = XMLHelper.get_value(skylight, 'Area', :float)
2403
+ @azimuth = XMLHelper.get_value(skylight, 'Azimuth', :integer)
2404
+ @orientation = XMLHelper.get_value(skylight, 'Orientation', :string)
2372
2405
  @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')
2406
+ @aluminum_thermal_break = XMLHelper.get_value(skylight, 'FrameType/Aluminum/ThermalBreak', :boolean)
2407
+ @glass_layers = XMLHelper.get_value(skylight, 'GlassLayers', :string)
2408
+ @glass_type = XMLHelper.get_value(skylight, 'GlassType', :string)
2409
+ @gas_fill = XMLHelper.get_value(skylight, 'GasFill', :string)
2410
+ @ufactor = XMLHelper.get_value(skylight, 'UFactor', :float)
2411
+ @shgc = XMLHelper.get_value(skylight, 'SHGC', :float)
2412
+ @interior_shading_factor_summer, @interior_shading_factor_summer_isdefaulted = XMLHelper.get_value_and_defaulted(skylight, 'InteriorShading/SummerShadingCoefficient', :float)
2413
+ @interior_shading_factor_winter, @interior_shading_factor_winter_isdefaulted = XMLHelper.get_value_and_defaulted(skylight, 'InteriorShading/WinterShadingCoefficient', :float)
2414
+ @exterior_shading = XMLHelper.get_value(skylight, 'ExteriorShading/Type', :string)
2382
2415
  @roof_idref = HPXML::get_idref(XMLHelper.get_element(skylight, 'AttachedToRoof'))
2383
2416
  end
2384
2417
  end
@@ -2449,9 +2482,9 @@ class HPXML < Object
2449
2482
  attached_to_wall = XMLHelper.add_element(door, 'AttachedToWall')
2450
2483
  XMLHelper.add_attribute(attached_to_wall, 'idref', @wall_idref)
2451
2484
  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?
2485
+ XMLHelper.add_element(door, 'Area', @area, :float) unless @area.nil?
2486
+ XMLHelper.add_element(door, 'Azimuth', @azimuth, :integer) unless @azimuth.nil?
2487
+ XMLHelper.add_element(door, 'RValue', @r_value, :float) unless @r_value.nil?
2455
2488
  end
2456
2489
 
2457
2490
  def from_oga(door)
@@ -2459,9 +2492,9 @@ class HPXML < Object
2459
2492
 
2460
2493
  @id = HPXML::get_id(door)
2461
2494
  @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'))
2495
+ @area = XMLHelper.get_value(door, 'Area', :float)
2496
+ @azimuth = XMLHelper.get_value(door, 'Azimuth', :integer)
2497
+ @r_value = XMLHelper.get_value(door, 'RValue', :float)
2465
2498
  end
2466
2499
  end
2467
2500
 
@@ -2487,8 +2520,9 @@ class HPXML < Object
2487
2520
  ATTRS = [:id, :distribution_system_idref, :year_installed, :heating_system_type,
2488
2521
  :heating_system_fuel, :heating_capacity, :heating_efficiency_afue,
2489
2522
  :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]
2523
+ :energy_star, :seed_id, :is_shared_system, :number_of_units_served,
2524
+ :shared_loop_watts, :fan_coil_watts, :wlhp_heating_efficiency_cop, :fan_watts_per_cfm,
2525
+ :fan_watts]
2492
2526
  attr_accessor(*ATTRS)
2493
2527
 
2494
2528
  def distribution_system
@@ -2539,14 +2573,14 @@ class HPXML < Object
2539
2573
  distribution_system = XMLHelper.add_element(heating_system, 'DistributionSystem')
2540
2574
  XMLHelper.add_attribute(distribution_system, 'idref', @distribution_system_idref)
2541
2575
  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?
2576
+ XMLHelper.add_element(heating_system, 'IsSharedSystem', @is_shared_system, :boolean) unless @is_shared_system.nil?
2577
+ XMLHelper.add_element(heating_system, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
2544
2578
  if not @heating_system_type.nil?
2545
2579
  heating_system_type_e = XMLHelper.add_element(heating_system, 'HeatingSystemType')
2546
2580
  XMLHelper.add_element(heating_system_type_e, @heating_system_type)
2547
2581
  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?
2582
+ XMLHelper.add_element(heating_system, 'HeatingSystemFuel', @heating_system_fuel, :string) unless @heating_system_fuel.nil?
2583
+ XMLHelper.add_element(heating_system, 'HeatingCapacity', @heating_capacity, :float) unless @heating_capacity.nil?
2550
2584
 
2551
2585
  efficiency_units = nil
2552
2586
  efficiency_value = nil
@@ -2559,20 +2593,21 @@ class HPXML < Object
2559
2593
  end
2560
2594
  if not efficiency_value.nil?
2561
2595
  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?
2596
+ XMLHelper.add_element(annual_efficiency, 'Units', efficiency_units, :string)
2597
+ XMLHelper.add_element(annual_efficiency, 'Value', efficiency_value, :float)
2598
+ end
2599
+ XMLHelper.add_element(heating_system, 'FractionHeatLoadServed', @fraction_heat_load_served, :float) unless @fraction_heat_load_served.nil?
2600
+ XMLHelper.add_element(heating_system, 'ElectricAuxiliaryEnergy', @electric_auxiliary_energy, :float, @electric_auxiliary_energy_isdefaulted) unless @electric_auxiliary_energy.nil?
2601
+ XMLHelper.add_extension(heating_system, 'SharedLoopWatts', @shared_loop_watts, :float) unless @shared_loop_watts.nil?
2602
+ XMLHelper.add_extension(heating_system, 'FanCoilWatts', @fan_coil_watts, :float) unless @fan_coil_watts.nil?
2603
+ XMLHelper.add_extension(heating_system, 'FanPowerWattsPerCFM', @fan_watts_per_cfm, :float, @fan_watts_per_cfm_isdefaulted) unless @fan_watts_per_cfm.nil?
2604
+ XMLHelper.add_extension(heating_system, 'FanPowerWatts', @fan_watts, :float, @fan_watts_isdefaulted) unless @fan_watts.nil?
2605
+ XMLHelper.add_extension(heating_system, 'SeedId', @seed_id, :string) unless @seed_id.nil?
2571
2606
  if not @wlhp_heating_efficiency_cop.nil?
2572
2607
  wlhp = XMLHelper.create_elements_as_needed(heating_system, ['extension', 'WaterLoopHeatPump'])
2573
2608
  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))
2609
+ XMLHelper.add_element(annual_efficiency, 'Units', UnitsCOP, :string)
2610
+ XMLHelper.add_element(annual_efficiency, 'Value', @wlhp_heating_efficiency_cop, :float)
2576
2611
  end
2577
2612
  end
2578
2613
 
@@ -2581,25 +2616,26 @@ class HPXML < Object
2581
2616
 
2582
2617
  @id = HPXML::get_id(heating_system)
2583
2618
  @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'))
2619
+ @year_installed = XMLHelper.get_value(heating_system, 'YearInstalled', :integer)
2620
+ @is_shared_system = XMLHelper.get_value(heating_system, 'IsSharedSystem', :boolean)
2621
+ @number_of_units_served = XMLHelper.get_value(heating_system, 'NumberofUnitsServed', :integer)
2587
2622
  @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'))
2623
+ @heating_system_fuel = XMLHelper.get_value(heating_system, 'HeatingSystemFuel', :string)
2624
+ @heating_capacity = XMLHelper.get_value(heating_system, 'HeatingCapacity', :float)
2590
2625
  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"))
2626
+ @heating_efficiency_afue = XMLHelper.get_value(heating_system, "AnnualHeatingEfficiency[Units='#{UnitsAFUE}']/Value", :float)
2592
2627
  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"))
2628
+ @heating_efficiency_percent = XMLHelper.get_value(heating_system, "AnnualHeatingEfficiency[Units='Percent']/Value", :float)
2629
+ end
2630
+ @fraction_heat_load_served = XMLHelper.get_value(heating_system, 'FractionHeatLoadServed', :float)
2631
+ @electric_auxiliary_energy, @electric_auxiliary_energy_isdefaulted = XMLHelper.get_value_and_defaulted(heating_system, 'ElectricAuxiliaryEnergy', :float)
2632
+ @energy_star = XMLHelper.get_values(heating_system, 'ThirdPartyCertification', :string).include?('Energy Star')
2633
+ @seed_id = XMLHelper.get_value(heating_system, 'extension/SeedId', :string)
2634
+ @fan_watts_per_cfm, @fan_watts_per_cfm_isdefaulted = XMLHelper.get_value_and_defaulted(heating_system, 'extension/FanPowerWattsPerCFM', :float)
2635
+ @fan_watts, @fan_watts_isdefaulted = XMLHelper.get_value_and_defaulted(heating_system, 'extension/FanPowerWatts', :float)
2636
+ @shared_loop_watts = XMLHelper.get_value(heating_system, 'extension/SharedLoopWatts', :float)
2637
+ @fan_coil_watts = XMLHelper.get_value(heating_system, 'extension/FanCoilWatts', :float)
2638
+ @wlhp_heating_efficiency_cop = XMLHelper.get_value(heating_system, "extension/WaterLoopHeatPump/AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value", :float)
2603
2639
  end
2604
2640
  end
2605
2641
 
@@ -2625,9 +2661,9 @@ class HPXML < Object
2625
2661
  ATTRS = [:id, :distribution_system_idref, :year_installed, :cooling_system_type,
2626
2662
  :cooling_system_fuel, :cooling_capacity, :compressor_type, :fraction_cool_load_served,
2627
2663
  :cooling_efficiency_seer, :cooling_efficiency_eer, :cooling_efficiency_kw_per_ton,
2628
- :cooling_shr, :cooling_cfm, :energy_star, :seed_id, :is_shared_system,
2664
+ :cooling_shr, :energy_star, :seed_id, :is_shared_system,
2629
2665
  :number_of_units_served, :shared_loop_watts, :fan_coil_watts, :wlhp_cooling_capacity,
2630
- :wlhp_cooling_efficiency_eer]
2666
+ :wlhp_cooling_efficiency_eer, :fan_watts_per_cfm]
2631
2667
  attr_accessor(*ATTRS)
2632
2668
 
2633
2669
  def distribution_system
@@ -2678,13 +2714,13 @@ class HPXML < Object
2678
2714
  distribution_system = XMLHelper.add_element(cooling_system, 'DistributionSystem')
2679
2715
  XMLHelper.add_attribute(distribution_system, 'idref', @distribution_system_idref)
2680
2716
  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?
2717
+ XMLHelper.add_element(cooling_system, 'IsSharedSystem', @is_shared_system, :boolean) unless @is_shared_system.nil?
2718
+ XMLHelper.add_element(cooling_system, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
2719
+ XMLHelper.add_element(cooling_system, 'CoolingSystemType', @cooling_system_type, :string) unless @cooling_system_type.nil?
2720
+ XMLHelper.add_element(cooling_system, 'CoolingSystemFuel', @cooling_system_fuel, :string) unless @cooling_system_fuel.nil?
2721
+ XMLHelper.add_element(cooling_system, 'CoolingCapacity', @cooling_capacity, :float) unless @cooling_capacity.nil?
2722
+ XMLHelper.add_element(cooling_system, 'CompressorType', @compressor_type, :string, @compressor_type_isdefaulted) unless @compressor_type.nil?
2723
+ XMLHelper.add_element(cooling_system, 'FractionCoolLoadServed', @fraction_cool_load_served, :float) unless @fraction_cool_load_served.nil?
2688
2724
 
2689
2725
  efficiency_units = nil
2690
2726
  efficiency_value = nil
@@ -2700,21 +2736,21 @@ class HPXML < Object
2700
2736
  end
2701
2737
  if not efficiency_value.nil?
2702
2738
  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?
2739
+ XMLHelper.add_element(annual_efficiency, 'Units', efficiency_units, :string)
2740
+ XMLHelper.add_element(annual_efficiency, 'Value', efficiency_value, :float)
2741
+ end
2742
+ XMLHelper.add_element(cooling_system, 'SensibleHeatFraction', @cooling_shr, :float, @cooling_shr_isdefaulted) unless @cooling_shr.nil?
2743
+ XMLHelper.add_extension(cooling_system, 'FanPowerWattsPerCFM', @fan_watts_per_cfm, :float, @fan_watts_per_cfm_isdefaulted) unless @fan_watts_per_cfm.nil?
2744
+ XMLHelper.add_extension(cooling_system, 'SharedLoopWatts', @shared_loop_watts, :float) unless @shared_loop_watts.nil?
2745
+ XMLHelper.add_extension(cooling_system, 'FanCoilWatts', @fan_coil_watts, :float) unless @fan_coil_watts.nil?
2746
+ XMLHelper.add_extension(cooling_system, 'SeedId', @seed_id, :string) unless @seed_id.nil?
2711
2747
  if (not @wlhp_cooling_capacity.nil?) || (not @wlhp_cooling_efficiency_eer.nil?)
2712
2748
  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?
2749
+ XMLHelper.add_element(wlhp, 'CoolingCapacity', @wlhp_cooling_capacity, :float) unless @wlhp_cooling_capacity.nil?
2714
2750
  if not @wlhp_cooling_efficiency_eer.nil?
2715
2751
  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))
2752
+ XMLHelper.add_element(annual_efficiency, 'Units', UnitsEER, :string)
2753
+ XMLHelper.add_element(annual_efficiency, 'Value', @wlhp_cooling_efficiency_eer, :float)
2718
2754
  end
2719
2755
  end
2720
2756
  end
@@ -2724,29 +2760,29 @@ class HPXML < Object
2724
2760
 
2725
2761
  @id = HPXML::get_id(cooling_system)
2726
2762
  @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'))
2763
+ @year_installed = XMLHelper.get_value(cooling_system, 'YearInstalled', :integer)
2764
+ @is_shared_system = XMLHelper.get_value(cooling_system, 'IsSharedSystem', :boolean)
2765
+ @number_of_units_served = XMLHelper.get_value(cooling_system, 'NumberofUnitsServed', :integer)
2766
+ @cooling_system_type = XMLHelper.get_value(cooling_system, 'CoolingSystemType', :string)
2767
+ @cooling_system_fuel = XMLHelper.get_value(cooling_system, 'CoolingSystemFuel', :string)
2768
+ @cooling_capacity = XMLHelper.get_value(cooling_system, 'CoolingCapacity', :float)
2769
+ @compressor_type, @compressor_type_isdefaulted = XMLHelper.get_value_and_defaulted(cooling_system, 'CompressorType', :string)
2770
+ @fraction_cool_load_served = XMLHelper.get_value(cooling_system, 'FractionCoolLoadServed', :float)
2735
2771
  if [HVACTypeCentralAirConditioner, HVACTypeMiniSplitAirConditioner].include? @cooling_system_type
2736
- @cooling_efficiency_seer = to_float_or_nil(XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value"))
2772
+ @cooling_efficiency_seer = XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value", :float)
2737
2773
  elsif [HVACTypeRoomAirConditioner].include? @cooling_system_type
2738
- @cooling_efficiency_eer = to_float_or_nil(XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value"))
2774
+ @cooling_efficiency_eer = XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value", :float)
2739
2775
  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"))
2776
+ @cooling_efficiency_kw_per_ton = XMLHelper.get_value(cooling_system, "AnnualCoolingEfficiency[Units='#{UnitsKwPerTon}']/Value", :float)
2741
2777
  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"))
2778
+ @cooling_shr, @cooling_shr_isdefaulted = XMLHelper.get_value_and_defaulted(cooling_system, 'SensibleHeatFraction', :float)
2779
+ @energy_star = XMLHelper.get_values(cooling_system, 'ThirdPartyCertification', :string).include?('Energy Star')
2780
+ @seed_id = XMLHelper.get_value(cooling_system, 'extension/SeedId', :string)
2781
+ @fan_watts_per_cfm, @fan_watts_per_cfm_isdefaulted = XMLHelper.get_value_and_defaulted(cooling_system, 'extension/FanPowerWattsPerCFM', :float)
2782
+ @shared_loop_watts = XMLHelper.get_value(cooling_system, 'extension/SharedLoopWatts', :float)
2783
+ @fan_coil_watts = XMLHelper.get_value(cooling_system, 'extension/FanCoilWatts', :float)
2784
+ @wlhp_cooling_capacity = XMLHelper.get_value(cooling_system, 'extension/WaterLoopHeatPump/CoolingCapacity', :float)
2785
+ @wlhp_cooling_efficiency_eer = XMLHelper.get_value(cooling_system, "extension/WaterLoopHeatPump/AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value", :float)
2750
2786
  end
2751
2787
  end
2752
2788
 
@@ -2820,31 +2856,31 @@ class HPXML < Object
2820
2856
  distribution_system = XMLHelper.add_element(heat_pump, 'DistributionSystem')
2821
2857
  XMLHelper.add_attribute(distribution_system, 'idref', @distribution_system_idref)
2822
2858
  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?
2859
+ XMLHelper.add_element(heat_pump, 'IsSharedSystem', @is_shared_system, :boolean) unless @is_shared_system.nil?
2860
+ XMLHelper.add_element(heat_pump, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
2861
+ XMLHelper.add_element(heat_pump, 'HeatPumpType', @heat_pump_type, :string) unless @heat_pump_type.nil?
2862
+ XMLHelper.add_element(heat_pump, 'HeatPumpFuel', @heat_pump_fuel, :string) unless @heat_pump_fuel.nil?
2863
+ XMLHelper.add_element(heat_pump, 'HeatingCapacity', @heating_capacity, :float) unless @heating_capacity.nil?
2864
+ XMLHelper.add_element(heat_pump, 'HeatingCapacity17F', @heating_capacity_17F, :float) unless @heating_capacity_17F.nil?
2865
+ XMLHelper.add_element(heat_pump, 'CoolingCapacity', @cooling_capacity, :float) unless @cooling_capacity.nil?
2866
+ XMLHelper.add_element(heat_pump, 'CompressorType', @compressor_type, :string, @compressor_type_isdefaulted) unless @compressor_type.nil?
2867
+ XMLHelper.add_element(heat_pump, 'CoolingSensibleHeatFraction', @cooling_shr, :float, @cooling_shr_isdefaulted) unless @cooling_shr.nil?
2832
2868
  if not @backup_heating_fuel.nil?
2833
- XMLHelper.add_element(heat_pump, 'BackupSystemFuel', @backup_heating_fuel)
2869
+ XMLHelper.add_element(heat_pump, 'BackupSystemFuel', @backup_heating_fuel, :string)
2834
2870
  efficiencies = { 'Percent' => @backup_heating_efficiency_percent,
2835
2871
  UnitsAFUE => @backup_heating_efficiency_afue }
2836
2872
  efficiencies.each do |units, value|
2837
2873
  next if value.nil?
2838
2874
 
2839
2875
  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))
2876
+ XMLHelper.add_element(backup_eff, 'Units', units, :string)
2877
+ XMLHelper.add_element(backup_eff, 'Value', value, :float)
2842
2878
  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?
2879
+ XMLHelper.add_element(heat_pump, 'BackupHeatingCapacity', @backup_heating_capacity, :float) unless @backup_heating_capacity.nil?
2880
+ XMLHelper.add_element(heat_pump, 'BackupHeatingSwitchoverTemperature', @backup_heating_switchover_temp, :float) unless @backup_heating_switchover_temp.nil?
2845
2881
  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?
2882
+ XMLHelper.add_element(heat_pump, 'FractionHeatLoadServed', @fraction_heat_load_served, :float) unless @fraction_heat_load_served.nil?
2883
+ XMLHelper.add_element(heat_pump, 'FractionCoolLoadServed', @fraction_cool_load_served, :float) unless @fraction_cool_load_served.nil?
2848
2884
 
2849
2885
  clg_efficiency_units = nil
2850
2886
  clg_efficiency_value = nil
@@ -2863,18 +2899,18 @@ class HPXML < Object
2863
2899
  end
2864
2900
  if not clg_efficiency_value.nil?
2865
2901
  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))
2902
+ XMLHelper.add_element(annual_efficiency, 'Units', clg_efficiency_units, :string)
2903
+ XMLHelper.add_element(annual_efficiency, 'Value', clg_efficiency_value, :float)
2868
2904
  end
2869
2905
  if not htg_efficiency_value.nil?
2870
2906
  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))
2907
+ XMLHelper.add_element(annual_efficiency, 'Units', htg_efficiency_units, :string)
2908
+ XMLHelper.add_element(annual_efficiency, 'Value', htg_efficiency_value, :float)
2873
2909
  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?
2910
+ XMLHelper.add_extension(heat_pump, 'FanPowerWattsPerCFM', @fan_watts_per_cfm, :float, @fan_watts_per_cfm_isdefaulted) unless @fan_watts_per_cfm.nil?
2911
+ XMLHelper.add_extension(heat_pump, 'PumpPowerWattsPerTon', @pump_watts_per_ton, :float, @pump_watts_per_ton_isdefaulted) unless @pump_watts_per_ton.nil?
2912
+ XMLHelper.add_extension(heat_pump, 'SharedLoopWatts', @shared_loop_watts, :float) unless @shared_loop_watts.nil?
2913
+ XMLHelper.add_extension(heat_pump, 'SeedId', @seed_id, :string) unless @seed_id.nil?
2878
2914
  end
2879
2915
 
2880
2916
  def from_oga(heat_pump)
@@ -2882,38 +2918,38 @@ class HPXML < Object
2882
2918
 
2883
2919
  @id = HPXML::get_id(heat_pump)
2884
2920
  @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'))
2921
+ @year_installed = XMLHelper.get_value(heat_pump, 'YearInstalled', :integer)
2922
+ @is_shared_system = XMLHelper.get_value(heat_pump, 'IsSharedSystem', :boolean)
2923
+ @number_of_units_served = XMLHelper.get_value(heat_pump, 'NumberofUnitsServed', :integer)
2924
+ @heat_pump_type = XMLHelper.get_value(heat_pump, 'HeatPumpType', :string)
2925
+ @heat_pump_fuel = XMLHelper.get_value(heat_pump, 'HeatPumpFuel', :string)
2926
+ @heating_capacity = XMLHelper.get_value(heat_pump, 'HeatingCapacity', :float)
2927
+ @heating_capacity_17F = XMLHelper.get_value(heat_pump, 'HeatingCapacity17F', :float)
2928
+ @cooling_capacity = XMLHelper.get_value(heat_pump, 'CoolingCapacity', :float)
2929
+ @compressor_type, @compressor_type_isdefaulted = XMLHelper.get_value_and_defaulted(heat_pump, 'CompressorType', :string)
2930
+ @cooling_shr, @cooling_shr_isdefaulted = XMLHelper.get_value_and_defaulted(heat_pump, 'CoolingSensibleHeatFraction', :float)
2931
+ @backup_heating_fuel = XMLHelper.get_value(heat_pump, 'BackupSystemFuel', :string)
2932
+ @backup_heating_capacity = XMLHelper.get_value(heat_pump, 'BackupHeatingCapacity', :float)
2933
+ @backup_heating_efficiency_percent = XMLHelper.get_value(heat_pump, "BackupAnnualHeatingEfficiency[Units='Percent']/Value", :float)
2934
+ @backup_heating_efficiency_afue = XMLHelper.get_value(heat_pump, "BackupAnnualHeatingEfficiency[Units='#{UnitsAFUE}']/Value", :float)
2935
+ @backup_heating_switchover_temp = XMLHelper.get_value(heat_pump, 'BackupHeatingSwitchoverTemperature', :float)
2936
+ @fraction_heat_load_served = XMLHelper.get_value(heat_pump, 'FractionHeatLoadServed', :float)
2937
+ @fraction_cool_load_served = XMLHelper.get_value(heat_pump, 'FractionCoolLoadServed', :float)
2902
2938
  if [HVACTypeHeatPumpAirToAir, HVACTypeHeatPumpMiniSplit].include? @heat_pump_type
2903
- @cooling_efficiency_seer = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value"))
2939
+ @cooling_efficiency_seer = XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsSEER}']/Value", :float)
2904
2940
  elsif [HVACTypeHeatPumpGroundToAir].include? @heat_pump_type
2905
- @cooling_efficiency_eer = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value"))
2941
+ @cooling_efficiency_eer = XMLHelper.get_value(heat_pump, "AnnualCoolingEfficiency[Units='#{UnitsEER}']/Value", :float)
2906
2942
  end
2907
2943
  if [HVACTypeHeatPumpAirToAir, HVACTypeHeatPumpMiniSplit].include? @heat_pump_type
2908
- @heating_efficiency_hspf = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsHSPF}']/Value"))
2944
+ @heating_efficiency_hspf = XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsHSPF}']/Value", :float)
2909
2945
  elsif [HVACTypeHeatPumpGroundToAir].include? @heat_pump_type
2910
- @heating_efficiency_cop = to_float_or_nil(XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value"))
2946
+ @heating_efficiency_cop = XMLHelper.get_value(heat_pump, "AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value", :float)
2911
2947
  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'))
2948
+ @energy_star = XMLHelper.get_values(heat_pump, 'ThirdPartyCertification', :string).include?('Energy Star')
2949
+ @pump_watts_per_ton, @pump_watts_per_ton_isdefaulted = XMLHelper.get_value_and_defaulted(heat_pump, 'extension/PumpPowerWattsPerTon', :float)
2950
+ @fan_watts_per_cfm, @fan_watts_per_cfm_isdefaulted = XMLHelper.get_value_and_defaulted(heat_pump, 'extension/FanPowerWattsPerCFM', :float)
2951
+ @seed_id = XMLHelper.get_value(heat_pump, 'extension/SeedId', :string)
2952
+ @shared_loop_watts = XMLHelper.get_value(heat_pump, 'extension/SharedLoopWatts', :float)
2917
2953
  end
2918
2954
  end
2919
2955
 
@@ -2935,7 +2971,9 @@ class HPXML < Object
2935
2971
  ATTRS = [:id, :control_type, :heating_setpoint_temp, :heating_setback_temp,
2936
2972
  :heating_setback_hours_per_week, :heating_setback_start_hour, :cooling_setpoint_temp,
2937
2973
  :cooling_setup_temp, :cooling_setup_hours_per_week, :cooling_setup_start_hour,
2938
- :ceiling_fan_cooling_setpoint_temp_offset]
2974
+ :ceiling_fan_cooling_setpoint_temp_offset,
2975
+ :weekday_heating_setpoints, :weekend_heating_setpoints,
2976
+ :weekday_cooling_setpoints, :weekend_cooling_setpoints]
2939
2977
  attr_accessor(*ATTRS)
2940
2978
 
2941
2979
  def delete
@@ -2954,32 +2992,40 @@ class HPXML < Object
2954
2992
  hvac_control = XMLHelper.add_element(hvac, 'HVACControl')
2955
2993
  sys_id = XMLHelper.add_element(hvac_control, 'SystemIdentifier')
2956
2994
  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?
2995
+ XMLHelper.add_element(hvac_control, 'ControlType', @control_type, :string) unless @control_type.nil?
2996
+ XMLHelper.add_element(hvac_control, 'SetpointTempHeatingSeason', @heating_setpoint_temp, :float) unless @heating_setpoint_temp.nil?
2997
+ XMLHelper.add_element(hvac_control, 'SetbackTempHeatingSeason', @heating_setback_temp, :float) unless @heating_setback_temp.nil?
2998
+ XMLHelper.add_element(hvac_control, 'TotalSetbackHoursperWeekHeating', @heating_setback_hours_per_week, :integer) unless @heating_setback_hours_per_week.nil?
2999
+ XMLHelper.add_element(hvac_control, 'SetupTempCoolingSeason', @cooling_setup_temp, :float) unless @cooling_setup_temp.nil?
3000
+ XMLHelper.add_element(hvac_control, 'SetpointTempCoolingSeason', @cooling_setpoint_temp, :float) unless @cooling_setpoint_temp.nil?
3001
+ XMLHelper.add_element(hvac_control, 'TotalSetupHoursperWeekCooling', @cooling_setup_hours_per_week, :integer) unless @cooling_setup_hours_per_week.nil?
3002
+ XMLHelper.add_extension(hvac_control, 'SetbackStartHourHeating', @heating_setback_start_hour, :integer, @heating_setback_start_hour_isdefaulted) unless @heating_setback_start_hour.nil?
3003
+ XMLHelper.add_extension(hvac_control, 'SetupStartHourCooling', @cooling_setup_start_hour, :integer, @cooling_setup_start_hour_isdefaulted) unless @cooling_setup_start_hour.nil?
3004
+ XMLHelper.add_extension(hvac_control, 'CeilingFanSetpointTempCoolingSeasonOffset', @ceiling_fan_cooling_setpoint_temp_offset, :float) unless @ceiling_fan_cooling_setpoint_temp_offset.nil?
3005
+ XMLHelper.add_extension(hvac_control, 'WeekdaySetpointTempsHeatingSeason', @weekday_heating_setpoints, :string) unless @weekday_heating_setpoints.nil?
3006
+ XMLHelper.add_extension(hvac_control, 'WeekendSetpointTempsHeatingSeason', @weekend_heating_setpoints, :string) unless @weekend_heating_setpoints.nil?
3007
+ XMLHelper.add_extension(hvac_control, 'WeekdaySetpointTempsCoolingSeason', @weekday_cooling_setpoints, :string) unless @weekday_cooling_setpoints.nil?
3008
+ XMLHelper.add_extension(hvac_control, 'WeekendSetpointTempsCoolingSeason', @weekend_cooling_setpoints, :string) unless @weekend_cooling_setpoints.nil?
2967
3009
  end
2968
3010
 
2969
3011
  def from_oga(hvac_control)
2970
3012
  return if hvac_control.nil?
2971
3013
 
2972
3014
  @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'))
3015
+ @control_type = XMLHelper.get_value(hvac_control, 'ControlType', :string)
3016
+ @heating_setpoint_temp = XMLHelper.get_value(hvac_control, 'SetpointTempHeatingSeason', :float)
3017
+ @heating_setback_temp = XMLHelper.get_value(hvac_control, 'SetbackTempHeatingSeason', :float)
3018
+ @heating_setback_hours_per_week = XMLHelper.get_value(hvac_control, 'TotalSetbackHoursperWeekHeating', :integer)
3019
+ @heating_setback_start_hour, @heating_setback_start_hour_isdefaulted = XMLHelper.get_value_and_defaulted(hvac_control, 'extension/SetbackStartHourHeating', :integer)
3020
+ @cooling_setpoint_temp = XMLHelper.get_value(hvac_control, 'SetpointTempCoolingSeason', :float)
3021
+ @cooling_setup_temp = XMLHelper.get_value(hvac_control, 'SetupTempCoolingSeason', :float)
3022
+ @cooling_setup_hours_per_week = XMLHelper.get_value(hvac_control, 'TotalSetupHoursperWeekCooling', :integer)
3023
+ @cooling_setup_start_hour, @cooling_setup_start_hour_isdefaulted = XMLHelper.get_value_and_defaulted(hvac_control, 'extension/SetupStartHourCooling', :integer)
3024
+ @ceiling_fan_cooling_setpoint_temp_offset = XMLHelper.get_value(hvac_control, 'extension/CeilingFanSetpointTempCoolingSeasonOffset', :float)
3025
+ @weekday_heating_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekdaySetpointTempsHeatingSeason', :string)
3026
+ @weekend_heating_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekendSetpointTempsHeatingSeason', :string)
3027
+ @weekday_cooling_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekdaySetpointTempsCoolingSeason', :string)
3028
+ @weekend_cooling_setpoints = XMLHelper.get_value(hvac_control, 'extension/WeekendSetpointTempsCoolingSeason', :string)
2983
3029
  end
2984
3030
  end
2985
3031
 
@@ -3076,22 +3122,22 @@ class HPXML < Object
3076
3122
  distribution_system_type_e = XMLHelper.add_element(hvac_distribution, 'DistributionSystemType')
3077
3123
  if [HVACDistributionTypeAir, HVACDistributionTypeHydronic, HVACDistributionTypeHydronicAndAir].include? @distribution_system_type
3078
3124
  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?
3125
+ XMLHelper.add_element(hvac_distribution, 'ConditionedFloorAreaServed', @conditioned_floor_area_served, :float) unless @conditioned_floor_area_served.nil?
3080
3126
  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?
3127
+ XMLHelper.add_element(distribution_system_type_e, 'Other', @distribution_system_type, :string)
3128
+ XMLHelper.add_element(hvac_distribution, 'AnnualHeatingDistributionSystemEfficiency', @annual_heating_dse, :float) unless @annual_heating_dse.nil?
3129
+ XMLHelper.add_element(hvac_distribution, 'AnnualCoolingDistributionSystemEfficiency', @annual_cooling_dse, :float) unless @annual_cooling_dse.nil?
3084
3130
  else
3085
3131
  fail "Unexpected distribution_system_type '#{@distribution_system_type}'."
3086
3132
  end
3087
3133
 
3088
3134
  if [HPXML::HVACDistributionTypeHydronic].include? @distribution_system_type
3089
3135
  distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicDistribution')
3090
- XMLHelper.add_element(distribution, 'HydronicDistributionType', @hydronic_type) unless @hydronic_type.nil?
3136
+ XMLHelper.add_element(distribution, 'HydronicDistributionType', @hydronic_type, :string) unless @hydronic_type.nil?
3091
3137
  end
3092
3138
  if [HPXML::HVACDistributionTypeHydronicAndAir].include? @distribution_system_type
3093
3139
  distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicAndAirDistribution')
3094
- XMLHelper.add_element(distribution, 'HydronicAndAirDistributionType', @hydronic_and_air_type) unless @hydronic_and_air_type.nil?
3140
+ XMLHelper.add_element(distribution, 'HydronicAndAirDistributionType', @hydronic_and_air_type, :string) unless @hydronic_and_air_type.nil?
3095
3141
  end
3096
3142
  if [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeHydronicAndAir].include? @distribution_system_type
3097
3143
  if @distribution_system_type == HPXML::HVACDistributionTypeAir
@@ -3101,8 +3147,8 @@ class HPXML < Object
3101
3147
  end
3102
3148
  @duct_leakage_measurements.to_oga(distribution)
3103
3149
  @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?
3150
+ XMLHelper.add_element(distribution, 'NumberofReturnRegisters', @number_of_return_registers, :integer, @number_of_return_registers_isdefaulted) unless @number_of_return_registers.nil?
3151
+ XMLHelper.add_extension(distribution, 'DuctLeakageToOutsideTestingExemption', @duct_leakage_to_outside_testing_exemption, :boolean) unless @duct_leakage_to_outside_testing_exemption.nil?
3106
3152
  end
3107
3153
  end
3108
3154
 
@@ -3112,28 +3158,28 @@ class HPXML < Object
3112
3158
  @id = HPXML::get_id(hvac_distribution)
3113
3159
  @distribution_system_type = XMLHelper.get_child_name(hvac_distribution, 'DistributionSystemType')
3114
3160
  if @distribution_system_type == 'Other'
3115
- @distribution_system_type = XMLHelper.get_value(XMLHelper.get_element(hvac_distribution, 'DistributionSystemType'), 'Other')
3161
+ @distribution_system_type = XMLHelper.get_value(XMLHelper.get_element(hvac_distribution, 'DistributionSystemType'), 'Other', :string)
3116
3162
  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'))
3163
+ @annual_heating_dse = XMLHelper.get_value(hvac_distribution, 'AnnualHeatingDistributionSystemEfficiency', :float)
3164
+ @annual_cooling_dse = XMLHelper.get_value(hvac_distribution, 'AnnualCoolingDistributionSystemEfficiency', :float)
3165
+ @duct_system_sealed = XMLHelper.get_value(hvac_distribution, 'HVACDistributionImprovement/DuctSystemSealed', :boolean)
3166
+ @conditioned_floor_area_served = XMLHelper.get_value(hvac_distribution, 'ConditionedFloorAreaServed', :float)
3121
3167
 
3122
3168
  air_distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/AirDistribution')
3123
3169
  hydronic_distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicDistribution')
3124
3170
  hydronic_and_air_distribution = XMLHelper.get_element(hvac_distribution, 'DistributionSystemType/HydronicAndAirDistribution')
3125
3171
 
3126
3172
  if not hydronic_distribution.nil?
3127
- @hydronic_type = XMLHelper.get_value(hydronic_distribution, 'HydronicDistributionType')
3173
+ @hydronic_type = XMLHelper.get_value(hydronic_distribution, 'HydronicDistributionType', :string)
3128
3174
  end
3129
3175
  if not hydronic_and_air_distribution.nil?
3130
- @hydronic_and_air_type = XMLHelper.get_value(hydronic_and_air_distribution, 'HydronicAndAirDistributionType')
3176
+ @hydronic_and_air_type = XMLHelper.get_value(hydronic_and_air_distribution, 'HydronicAndAirDistributionType', :string)
3131
3177
  end
3132
3178
  if (not air_distribution.nil?) || (not hydronic_and_air_distribution.nil?)
3133
3179
  distribution = air_distribution
3134
3180
  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'))
3181
+ @number_of_return_registers, @number_of_return_registers_isdefaulted = XMLHelper.get_value_and_defaulted(distribution, 'NumberofReturnRegisters', :integer)
3182
+ @duct_leakage_to_outside_testing_exemption = XMLHelper.get_value(distribution, 'extension/DuctLeakageToOutsideTestingExemption', :boolean)
3137
3183
  @duct_leakage_measurements.from_oga(distribution)
3138
3184
  @ducts.from_oga(distribution)
3139
3185
  end
@@ -3174,23 +3220,23 @@ class HPXML < Object
3174
3220
 
3175
3221
  def to_oga(air_distribution)
3176
3222
  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?
3223
+ XMLHelper.add_element(duct_leakage_measurement_el, 'DuctType', @duct_type, :string) unless @duct_type.nil?
3178
3224
  if not @duct_leakage_value.nil?
3179
3225
  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?
3226
+ XMLHelper.add_element(duct_leakage_el, 'Units', @duct_leakage_units, :string) unless @duct_leakage_units.nil?
3227
+ XMLHelper.add_element(duct_leakage_el, 'Value', @duct_leakage_value, :float)
3228
+ XMLHelper.add_element(duct_leakage_el, 'TotalOrToOutside', @duct_leakage_total_or_to_outside, :string) unless @duct_leakage_total_or_to_outside.nil?
3183
3229
  end
3184
3230
  end
3185
3231
 
3186
3232
  def from_oga(duct_leakage_measurement)
3187
3233
  return if duct_leakage_measurement.nil?
3188
3234
 
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')
3235
+ @duct_type = XMLHelper.get_value(duct_leakage_measurement, 'DuctType', :string)
3236
+ @duct_leakage_test_method = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakageTestMethod', :string)
3237
+ @duct_leakage_units = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/Units', :string)
3238
+ @duct_leakage_value = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/Value', :float)
3239
+ @duct_leakage_total_or_to_outside = XMLHelper.get_value(duct_leakage_measurement, 'DuctLeakage/TotalOrToOutside', :string)
3194
3240
  end
3195
3241
  end
3196
3242
 
@@ -3228,21 +3274,21 @@ class HPXML < Object
3228
3274
 
3229
3275
  def to_oga(air_distribution)
3230
3276
  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?
3277
+ XMLHelper.add_element(ducts_el, 'DuctType', @duct_type, :string) unless @duct_type.nil?
3278
+ XMLHelper.add_element(ducts_el, 'DuctInsulationRValue', @duct_insulation_r_value, :float) unless @duct_insulation_r_value.nil?
3279
+ XMLHelper.add_element(ducts_el, 'DuctLocation', @duct_location, :string, @duct_location_isdefaulted) unless @duct_location.nil?
3280
+ XMLHelper.add_element(ducts_el, 'DuctSurfaceArea', @duct_surface_area, :float, @duct_surface_area_isdefaulted) unless @duct_surface_area.nil?
3235
3281
  end
3236
3282
 
3237
3283
  def from_oga(duct)
3238
3284
  return if duct.nil?
3239
3285
 
3240
- @duct_type = XMLHelper.get_value(duct, 'DuctType')
3241
- @duct_insulation_r_value = to_float_or_nil(XMLHelper.get_value(duct, 'DuctInsulationRValue'))
3286
+ @duct_type = XMLHelper.get_value(duct, 'DuctType', :string)
3287
+ @duct_insulation_r_value = XMLHelper.get_value(duct, 'DuctInsulationRValue', :float)
3242
3288
  @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'))
3289
+ @duct_location, @duct_location_isdefaulted = XMLHelper.get_value_and_defaulted(duct, 'DuctLocation', :string)
3290
+ @duct_fraction_area = XMLHelper.get_value(duct, 'FractionDuctArea', :float)
3291
+ @duct_surface_area, @duct_surface_area_isdefaulted = XMLHelper.get_value_and_defaulted(duct, 'DuctSurfaceArea', :float)
3246
3292
  end
3247
3293
  end
3248
3294
 
@@ -3268,7 +3314,7 @@ class HPXML < Object
3268
3314
  :fan_power, :fan_power_defaulted, :quantity, :fan_location, :distribution_system_idref, :start_hour,
3269
3315
  :is_shared_system, :in_unit_flow_rate, :fraction_recirculation,
3270
3316
  :preheating_fuel, :preheating_efficiency_cop, :preheating_fraction_load_served, :precooling_fuel,
3271
- :precooling_efficiency_cop, :precooling_fraction_load_served,]
3317
+ :precooling_efficiency_cop, :precooling_fraction_load_served]
3272
3318
  attr_accessor(*ATTRS)
3273
3319
 
3274
3320
  def distribution_system
@@ -3316,6 +3362,7 @@ class HPXML < Object
3316
3362
  # Daily-average outdoor air (cfm) associated with the unit
3317
3363
  return if oa_unit_flow_rate.nil?
3318
3364
  return if @hours_in_operation.nil?
3365
+
3319
3366
  return oa_unit_flow_rate * (@hours_in_operation / 24.0)
3320
3367
  end
3321
3368
 
@@ -3323,12 +3370,14 @@ class HPXML < Object
3323
3370
  # Daily-average total air (cfm) associated with the unit
3324
3371
  return if total_unit_flow_rate.nil?
3325
3372
  return if @hours_in_operation.nil?
3373
+
3326
3374
  return total_unit_flow_rate * (@hours_in_operation / 24.0)
3327
3375
  end
3328
3376
 
3329
3377
  def unit_flow_rate_ratio
3330
3378
  return 1.0 unless @is_shared_system
3331
3379
  return if @in_unit_flow_rate.nil?
3380
+
3332
3381
  if not @tested_flow_rate.nil?
3333
3382
  ratio = @in_unit_flow_rate / @tested_flow_rate
3334
3383
  elsif not @rated_flow_rate.nil?
@@ -3338,13 +3387,16 @@ class HPXML < Object
3338
3387
  if ratio >= 1.0
3339
3388
  fail "The in-unit flow rate of shared fan '#{@id}' must be less than the system flow rate."
3340
3389
  end
3390
+
3341
3391
  return ratio
3342
3392
  end
3343
3393
 
3344
3394
  def unit_fan_power
3345
3395
  return if @fan_power.nil?
3396
+
3346
3397
  if @is_shared_system
3347
3398
  return if unit_flow_rate_ratio.nil?
3399
+
3348
3400
  return @fan_power * unit_flow_rate_ratio
3349
3401
  else
3350
3402
  return @fan_power
@@ -3354,6 +3406,7 @@ class HPXML < Object
3354
3406
  def average_unit_fan_power
3355
3407
  return if unit_fan_power.nil?
3356
3408
  return if @hours_in_operation.nil?
3409
+
3357
3410
  return unit_fan_power * (@hours_in_operation / 24.0)
3358
3411
  end
3359
3412
 
@@ -3400,85 +3453,85 @@ class HPXML < Object
3400
3453
  ventilation_fan = XMLHelper.add_element(ventilation_fans, 'VentilationFan')
3401
3454
  sys_id = XMLHelper.add_element(ventilation_fan, 'SystemIdentifier')
3402
3455
  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?
3456
+ XMLHelper.add_element(ventilation_fan, 'Quantity', @quantity, :integer, @quantity_isdefaulted) unless @quantity.nil?
3457
+ XMLHelper.add_element(ventilation_fan, 'FanType', @fan_type, :string) unless @fan_type.nil?
3458
+ XMLHelper.add_element(ventilation_fan, 'RatedFlowRate', @rated_flow_rate, :float, @rated_flow_rate_isdefaulted) unless @rated_flow_rate.nil?
3459
+ XMLHelper.add_element(ventilation_fan, 'TestedFlowRate', @tested_flow_rate, :float) unless @tested_flow_rate.nil?
3460
+ XMLHelper.add_element(ventilation_fan, 'HoursInOperation', @hours_in_operation, :float, @hours_in_operation_isdefaulted) unless @hours_in_operation.nil?
3461
+ XMLHelper.add_element(ventilation_fan, 'FanLocation', @fan_location, :string) unless @fan_location.nil?
3462
+ XMLHelper.add_element(ventilation_fan, 'UsedForLocalVentilation', @used_for_local_ventilation, :boolean) unless @used_for_local_ventilation.nil?
3463
+ XMLHelper.add_element(ventilation_fan, 'UsedForWholeBuildingVentilation', @used_for_whole_building_ventilation, :boolean) unless @used_for_whole_building_ventilation.nil?
3464
+ XMLHelper.add_element(ventilation_fan, 'UsedForSeasonalCoolingLoadReduction', @used_for_seasonal_cooling_load_reduction, :boolean) unless @used_for_seasonal_cooling_load_reduction.nil?
3465
+ XMLHelper.add_element(ventilation_fan, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
3413
3466
  if @is_shared_system
3414
- XMLHelper.add_element(ventilation_fan, 'FractionRecirculation', to_float(@fraction_recirculation)) unless @fraction_recirculation.nil?
3467
+ XMLHelper.add_element(ventilation_fan, 'FractionRecirculation', @fraction_recirculation, :float) unless @fraction_recirculation.nil?
3415
3468
  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?
3469
+ XMLHelper.add_element(ventilation_fan, 'TotalRecoveryEfficiency', @total_recovery_efficiency, :float) unless @total_recovery_efficiency.nil?
3470
+ XMLHelper.add_element(ventilation_fan, 'SensibleRecoveryEfficiency', @sensible_recovery_efficiency, :float) unless @sensible_recovery_efficiency.nil?
3471
+ XMLHelper.add_element(ventilation_fan, 'AdjustedTotalRecoveryEfficiency', @total_recovery_efficiency_adjusted, :float) unless @total_recovery_efficiency_adjusted.nil?
3472
+ XMLHelper.add_element(ventilation_fan, 'AdjustedSensibleRecoveryEfficiency', @sensible_recovery_efficiency_adjusted, :float) unless @sensible_recovery_efficiency_adjusted.nil?
3473
+ XMLHelper.add_element(ventilation_fan, 'FanPower', @fan_power, :float, @fan_power_isdefaulted) unless @fan_power.nil?
3421
3474
  if not @distribution_system_idref.nil?
3422
3475
  attached_to_hvac_distribution_system = XMLHelper.add_element(ventilation_fan, 'AttachedToHVACDistributionSystem')
3423
3476
  XMLHelper.add_attribute(attached_to_hvac_distribution_system, 'idref', @distribution_system_idref)
3424
3477
  end
3425
- XMLHelper.add_extension(ventilation_fan, 'StartHour', to_integer(@start_hour)) unless @start_hour.nil?
3478
+ XMLHelper.add_extension(ventilation_fan, 'StartHour', @start_hour, :integer, @start_hour_isdefaulted) unless @start_hour.nil?
3426
3479
  if @is_shared_system
3427
- XMLHelper.add_extension(ventilation_fan, 'InUnitFlowRate', to_float(@in_unit_flow_rate)) unless @in_unit_flow_rate.nil?
3480
+ XMLHelper.add_extension(ventilation_fan, 'InUnitFlowRate', @in_unit_flow_rate, :float) unless @in_unit_flow_rate.nil?
3428
3481
  if (not @preheating_fuel.nil?) && (not @preheating_efficiency_cop.nil?)
3429
3482
  precond_htg = XMLHelper.create_elements_as_needed(ventilation_fan, ['extension', 'PreHeating'])
3430
- XMLHelper.add_element(precond_htg, 'Fuel', @preheating_fuel) unless @preheating_fuel.nil?
3483
+ XMLHelper.add_element(precond_htg, 'Fuel', @preheating_fuel, :string) unless @preheating_fuel.nil?
3431
3484
  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?
3485
+ XMLHelper.add_element(eff, 'Value', @preheating_efficiency_cop, :float) unless eff.nil?
3486
+ XMLHelper.add_element(eff, 'Units', UnitsCOP, :string) unless eff.nil?
3487
+ XMLHelper.add_element(precond_htg, 'FractionVentilationHeatLoadServed', @preheating_fraction_load_served, :float) unless @preheating_fraction_load_served.nil?
3435
3488
  end
3436
3489
  if (not @precooling_fuel.nil?) && (not @precooling_efficiency_cop.nil?)
3437
3490
  precond_clg = XMLHelper.create_elements_as_needed(ventilation_fan, ['extension', 'PreCooling'])
3438
- XMLHelper.add_element(precond_clg, 'Fuel', @precooling_fuel) unless @precooling_fuel.nil?
3491
+ XMLHelper.add_element(precond_clg, 'Fuel', @precooling_fuel, :string) unless @precooling_fuel.nil?
3439
3492
  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?
3493
+ XMLHelper.add_element(eff, 'Value', @precooling_efficiency_cop, :float) unless eff.nil?
3494
+ XMLHelper.add_element(eff, 'Units', UnitsCOP, :string) unless eff.nil?
3495
+ XMLHelper.add_element(precond_clg, 'FractionVentilationCoolLoadServed', @precooling_fraction_load_served, :float) unless @precooling_fraction_load_served.nil?
3443
3496
  end
3444
3497
  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?
3498
+ XMLHelper.add_extension(ventilation_fan, 'FlowRateNotTested', @flow_rate_not_tested, :boolean) unless @flow_rate_not_tested.nil?
3499
+ XMLHelper.add_extension(ventilation_fan, 'FanPowerDefaulted', @fan_power_defaulted, :boolean) unless @fan_power_defaulted.nil?
3447
3500
  end
3448
3501
 
3449
3502
  def from_oga(ventilation_fan)
3450
3503
  return if ventilation_fan.nil?
3451
3504
 
3452
3505
  @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'))
3506
+ @quantity, @quantity_isdefaulted = XMLHelper.get_value_and_defaulted(ventilation_fan, 'Quantity', :integer)
3507
+ @fan_type = XMLHelper.get_value(ventilation_fan, 'FanType', :string)
3508
+ @is_shared_system, @is_shared_system_isdefaulted = XMLHelper.get_value_and_defaulted(ventilation_fan, 'IsSharedSystem', :boolean)
3509
+ @rated_flow_rate, @rated_flow_rate_isdefaulted = XMLHelper.get_value_and_defaulted(ventilation_fan, 'RatedFlowRate', :float)
3510
+ @tested_flow_rate = XMLHelper.get_value(ventilation_fan, 'TestedFlowRate', :float)
3511
+ @flow_rate_not_tested = XMLHelper.get_value(ventilation_fan, 'extension/FlowRateNotTested', :boolean)
3512
+ @fan_power, @fan_power_isdefaulted = XMLHelper.get_value_and_defaulted(ventilation_fan, 'FanPower', :float)
3513
+ @fan_power_defaulted = XMLHelper.get_value(ventilation_fan, 'extension/FanPowerDefaulted', :boolean)
3461
3514
  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'))
3515
+ @fraction_recirculation = XMLHelper.get_value(ventilation_fan, 'FractionRecirculation', :float)
3516
+ @in_unit_flow_rate = XMLHelper.get_value(ventilation_fan, 'extension/InUnitFlowRate', :float)
3517
+ @preheating_fuel = XMLHelper.get_value(ventilation_fan, 'extension/PreHeating/Fuel', :string)
3518
+ @preheating_efficiency_cop = XMLHelper.get_value(ventilation_fan, "extension/PreHeating/AnnualHeatingEfficiency[Units='#{UnitsCOP}']/Value", :float)
3519
+ @preheating_fraction_load_served = XMLHelper.get_value(ventilation_fan, 'extension/PreHeating/FractionVentilationHeatLoadServed', :float)
3520
+ @precooling_fuel = XMLHelper.get_value(ventilation_fan, 'extension/PreCooling/Fuel', :string)
3521
+ @precooling_efficiency_cop = XMLHelper.get_value(ventilation_fan, "extension/PreCooling/AnnualCoolingEfficiency[Units='#{UnitsCOP}']/Value", :float)
3522
+ @precooling_fraction_load_served = XMLHelper.get_value(ventilation_fan, 'extension/PreCooling/FractionVentilationCoolLoadServed', :float)
3523
+ end
3524
+ @hours_in_operation, @hours_in_operation_isdefaulted = XMLHelper.get_value_and_defaulted(ventilation_fan, 'HoursInOperation', :float)
3525
+ @fan_location = XMLHelper.get_value(ventilation_fan, 'FanLocation', :string)
3526
+ @used_for_local_ventilation = XMLHelper.get_value(ventilation_fan, 'UsedForLocalVentilation', :boolean)
3527
+ @used_for_whole_building_ventilation = XMLHelper.get_value(ventilation_fan, 'UsedForWholeBuildingVentilation', :boolean)
3528
+ @used_for_seasonal_cooling_load_reduction = XMLHelper.get_value(ventilation_fan, 'UsedForSeasonalCoolingLoadReduction', :boolean)
3529
+ @total_recovery_efficiency = XMLHelper.get_value(ventilation_fan, 'TotalRecoveryEfficiency', :float)
3530
+ @total_recovery_efficiency_adjusted = XMLHelper.get_value(ventilation_fan, 'AdjustedTotalRecoveryEfficiency', :float)
3531
+ @sensible_recovery_efficiency = XMLHelper.get_value(ventilation_fan, 'SensibleRecoveryEfficiency', :float)
3532
+ @sensible_recovery_efficiency_adjusted = XMLHelper.get_value(ventilation_fan, 'AdjustedSensibleRecoveryEfficiency', :float)
3480
3533
  @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'))
3534
+ @start_hour, @start_hour_isdefaulted = XMLHelper.get_value_and_defaulted(ventilation_fan, 'extension/StartHour', :integer)
3482
3535
  end
3483
3536
  end
3484
3537
 
@@ -3499,7 +3552,7 @@ class HPXML < Object
3499
3552
  class WaterHeatingSystem < BaseElement
3500
3553
  ATTRS = [:id, :year_installed, :fuel_type, :water_heater_type, :location, :performance_adjustment,
3501
3554
  :tank_volume, :fraction_dhw_load_served, :heating_capacity, :energy_factor,
3502
- :uniform_energy_factor, :recovery_efficiency, :uses_desuperheater, :jacket_r_value,
3555
+ :uniform_energy_factor, :first_hour_rating, :recovery_efficiency, :uses_desuperheater, :jacket_r_value,
3503
3556
  :related_hvac_idref, :energy_star, :standby_loss, :temperature, :is_shared_system,
3504
3557
  :number_of_units_served]
3505
3558
  attr_accessor(*ATTRS)
@@ -3537,26 +3590,27 @@ class HPXML < Object
3537
3590
  water_heating_system = XMLHelper.add_element(water_heating, 'WaterHeatingSystem')
3538
3591
  sys_id = XMLHelper.add_element(water_heating_system, 'SystemIdentifier')
3539
3592
  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?
3593
+ XMLHelper.add_element(water_heating_system, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
3594
+ XMLHelper.add_element(water_heating_system, 'WaterHeaterType', @water_heater_type, :string) unless @water_heater_type.nil?
3595
+ XMLHelper.add_element(water_heating_system, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
3596
+ XMLHelper.add_element(water_heating_system, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
3597
+ XMLHelper.add_element(water_heating_system, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
3598
+ XMLHelper.add_element(water_heating_system, 'PerformanceAdjustment', @performance_adjustment, :float, @performance_adjustment_isdefaulted) unless @performance_adjustment.nil?
3599
+ XMLHelper.add_element(water_heating_system, 'TankVolume', @tank_volume, :float, @tank_volume_isdefaulted) unless @tank_volume.nil?
3600
+ XMLHelper.add_element(water_heating_system, 'FractionDHWLoadServed', @fraction_dhw_load_served, :float) unless @fraction_dhw_load_served.nil?
3601
+ XMLHelper.add_element(water_heating_system, 'HeatingCapacity', @heating_capacity, :float, @heating_capacity_isdefaulted) unless @heating_capacity.nil?
3602
+ XMLHelper.add_element(water_heating_system, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
3603
+ XMLHelper.add_element(water_heating_system, 'UniformEnergyFactor', @uniform_energy_factor, :float) unless @uniform_energy_factor.nil?
3604
+ XMLHelper.add_element(water_heating_system, 'FirstHourRating', @first_hour_rating, :float) unless @first_hour_rating.nil?
3605
+ XMLHelper.add_element(water_heating_system, 'RecoveryEfficiency', @recovery_efficiency, :float, @recovery_efficiency_isdefaulted) unless @recovery_efficiency.nil?
3552
3606
  if not @jacket_r_value.nil?
3553
3607
  water_heater_insulation = XMLHelper.add_element(water_heating_system, 'WaterHeaterInsulation')
3554
3608
  jacket = XMLHelper.add_element(water_heater_insulation, 'Jacket')
3555
- XMLHelper.add_element(jacket, 'JacketRValue', @jacket_r_value)
3609
+ XMLHelper.add_element(jacket, 'JacketRValue', @jacket_r_value, :float)
3556
3610
  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?
3611
+ XMLHelper.add_element(water_heating_system, 'StandbyLoss', @standby_loss, :float, @standby_loss_isdefaulted) unless @standby_loss.nil?
3612
+ XMLHelper.add_element(water_heating_system, 'HotWaterTemperature', @temperature, :float, @temperature_isdefaulted) unless @temperature.nil?
3613
+ XMLHelper.add_element(water_heating_system, 'UsesDesuperheater', @uses_desuperheater, :boolean) unless @uses_desuperheater.nil?
3560
3614
  if not @related_hvac_idref.nil?
3561
3615
  related_hvac_idref_el = XMLHelper.add_element(water_heating_system, 'RelatedHVACSystem')
3562
3616
  XMLHelper.add_attribute(related_hvac_idref_el, 'idref', @related_hvac_idref)
@@ -3567,25 +3621,26 @@ class HPXML < Object
3567
3621
  return if water_heating_system.nil?
3568
3622
 
3569
3623
  @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'))
3624
+ @year_installed = XMLHelper.get_value(water_heating_system, 'YearInstalled', :integer)
3625
+ @fuel_type = XMLHelper.get_value(water_heating_system, 'FuelType', :string)
3626
+ @water_heater_type = XMLHelper.get_value(water_heating_system, 'WaterHeaterType', :string)
3627
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'Location', :string)
3628
+ @is_shared_system, @is_shared_system_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'IsSharedSystem', :boolean)
3629
+ @number_of_units_served = XMLHelper.get_value(water_heating_system, 'NumberofUnitsServed', :integer)
3630
+ @performance_adjustment, @performance_adjustment_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'PerformanceAdjustment', :float)
3631
+ @tank_volume, @tank_volume_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'TankVolume', :float)
3632
+ @fraction_dhw_load_served = XMLHelper.get_value(water_heating_system, 'FractionDHWLoadServed', :float)
3633
+ @heating_capacity, @heating_capacity_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'HeatingCapacity', :float)
3634
+ @energy_factor = XMLHelper.get_value(water_heating_system, 'EnergyFactor', :float)
3635
+ @uniform_energy_factor = XMLHelper.get_value(water_heating_system, 'UniformEnergyFactor', :float)
3636
+ @first_hour_rating = XMLHelper.get_value(water_heating_system, 'FirstHourRating', :float)
3637
+ @recovery_efficiency, @recovery_efficiency_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'RecoveryEfficiency', :float)
3638
+ @uses_desuperheater = XMLHelper.get_value(water_heating_system, 'UsesDesuperheater', :boolean)
3639
+ @jacket_r_value = XMLHelper.get_value(water_heating_system, 'WaterHeaterInsulation/Jacket/JacketRValue', :float)
3585
3640
  @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'))
3641
+ @energy_star = XMLHelper.get_values(water_heating_system, 'ThirdPartyCertification', :string).include?('Energy Star')
3642
+ @standby_loss, @standby_loss_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'StandbyLoss', :float)
3643
+ @temperature, @temperature_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating_system, 'HotWaterTemperature', :float)
3589
3644
  end
3590
3645
  end
3591
3646
 
@@ -3631,33 +3686,33 @@ class HPXML < Object
3631
3686
  system_type_e = XMLHelper.add_element(hot_water_distribution, 'SystemType')
3632
3687
  if @system_type == DHWDistTypeStandard
3633
3688
  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?
3689
+ XMLHelper.add_element(standard, 'PipingLength', @standard_piping_length, :float, @standard_piping_length_isdefaulted) unless @standard_piping_length.nil?
3635
3690
  elsif system_type == DHWDistTypeRecirc
3636
3691
  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?
3692
+ XMLHelper.add_element(recirculation, 'ControlType', @recirculation_control_type, :string) unless @recirculation_control_type.nil?
3693
+ XMLHelper.add_element(recirculation, 'RecirculationPipingLoopLength', @recirculation_piping_length, :float, @recirculation_piping_length_isdefaulted) unless @recirculation_piping_length.nil?
3694
+ XMLHelper.add_element(recirculation, 'BranchPipingLoopLength', @recirculation_branch_piping_length, :float, @recirculation_branch_piping_length_isdefaulted) unless @recirculation_branch_piping_length.nil?
3695
+ XMLHelper.add_element(recirculation, 'PumpPower', @recirculation_pump_power, :float, @recirculation_pump_power_isdefaulted) unless @recirculation_pump_power.nil?
3641
3696
  else
3642
3697
  fail "Unhandled hot water distribution type '#{@system_type}'."
3643
3698
  end
3644
3699
  end
3645
3700
  if not @pipe_r_value.nil?
3646
3701
  pipe_insulation = XMLHelper.add_element(hot_water_distribution, 'PipeInsulation')
3647
- XMLHelper.add_element(pipe_insulation, 'PipeRValue', to_float(@pipe_r_value))
3702
+ XMLHelper.add_element(pipe_insulation, 'PipeRValue', @pipe_r_value, :float, @pipe_r_value_isdefaulted)
3648
3703
  end
3649
3704
  if (not @dwhr_facilities_connected.nil?) || (not @dwhr_equal_flow.nil?) || (not @dwhr_efficiency.nil?)
3650
3705
  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?
3706
+ XMLHelper.add_element(drain_water_heat_recovery, 'FacilitiesConnected', @dwhr_facilities_connected, :string) unless @dwhr_facilities_connected.nil?
3707
+ XMLHelper.add_element(drain_water_heat_recovery, 'EqualFlow', @dwhr_equal_flow, :boolean) unless @dwhr_equal_flow.nil?
3708
+ XMLHelper.add_element(drain_water_heat_recovery, 'Efficiency', @dwhr_efficiency, :float) unless @dwhr_efficiency.nil?
3654
3709
  end
3655
3710
  if @has_shared_recirculation
3656
3711
  extension = XMLHelper.create_elements_as_needed(hot_water_distribution, ['extension'])
3657
3712
  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?
3713
+ XMLHelper.add_element(shared_recirculation, 'NumberofUnitsServed', @shared_recirculation_number_of_units_served, :integer) unless @shared_recirculation_number_of_units_served.nil?
3714
+ XMLHelper.add_element(shared_recirculation, 'PumpPower', @shared_recirculation_pump_power, :float, @shared_recirculation_pump_power_isdefaulted) unless @shared_recirculation_pump_power.nil?
3715
+ XMLHelper.add_element(shared_recirculation, 'ControlType', @shared_recirculation_control_type, :string) unless @shared_recirculation_control_type.nil?
3661
3716
  end
3662
3717
  end
3663
3718
 
@@ -3666,23 +3721,23 @@ class HPXML < Object
3666
3721
 
3667
3722
  @id = HPXML::get_id(hot_water_distribution)
3668
3723
  @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'))
3724
+ @pipe_r_value, @pipe_r_value_isdefaulted = XMLHelper.get_value_and_defaulted(hot_water_distribution, 'PipeInsulation/PipeRValue', :float)
3670
3725
  if @system_type == 'Standard'
3671
- @standard_piping_length = to_float_or_nil(XMLHelper.get_value(hot_water_distribution, 'SystemType/Standard/PipingLength'))
3726
+ @standard_piping_length, @standard_piping_length_isdefaulted = XMLHelper.get_value_and_defaulted(hot_water_distribution, 'SystemType/Standard/PipingLength', :float)
3672
3727
  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'))
3728
+ @recirculation_control_type = XMLHelper.get_value(hot_water_distribution, 'SystemType/Recirculation/ControlType', :string)
3729
+ @recirculation_piping_length, @recirculation_piping_length_isdefaulted = XMLHelper.get_value_and_defaulted(hot_water_distribution, 'SystemType/Recirculation/RecirculationPipingLoopLength', :float)
3730
+ @recirculation_branch_piping_length, @recirculation_branch_piping_length_isdefaulted = XMLHelper.get_value_and_defaulted(hot_water_distribution, 'SystemType/Recirculation/BranchPipingLoopLength', :float)
3731
+ @recirculation_pump_power, @recirculation_pump_power_isdefaulted = XMLHelper.get_value_and_defaulted(hot_water_distribution, 'SystemType/Recirculation/PumpPower', :float)
3732
+ end
3733
+ @dwhr_facilities_connected = XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/FacilitiesConnected', :string)
3734
+ @dwhr_equal_flow = XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/EqualFlow', :boolean)
3735
+ @dwhr_efficiency = XMLHelper.get_value(hot_water_distribution, 'DrainWaterHeatRecovery/Efficiency', :float)
3681
3736
  @has_shared_recirculation = XMLHelper.has_element(hot_water_distribution, 'extension/SharedRecirculation')
3682
3737
  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')
3738
+ @shared_recirculation_number_of_units_served = XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/NumberofUnitsServed', :integer)
3739
+ @shared_recirculation_pump_power, @shared_recirculation_pump_power_isdefaulted = XMLHelper.get_value_and_defaulted(hot_water_distribution, 'extension/SharedRecirculation/PumpPower', :float)
3740
+ @shared_recirculation_control_type = XMLHelper.get_value(hot_water_distribution, 'extension/SharedRecirculation/ControlType', :string)
3686
3741
  end
3687
3742
  end
3688
3743
  end
@@ -3721,16 +3776,16 @@ class HPXML < Object
3721
3776
  water_fixture = XMLHelper.add_element(water_heating, 'WaterFixture')
3722
3777
  sys_id = XMLHelper.add_element(water_fixture, 'SystemIdentifier')
3723
3778
  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?
3779
+ XMLHelper.add_element(water_fixture, 'WaterFixtureType', @water_fixture_type, :string) unless @water_fixture_type.nil?
3780
+ XMLHelper.add_element(water_fixture, 'LowFlow', @low_flow, :boolean) unless @low_flow.nil?
3726
3781
  end
3727
3782
 
3728
3783
  def from_oga(water_fixture)
3729
3784
  return if water_fixture.nil?
3730
3785
 
3731
3786
  @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'))
3787
+ @water_fixture_type = XMLHelper.get_value(water_fixture, 'WaterFixtureType', :string)
3788
+ @low_flow = XMLHelper.get_value(water_fixture, 'LowFlow', :boolean)
3734
3789
  end
3735
3790
  end
3736
3791
 
@@ -3747,7 +3802,7 @@ class HPXML < Object
3747
3802
  return if nil?
3748
3803
 
3749
3804
  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?
3805
+ XMLHelper.add_extension(water_heating, 'WaterFixturesUsageMultiplier', @water_fixtures_usage_multiplier, :float, @water_fixtures_usage_multiplier_isdefaulted) unless @water_fixtures_usage_multiplier.nil?
3751
3806
  end
3752
3807
 
3753
3808
  def from_oga(hpxml)
@@ -3756,7 +3811,7 @@ class HPXML < Object
3756
3811
  water_heating = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/Systems/WaterHeating')
3757
3812
  return if water_heating.nil?
3758
3813
 
3759
- @water_fixtures_usage_multiplier = to_float_or_nil(XMLHelper.get_value(water_heating, 'extension/WaterFixturesUsageMultiplier'))
3814
+ @water_fixtures_usage_multiplier, @water_fixtures_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(water_heating, 'extension/WaterFixturesUsageMultiplier', :float)
3760
3815
  end
3761
3816
  end
3762
3817
 
@@ -3808,37 +3863,37 @@ class HPXML < Object
3808
3863
  solar_thermal_system = XMLHelper.add_element(solar_thermal, 'SolarThermalSystem')
3809
3864
  sys_id = XMLHelper.add_element(solar_thermal_system, 'SystemIdentifier')
3810
3865
  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?
3866
+ XMLHelper.add_element(solar_thermal_system, 'SystemType', @system_type, :string) unless @system_type.nil?
3867
+ XMLHelper.add_element(solar_thermal_system, 'CollectorArea', @collector_area, :float) unless @collector_area.nil?
3868
+ XMLHelper.add_element(solar_thermal_system, 'CollectorLoopType', @collector_loop_type, :string) unless @collector_loop_type.nil?
3869
+ XMLHelper.add_element(solar_thermal_system, 'CollectorType', @collector_type, :string) unless @collector_type.nil?
3870
+ XMLHelper.add_element(solar_thermal_system, 'CollectorAzimuth', @collector_azimuth, :integer) unless @collector_azimuth.nil?
3871
+ XMLHelper.add_element(solar_thermal_system, 'CollectorTilt', @collector_tilt, :float) unless @collector_tilt.nil?
3872
+ XMLHelper.add_element(solar_thermal_system, 'CollectorRatedOpticalEfficiency', @collector_frta, :float) unless @collector_frta.nil?
3873
+ XMLHelper.add_element(solar_thermal_system, 'CollectorRatedThermalLosses', @collector_frul, :float) unless @collector_frul.nil?
3874
+ XMLHelper.add_element(solar_thermal_system, 'StorageVolume', @storage_volume, :float, @storage_volume_isdefaulted) unless @storage_volume.nil?
3820
3875
  if not @water_heating_system_idref.nil?
3821
3876
  connected_to = XMLHelper.add_element(solar_thermal_system, 'ConnectedTo')
3822
3877
  XMLHelper.add_attribute(connected_to, 'idref', @water_heating_system_idref)
3823
3878
  end
3824
- XMLHelper.add_element(solar_thermal_system, 'SolarFraction', to_float(@solar_fraction)) unless @solar_fraction.nil?
3879
+ XMLHelper.add_element(solar_thermal_system, 'SolarFraction', @solar_fraction, :float) unless @solar_fraction.nil?
3825
3880
  end
3826
3881
 
3827
3882
  def from_oga(solar_thermal_system)
3828
3883
  return if solar_thermal_system.nil?
3829
3884
 
3830
3885
  @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'))
3886
+ @system_type = XMLHelper.get_value(solar_thermal_system, 'SystemType', :string)
3887
+ @collector_area = XMLHelper.get_value(solar_thermal_system, 'CollectorArea', :float)
3888
+ @collector_loop_type = XMLHelper.get_value(solar_thermal_system, 'CollectorLoopType', :string)
3889
+ @collector_azimuth = XMLHelper.get_value(solar_thermal_system, 'CollectorAzimuth', :integer)
3890
+ @collector_type = XMLHelper.get_value(solar_thermal_system, 'CollectorType', :string)
3891
+ @collector_tilt = XMLHelper.get_value(solar_thermal_system, 'CollectorTilt', :float)
3892
+ @collector_frta = XMLHelper.get_value(solar_thermal_system, 'CollectorRatedOpticalEfficiency', :float)
3893
+ @collector_frul = XMLHelper.get_value(solar_thermal_system, 'CollectorRatedThermalLosses', :float)
3894
+ @storage_volume, @storage_volume_isdefaulted = XMLHelper.get_value_and_defaulted(solar_thermal_system, 'StorageVolume', :float)
3840
3895
  @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'))
3896
+ @solar_fraction = XMLHelper.get_value(solar_thermal_system, 'SolarFraction', :float)
3842
3897
  end
3843
3898
  end
3844
3899
 
@@ -3878,36 +3933,89 @@ class HPXML < Object
3878
3933
  pv_system = XMLHelper.add_element(photovoltaics, 'PVSystem')
3879
3934
  sys_id = XMLHelper.add_element(pv_system, 'SystemIdentifier')
3880
3935
  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?
3936
+ XMLHelper.add_element(pv_system, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
3937
+ XMLHelper.add_element(pv_system, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
3938
+ XMLHelper.add_element(pv_system, 'ModuleType', @module_type, :string, @module_type_isdefaulted) unless @module_type.nil?
3939
+ XMLHelper.add_element(pv_system, 'Tracking', @tracking, :string, @tracking_isdefaulted) unless @tracking.nil?
3940
+ XMLHelper.add_element(pv_system, 'ArrayAzimuth', @array_azimuth, :integer) unless @array_azimuth.nil?
3941
+ XMLHelper.add_element(pv_system, 'ArrayTilt', @array_tilt, :float) unless @array_tilt.nil?
3942
+ XMLHelper.add_element(pv_system, 'MaxPowerOutput', @max_power_output, :float) unless @max_power_output.nil?
3943
+ XMLHelper.add_element(pv_system, 'InverterEfficiency', @inverter_efficiency, :float, @inverter_efficiency_isdefaulted) unless @inverter_efficiency.nil?
3944
+ XMLHelper.add_element(pv_system, 'SystemLossesFraction', @system_losses_fraction, :float, @system_losses_fraction_isdefaulted) unless @system_losses_fraction.nil?
3945
+ XMLHelper.add_element(pv_system, 'YearModulesManufactured', @year_modules_manufactured, :integer) unless @year_modules_manufactured.nil?
3946
+ XMLHelper.add_extension(pv_system, 'NumberofBedroomsServed', @number_of_bedrooms_served, :integer) unless @number_of_bedrooms_served.nil?
3892
3947
  end
3893
3948
 
3894
3949
  def from_oga(pv_system)
3895
3950
  return if pv_system.nil?
3896
3951
 
3897
3952
  @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'))
3953
+ @is_shared_system, @is_shared_system_isdefaulted = XMLHelper.get_value_and_defaulted(pv_system, 'IsSharedSystem', :boolean)
3954
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(pv_system, 'Location', :string)
3955
+ @module_type, @module_type_isdefaulted = XMLHelper.get_value_and_defaulted(pv_system, 'ModuleType', :string)
3956
+ @tracking, @tracking_isdefaulted = XMLHelper.get_value_and_defaulted(pv_system, 'Tracking', :string)
3957
+ @array_orientation = XMLHelper.get_value(pv_system, 'ArrayOrientation', :string)
3958
+ @array_azimuth = XMLHelper.get_value(pv_system, 'ArrayAzimuth', :integer)
3959
+ @array_tilt = XMLHelper.get_value(pv_system, 'ArrayTilt', :float)
3960
+ @max_power_output = XMLHelper.get_value(pv_system, 'MaxPowerOutput', :float)
3961
+ @inverter_efficiency, @inverter_efficiency_isdefaulted = XMLHelper.get_value_and_defaulted(pv_system, 'InverterEfficiency', :float)
3962
+ @system_losses_fraction, @system_losses_fraction_isdefaulted = XMLHelper.get_value_and_defaulted(pv_system, 'SystemLossesFraction', :float)
3963
+ @number_of_panels = XMLHelper.get_value(pv_system, 'NumberOfPanels', :integer)
3964
+ @year_modules_manufactured = XMLHelper.get_value(pv_system, 'YearModulesManufactured', :integer)
3965
+ @number_of_bedrooms_served = XMLHelper.get_value(pv_system, 'extension/NumberofBedroomsServed', :integer)
3966
+ end
3967
+ end
3968
+
3969
+ class Generators < BaseArrayElement
3970
+ def add(**kwargs)
3971
+ self << Generator.new(@hpxml_object, **kwargs)
3972
+ end
3973
+
3974
+ def from_oga(hpxml)
3975
+ return if hpxml.nil?
3976
+
3977
+ XMLHelper.get_elements(hpxml, 'Building/BuildingDetails/Systems/extension/Generators/Generator').each do |generator|
3978
+ self << Generator.new(@hpxml_object, generator)
3979
+ end
3980
+ end
3981
+ end
3982
+
3983
+ class Generator < BaseElement
3984
+ ATTRS = [:id, :fuel_type, :annual_consumption_kbtu, :annual_output_kwh, :is_shared_system, :number_of_bedrooms_served]
3985
+ attr_accessor(*ATTRS)
3986
+
3987
+ def delete
3988
+ @hpxml_object.generators.delete(self)
3989
+ end
3990
+
3991
+ def check_for_errors
3992
+ errors = []
3993
+ return errors
3994
+ end
3995
+
3996
+ def to_oga(doc)
3997
+ return if nil?
3998
+
3999
+ generators = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'Systems', 'extension', 'Generators'])
4000
+ generator = XMLHelper.add_element(generators, 'Generator')
4001
+ sys_id = XMLHelper.add_element(generator, 'SystemIdentifier')
4002
+ XMLHelper.add_attribute(sys_id, 'id', @id)
4003
+ XMLHelper.add_element(generator, 'IsSharedSystem', @is_shared_system, :boolean, @is_shared_system_isdefaulted) unless @is_shared_system.nil?
4004
+ XMLHelper.add_element(generator, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
4005
+ XMLHelper.add_element(generator, 'AnnualConsumptionkBtu', @annual_consumption_kbtu, :float) unless @annual_consumption_kbtu.nil?
4006
+ XMLHelper.add_element(generator, 'AnnualOutputkWh', @annual_output_kwh, :float) unless @annual_output_kwh.nil?
4007
+ XMLHelper.add_element(generator, 'NumberofBedroomsServed', @number_of_bedrooms_served, :integer) unless @number_of_bedrooms_served.nil?
4008
+ end
4009
+
4010
+ def from_oga(generator)
4011
+ return if generator.nil?
4012
+
4013
+ @id = HPXML::get_id(generator)
4014
+ @is_shared_system, @is_shared_system_isdefaulted = XMLHelper.get_value_and_defaulted(generator, 'IsSharedSystem', :boolean)
4015
+ @fuel_type = XMLHelper.get_value(generator, 'FuelType', :string)
4016
+ @annual_consumption_kbtu = XMLHelper.get_value(generator, 'AnnualConsumptionkBtu', :float)
4017
+ @annual_output_kwh = XMLHelper.get_value(generator, 'AnnualOutputkWh', :float)
4018
+ @number_of_bedrooms_served = XMLHelper.get_value(generator, 'NumberofBedroomsServed', :integer)
3911
4019
  end
3912
4020
  end
3913
4021
 
@@ -3960,42 +4068,42 @@ class HPXML < Object
3960
4068
  clothes_washer = XMLHelper.add_element(appliances, 'ClothesWasher')
3961
4069
  sys_id = XMLHelper.add_element(clothes_washer, 'SystemIdentifier')
3962
4070
  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?
4071
+ XMLHelper.add_element(clothes_washer, 'NumberofUnits', @number_of_units, :integer) unless @number_of_units.nil?
4072
+ XMLHelper.add_element(clothes_washer, 'IsSharedAppliance', @is_shared_appliance, :boolean, @is_shared_appliance_isdefaulted) unless @is_shared_appliance.nil?
4073
+ XMLHelper.add_element(clothes_washer, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
3966
4074
  if not @water_heating_system_idref.nil?
3967
4075
  attached_water_heater = XMLHelper.add_element(clothes_washer, 'AttachedToWaterHeatingSystem')
3968
4076
  XMLHelper.add_attribute(attached_water_heater, 'idref', @water_heating_system_idref)
3969
4077
  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?
4078
+ XMLHelper.add_element(clothes_washer, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4079
+ XMLHelper.add_element(clothes_washer, 'ModifiedEnergyFactor', @modified_energy_factor, :float) unless @modified_energy_factor.nil?
4080
+ XMLHelper.add_element(clothes_washer, 'IntegratedModifiedEnergyFactor', @integrated_modified_energy_factor, :float, @integrated_modified_energy_factor_isdefaulted) unless @integrated_modified_energy_factor.nil?
4081
+ XMLHelper.add_element(clothes_washer, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4082
+ XMLHelper.add_element(clothes_washer, 'LabelElectricRate', @label_electric_rate, :float, @label_electric_rate_isdefaulted) unless @label_electric_rate.nil?
4083
+ XMLHelper.add_element(clothes_washer, 'LabelGasRate', @label_gas_rate, :float, @label_gas_rate_isdefaulted) unless @label_gas_rate.nil?
4084
+ XMLHelper.add_element(clothes_washer, 'LabelAnnualGasCost', @label_annual_gas_cost, :float, @label_annual_gas_cost_isdefaulted) unless @label_annual_gas_cost.nil?
4085
+ XMLHelper.add_element(clothes_washer, 'LabelUsage', @label_usage, :float, @label_usage_isdefaulted) unless @label_usage.nil?
4086
+ XMLHelper.add_element(clothes_washer, 'Capacity', @capacity, :float, @capacity_isdefaulted) unless @capacity.nil?
4087
+ XMLHelper.add_extension(clothes_washer, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
3980
4088
  end
3981
4089
 
3982
4090
  def from_oga(clothes_washer)
3983
4091
  return if clothes_washer.nil?
3984
4092
 
3985
4093
  @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'))
4094
+ @number_of_units = XMLHelper.get_value(clothes_washer, 'NumberofUnits', :integer)
4095
+ @is_shared_appliance, @is_shared_appliance_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'IsSharedAppliance', :boolean)
4096
+ @number_of_units_served = XMLHelper.get_value(clothes_washer, 'NumberofUnitsServed', :integer)
4097
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'Location', :string)
4098
+ @modified_energy_factor = XMLHelper.get_value(clothes_washer, 'ModifiedEnergyFactor', :float)
4099
+ @integrated_modified_energy_factor, @integrated_modified_energy_factor_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'IntegratedModifiedEnergyFactor', :float)
4100
+ @rated_annual_kwh, @rated_annual_kwh_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'RatedAnnualkWh', :float)
4101
+ @label_electric_rate, @label_electric_rate_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'LabelElectricRate', :float)
4102
+ @label_gas_rate, @label_gas_rate_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'LabelGasRate', :float)
4103
+ @label_annual_gas_cost, @label_annual_gas_cost_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'LabelAnnualGasCost', :float)
4104
+ @label_usage, @label_usage_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'LabelUsage', :float)
4105
+ @capacity, @capacity_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'Capacity', :float)
4106
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_washer, 'extension/UsageMultiplier', :float)
3999
4107
  @water_heating_system_idref = HPXML::get_idref(XMLHelper.get_element(clothes_washer, 'AttachedToWaterHeatingSystem'))
4000
4108
  end
4001
4109
  end
@@ -4036,34 +4144,34 @@ class HPXML < Object
4036
4144
  clothes_dryer = XMLHelper.add_element(appliances, 'ClothesDryer')
4037
4145
  sys_id = XMLHelper.add_element(clothes_dryer, 'SystemIdentifier')
4038
4146
  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?
4147
+ XMLHelper.add_element(clothes_dryer, 'NumberofUnits', @number_of_units, :integer) unless @number_of_units.nil?
4148
+ XMLHelper.add_element(clothes_dryer, 'IsSharedAppliance', @is_shared_appliance, :boolean, @is_shared_appliance_isdefaulted) unless @is_shared_appliance.nil?
4149
+ XMLHelper.add_element(clothes_dryer, 'NumberofUnitsServed', @number_of_units_served, :integer) unless @number_of_units_served.nil?
4150
+ XMLHelper.add_element(clothes_dryer, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4151
+ XMLHelper.add_element(clothes_dryer, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
4152
+ XMLHelper.add_element(clothes_dryer, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
4153
+ XMLHelper.add_element(clothes_dryer, 'CombinedEnergyFactor', @combined_energy_factor, :float, @combined_energy_factor_isdefaulted) unless @combined_energy_factor.nil?
4154
+ XMLHelper.add_element(clothes_dryer, 'ControlType', @control_type, :string, @control_type_isdefaulted) unless @control_type.nil?
4155
+ XMLHelper.add_extension(clothes_dryer, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4156
+ XMLHelper.add_extension(clothes_dryer, 'IsVented', @is_vented, :boolean, @is_vented_isdefaulted) unless @is_vented.nil?
4157
+ XMLHelper.add_extension(clothes_dryer, 'VentedFlowRate', @vented_flow_rate, :float, @vented_flow_rate_isdefaulted) unless @vented_flow_rate.nil?
4050
4158
  end
4051
4159
 
4052
4160
  def from_oga(clothes_dryer)
4053
4161
  return if clothes_dryer.nil?
4054
4162
 
4055
4163
  @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'))
4164
+ @number_of_units = XMLHelper.get_value(clothes_dryer, 'NumberofUnits', :integer)
4165
+ @is_shared_appliance, @is_shared_appliance_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_dryer, 'IsSharedAppliance', :boolean)
4166
+ @number_of_units_served = XMLHelper.get_value(clothes_dryer, 'NumberofUnitsServed', :integer)
4167
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_dryer, 'Location', :string)
4168
+ @fuel_type = XMLHelper.get_value(clothes_dryer, 'FuelType', :string)
4169
+ @energy_factor = XMLHelper.get_value(clothes_dryer, 'EnergyFactor', :float)
4170
+ @combined_energy_factor, @combined_energy_factor_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_dryer, 'CombinedEnergyFactor', :float)
4171
+ @control_type, @control_type_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_dryer, 'ControlType', :string)
4172
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_dryer, 'extension/UsageMultiplier', :float)
4173
+ @is_vented, @is_vented_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_dryer, 'extension/IsVented', :boolean)
4174
+ @vented_flow_rate, @vented_flow_rate_isdefaulted = XMLHelper.get_value_and_defaulted(clothes_dryer, 'extension/VentedFlowRate', :float)
4067
4175
  end
4068
4176
  end
4069
4177
 
@@ -4115,36 +4223,36 @@ class HPXML < Object
4115
4223
  dishwasher = XMLHelper.add_element(appliances, 'Dishwasher')
4116
4224
  sys_id = XMLHelper.add_element(dishwasher, 'SystemIdentifier')
4117
4225
  XMLHelper.add_attribute(sys_id, 'id', @id)
4118
- XMLHelper.add_element(dishwasher, 'IsSharedAppliance', to_boolean(@is_shared_appliance)) unless @is_shared_appliance.nil?
4226
+ XMLHelper.add_element(dishwasher, 'IsSharedAppliance', @is_shared_appliance, :boolean, @is_shared_appliance_isdefaulted) unless @is_shared_appliance.nil?
4119
4227
  if not @water_heating_system_idref.nil?
4120
4228
  attached_water_heater = XMLHelper.add_element(dishwasher, 'AttachedToWaterHeatingSystem')
4121
4229
  XMLHelper.add_attribute(attached_water_heater, 'idref', @water_heating_system_idref)
4122
4230
  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?
4231
+ XMLHelper.add_element(dishwasher, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4232
+ XMLHelper.add_element(dishwasher, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4233
+ XMLHelper.add_element(dishwasher, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
4234
+ XMLHelper.add_element(dishwasher, 'PlaceSettingCapacity', @place_setting_capacity, :integer, @place_setting_capacity_isdefaulted) unless @place_setting_capacity.nil?
4235
+ XMLHelper.add_element(dishwasher, 'LabelElectricRate', @label_electric_rate, :float, @label_electric_rate_isdefaulted) unless @label_electric_rate.nil?
4236
+ XMLHelper.add_element(dishwasher, 'LabelGasRate', @label_gas_rate, :float, @label_gas_rate_isdefaulted) unless @label_gas_rate.nil?
4237
+ XMLHelper.add_element(dishwasher, 'LabelAnnualGasCost', @label_annual_gas_cost, :float, @label_annual_gas_cost_isdefaulted) unless @label_annual_gas_cost.nil?
4238
+ XMLHelper.add_element(dishwasher, 'LabelUsage', @label_usage, :float, @label_usage_isdefaulted) unless @label_usage.nil?
4239
+ XMLHelper.add_extension(dishwasher, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4132
4240
  end
4133
4241
 
4134
4242
  def from_oga(dishwasher)
4135
4243
  return if dishwasher.nil?
4136
4244
 
4137
4245
  @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'))
4246
+ @is_shared_appliance, @is_shared_appliance_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'IsSharedAppliance', :boolean)
4247
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'Location', :string)
4248
+ @rated_annual_kwh, @rated_annual_kwh_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'RatedAnnualkWh', :float)
4249
+ @energy_factor = XMLHelper.get_value(dishwasher, 'EnergyFactor', :float)
4250
+ @place_setting_capacity, @place_setting_capacity_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'PlaceSettingCapacity', :integer)
4251
+ @label_electric_rate, @label_electric_rate_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'LabelElectricRate', :float)
4252
+ @label_gas_rate, @label_gas_rate_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'LabelGasRate', :float)
4253
+ @label_annual_gas_cost, @label_annual_gas_cost_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'LabelAnnualGasCost', :float)
4254
+ @label_usage, @label_usage_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'LabelUsage', :float)
4255
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(dishwasher, 'extension/UsageMultiplier', :float)
4148
4256
  @water_heating_system_idref = HPXML::get_idref(XMLHelper.get_element(dishwasher, 'AttachedToWaterHeatingSystem'))
4149
4257
  end
4150
4258
  end
@@ -4174,18 +4282,6 @@ class HPXML < Object
4174
4282
 
4175
4283
  def check_for_errors
4176
4284
  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
4285
  return errors
4190
4286
  end
4191
4287
 
@@ -4196,28 +4292,28 @@ class HPXML < Object
4196
4292
  refrigerator = XMLHelper.add_element(appliances, 'Refrigerator')
4197
4293
  sys_id = XMLHelper.add_element(refrigerator, 'SystemIdentifier')
4198
4294
  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?
4295
+ XMLHelper.add_element(refrigerator, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4296
+ XMLHelper.add_element(refrigerator, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4297
+ XMLHelper.add_element(refrigerator, 'PrimaryIndicator', @primary_indicator, :boolean, @primary_indicator_isdefaulted) unless @primary_indicator.nil?
4298
+ XMLHelper.add_extension(refrigerator, 'AdjustedAnnualkWh', @adjusted_annual_kwh, :float) unless @adjusted_annual_kwh.nil?
4299
+ XMLHelper.add_extension(refrigerator, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4300
+ XMLHelper.add_extension(refrigerator, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
4301
+ XMLHelper.add_extension(refrigerator, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
4302
+ XMLHelper.add_extension(refrigerator, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4207
4303
  end
4208
4304
 
4209
4305
  def from_oga(refrigerator)
4210
4306
  return if refrigerator.nil?
4211
4307
 
4212
4308
  @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')
4309
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(refrigerator, 'Location', :string)
4310
+ @rated_annual_kwh, @rated_annual_kwh_isdefaulted = XMLHelper.get_value_and_defaulted(refrigerator, 'RatedAnnualkWh', :float)
4311
+ @primary_indicator, @primary_indicator_isdefaulted = XMLHelper.get_value_and_defaulted(refrigerator, 'PrimaryIndicator', :boolean)
4312
+ @adjusted_annual_kwh = XMLHelper.get_value(refrigerator, 'extension/AdjustedAnnualkWh', :float)
4313
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(refrigerator, 'extension/UsageMultiplier', :float)
4314
+ @weekday_fractions, @weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(refrigerator, 'extension/WeekdayScheduleFractions', :string)
4315
+ @weekend_fractions, @weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(refrigerator, 'extension/WeekendScheduleFractions', :string)
4316
+ @monthly_multipliers, @monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(refrigerator, 'extension/MonthlyScheduleMultipliers', :string)
4221
4317
  end
4222
4318
  end
4223
4319
 
@@ -4256,26 +4352,26 @@ class HPXML < Object
4256
4352
  freezer = XMLHelper.add_element(appliances, 'Freezer')
4257
4353
  sys_id = XMLHelper.add_element(freezer, 'SystemIdentifier')
4258
4354
  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?
4355
+ XMLHelper.add_element(freezer, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4356
+ XMLHelper.add_element(freezer, 'RatedAnnualkWh', @rated_annual_kwh, :float, @rated_annual_kwh_isdefaulted) unless @rated_annual_kwh.nil?
4357
+ XMLHelper.add_extension(freezer, 'AdjustedAnnualkWh', @adjusted_annual_kwh, :float) unless @adjusted_annual_kwh.nil?
4358
+ XMLHelper.add_extension(freezer, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4359
+ XMLHelper.add_extension(freezer, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
4360
+ XMLHelper.add_extension(freezer, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
4361
+ XMLHelper.add_extension(freezer, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4266
4362
  end
4267
4363
 
4268
4364
  def from_oga(freezer)
4269
4365
  return if freezer.nil?
4270
4366
 
4271
4367
  @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')
4368
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(freezer, 'Location', :string)
4369
+ @rated_annual_kwh, @rated_annual_kwh_isdefaulted = XMLHelper.get_value_and_defaulted(freezer, 'RatedAnnualkWh', :float)
4370
+ @adjusted_annual_kwh = XMLHelper.get_value(freezer, 'extension/AdjustedAnnualkWh', :float)
4371
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(freezer, 'extension/UsageMultiplier', :float)
4372
+ @weekday_fractions, @weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(freezer, 'extension/WeekdayScheduleFractions', :string)
4373
+ @weekend_fractions, @weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(freezer, 'extension/WeekendScheduleFractions', :string)
4374
+ @monthly_multipliers, @monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(freezer, 'extension/MonthlyScheduleMultipliers', :string)
4279
4375
  end
4280
4376
  end
4281
4377
 
@@ -4294,7 +4390,7 @@ class HPXML < Object
4294
4390
  end
4295
4391
 
4296
4392
  class Dehumidifier < BaseElement
4297
- ATTRS = [:id, :capacity, :energy_factor, :integrated_energy_factor, :rh_setpoint, :fraction_served]
4393
+ ATTRS = [:id, :type, :capacity, :energy_factor, :integrated_energy_factor, :rh_setpoint, :fraction_served]
4298
4394
  attr_accessor(*ATTRS)
4299
4395
 
4300
4396
  def delete
@@ -4313,22 +4409,24 @@ class HPXML < Object
4313
4409
  dehumidifier = XMLHelper.add_element(appliances, 'Dehumidifier')
4314
4410
  sys_id = XMLHelper.add_element(dehumidifier, 'SystemIdentifier')
4315
4411
  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?
4412
+ XMLHelper.add_element(dehumidifier, 'Type', @type, :string) unless @type.nil?
4413
+ XMLHelper.add_element(dehumidifier, 'Capacity', @capacity, :float) unless @capacity.nil?
4414
+ XMLHelper.add_element(dehumidifier, 'EnergyFactor', @energy_factor, :float) unless @energy_factor.nil?
4415
+ XMLHelper.add_element(dehumidifier, 'IntegratedEnergyFactor', @integrated_energy_factor, :float) unless @integrated_energy_factor.nil?
4416
+ XMLHelper.add_element(dehumidifier, 'DehumidistatSetpoint', @rh_setpoint, :float) unless @rh_setpoint.nil?
4417
+ XMLHelper.add_element(dehumidifier, 'FractionDehumidificationLoadServed', @fraction_served, :float) unless @fraction_served.nil?
4321
4418
  end
4322
4419
 
4323
4420
  def from_oga(dehumidifier)
4324
4421
  return if dehumidifier.nil?
4325
4422
 
4326
4423
  @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'))
4424
+ @type = XMLHelper.get_value(dehumidifier, 'Type', :string)
4425
+ @capacity = XMLHelper.get_value(dehumidifier, 'Capacity', :float)
4426
+ @energy_factor = XMLHelper.get_value(dehumidifier, 'EnergyFactor', :float)
4427
+ @integrated_energy_factor = XMLHelper.get_value(dehumidifier, 'IntegratedEnergyFactor', :float)
4428
+ @rh_setpoint = XMLHelper.get_value(dehumidifier, 'DehumidistatSetpoint', :float)
4429
+ @fraction_served = XMLHelper.get_value(dehumidifier, 'FractionDehumidificationLoadServed', :float)
4332
4430
  end
4333
4431
  end
4334
4432
 
@@ -4367,26 +4465,26 @@ class HPXML < Object
4367
4465
  cooking_range = XMLHelper.add_element(appliances, 'CookingRange')
4368
4466
  sys_id = XMLHelper.add_element(cooking_range, 'SystemIdentifier')
4369
4467
  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?
4468
+ XMLHelper.add_element(cooking_range, 'Location', @location, :string, @location_isdefaulted) unless @location.nil?
4469
+ XMLHelper.add_element(cooking_range, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
4470
+ XMLHelper.add_element(cooking_range, 'IsInduction', @is_induction, :boolean, @is_induction_isdefaulted) unless @is_induction.nil?
4471
+ XMLHelper.add_extension(cooking_range, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4472
+ XMLHelper.add_extension(cooking_range, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
4473
+ XMLHelper.add_extension(cooking_range, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
4474
+ XMLHelper.add_extension(cooking_range, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4377
4475
  end
4378
4476
 
4379
4477
  def from_oga(cooking_range)
4380
4478
  return if cooking_range.nil?
4381
4479
 
4382
4480
  @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')
4481
+ @location, @location_isdefaulted = XMLHelper.get_value_and_defaulted(cooking_range, 'Location', :string)
4482
+ @fuel_type = XMLHelper.get_value(cooking_range, 'FuelType', :string)
4483
+ @is_induction, @is_induction_isdefaulted = XMLHelper.get_value_and_defaulted(cooking_range, 'IsInduction', :boolean)
4484
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(cooking_range, 'extension/UsageMultiplier', :float)
4485
+ @weekday_fractions, @weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(cooking_range, 'extension/WeekdayScheduleFractions', :string)
4486
+ @weekend_fractions, @weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(cooking_range, 'extension/WeekendScheduleFractions', :string)
4487
+ @monthly_multipliers, @monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(cooking_range, 'extension/MonthlyScheduleMultipliers', :string)
4390
4488
  end
4391
4489
  end
4392
4490
 
@@ -4424,14 +4522,14 @@ class HPXML < Object
4424
4522
  oven = XMLHelper.add_element(appliances, 'Oven')
4425
4523
  sys_id = XMLHelper.add_element(oven, 'SystemIdentifier')
4426
4524
  XMLHelper.add_attribute(sys_id, 'id', @id)
4427
- XMLHelper.add_element(oven, 'IsConvection', to_boolean(@is_convection)) unless @is_convection.nil?
4525
+ XMLHelper.add_element(oven, 'IsConvection', @is_convection, :boolean, @is_convection_isdefaulted) unless @is_convection.nil?
4428
4526
  end
4429
4527
 
4430
4528
  def from_oga(oven)
4431
4529
  return if oven.nil?
4432
4530
 
4433
4531
  @id = HPXML::get_id(oven)
4434
- @is_convection = to_boolean_or_nil(XMLHelper.get_value(oven, 'IsConvection'))
4532
+ @is_convection, @is_convection_isdefaulted = XMLHelper.get_value_and_defaulted(oven, 'IsConvection', :boolean)
4435
4533
  end
4436
4534
  end
4437
4535
 
@@ -4469,8 +4567,8 @@ class HPXML < Object
4469
4567
  lighting_group = XMLHelper.add_element(lighting, 'LightingGroup')
4470
4568
  sys_id = XMLHelper.add_element(lighting_group, 'SystemIdentifier')
4471
4569
  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?
4570
+ XMLHelper.add_element(lighting_group, 'Location', @location, :string) unless @location.nil?
4571
+ XMLHelper.add_element(lighting_group, 'FractionofUnitsInLocation', @fraction_of_units_in_location, :float) unless @fraction_of_units_in_location.nil?
4474
4572
  if not @lighting_type.nil?
4475
4573
  lighting_type = XMLHelper.add_element(lighting_group, 'LightingType')
4476
4574
  XMLHelper.add_element(lighting_type, @lighting_type)
@@ -4481,8 +4579,8 @@ class HPXML < Object
4481
4579
  return if lighting_group.nil?
4482
4580
 
4483
4581
  @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'))
4582
+ @location = XMLHelper.get_value(lighting_group, 'Location', :string)
4583
+ @fraction_of_units_in_location = XMLHelper.get_value(lighting_group, 'FractionofUnitsInLocation', :float)
4486
4584
  @lighting_type = XMLHelper.get_child_name(lighting_group, 'LightingType')
4487
4585
  end
4488
4586
  end
@@ -4492,8 +4590,8 @@ class HPXML < Object
4492
4590
  :interior_weekday_fractions, :interior_weekend_fractions, :interior_monthly_multipliers,
4493
4591
  :garage_weekday_fractions, :garage_weekend_fractions, :garage_monthly_multipliers,
4494
4592
  :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]
4593
+ :holiday_exists, :holiday_kwh_per_day, :holiday_period_begin_month, :holiday_period_begin_day,
4594
+ :holiday_period_end_month, :holiday_period_end_day, :holiday_weekday_fractions, :holiday_weekend_fractions]
4497
4595
  attr_accessor(*ATTRS)
4498
4596
 
4499
4597
  def check_for_errors
@@ -4505,31 +4603,31 @@ class HPXML < Object
4505
4603
  return if nil?
4506
4604
 
4507
4605
  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?
4606
+ XMLHelper.add_extension(lighting, 'InteriorUsageMultiplier', @interior_usage_multiplier, :float, @interior_usage_multiplier_isdefaulted) unless @interior_usage_multiplier.nil?
4607
+ XMLHelper.add_extension(lighting, 'GarageUsageMultiplier', @garage_usage_multiplier, :float, @garage_usage_multiplier_isdefaulted) unless @garage_usage_multiplier.nil?
4608
+ XMLHelper.add_extension(lighting, 'ExteriorUsageMultiplier', @exterior_usage_multiplier, :float, @exterior_usage_multiplier_isdefaulted) unless @exterior_usage_multiplier.nil?
4609
+ XMLHelper.add_extension(lighting, 'InteriorWeekdayScheduleFractions', @interior_weekday_fractions, :string, @interior_weekday_fractions_isdefaulted) unless @interior_weekday_fractions.nil?
4610
+ XMLHelper.add_extension(lighting, 'InteriorWeekendScheduleFractions', @interior_weekend_fractions, :string, @interior_weekend_fractions_isdefaulted) unless @interior_weekend_fractions.nil?
4611
+ XMLHelper.add_extension(lighting, 'InteriorMonthlyScheduleMultipliers', @interior_monthly_multipliers, :string, @interior_monthly_multipliers_isdefaulted) unless @interior_monthly_multipliers.nil?
4612
+ XMLHelper.add_extension(lighting, 'GarageWeekdayScheduleFractions', @garage_weekday_fractions, :string, @garage_weekday_fractions_isdefaulted) unless @garage_weekday_fractions.nil?
4613
+ XMLHelper.add_extension(lighting, 'GarageWeekendScheduleFractions', @garage_weekend_fractions, :string, @garage_weekend_fractions_isdefaulted) unless @garage_weekend_fractions.nil?
4614
+ XMLHelper.add_extension(lighting, 'GarageMonthlyScheduleMultipliers', @garage_monthly_multipliers, :string, @garage_monthly_multipliers_isdefaulted) unless @garage_monthly_multipliers.nil?
4615
+ XMLHelper.add_extension(lighting, 'ExteriorWeekdayScheduleFractions', @exterior_weekday_fractions, :string, @exterior_weekday_fractions_isdefaulted) unless @exterior_weekday_fractions.nil?
4616
+ XMLHelper.add_extension(lighting, 'ExteriorWeekendScheduleFractions', @exterior_weekend_fractions, :string, @exterior_weekend_fractions_isdefaulted) unless @exterior_weekend_fractions.nil?
4617
+ XMLHelper.add_extension(lighting, 'ExteriorMonthlyScheduleMultipliers', @exterior_monthly_multipliers, :string, @exterior_monthly_multipliers_isdefaulted) unless @exterior_monthly_multipliers.nil?
4520
4618
  if @holiday_exists
4521
4619
  exterior_holiday_lighting = XMLHelper.create_elements_as_needed(doc, ['HPXML', 'Building', 'BuildingDetails', 'Lighting', 'extension', 'ExteriorHolidayLighting'])
4522
4620
  if not @holiday_kwh_per_day.nil?
4523
4621
  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))
4622
+ XMLHelper.add_element(holiday_lighting_load, 'Units', 'kWh/day', :string)
4623
+ XMLHelper.add_element(holiday_lighting_load, 'Value', @holiday_kwh_per_day, :float, @holiday_kwh_per_day_isdefaulted)
4526
4624
  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?
4625
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodBeginMonth', @holiday_period_begin_month, :integer, @holiday_period_begin_month_isdefaulted) unless @holiday_period_begin_month.nil?
4626
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodBeginDayOfMonth', @holiday_period_begin_day, :integer, @holiday_period_begin_day_isdefaulted) unless @holiday_period_begin_day.nil?
4627
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodEndMonth', @holiday_period_end_month, :integer, @holiday_period_end_month_isdefaulted) unless @holiday_period_end_month.nil?
4628
+ XMLHelper.add_element(exterior_holiday_lighting, 'PeriodEndDayOfMonth', @holiday_period_end_day, :integer, @holiday_period_end_day_isdefaulted) unless @holiday_period_end_day.nil?
4629
+ XMLHelper.add_element(exterior_holiday_lighting, 'WeekdayScheduleFractions', @holiday_weekday_fractions, :string, @holiday_weekday_fractions_isdefaulted) unless @holiday_weekday_fractions.nil?
4630
+ XMLHelper.add_element(exterior_holiday_lighting, 'WeekendScheduleFractions', @holiday_weekend_fractions, :string, @holiday_weekend_fractions_isdefaulted) unless @holiday_weekend_fractions.nil?
4533
4631
  end
4534
4632
  end
4535
4633
 
@@ -4539,27 +4637,27 @@ class HPXML < Object
4539
4637
  lighting = XMLHelper.get_element(hpxml, 'Building/BuildingDetails/Lighting')
4540
4638
  return if lighting.nil?
4541
4639
 
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')
4640
+ @interior_usage_multiplier, @interior_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/InteriorUsageMultiplier', :float)
4641
+ @garage_usage_multiplier, @garage_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/GarageUsageMultiplier', :float)
4642
+ @exterior_usage_multiplier, @exterior_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorUsageMultiplier', :float)
4643
+ @interior_weekday_fractions, @interior_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/InteriorWeekdayScheduleFractions', :string)
4644
+ @interior_weekend_fractions, @interior_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/InteriorWeekendScheduleFractions', :string)
4645
+ @interior_monthly_multipliers, @interior_monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/InteriorMonthlyScheduleMultipliers', :string)
4646
+ @garage_weekday_fractions, @garage_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/GarageWeekdayScheduleFractions', :string)
4647
+ @garage_weekend_fractions, @garage_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/GarageWeekendScheduleFractions', :string)
4648
+ @garage_monthly_multipliers, @garage_monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/GarageMonthlyScheduleMultipliers', :string)
4649
+ @exterior_weekday_fractions, @exterior_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorWeekdayScheduleFractions', :string)
4650
+ @exterior_weekend_fractions, @exterior_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorWeekendScheduleFractions', :string)
4651
+ @exterior_monthly_multipliers, @exterior_monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorMonthlyScheduleMultipliers', :string)
4554
4652
  if not XMLHelper.get_element(hpxml, 'Building/BuildingDetails/Lighting/extension/ExteriorHolidayLighting').nil?
4555
4653
  @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')
4654
+ @holiday_kwh_per_day, @holiday_kwh_per_day_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorHolidayLighting/Load[Units="kWh/day"]/Value', :float)
4655
+ @holiday_period_begin_month, @holiday_period_begin_month_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorHolidayLighting/PeriodBeginMonth', :integer)
4656
+ @holiday_period_begin_day, @holiday_period_begin_day_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorHolidayLighting/PeriodBeginDayOfMonth', :integer)
4657
+ @holiday_period_end_month, @holiday_period_end_month_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorHolidayLighting/PeriodEndMonth', :integer)
4658
+ @holiday_period_end_day, @holiday_period_end_day_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorHolidayLighting/PeriodEndDayOfMonth', :integer)
4659
+ @holiday_weekday_fractions, @holiday_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorHolidayLighting/WeekdayScheduleFractions', :string)
4660
+ @holiday_weekend_fractions, @holiday_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(lighting, 'extension/ExteriorHolidayLighting/WeekendScheduleFractions', :string)
4563
4661
  else
4564
4662
  @holiday_exists = false
4565
4663
  end
@@ -4602,16 +4700,16 @@ class HPXML < Object
4602
4700
  XMLHelper.add_attribute(sys_id, 'id', @id)
4603
4701
  if not @efficiency.nil?
4604
4702
  airflow = XMLHelper.add_element(ceiling_fan, 'Airflow')
4605
- XMLHelper.add_element(airflow, 'FanSpeed', 'medium')
4606
- XMLHelper.add_element(airflow, 'Efficiency', to_float(@efficiency))
4703
+ XMLHelper.add_element(airflow, 'FanSpeed', 'medium', :string)
4704
+ XMLHelper.add_element(airflow, 'Efficiency', @efficiency, :float, @efficiency_isdefaulted)
4607
4705
  end
4608
- XMLHelper.add_element(ceiling_fan, 'Quantity', to_integer(@quantity)) unless @quantity.nil?
4706
+ XMLHelper.add_element(ceiling_fan, 'Quantity', @quantity, :integer, @quantity_isdefaulted) unless @quantity.nil?
4609
4707
  end
4610
4708
 
4611
4709
  def from_oga(ceiling_fan)
4612
4710
  @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'))
4711
+ @efficiency, @efficiency_isdefaulted = XMLHelper.get_value_and_defaulted(ceiling_fan, "Airflow[FanSpeed='medium']/Efficiency", :float)
4712
+ @quantity, @quantity_isdefaulted = XMLHelper.get_value_and_defaulted(ceiling_fan, 'Quantity', :integer)
4615
4713
  end
4616
4714
  end
4617
4715
 
@@ -4662,12 +4760,12 @@ class HPXML < Object
4662
4760
  end
4663
4761
  if not @pump_kwh_per_year.nil?
4664
4762
  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?
4763
+ XMLHelper.add_element(load, 'Units', UnitsKwhPerYear, :string)
4764
+ XMLHelper.add_element(load, 'Value', @pump_kwh_per_year, :float, @pump_kwh_per_year_isdefaulted)
4765
+ XMLHelper.add_extension(pool_pump, 'UsageMultiplier', @pump_usage_multiplier, :float, @pump_usage_multiplier_isdefaulted) unless @pump_usage_multiplier.nil?
4766
+ XMLHelper.add_extension(pool_pump, 'WeekdayScheduleFractions', @pump_weekday_fractions, :string, @pump_weekday_fractions_isdefaulted) unless @pump_weekday_fractions.nil?
4767
+ XMLHelper.add_extension(pool_pump, 'WeekendScheduleFractions', @pump_weekend_fractions, :string, @pump_weekend_fractions_isdefaulted) unless @pump_weekend_fractions.nil?
4768
+ XMLHelper.add_extension(pool_pump, 'MonthlyScheduleMultipliers', @pump_monthly_multipliers, :string, @pump_monthly_multipliers_isdefaulted) unless @pump_monthly_multipliers.nil?
4671
4769
  end
4672
4770
  if not @heater_type.nil?
4673
4771
  heater = XMLHelper.add_element(pool, 'Heater')
@@ -4677,16 +4775,16 @@ class HPXML < Object
4677
4775
  else
4678
4776
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Heater')
4679
4777
  end
4680
- XMLHelper.add_element(heater, 'Type', @heater_type)
4778
+ XMLHelper.add_element(heater, 'Type', @heater_type, :string)
4681
4779
  if (not @heater_load_units.nil?) && (not @heater_load_value.nil?)
4682
4780
  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))
4781
+ XMLHelper.add_element(load, 'Units', @heater_load_units, :string)
4782
+ XMLHelper.add_element(load, 'Value', @heater_load_value, :float, @heater_load_value_isdefaulted)
4685
4783
  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?
4784
+ XMLHelper.add_extension(heater, 'UsageMultiplier', @heater_usage_multiplier, :float, @heater_usage_multiplier_isdefaulted) unless @heater_usage_multiplier.nil?
4785
+ XMLHelper.add_extension(heater, 'WeekdayScheduleFractions', @heater_weekday_fractions, :string, @heater_weekday_fractions_isdefaulted) unless @heater_weekday_fractions.nil?
4786
+ XMLHelper.add_extension(heater, 'WeekendScheduleFractions', @heater_weekend_fractions, :string, @heater_weekend_fractions_isdefaulted) unless @heater_weekend_fractions.nil?
4787
+ XMLHelper.add_extension(heater, 'MonthlyScheduleMultipliers', @heater_monthly_multipliers, :string, @heater_monthly_multipliers_isdefaulted) unless @heater_monthly_multipliers.nil?
4690
4788
  end
4691
4789
  end
4692
4790
 
@@ -4694,21 +4792,21 @@ class HPXML < Object
4694
4792
  @id = HPXML::get_id(pool)
4695
4793
  pool_pump = XMLHelper.get_element(pool, 'PoolPumps/PoolPump')
4696
4794
  @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')
4795
+ @pump_kwh_per_year, @pump_kwh_per_year_isdefaulted = XMLHelper.get_value_and_defaulted(pool_pump, "Load[Units='#{UnitsKwhPerYear}']/Value", :float)
4796
+ @pump_usage_multiplier, @pump_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(pool_pump, 'extension/UsageMultiplier', :float)
4797
+ @pump_weekday_fractions, @pump_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(pool_pump, 'extension/WeekdayScheduleFractions', :string)
4798
+ @pump_weekend_fractions, @pump_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(pool_pump, 'extension/WeekendScheduleFractions', :string)
4799
+ @pump_monthly_multipliers, @pump_monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(pool_pump, 'extension/MonthlyScheduleMultipliers', :string)
4702
4800
  heater = XMLHelper.get_element(pool, 'Heater')
4703
4801
  if not heater.nil?
4704
4802
  @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')
4803
+ @heater_type = XMLHelper.get_value(heater, 'Type', :string)
4804
+ @heater_load_units = XMLHelper.get_value(heater, 'Load/Units', :string)
4805
+ @heater_load_value, @heater_load_value_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'Load/Value', :float)
4806
+ @heater_usage_multiplier, @heater_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/UsageMultiplier', :float)
4807
+ @heater_weekday_fractions, @heater_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/WeekdayScheduleFractions', :string)
4808
+ @heater_weekend_fractions, @heater_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/WeekendScheduleFractions', :string)
4809
+ @heater_monthly_multipliers, @heater_monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/MonthlyScheduleMultipliers', :string)
4712
4810
  end
4713
4811
  end
4714
4812
  end
@@ -4760,12 +4858,12 @@ class HPXML < Object
4760
4858
  end
4761
4859
  if not @pump_kwh_per_year.nil?
4762
4860
  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?
4861
+ XMLHelper.add_element(load, 'Units', UnitsKwhPerYear, :string)
4862
+ XMLHelper.add_element(load, 'Value', @pump_kwh_per_year, :float, @pump_kwh_per_year_isdefaulted)
4863
+ XMLHelper.add_extension(hot_tub_pump, 'UsageMultiplier', @pump_usage_multiplier, :float, @pump_usage_multiplier_isdefaulted) unless @pump_usage_multiplier.nil?
4864
+ XMLHelper.add_extension(hot_tub_pump, 'WeekdayScheduleFractions', @pump_weekday_fractions, :string, @pump_weekday_fractions_isdefaulted) unless @pump_weekday_fractions.nil?
4865
+ XMLHelper.add_extension(hot_tub_pump, 'WeekendScheduleFractions', @pump_weekend_fractions, :string, @pump_weekend_fractions_isdefaulted) unless @pump_weekend_fractions.nil?
4866
+ XMLHelper.add_extension(hot_tub_pump, 'MonthlyScheduleMultipliers', @pump_monthly_multipliers, :string, @pump_monthly_multipliers_isdefaulted) unless @pump_monthly_multipliers.nil?
4769
4867
  end
4770
4868
  if not @heater_type.nil?
4771
4869
  heater = XMLHelper.add_element(hot_tub, 'Heater')
@@ -4775,16 +4873,16 @@ class HPXML < Object
4775
4873
  else
4776
4874
  XMLHelper.add_attribute(sys_id, 'id', @id + 'Heater')
4777
4875
  end
4778
- XMLHelper.add_element(heater, 'Type', @heater_type)
4876
+ XMLHelper.add_element(heater, 'Type', @heater_type, :string)
4779
4877
  if (not @heater_load_units.nil?) && (not @heater_load_value.nil?)
4780
4878
  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))
4879
+ XMLHelper.add_element(load, 'Units', @heater_load_units, :string)
4880
+ XMLHelper.add_element(load, 'Value', @heater_load_value, :float, @heater_load_value_isdefaulted)
4783
4881
  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?
4882
+ XMLHelper.add_extension(heater, 'UsageMultiplier', @heater_usage_multiplier, :float, @heater_usage_multiplier_isdefaulted) unless @heater_usage_multiplier.nil?
4883
+ XMLHelper.add_extension(heater, 'WeekdayScheduleFractions', @heater_weekday_fractions, :string, @heater_weekday_fractions_isdefaulted) unless @heater_weekday_fractions.nil?
4884
+ XMLHelper.add_extension(heater, 'WeekendScheduleFractions', @heater_weekend_fractions, :string, @heater_weekend_fractions_isdefaulted) unless @heater_weekend_fractions.nil?
4885
+ XMLHelper.add_extension(heater, 'MonthlyScheduleMultipliers', @heater_monthly_multipliers, :string, @heater_monthly_multipliers_isdefaulted) unless @heater_monthly_multipliers.nil?
4788
4886
  end
4789
4887
  end
4790
4888
 
@@ -4792,21 +4890,21 @@ class HPXML < Object
4792
4890
  @id = HPXML::get_id(hot_tub)
4793
4891
  hot_tub_pump = XMLHelper.get_element(hot_tub, 'HotTubPumps/HotTubPump')
4794
4892
  @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')
4893
+ @pump_kwh_per_year, @pump_kwh_per_year_isdefaulted = XMLHelper.get_value_and_defaulted(hot_tub_pump, "Load[Units='#{UnitsKwhPerYear}']/Value", :float)
4894
+ @pump_usage_multiplier, @pump_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(hot_tub_pump, 'extension/UsageMultiplier', :float)
4895
+ @pump_weekday_fractions, @pump_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(hot_tub_pump, 'extension/WeekdayScheduleFractions', :string)
4896
+ @pump_weekend_fractions, @pump_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(hot_tub_pump, 'extension/WeekendScheduleFractions', :string)
4897
+ @pump_monthly_multipliers, @pump_monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(hot_tub_pump, 'extension/MonthlyScheduleMultipliers', :string)
4800
4898
  heater = XMLHelper.get_element(hot_tub, 'Heater')
4801
4899
  if not heater.nil?
4802
4900
  @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')
4901
+ @heater_type = XMLHelper.get_value(heater, 'Type', :string)
4902
+ @heater_load_units = XMLHelper.get_value(heater, 'Load/Units', :string)
4903
+ @heater_load_value, @heater_load_value_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'Load/Value', :float)
4904
+ @heater_usage_multiplier, @heater_usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/UsageMultiplier', :float)
4905
+ @heater_weekday_fractions, @heater_weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/WeekdayScheduleFractions', :string)
4906
+ @heater_weekend_fractions, @heater_weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/WeekendScheduleFractions', :string)
4907
+ @heater_monthly_multipliers, @heater_monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(heater, 'extension/MonthlyScheduleMultipliers', :string)
4810
4908
  end
4811
4909
  end
4812
4910
  end
@@ -4827,7 +4925,7 @@ class HPXML < Object
4827
4925
 
4828
4926
  class PlugLoad < BaseElement
4829
4927
  ATTRS = [:id, :plug_load_type, :kWh_per_year, :frac_sensible, :frac_latent, :usage_multiplier,
4830
- :weekday_fractions, :weekend_fractions, :monthly_multipliers, :location]
4928
+ :weekday_fractions, :weekend_fractions, :monthly_multipliers]
4831
4929
  attr_accessor(*ATTRS)
4832
4930
 
4833
4931
  def delete
@@ -4846,32 +4944,30 @@ class HPXML < Object
4846
4944
  plug_load = XMLHelper.add_element(misc_loads, 'PlugLoad')
4847
4945
  sys_id = XMLHelper.add_element(plug_load, 'SystemIdentifier')
4848
4946
  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?
4947
+ XMLHelper.add_element(plug_load, 'PlugLoadType', @plug_load_type, :string) unless @plug_load_type.nil?
4851
4948
  if not @kWh_per_year.nil?
4852
4949
  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))
4950
+ XMLHelper.add_element(load, 'Units', UnitsKwhPerYear, :string)
4951
+ XMLHelper.add_element(load, 'Value', @kWh_per_year, :float, @kWh_per_year_isdefaulted)
4855
4952
  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?
4953
+ XMLHelper.add_extension(plug_load, 'FracSensible', @frac_sensible, :float, @frac_sensible_isdefaulted) unless @frac_sensible.nil?
4954
+ XMLHelper.add_extension(plug_load, 'FracLatent', @frac_latent, :float, @frac_latent_isdefaulted) unless @frac_latent.nil?
4955
+ XMLHelper.add_extension(plug_load, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
4956
+ XMLHelper.add_extension(plug_load, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
4957
+ XMLHelper.add_extension(plug_load, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
4958
+ XMLHelper.add_extension(plug_load, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4862
4959
  end
4863
4960
 
4864
4961
  def from_oga(plug_load)
4865
4962
  @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')
4963
+ @plug_load_type = XMLHelper.get_value(plug_load, 'PlugLoadType', :string)
4964
+ @kWh_per_year, @kWh_per_year_isdefaulted = XMLHelper.get_value_and_defaulted(plug_load, "Load[Units='#{UnitsKwhPerYear}']/Value", :float)
4965
+ @frac_sensible, @frac_sensible_isdefaulted = XMLHelper.get_value_and_defaulted(plug_load, 'extension/FracSensible', :float)
4966
+ @frac_latent, @frac_latent_isdefaulted = XMLHelper.get_value_and_defaulted(plug_load, 'extension/FracLatent', :float)
4967
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(plug_load, 'extension/UsageMultiplier', :float)
4968
+ @weekday_fractions, @weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(plug_load, 'extension/WeekdayScheduleFractions', :string)
4969
+ @weekend_fractions, @weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(plug_load, 'extension/WeekendScheduleFractions', :string)
4970
+ @monthly_multipliers, @monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(plug_load, 'extension/MonthlyScheduleMultipliers', :string)
4875
4971
  end
4876
4972
  end
4877
4973
 
@@ -4891,7 +4987,7 @@ class HPXML < Object
4891
4987
 
4892
4988
  class FuelLoad < BaseElement
4893
4989
  ATTRS = [:id, :fuel_load_type, :fuel_type, :therm_per_year, :frac_sensible, :frac_latent, :usage_multiplier,
4894
- :weekday_fractions, :weekend_fractions, :monthly_multipliers, :location]
4990
+ :weekday_fractions, :weekend_fractions, :monthly_multipliers]
4895
4991
  attr_accessor(*ATTRS)
4896
4992
 
4897
4993
  def delete
@@ -4910,34 +5006,32 @@ class HPXML < Object
4910
5006
  fuel_load = XMLHelper.add_element(misc_loads, 'FuelLoad')
4911
5007
  sys_id = XMLHelper.add_element(fuel_load, 'SystemIdentifier')
4912
5008
  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?
5009
+ XMLHelper.add_element(fuel_load, 'FuelLoadType', @fuel_load_type, :string) unless @fuel_load_type.nil?
4915
5010
  if not @therm_per_year.nil?
4916
5011
  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))
5012
+ XMLHelper.add_element(load, 'Units', UnitsThermPerYear, :string)
5013
+ XMLHelper.add_element(load, 'Value', @therm_per_year, :float, @therm_per_year_isdefaulted)
4919
5014
  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?
5015
+ XMLHelper.add_element(fuel_load, 'FuelType', @fuel_type, :string) unless @fuel_type.nil?
5016
+ XMLHelper.add_extension(fuel_load, 'FracSensible', @frac_sensible, :float, @frac_sensible_isdefaulted) unless @frac_sensible.nil?
5017
+ XMLHelper.add_extension(fuel_load, 'FracLatent', @frac_latent, :float, @frac_latent_isdefaulted) unless @frac_latent.nil?
5018
+ XMLHelper.add_extension(fuel_load, 'UsageMultiplier', @usage_multiplier, :float, @usage_multiplier_isdefaulted) unless @usage_multiplier.nil?
5019
+ XMLHelper.add_extension(fuel_load, 'WeekdayScheduleFractions', @weekday_fractions, :string, @weekday_fractions_isdefaulted) unless @weekday_fractions.nil?
5020
+ XMLHelper.add_extension(fuel_load, 'WeekendScheduleFractions', @weekend_fractions, :string, @weekend_fractions_isdefaulted) unless @weekend_fractions.nil?
5021
+ XMLHelper.add_extension(fuel_load, 'MonthlyScheduleMultipliers', @monthly_multipliers, :string, @monthly_multipliers_isdefaulted) unless @monthly_multipliers.nil?
4927
5022
  end
4928
5023
 
4929
5024
  def from_oga(fuel_load)
4930
5025
  @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')
5026
+ @fuel_load_type = XMLHelper.get_value(fuel_load, 'FuelLoadType', :string)
5027
+ @therm_per_year, @therm_per_year_isdefaulted = XMLHelper.get_value_and_defaulted(fuel_load, "Load[Units='#{UnitsThermPerYear}']/Value", :float)
5028
+ @fuel_type = XMLHelper.get_value(fuel_load, 'FuelType', :string)
5029
+ @frac_sensible, @frac_sensible_isdefaulted = XMLHelper.get_value_and_defaulted(fuel_load, 'extension/FracSensible', :float)
5030
+ @frac_latent, @frac_latent_isdefaulted = XMLHelper.get_value_and_defaulted(fuel_load, 'extension/FracLatent', :float)
5031
+ @usage_multiplier, @usage_multiplier_isdefaulted = XMLHelper.get_value_and_defaulted(fuel_load, 'extension/UsageMultiplier', :float)
5032
+ @weekday_fractions, @weekday_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(fuel_load, 'extension/WeekdayScheduleFractions', :string)
5033
+ @weekend_fractions, @weekend_fractions_isdefaulted = XMLHelper.get_value_and_defaulted(fuel_load, 'extension/WeekendScheduleFractions', :string)
5034
+ @monthly_multipliers, @monthly_multipliers_isdefaulted = XMLHelper.get_value_and_defaulted(fuel_load, 'extension/MonthlyScheduleMultipliers', :string)
4941
5035
  end
4942
5036
  end
4943
5037
 
@@ -4985,11 +5079,13 @@ class HPXML < Object
4985
5079
 
4986
5080
  match = true
4987
5081
  surf.class::ATTRS.each do |attribute|
5082
+ next if attribute.to_s.end_with? '_isdefaulted'
4988
5083
  next if attrs_to_ignore.include? attribute
4989
5084
  next if (surf_type == :foundation_walls) && (attribute == :azimuth) # Azimuth of foundation walls is irrelevant
4990
5085
  next if surf.send(attribute) == surf2.send(attribute)
4991
5086
 
4992
5087
  match = false
5088
+ break
4993
5089
  end
4994
5090
  next unless match
4995
5091
 
@@ -5022,7 +5118,7 @@ class HPXML < Object
5022
5118
 
5023
5119
  def delete_tiny_surfaces()
5024
5120
  (@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)
5121
+ next if surface.area.nil? || (surface.area > 1.0)
5026
5122
 
5027
5123
  surface.delete
5028
5124
  end
@@ -5030,20 +5126,54 @@ class HPXML < Object
5030
5126
 
5031
5127
  def delete_adiabatic_subsurfaces()
5032
5128
  @doors.reverse_each do |door|
5129
+ next if door.wall.nil?
5033
5130
  next if door.wall.exterior_adjacent_to != HPXML::LocationOtherHousingUnit
5034
5131
 
5035
5132
  door.delete
5036
5133
  end
5037
5134
  @windows.reverse_each do |window|
5135
+ next if window.wall.nil?
5038
5136
  next if window.wall.exterior_adjacent_to != HPXML::LocationOtherHousingUnit
5039
5137
 
5040
5138
  window.delete
5041
5139
  end
5042
5140
  end
5043
5141
 
5142
+ def validate_against_schematron(schematron_validators: [])
5143
+ # ----------------------------- #
5144
+ # Perform Schematron validation #
5145
+ # ----------------------------- #
5146
+
5147
+ if not schematron_validators.empty?
5148
+ errors, warnings = Validator.run_validators(@doc, schematron_validators)
5149
+ else
5150
+ errors = []
5151
+ warnings = []
5152
+ end
5153
+
5154
+ errors.map! { |e| "#{@hpxml_path}: #{e}" }
5155
+ warnings.map! { |w| "#{@hpxml_path}: #{w}" }
5156
+
5157
+ return errors, warnings
5158
+ end
5159
+
5044
5160
  def check_for_errors()
5045
5161
  errors = []
5046
5162
 
5163
+ # ------------------------------- #
5164
+ # Check for errors within objects #
5165
+ # ------------------------------- #
5166
+
5167
+ # Ask objects to check for errors
5168
+ self.class::HPXML_ATTRS.each do |attribute|
5169
+ hpxml_obj = send(attribute)
5170
+ if not hpxml_obj.respond_to? :check_for_errors
5171
+ fail "Need to add 'check_for_errors' method to #{hpxml_obj.class} class."
5172
+ end
5173
+
5174
+ errors += hpxml_obj.check_for_errors
5175
+ end
5176
+
5047
5177
  # ------------------------------- #
5048
5178
  # Check for errors across objects #
5049
5179
  # ------------------------------- #
@@ -5110,26 +5240,28 @@ class HPXML < Object
5110
5240
  end
5111
5241
 
5112
5242
  # 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
5243
+ if not @building_construction.conditioned_floor_area.nil?
5244
+ air_distributions = @hvac_distributions.select { |dist| dist if [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeHydronicAndAir].include? dist.distribution_system_type }
5245
+ heating_dist = []
5246
+ cooling_dist = []
5247
+ air_distributions.each do |dist|
5248
+ heating_systems = dist.hvac_systems.select { |sys| sys if (sys.respond_to? :fraction_heat_load_served) && (sys.fraction_heat_load_served.to_f > 0) }
5249
+ cooling_systems = dist.hvac_systems.select { |sys| sys if (sys.respond_to? :fraction_cool_load_served) && (sys.fraction_cool_load_served.to_f > 0) }
5250
+ if heating_systems.size > 0
5251
+ heating_dist << dist
5252
+ end
5253
+ if cooling_systems.size > 0
5254
+ cooling_dist << dist
5255
+ end
5121
5256
  end
5122
- if cooling_systems.size > 0
5123
- cooling_dist << dist
5257
+ heating_total_dist_cfa_served = heating_dist.map { |htg_dist| htg_dist.conditioned_floor_area_served.to_f }.sum(0.0)
5258
+ cooling_total_dist_cfa_served = cooling_dist.map { |clg_dist| clg_dist.conditioned_floor_area_served.to_f }.sum(0.0)
5259
+ if (heating_total_dist_cfa_served > @building_construction.conditioned_floor_area)
5260
+ 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.'
5261
+ end
5262
+ if (cooling_total_dist_cfa_served > @building_construction.conditioned_floor_area)
5263
+ 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
5264
  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
5265
  end
5134
5266
 
5135
5267
  # Check for objects referencing SFA/MF spaces where the building type is not SFA/MF
@@ -5157,20 +5289,18 @@ class HPXML < Object
5157
5289
  end
5158
5290
  end
5159
5291
 
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."
5292
+ # Check for correct PrimaryIndicator values across all refrigerators
5293
+ if @refrigerators.size > 1
5294
+ primary_indicators = @refrigerators.select { |r| r.primary_indicator }.size
5295
+ if primary_indicators > 1
5296
+ errors << 'More than one refrigerator designated as the primary.'
5297
+ elsif primary_indicators == 0
5298
+ errors << 'Could not find a primary refrigerator.'
5169
5299
  end
5170
-
5171
- errors += hpxml_obj.check_for_errors
5172
5300
  end
5173
5301
 
5302
+ errors.map! { |e| "#{@hpxml_path}: #{e}" }
5303
+
5174
5304
  return errors
5175
5305
  end
5176
5306
 
@@ -5190,6 +5320,7 @@ class HPXML < Object
5190
5320
  # wall between living space and "other housing unit"
5191
5321
  return true
5192
5322
  end
5323
+
5193
5324
  return false
5194
5325
  end
5195
5326
 
@@ -5210,56 +5341,3 @@ class HPXML < Object
5210
5341
  return XMLHelper.get_attribute_value(element, 'idref')
5211
5342
  end
5212
5343
  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