lib/measures/CoilHeatingWaterMultiplier/measure.rb in openstudio-calibration-0.9.0 vs lib/measures/CoilHeatingWaterMultiplier/measure.rb in openstudio-calibration-0.10.0

- old
+ new

@@ -55,10 +55,11 @@ loop_args_hash.sort.map do |_key, value| show_loop = false components = value.supplyComponents components.each do |component| next if component.to_CoilHeatingWater.empty? + show_loop = true loop_handles << component.handle.to_s loop_display_names << component.name.to_s end @@ -161,33 +162,30 @@ altered_coilefficiency = [] # loop through coils coils.each do |coil| altered_coil = false # coil_capacity_multiplier - if coil_capacity_multiplier != 1.0 - if coil.ratedCapacity.is_initialized - runner.registerInfo("Applying ratedCapacity #{coil_capacity_multiplier}x multiplier to #{coil.name.get}.") - coil.setRatedCapacity(coil.ratedCapacity.get * coil_capacity_multiplier) - altered_capacity << coil.handle.to_s - altered_coil = true - end + if coil_capacity_multiplier != 1.0 && coil.ratedCapacity.is_initialized + runner.registerInfo("Applying ratedCapacity #{coil_capacity_multiplier}x multiplier to #{coil.name.get}.") + coil.setRatedCapacity(coil.ratedCapacity.get * coil_capacity_multiplier) + altered_capacity << coil.handle.to_s + altered_coil = true end # modify ua_factor - if ua_factor != 1.0 - if coil.uFactorTimesAreaValue.is_initialized - runner.registerInfo("Applying uFactorTimesAreaValue #{ua_factor}x multiplier to #{coil.name.get}.") - coil.setUFactorTimesAreaValue(coil.uFactorTimesAreaValue.get * ua_factor) - altered_coilefficiency << coil.handle.to_s - altered_coil = true - end + if ua_factor != 1.0 && coil.uFactorTimesAreaValue.is_initialized + runner.registerInfo("Applying uFactorTimesAreaValue #{ua_factor}x multiplier to #{coil.name.get}.") + coil.setUFactorTimesAreaValue(coil.uFactorTimesAreaValue.get * ua_factor) + altered_coilefficiency << coil.handle.to_s + altered_coil = true end next unless altered_coil + altered_coils << coil.handle.to_s change_name(coil, ua_factor, coil_capacity_multiplier) runner.registerInfo("coil name changed to: #{coil.name.get}") - end # end coil loop + end # na if nothing in model to look at if altered_coils.empty? runner.registerAsNotApplicable('No Coils were altered in the model') return true