Class: OutputTableSummaryReports

Inherits:
OpenStudio::Measure::ModelMeasure
  • Object
show all
Defined in:
lib/measures/output_table_summary_reports/measure.rb

Overview

start the measure

Instance Method Summary collapse

Instance Method Details

#arguments(model) ⇒ Object

define the arguments that the user will input



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/measures/output_table_summary_reports/measure.rb', line 30

def arguments(model)
  args = OpenStudio::Measure::OSArgumentVector.new

  # make choice argument for output summary value
  choices = OpenStudio::StringVector.new
  choices << 'AllSummary'
  choices << 'AllMonthly'
  choices << 'AllSummaryAndMonthly'
  choices << 'AllSummaryAndSizingPeriod'
  choices << 'AllSummaryMonthlyAndSizingPeriod'
  report = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('report', choices, true)
  report.setDisplayName('Output Table Summary Report')
  report.setDescription('AllSummary is added automatically by OpenStudio.')
  report.setDefaultValue('AllSummaryAndSizingPeriod')
  args << report

  return args
end

#descriptionObject

human readable description



20
21
22
# File 'lib/measures/output_table_summary_reports/measure.rb', line 20

def description
  return 'This Measure adds one of the predefined summary table outputs from EnergyPlus to the the Model, which can be helpful for requesting monthly or sizing reports.'
end

#modeler_descriptionObject

human readable description of modeling approach



25
26
27
# File 'lib/measures/output_table_summary_reports/measure.rb', line 25

def modeler_description
  return 'OpenStudio automatically adds the AllSummary report during translation to EnergyPlus. Choices include reports with the All* prefix and do not include individual predefined reports such as the "Annual Building Utility Performance Summary". Including the Component Load Summary reports (any with *AndSizingPeriod) will increase the simulation run time'
end

#nameObject

human readable name



14
15
16
17
# File 'lib/measures/output_table_summary_reports/measure.rb', line 14

def name
  # Measure name should be the title case of the class name.
  return 'Output Table Summary Reports'
end

#run(model, runner, user_arguments) ⇒ Object

define what happens when the measure is run



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/measures/output_table_summary_reports/measure.rb', line 50

def run(model, runner, user_arguments)
  super(model, runner, user_arguments)

  # use the built-in error checking
  if !runner.validateUserArguments(arguments(model), user_arguments)
    return false
  end

  # assign the user inputs to variables
  report = runner.getStringArgumentValue('report', user_arguments)

  # get object, which will instantiate it if it doesn't exist
  otsr = model.getOutputTableSummaryReports

  # report initial condition
  runner.registerInitialCondition("Output Table Summary Reports = #{otsr.summaryReports}")

  # add report to object
  otsr.addSummaryReport(report)

  # report final condition
  runner.registerFinalCondition("Output Table Summary Reports = #{otsr.summaryReports}")

  return true
end