Measures/m_8_example_8_system_sizing_with_discrete_package_sizes/measure.rb
# define the arguments that the user will input
define the arguments that the user will input
define the arguments that the user will input
def arguments(model)
    args = OpenStudio::Measure::OSArgumentVector.new
	verbose_info_statements = OpenStudio::Ruleset::OSArgument::makeBoolArgument("verbose_info_statements", false)
	verbose_info_statements.setDisplayName("Check to allow measure to generate verbose runner.registerInfo statements.")
	verbose_info_statements.setDefaultValue(false)
	args << verbose_info_statements
    airloop_handles = OpenStudio::StringVector.new
    airloop_display_names = OpenStudio::StringVector.new
    show_loop = false
    model.getAirLoopHVACs.each do |air_loop|
      if air_loop.designSupplyAirFlowRate.empty?
        supply_comps = air_loop.supplyComponents
        supply_comps.each do |supply_comp|
          if supply_comp.to_CoilCoolingDXSingleSpeed.is_initialized || supply_comp.to_CoilCoolingDXTwoSpeed.is_initialized || supply_comp.to_CoilCoolingDXVariableSpeed.is_initialized
            show_loop = true
          end      
        end 
      end 
      if show_loop == true
        airloop_handles << air_loop.handle.to_s
        airloop_display_names << air_loop.name.to_s
      end
    end    
    building = model.getBuilding
    if show_loop == true 
      airloop_handles << building.handle.to_s
      airloop_display_names << '*All Autosized AirLoops served by DX Cooling*'    
    end     
    air_loop_objects = OpenStudio::Ruleset::OSArgument::makeChoiceArgument("air_loop_objects", airloop_handles, airloop_display_names,true)
    air_loop_objects.setDisplayName("Choose an Air Loop to Alter.")
    air_loop_objects.setDefaultValue('*All Autosized AirLoops served by DX Cooling*') 
    args << air_loop_objects
    int_var_avail_dict_rep_chs = OpenStudio::StringVector.new
    int_var_avail_dict_rep_chs << 'None'
    int_var_avail_dict_rep_chs << 'NotByUniqueKeyNames'
    int_var_avail_dict_rep_chs << 'Verbose'
    internal_variable_availability_dictionary_reporting = OpenStudio::Measure::OSArgument.makeChoiceArgument('internal_variable_availability_dictionary_reporting', int_var_avail_dict_rep_chs, true)
    internal_variable_availability_dictionary_reporting.setDisplayName('Level of output reporting related to the EMS internal variables that are available.')
    internal_variable_availability_dictionary_reporting.setDefaultValue('None')
    args << internal_variable_availability_dictionary_reporting
    ems_runtime_language_debug_level_chs = OpenStudio::StringVector.new
    ems_runtime_language_debug_level_chs << 'None'
    ems_runtime_language_debug_level_chs << 'ErrorsOnly'
    ems_runtime_language_debug_level_chs << 'Verbose'
    ems_runtime_language_debug_output_level = OpenStudio::Measure::OSArgument.makeChoiceArgument('ems_runtime_language_debug_output_level', ems_runtime_language_debug_level_chs, true)
    ems_runtime_language_debug_output_level.setDisplayName('Level of output reporting related to the execution of EnergyPlus Runtime Language, written to .edd file.')
    ems_runtime_language_debug_output_level.setDefaultValue('None')
    args << ems_runtime_language_debug_output_level
    actuator_avail_dict_rep_chs = OpenStudio::StringVector.new
    actuator_avail_dict_rep_chs << 'None'
    actuator_avail_dict_rep_chs << 'NotByUniqueKeyNames'
    actuator_avail_dict_rep_chs << 'Verbose'
    actuator_availability_dictionary_reporting = OpenStudio::Measure::OSArgument.makeChoiceArgument('actuator_availability_dictionary_reporting', actuator_avail_dict_rep_chs, true)
    actuator_availability_dictionary_reporting.setDisplayName('Level of output reporting related to the EMS actuators that are available.')
    actuator_availability_dictionary_reporting.setDefaultValue('None')
    args << actuator_availability_dictionary_reporting
    return args
  end
