lib/openstudio-standards/standards/Standards.ScheduleCompact.rb in openstudio-standards-0.1.15 vs lib/openstudio-standards/standards/Standards.ScheduleCompact.rb in openstudio-standards-0.2.0.rc1
- old
+ new
@@ -1,13 +1,14 @@
-# Reopen the OpenStudio class to add methods to apply standards to this object
-class OpenStudio::Model::ScheduleCompact
+class Standard
+ # @!group ScheduleCompact
+
# Returns the min and max value for this schedule.
#
# @author Andrew Parker, NREL.
# return [Hash] Hash has two keys, min and max.
- def annual_min_max_value
+ def schedule_compact_annual_min_max_value(schedule_compact)
vals = []
prev_str = ''
sch.extensibleGroups.each do |eg|
if prev_str.include?('until')
val = eg.getDouble(0)
@@ -21,10 +22,10 @@
end
end
# Error if no values were found
if vals.size.zero?
- OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.ScheduleCompact', "Could not find any value in #{name} when determining min and max.")
+ OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.ScheduleCompact', "Could not find any value in #{schedule_compact.name} when determining min and max.")
result = { 'min' => 999.9, 'max' => 999.9 }
return result
end
result = { 'min' => vals.min, 'max' => vals.max }