@@ -5236,8 +5236,8 @@ class ClothesWasher < BaseElement
52365236 ATTRS = [ :id , :location , :modified_energy_factor , :integrated_modified_energy_factor ,
52375237 :rated_annual_kwh , :label_electric_rate , :label_gas_rate , :label_annual_gas_cost ,
52385238 :capacity , :label_usage , :usage_multiplier , :is_shared_appliance , :number_of_units ,
5239- :number_of_units_served , :water_heating_system_idref , :weekday_fractions ,
5240- :weekend_fractions , :monthly_multipliers ]
5239+ :number_of_units_served , :water_heating_system_idref , :hot_water_distribution_idref ,
5240+ :weekday_fractions , : weekend_fractions, :monthly_multipliers ]
52415241
52425242 attr_accessor ( *ATTRS )
52435243
@@ -5252,13 +5252,25 @@ def water_heating_system
52525252 fail "Attached water heating system '#{ @water_heating_system_idref } ' not found for clothes washer '#{ @id } '."
52535253 end
52545254
5255+ def hot_water_distribution
5256+ return if @hot_water_distribution_idref . nil?
5257+
5258+ @hpxml_object . hot_water_distributions . each do |hot_water_distribution |
5259+ next unless hot_water_distribution . id == @hot_water_distribution_idref
5260+
5261+ return hot_water_distribution
5262+ end
5263+ fail "Attached hot water distribution '#{ @hot_water_distribution_idref } ' not found for clothes washer '#{ @id } '."
5264+ end
5265+
52555266 def delete
52565267 @hpxml_object . clothes_washers . delete ( self )
52575268 end
52585269
52595270 def check_for_errors
52605271 errors = [ ]
52615272 begin ; water_heating_system ; rescue StandardError => e ; errors << e . message ; end
5273+ begin ; hot_water_distribution ; rescue StandardError => e ; errors << e . message ; end
52625274 return errors
52635275 end
52645276
@@ -5275,6 +5287,9 @@ def to_oga(doc)
52755287 if not @water_heating_system_idref . nil?
52765288 attached_water_heater = XMLHelper . add_element ( clothes_washer , 'AttachedToWaterHeatingSystem' )
52775289 XMLHelper . add_attribute ( attached_water_heater , 'idref' , @water_heating_system_idref )
5290+ elsif not @hot_water_distribution_idref . nil?
5291+ attached_hot_water_dist = XMLHelper . add_element ( clothes_washer , 'AttachedToHotWaterDistribution' )
5292+ XMLHelper . add_attribute ( attached_hot_water_dist , 'idref' , @hot_water_distribution_idref )
52785293 end
52795294 XMLHelper . add_element ( clothes_washer , 'Location' , @location , :string , @location_isdefaulted ) unless @location . nil?
52805295 XMLHelper . add_element ( clothes_washer , 'ModifiedEnergyFactor' , @modified_energy_factor , :float ) unless @modified_energy_factor . nil?
@@ -5299,6 +5314,7 @@ def from_oga(clothes_washer)
52995314 @is_shared_appliance = XMLHelper . get_value ( clothes_washer , 'IsSharedAppliance' , :boolean )
53005315 @number_of_units_served = XMLHelper . get_value ( clothes_washer , 'NumberofUnitsServed' , :integer )
53015316 @water_heating_system_idref = HPXML ::get_idref ( XMLHelper . get_element ( clothes_washer , 'AttachedToWaterHeatingSystem' ) )
5317+ @hot_water_distribution_idref = HPXML ::get_idref ( XMLHelper . get_element ( clothes_washer , 'AttachedToHotWaterDistribution' ) )
53025318 @location = XMLHelper . get_value ( clothes_washer , 'Location' , :string )
53035319 @modified_energy_factor = XMLHelper . get_value ( clothes_washer , 'ModifiedEnergyFactor' , :float )
53045320 @integrated_modified_energy_factor = XMLHelper . get_value ( clothes_washer , 'IntegratedModifiedEnergyFactor' , :float )
@@ -5405,9 +5421,9 @@ def from_oga(hpxml)
54055421
54065422 class Dishwasher < BaseElement
54075423 ATTRS = [ :id , :location , :energy_factor , :rated_annual_kwh , :place_setting_capacity ,
5408- :label_electric_rate , :label_gas_rate , :label_annual_gas_cost ,
5409- :label_usage , : usage_multiplier, :is_shared_appliance , :water_heating_system_idref ,
5410- :weekday_fractions , :weekend_fractions , :monthly_multipliers ]
5424+ :label_electric_rate , :label_gas_rate , :label_annual_gas_cost , :label_usage ,
5425+ :usage_multiplier , :is_shared_appliance , :water_heating_system_idref ,
5426+ :hot_water_distribution_idref , : weekday_fractions, :weekend_fractions , :monthly_multipliers ]
54115427 attr_accessor ( *ATTRS )
54125428
54135429 def water_heating_system
@@ -5421,13 +5437,25 @@ def water_heating_system
54215437 fail "Attached water heating system '#{ @water_heating_system_idref } ' not found for dishwasher '#{ @id } '."
54225438 end
54235439
5440+ def hot_water_distribution
5441+ return if @hot_water_distribution_idref . nil?
5442+
5443+ @hpxml_object . hot_water_distributions . each do |hot_water_distribution |
5444+ next unless hot_water_distribution . id == @hot_water_distribution_idref
5445+
5446+ return hot_water_distribution
5447+ end
5448+ fail "Attached hot water distribution '#{ @hot_water_distribution_idref } ' not found for dishwasher '#{ @id } '."
5449+ end
5450+
54245451 def delete
54255452 @hpxml_object . dishwashers . delete ( self )
54265453 end
54275454
54285455 def check_for_errors
54295456 errors = [ ]
54305457 begin ; water_heating_system ; rescue StandardError => e ; errors << e . message ; end
5458+ begin ; hot_water_distribution ; rescue StandardError => e ; errors << e . message ; end
54315459 return errors
54325460 end
54335461
@@ -5442,6 +5470,9 @@ def to_oga(doc)
54425470 if not @water_heating_system_idref . nil?
54435471 attached_water_heater = XMLHelper . add_element ( dishwasher , 'AttachedToWaterHeatingSystem' )
54445472 XMLHelper . add_attribute ( attached_water_heater , 'idref' , @water_heating_system_idref )
5473+ elsif not @hot_water_distribution_idref . nil?
5474+ attached_hot_water_dist = XMLHelper . add_element ( dishwasher , 'AttachedToHotWaterDistribution' )
5475+ XMLHelper . add_attribute ( attached_hot_water_dist , 'idref' , @hot_water_distribution_idref )
54455476 end
54465477 XMLHelper . add_element ( dishwasher , 'Location' , @location , :string , @location_isdefaulted ) unless @location . nil?
54475478 XMLHelper . add_element ( dishwasher , 'RatedAnnualkWh' , @rated_annual_kwh , :float , @rated_annual_kwh_isdefaulted ) unless @rated_annual_kwh . nil?
@@ -5463,6 +5494,7 @@ def from_oga(dishwasher)
54635494 @id = HPXML ::get_id ( dishwasher )
54645495 @is_shared_appliance = XMLHelper . get_value ( dishwasher , 'IsSharedAppliance' , :boolean )
54655496 @water_heating_system_idref = HPXML ::get_idref ( XMLHelper . get_element ( dishwasher , 'AttachedToWaterHeatingSystem' ) )
5497+ @hot_water_distribution_idref = HPXML ::get_idref ( XMLHelper . get_element ( dishwasher , 'AttachedToHotWaterDistribution' ) )
54665498 @location = XMLHelper . get_value ( dishwasher , 'Location' , :string )
54675499 @rated_annual_kwh = XMLHelper . get_value ( dishwasher , 'RatedAnnualkWh' , :float )
54685500 @energy_factor = XMLHelper . get_value ( dishwasher , 'EnergyFactor' , :float )
0 commit comments