@@ -1106,7 +1106,7 @@ class EmissionsScenario < BaseElement
11061106 attr_accessor ( *ATTRS )
11071107
11081108 def delete
1109- @hpxml_object . emissions_scenarios . delete ( self )
1109+ @hpxml_object . header . emissions_scenarios . delete ( self )
11101110 end
11111111
11121112 def check_for_errors
@@ -1203,7 +1203,7 @@ class UtilityBillScenario < BaseElement
12031203 attr_accessor ( *ATTRS )
12041204
12051205 def delete
1206- @hpxml_object . utility_bill_scenarios . delete ( self )
1206+ @hpxml_object . header . utility_bill_scenarios . delete ( self )
12071207 end
12081208
12091209 def check_for_errors
@@ -1459,12 +1459,17 @@ def from_oga(hpxml)
14591459 end
14601460
14611461 class ClimateandRiskZones < BaseElement
1462- ATTRS = [ :iecc_year , :iecc_zone , :weather_station_id , :weather_station_name , :weather_station_wmo ,
1463- :weather_station_epw_filepath ]
1462+ def initialize ( hpxml_object , *args )
1463+ @climate_zone_ieccs = ClimateZoneIECCs . new ( hpxml_object )
1464+ super ( hpxml_object , *args )
1465+ end
1466+ ATTRS = [ :weather_station_id , :weather_station_name , :weather_station_wmo , :weather_station_epw_filepath ]
14641467 attr_accessor ( *ATTRS )
1468+ attr_reader ( :climate_zone_ieccs )
14651469
14661470 def check_for_errors
14671471 errors = [ ]
1472+ errors += @climate_zone_ieccs . check_for_errors
14681473 return errors
14691474 end
14701475
@@ -1473,11 +1478,7 @@ def to_oga(doc)
14731478
14741479 climate_and_risk_zones = XMLHelper . create_elements_as_needed ( doc , [ 'HPXML' , 'Building' , 'BuildingDetails' , 'ClimateandRiskZones' ] )
14751480
1476- if ( not @iecc_year . nil? ) && ( not @iecc_zone . nil? )
1477- climate_zone_iecc = XMLHelper . add_element ( climate_and_risk_zones , 'ClimateZoneIECC' )
1478- XMLHelper . add_element ( climate_zone_iecc , 'Year' , @iecc_year , :integer , @iecc_year_isdefaulted ) unless @iecc_year . nil?
1479- XMLHelper . add_element ( climate_zone_iecc , 'ClimateZone' , @iecc_zone , :string , @iecc_zone_isdefaulted ) unless @iecc_zone . nil?
1480- end
1481+ @climate_zone_ieccs . to_oga ( climate_and_risk_zones )
14811482
14821483 if not @weather_station_id . nil?
14831484 weather_station = XMLHelper . add_element ( climate_and_risk_zones , 'WeatherStation' )
@@ -1495,8 +1496,8 @@ def from_oga(hpxml)
14951496 climate_and_risk_zones = XMLHelper . get_element ( hpxml , 'Building/BuildingDetails/ClimateandRiskZones' )
14961497 return if climate_and_risk_zones . nil?
14971498
1498- @iecc_year = XMLHelper . get_value ( climate_and_risk_zones , 'ClimateZoneIECC/Year' , :integer )
1499- @iecc_zone = XMLHelper . get_value ( climate_and_risk_zones , 'ClimateZoneIECC/ClimateZone' , :string )
1499+ @climate_zone_ieccs . from_oga ( climate_and_risk_zones )
1500+
15001501 weather_station = XMLHelper . get_element ( climate_and_risk_zones , 'WeatherStation' )
15011502 if not weather_station . nil?
15021503 @weather_station_id = HPXML ::get_id ( weather_station )
@@ -1507,6 +1508,47 @@ def from_oga(hpxml)
15071508 end
15081509 end
15091510
1511+ class ClimateZoneIECCs < BaseArrayElement
1512+ def add ( **kwargs )
1513+ self << ClimateZoneIECC . new ( @hpxml_object , **kwargs )
1514+ end
1515+
1516+ def from_oga ( climate_and_risk_zones )
1517+ return if climate_and_risk_zones . nil?
1518+
1519+ XMLHelper . get_elements ( climate_and_risk_zones , 'ClimateZoneIECC' ) . each do |climate_zone_iecc |
1520+ self << ClimateZoneIECC . new ( @hpxml_object , climate_zone_iecc )
1521+ end
1522+ end
1523+ end
1524+
1525+ class ClimateZoneIECC < BaseElement
1526+ ATTRS = [ :year , :zone ]
1527+ attr_accessor ( *ATTRS )
1528+
1529+ def delete
1530+ @hpxml_object . climate_and_risk_zones . climate_zone_ieccs . delete ( self )
1531+ end
1532+
1533+ def check_for_errors
1534+ errors = [ ]
1535+ return errors
1536+ end
1537+
1538+ def to_oga ( climate_and_risk_zones )
1539+ climate_zone_iecc = XMLHelper . add_element ( climate_and_risk_zones , 'ClimateZoneIECC' )
1540+ XMLHelper . add_element ( climate_zone_iecc , 'Year' , @year , :integer , @year_isdefaulted ) unless @year . nil?
1541+ XMLHelper . add_element ( climate_zone_iecc , 'ClimateZone' , @zone , :string , @zone_isdefaulted ) unless @zone . nil?
1542+ end
1543+
1544+ def from_oga ( climate_zone_iecc )
1545+ return if climate_zone_iecc . nil?
1546+
1547+ @year = XMLHelper . get_value ( climate_zone_iecc , 'Year' , :integer )
1548+ @zone = XMLHelper . get_value ( climate_zone_iecc , 'ClimateZone' , :string )
1549+ end
1550+ end
1551+
15101552 class AirInfiltrationMeasurements < BaseArrayElement
15111553 def add ( **kwargs )
15121554 self << AirInfiltrationMeasurement . new ( @hpxml_object , **kwargs )
0 commit comments