diff --git a/BuildResidentialHPXML/measure.rb b/BuildResidentialHPXML/measure.rb index 96d11d1e4f..60366cbde9 100644 --- a/BuildResidentialHPXML/measure.rb +++ b/BuildResidentialHPXML/measure.rb @@ -5133,40 +5133,6 @@ def makeArgument(name:, return args end - # TODO - def convertArgumentValues(arguments_model, args) - args.each do |name, value| - if value == Constants::Auto - args.delete(name) - next - end - - arg = arguments_model.find { |a| name == a.name.to_sym } - type = arg.type - - if type == 'Choice'.to_OSArgumentType - choices = arg.choiceValues - if choices.include?(Constants::Auto) - if value.downcase.to_s == 'true' - args[name] = true - elsif value.downcase.to_s == 'false' - args[name] = false - end - end - elsif type == 'String'.to_OSArgumentType - begin - args[name] = Integer(value) - rescue - begin - args[name] = Float(value) - rescue - end - end - end - end - return args - end - # TODO def defaultOptionalArgumentValues(args) # these were previously required arguments with default values set @@ -5187,9 +5153,17 @@ def defaultOptionalArgumentValues(args) args[:neighbor_left_distance] = 10.0 if args[:neighbor_left_distance].nil? args[:neighbor_right_distance] = 10.0 if args[:neighbor_right_distance].nil? args[:overhangs_front_depth] = 0 if args[:overhangs_front_depth].nil? + args[:overhangs_front_distance_to_top_of_window] = 0 if args[:overhangs_front_distance_to_top_of_window].nil? + args[:overhangs_front_distance_to_bottom_of_window] = 4 if args[:overhangs_front_distance_to_bottom_of_window].nil? args[:overhangs_back_depth] = 0 if args[:overhangs_back_depth].nil? + args[:overhangs_back_distance_to_top_of_window] = 0 if args[:overhangs_back_distance_to_top_of_window].nil? + args[:overhangs_back_distance_to_bottom_of_window] = 4 if args[:overhangs_back_distance_to_bottom_of_window].nil? args[:overhangs_left_depth] = 0 if args[:overhangs_left_depth].nil? + args[:overhangs_left_distance_to_top_of_window] = 0 if args[:overhangs_left_distance_to_top_of_window].nil? + args[:overhangs_left_distance_to_bottom_of_window] = 4 if args[:overhangs_left_distance_to_bottom_of_window].nil? args[:overhangs_right_depth] = 0 if args[:overhangs_right_depth].nil? + args[:overhangs_right_distance_to_top_of_window] = 0 if args[:overhangs_right_distance_to_top_of_window].nil? + args[:overhangs_right_distance_to_bottom_of_window] = 4 if args[:overhangs_right_distance_to_bottom_of_window].nil? args[:skylight_ufactor] = 0.33 if args[:skylight_ufactor].nil? args[:skylight_shgc] = 0.45 if args[:skylight_shgc].nil? args[:heating_system_2_type] = Constants::None if args[:heating_system_2_type].nil? diff --git a/BuildResidentialHPXML/measure.xml b/BuildResidentialHPXML/measure.xml index f79e411d00..64dec1ae6e 100644 --- a/BuildResidentialHPXML/measure.xml +++ b/BuildResidentialHPXML/measure.xml @@ -3,8 +3,8 @@ 3.1 build_residential_hpxml a13a8983-2b01-4930-8af2-42030b6e4233 - f395b10d-1835-4a9c-a974-84f065590fb2 - 2024-11-04T17:29:08Z + 1f5d4f80-84aa-4782-a014-a377a70ea0d2 + 2024-11-04T18:08:10Z 2C38F48B BuildResidentialHPXML HPXML Builder @@ -7628,7 +7628,7 @@ measure.rb rb script - 4DE55017 + 44646A2C constants.rb diff --git a/HPXMLtoOpenStudio/measure.xml b/HPXMLtoOpenStudio/measure.xml index 59e6f0a7bc..0c97b92072 100644 --- a/HPXMLtoOpenStudio/measure.xml +++ b/HPXMLtoOpenStudio/measure.xml @@ -3,8 +3,8 @@ 3.1 hpxm_lto_openstudio b1543b30-9465-45ff-ba04-1d1f85e763bc - 5ba92132-b948-4d22-ba2f-2b01e874ee21 - 2024-11-01T16:22:35Z + 67aeb4d4-239a-428c-b4d5-3f56a8404f3d + 2024-11-04T18:08:12Z D8922A73 HPXMLtoOpenStudio HPXML to OpenStudio Translator @@ -429,7 +429,7 @@ meta_measure.rb rb resource - F335EDC8 + B5131E34 minitest_helper.rb diff --git a/HPXMLtoOpenStudio/resources/meta_measure.rb b/HPXMLtoOpenStudio/resources/meta_measure.rb index 22462098e1..2bcff0faa7 100644 --- a/HPXMLtoOpenStudio/resources/meta_measure.rb +++ b/HPXMLtoOpenStudio/resources/meta_measure.rb @@ -624,3 +624,37 @@ def is_integer? return true end end + +# TODO +def convertArgumentValues(arguments_model, args, delete_auto = true) + args.each do |name, value| + if delete_auto && value == Constants::Auto + args.delete(name) + next + end + + arg = arguments_model.find { |a| name == a.name.to_sym } + type = arg.type + + if type == 'Choice'.to_OSArgumentType + choices = arg.choiceValues + if choices.include?(Constants::Auto) + if value.downcase.to_s == 'true' + args[name] = true + elsif value.downcase.to_s == 'false' + args[name] = false + end + end + elsif type == 'String'.to_OSArgumentType + begin + args[name] = Integer(value) + rescue + begin + args[name] = Float(value) + rescue + end + end + end + end + return args +end