Measures/m_5_example_5_computed_schedule/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
    tz_handles = OpenStudio::StringVector.new
    tz_display_names = OpenStudio::StringVector.new
    tz_hash = {}
    model.getThermalZones.each do |tz|
      tz_hash[tz.name.to_s] = tz
    end
    tz_hash.sort.map do |tz_name, tz|
      if tz.thermostatSetpointDualSetpoint.is_initialized
        tstat = tz.thermostatSetpointDualSetpoint.get
        if tstat.heatingSetpointTemperatureSchedule.is_initialized || tstat.coolingSetpointTemperatureSchedule.is_initialized
          tz_handles << tz.handle.to_s
          tz_display_names << tz_name
        end
      end
    end
    building = model.getBuilding
    tz_handles << building.handle.to_s
    tz_display_names << '*All Conditioned Thermal Zones*'    
    zones = OpenStudio::Measure::OSArgument.makeChoiceArgument('zones', tz_handles, tz_display_names, true)
    zones.setDisplayName('Choose Conditioned Thermal Zone(s) to apply EMS Program T-stat changes to.')
    zones.setDefaultValue('*All Conditioned Thermal Zones*') 
    args << zones
    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 tz_handles = OpenStudio :: StringVector . new tz_display_names = OpenStudio :: StringVector . new tz_hash = { } model . getThermalZones . each do | tz | tz_hash [ tz . name . to_s ] = tz end tz_hash . sort . map do | tz_name , tz | if tz . thermostatSetpointDualSetpoint . is_initialized tstat = tz . thermostatSetpointDualSetpoint . get if tstat . heatingSetpointTemperatureSchedule . is_initialized || tstat . coolingSetpointTemperatureSchedule . is_initialized tz_handles << tz . handle . to_s tz_display_names << tz_name end end end building = model . getBuilding tz_handles << building . handle . to_s tz_display_names << '*All Conditioned Thermal Zones*' zones = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'zones' , tz_handles , tz_display_names , true ) zones . setDisplayName ( 'Choose Conditioned Thermal Zone(s) to apply EMS Program T-stat changes to.' ) zones . setDefaultValue ( '*All Conditioned Thermal Zones*' ) args << zones 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 # 1) make an argument for <conditioned> thermal zone(s) to apply EMS t-stat schedule changes to  # put thermal zone names into a hash # looping through a sorted hash of zones # add building to string vector with zones # if no zone is chosen this will run on all zones # 2) make a choice argument for setting EMS InternalVariableAvailabilityDictionaryReporting value # 3) make a choice argument for setting EMSRuntimeLanguageDebugOutputLevel value # 4) make a choice argument for setting EMS ActuatorAvailabilityDictionaryReportingvalue
model
<not_specific>