def arguments ( model ) args = OpenStudio :: Measure :: OSArgumentVector . new verbose_info_statements = OpenStudio :: Ruleset :: OSArgument :: makeBoolArgument ( "verbose_info_statements" , false ) verbose_info_statements . setDisplayName ( "Check to allow measure to generate verbose runner.registerInfo statements." ) verbose_info_statements . setDefaultValue ( false ) args << verbose_info_statements airloop_handles = OpenStudio :: StringVector . new airloop_display_names = OpenStudio :: StringVector . new show_loop = false model . getAirLoopHVACs . each do | air_loop | if air_loop . designSupplyAirFlowRate . empty? supply_comps = air_loop . supplyComponents supply_comps . each do | supply_comp | if supply_comp . to_CoilCoolingDXSingleSpeed . is_initialized || supply_comp . to_CoilCoolingDXTwoSpeed . is_initialized || supply_comp . to_CoilCoolingDXVariableSpeed . is_initialized show_loop = true end end end if show_loop == true airloop_handles << air_loop . handle . to_s airloop_display_names << air_loop . name . to_s end end building = model . getBuilding if show_loop == true airloop_handles << building . handle . to_s airloop_display_names << '*All Autosized AirLoops served by DX Cooling*' end air_loop_objects = OpenStudio :: Ruleset :: OSArgument :: makeChoiceArgument ( "air_loop_objects" , airloop_handles , airloop_display_names , true ) air_loop_objects . setDisplayName ( "Choose an Air Loop to Alter." ) air_loop_objects . setDefaultValue ( '*All Autosized AirLoops served by DX Cooling*' ) args << air_loop_objects int_var_avail_dict_rep_chs = OpenStudio :: StringVector . new int_var_avail_dict_rep_chs << 'None' int_var_avail_dict_rep_chs << 'NotByUniqueKeyNames' int_var_avail_dict_rep_chs << 'Verbose' internal_variable_availability_dictionary_reporting = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'internal_variable_availability_dictionary_reporting' , int_var_avail_dict_rep_chs , true ) internal_variable_availability_dictionary_reporting . setDisplayName ( 'Level of output reporting related to the EMS internal variables that are available.' ) internal_variable_availability_dictionary_reporting . setDefaultValue ( 'None' ) args << internal_variable_availability_dictionary_reporting ems_runtime_language_debug_level_chs = OpenStudio :: StringVector . new ems_runtime_language_debug_level_chs << 'None' ems_runtime_language_debug_level_chs << 'ErrorsOnly' ems_runtime_language_debug_level_chs << 'Verbose' ems_runtime_language_debug_output_level = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'ems_runtime_language_debug_output_level' , ems_runtime_language_debug_level_chs , true ) ems_runtime_language_debug_output_level . setDisplayName ( 'Level of output reporting related to the execution of EnergyPlus Runtime Language, written to .edd file.' ) ems_runtime_language_debug_output_level . setDefaultValue ( 'None' ) args << ems_runtime_language_debug_output_level actuator_avail_dict_rep_chs = OpenStudio :: StringVector . new actuator_avail_dict_rep_chs << 'None' actuator_avail_dict_rep_chs << 'NotByUniqueKeyNames' actuator_avail_dict_rep_chs << 'Verbose' actuator_availability_dictionary_reporting = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'actuator_availability_dictionary_reporting' , actuator_avail_dict_rep_chs , true ) actuator_availability_dictionary_reporting . setDisplayName ( 'Level of output reporting related to the EMS actuators that are available.' ) actuator_availability_dictionary_reporting . setDefaultValue ( 'None' ) args << actuator_availability_dictionary_reporting return args end
define the arguments that the user will input
define the arguments that the user will input
# Add a check box for specifying verbose info statements # Make arrays of qualified air loops names and handles # end loop through supply components #if loop as air_loop_air_loop_object of correct type then add to hash. # Make an argument for air loops #if no loop is chosen this will run on all air loops # make a choice argument for setting EMS InternalVariableAvailabilityDictionaryReporting value # make a choice argument for setting EMSRuntimeLanguageDebugOutputLevel value # make a choice argument for setting EMS ActuatorAvailabilityDictionaryReportingvalue
model
<not_specific>