Measures/m_2_example_2_traditional_setpoint_and_availability_managers/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
    qualified_airloop_handles = OpenStudio::StringVector.new
    qualified_airloop_display_names = OpenStudio::StringVector.new
    airloop_hash = {}
    model.getAirLoopHVACs.each do |airloop|
      airloop_hash[airloop.name.to_s] = airloop
    end
    airloop_hash.sort.map do |airloop_name, airloop|
      has_vfd_fan = false
      airloop.supplyComponents.each do |supply_comp|
        if supply_comp.to_FanVariableVolume.is_initialized
          has_vfd_fan = true
        end
      end
      if has_vfd_fan == true 
        qualified_airloop_handles << airloop.handle.to_s
        qualified_airloop_display_names << airloop_name 
      end
    end  
    airloop = OpenStudio::Measure::OSArgument.makeChoiceArgument('airloop', qualified_airloop_handles, qualified_airloop_display_names, true)
    airloop.setDisplayName("Choose an Airloop to replicate EMS functions described in EMS Applications Guide, Example 8.2.")
    args << airloop  
	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
    internal_variable_availability_dictionary_reporting_choice = OpenStudio::StringVector.new
    internal_variable_availability_dictionary_reporting_choice << 'None'
    internal_variable_availability_dictionary_reporting_choice << 'NotByUniqueKeyNames'
    internal_variable_availability_dictionary_reporting_choice << 'Verbose'
    internal_variable_availability_dictionary_reporting = OpenStudio::Measure::OSArgument.makeChoiceArgument('internal_variable_availability_dictionary_reporting', internal_variable_availability_dictionary_reporting_choice, 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_output_level_choice = OpenStudio::StringVector.new
    ems_runtime_language_debug_output_level_choice << 'None'
    ems_runtime_language_debug_output_level_choice << 'ErrorsOnly'
    ems_runtime_language_debug_output_level_choice << 'Verbose'
    ems_runtime_language_debug_output_level = OpenStudio::Measure::OSArgument.makeChoiceArgument('ems_runtime_language_debug_output_level', ems_runtime_language_debug_output_level_choice, 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_availability_dictionary_reporting_choice = OpenStudio::StringVector.new
    actuator_availability_dictionary_reporting_choice << 'None'
    actuator_availability_dictionary_reporting_choice << 'NotByUniqueKeyNames'
    actuator_availability_dictionary_reporting_choice << 'Verbose'
    actuator_availability_dictionary_reporting = OpenStudio::Measure::OSArgument.makeChoiceArgument('actuator_availability_dictionary_reporting', actuator_availability_dictionary_reporting_choice, 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 qualified_airloop_handles = OpenStudio :: StringVector . new qualified_airloop_display_names = OpenStudio :: StringVector . new airloop_hash = { } model . getAirLoopHVACs . each do | airloop | airloop_hash [ airloop . name . to_s ] = airloop end airloop_hash . sort . map do | airloop_name , airloop | has_vfd_fan = false airloop . supplyComponents . each do | supply_comp | if supply_comp . to_FanVariableVolume . is_initialized has_vfd_fan = true end end if has_vfd_fan == true qualified_airloop_handles << airloop . handle . to_s qualified_airloop_display_names << airloop_name end end airloop = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'airloop' , qualified_airloop_handles , qualified_airloop_display_names , true ) airloop . setDisplayName ( "Choose an Airloop to replicate EMS functions described in EMS Applications Guide, Example 8.2." ) args << airloop 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 internal_variable_availability_dictionary_reporting_choice = OpenStudio :: StringVector . new internal_variable_availability_dictionary_reporting_choice << 'None' internal_variable_availability_dictionary_reporting_choice << 'NotByUniqueKeyNames' internal_variable_availability_dictionary_reporting_choice << 'Verbose' internal_variable_availability_dictionary_reporting = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'internal_variable_availability_dictionary_reporting' , internal_variable_availability_dictionary_reporting_choice , 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_output_level_choice = OpenStudio :: StringVector . new ems_runtime_language_debug_output_level_choice << 'None' ems_runtime_language_debug_output_level_choice << 'ErrorsOnly' ems_runtime_language_debug_output_level_choice << 'Verbose' ems_runtime_language_debug_output_level = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'ems_runtime_language_debug_output_level' , ems_runtime_language_debug_output_level_choice , 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_availability_dictionary_reporting_choice = OpenStudio :: StringVector . new actuator_availability_dictionary_reporting_choice << 'None' actuator_availability_dictionary_reporting_choice << 'NotByUniqueKeyNames' actuator_availability_dictionary_reporting_choice << 'Verbose' actuator_availability_dictionary_reporting = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'actuator_availability_dictionary_reporting' , actuator_availability_dictionary_reporting_choice , 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
# make a Choice List Argument for selecting the VAV airloophvac to demonstrate examnple 8.2 EnergyPlus EMS features against # put airloops into a hash # looping through a sorted hash of airloops # make an argument for airloop # Add a check box for specifying verbose info statements # make a choice argument for setting InternalVariableAvailabilityDictionaryReporting value # make a choice argument for setting EMSRuntimeLanguageDebugOutputLevel value # make a choice argument for setting ActuatorAvailabilityDictionaryReportingvalue
model
<not_specific>