openstudio-calibration 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/Gemfile +6 -0
  4. data/LICENSE.md +1 -1
  5. data/Rakefile +1 -1
  6. data/doc_templates/LICENSE.md +1 -1
  7. data/doc_templates/copyright_erb.txt +1 -1
  8. data/doc_templates/copyright_js.txt +1 -1
  9. data/doc_templates/copyright_ruby.txt +1 -1
  10. data/lib/measures/AddMonthlyJSONUtilityData/LICENSE.md +1 -1
  11. data/lib/measures/AddMonthlyJSONUtilityData/measure.rb +1 -1
  12. data/lib/measures/AddMonthlyJSONUtilityData/measure.xml +12 -11
  13. data/lib/measures/AddMonthlyUtilityData/LICENSE.md +1 -1
  14. data/lib/measures/AddMonthlyUtilityData/measure.rb +1 -1
  15. data/lib/measures/AddMonthlyUtilityData/measure.xml +13 -12
  16. data/lib/measures/CalibrationReports/LICENSE.md +1 -1
  17. data/lib/measures/CalibrationReports/README.md +2 -2
  18. data/lib/measures/CalibrationReports/measure.rb +1 -1
  19. data/lib/measures/CalibrationReports/measure.xml +12 -11
  20. data/lib/measures/CalibrationReportsEnhanced/LICENSE.md +1 -1
  21. data/lib/measures/CalibrationReportsEnhanced/measure.rb +2 -2
  22. data/lib/measures/CalibrationReportsEnhanced/measure.xml +18 -17
  23. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/LICENSE.md +1 -1
  24. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.rb +1 -1
  25. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.xml +14 -13
  26. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/LICENSE.md +1 -1
  27. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.rb +1 -1
  28. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.xml +14 -13
  29. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/LICENSE.md +1 -1
  30. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.rb +1 -1
  31. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.xml +14 -13
  32. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/LICENSE.md +1 -1
  33. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.rb +1 -1
  34. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.xml +14 -13
  35. data/lib/measures/CoilCoolingWaterMultiplier/LICENSE.md +1 -1
  36. data/lib/measures/CoilCoolingWaterMultiplier/measure.rb +1 -1
  37. data/lib/measures/CoilCoolingWaterMultiplier/measure.xml +14 -13
  38. data/lib/measures/CoilCoolingWaterPercentChange/LICENSE.md +1 -1
  39. data/lib/measures/CoilCoolingWaterPercentChange/measure.rb +1 -1
  40. data/lib/measures/CoilCoolingWaterPercentChange/measure.xml +14 -13
  41. data/lib/measures/CoilHeatingElectricMultiplier/LICENSE.md +1 -1
  42. data/lib/measures/CoilHeatingElectricMultiplier/measure.rb +1 -1
  43. data/lib/measures/CoilHeatingElectricMultiplier/measure.xml +14 -13
  44. data/lib/measures/CoilHeatingElectricPercentChange/LICENSE.md +1 -1
  45. data/lib/measures/CoilHeatingElectricPercentChange/measure.rb +1 -1
  46. data/lib/measures/CoilHeatingElectricPercentChange/measure.xml +14 -13
  47. data/lib/measures/CoilHeatingGasMultiplier/LICENSE.md +1 -1
  48. data/lib/measures/CoilHeatingGasMultiplier/measure.rb +1 -1
  49. data/lib/measures/CoilHeatingGasMultiplier/measure.xml +14 -13
  50. data/lib/measures/CoilHeatingGasPercentChange/LICENSE.md +1 -1
  51. data/lib/measures/CoilHeatingGasPercentChange/measure.rb +1 -1
  52. data/lib/measures/CoilHeatingGasPercentChange/measure.xml +14 -13
  53. data/lib/measures/CoilHeatingWaterMultiplier/LICENSE.md +1 -1
  54. data/lib/measures/CoilHeatingWaterMultiplier/measure.rb +1 -1
  55. data/lib/measures/CoilHeatingWaterMultiplier/measure.xml +14 -13
  56. data/lib/measures/CoilHeatingWaterPercentChange/LICENSE.md +1 -1
  57. data/lib/measures/CoilHeatingWaterPercentChange/measure.rb +1 -1
  58. data/lib/measures/CoilHeatingWaterPercentChange/measure.xml +14 -13
  59. data/lib/measures/ConstructionLayerZeroMaterialProperties/LICENSE.md +1 -1
  60. data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.rb +1 -1
  61. data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.xml +12 -11
  62. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/LICENSE.md +1 -1
  63. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/measure.rb +1 -1
  64. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/measure.xml +12 -11
  65. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/LICENSE.md +1 -1
  66. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.rb +3 -3
  67. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.xml +24 -11
  68. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/LICENSE.md +1 -1
  69. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.rb +3 -3
  70. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.xml +24 -11
  71. data/lib/measures/FansMultiplier/LICENSE.md +1 -1
  72. data/lib/measures/FansMultiplier/measure.rb +1 -1
  73. data/lib/measures/FansMultiplier/measure.xml +14 -13
  74. data/lib/measures/FansPercentChange/LICENSE.md +1 -1
  75. data/lib/measures/FansPercentChange/measure.rb +1 -1
  76. data/lib/measures/FansPercentChange/measure.xml +14 -13
  77. data/lib/measures/GeneralCalibrationMeasureMultiplier/LICENSE.md +1 -1
  78. data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.rb +1 -1
  79. data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.xml +16 -15
  80. data/lib/measures/GeneralCalibrationMeasurePercentChange/LICENSE.md +1 -1
  81. data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.rb +1 -1
  82. data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.xml +16 -15
  83. data/lib/measures/HardSizeHvac/LICENSE.md +1 -1
  84. data/lib/measures/HardSizeHvac/measure.rb +1 -1
  85. data/lib/measures/HardSizeHvac/measure.xml +13 -12
  86. data/lib/measures/RValueOfInsulationForConstructionMultiplier/LICENSE.md +1 -1
  87. data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.rb +1 -1
  88. data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.xml +12 -11
  89. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/LICENSE.md +1 -1
  90. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.rb +1 -1
  91. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.xml +12 -11
  92. data/lib/measures/RoofThermalPropertiesMultiplier/LICENSE.md +1 -1
  93. data/lib/measures/RoofThermalPropertiesMultiplier/measure.rb +3 -3
  94. data/lib/measures/RoofThermalPropertiesMultiplier/measure.xml +24 -11
  95. data/lib/measures/RoofThermalPropertiesPercentChange/LICENSE.md +1 -1
  96. data/lib/measures/RoofThermalPropertiesPercentChange/measure.rb +3 -3
  97. data/lib/measures/RoofThermalPropertiesPercentChange/measure.xml +24 -11
  98. data/lib/measures/TimeseriesObjectiveFunction/LICENSE.md +1 -1
  99. data/lib/measures/TimeseriesObjectiveFunction/measure.rb +1 -1
  100. data/lib/measures/TimeseriesObjectiveFunction/measure.xml +12 -12
  101. data/lib/measures/TimeseriesObjectiveFunction/resources/report.html.erb +4 -1
  102. data/lib/measures/TimeseriesPlot/LICENSE.md +1 -1
  103. data/lib/measures/TimeseriesPlot/measure.rb +1 -1
  104. data/lib/measures/TimeseriesPlot/measure.xml +17 -17
  105. data/lib/measures/TimeseriesPlot/resources/report.html.erb +4 -1
  106. data/lib/measures/WaterHeaterMixedMultiplier/LICENSE.md +1 -1
  107. data/lib/measures/WaterHeaterMixedMultiplier/measure.rb +1 -1
  108. data/lib/measures/WaterHeaterMixedMultiplier/measure.xml +14 -13
  109. data/lib/measures/WaterHeaterMixedPercentChange/LICENSE.md +1 -1
  110. data/lib/measures/WaterHeaterMixedPercentChange/measure.rb +1 -1
  111. data/lib/measures/WaterHeaterMixedPercentChange/measure.xml +14 -13
  112. data/lib/measures/{zone_report → inspect_and_edit_parametric_schedules}/LICENSE.md +1 -1
  113. data/lib/measures/inspect_and_edit_parametric_schedules/README.md +41 -0
  114. data/lib/measures/inspect_and_edit_parametric_schedules/README.md.erb +53 -0
  115. data/lib/measures/inspect_and_edit_parametric_schedules/docs/.gitkeep +0 -0
  116. data/lib/measures/inspect_and_edit_parametric_schedules/docs/apply_measures_now.png +0 -0
  117. data/lib/measures/inspect_and_edit_parametric_schedules/measure.rb +224 -0
  118. data/lib/measures/inspect_and_edit_parametric_schedules/measure.xml +131 -0
  119. data/lib/measures/shift_hours_of_operation/LICENSE.md +27 -0
  120. data/lib/measures/shift_hours_of_operation/README.md +134 -0
  121. data/lib/measures/{zone_report → shift_hours_of_operation}/README.md.erb +5 -0
  122. data/lib/measures/shift_hours_of_operation/docs/.gitkeep +0 -0
  123. data/lib/measures/shift_hours_of_operation/measure.rb +513 -0
  124. data/lib/measures/shift_hours_of_operation/measure.xml +261 -0
  125. data/lib/openstudio-calibration.rb +1 -1
  126. data/lib/openstudio/calibration.rb +1 -1
  127. data/lib/openstudio/calibration/extension.rb +1 -1
  128. data/lib/openstudio/calibration/version.rb +2 -2
  129. data/openstudio-calibration.gemspec +3 -3
  130. metadata +21 -14
  131. data/lib/measures/zone_report/README.md +0 -26
  132. data/lib/measures/zone_report/measure.rb +0 -706
  133. data/lib/measures/zone_report/measure.xml +0 -69
  134. data/lib/measures/zone_report/resources/report.html.in +0 -342
@@ -1,4 +1,4 @@
1
- OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
1
+ OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC. All rights reserved.
2
2
 
3
3
  Redistribution and use in source and binary forms, with or without modification, are permitted
4
4
  provided that the following conditions are met:
@@ -0,0 +1,41 @@
1
+
2
+
3
+
4
+ ![Apply Measures Now Dialog](./docs/apply_measures_now.png?raw=true)
5
+ *Each parametric schedule will have a series of arguments including one or more profile, and optionally a ceiling and floor value which can be used in the profile formulas.*
6
+
7
+ Additional documentation will follow at a later date.
8
+
9
+ ###### (Automatically generated documentation below)
10
+
11
+ # Inspect and Edit Parametric Schedules
12
+
13
+ ## Description
14
+ This model will create arguments out of additional property inputs for parametric schedules in the model. You can use this just to inspect, or you can alter the inputs. It will not make parametric inputs for schedules that are not already setup as parametric. If you want to generate parametric schedules you can first run the Shift Hours of Operation Schedule with default 0 argument values for change in hours of operation.
15
+
16
+ ## Modeler Description
17
+ This can be used in apply measure now, or can be used in a parametric workflow to load in any custom user profiles or floor/ceiling values.
18
+
19
+ ## Measure Type
20
+ ModelMeasure
21
+
22
+ ## Taxonomy
23
+
24
+
25
+ ## Arguments
26
+
27
+
28
+ ### Apply Parametric Schedules to the Model
29
+ When this is true the parametric schedules will be regenerated based on modified formulas, ceiling and floor values, and current horus of operation for building.
30
+ **Name:** apply_parametric_sch,
31
+ **Type:** Boolean,
32
+ **Units:** ,
33
+ **Required:** true,
34
+ **Model Dependent:** false
35
+
36
+
37
+
38
+
39
+
40
+
41
+
@@ -0,0 +1,53 @@
1
+ <%#= README.md.erb is used to auto-generate README.md. %>
2
+ <%#= To manually maintain README.md throw away README.md.erb and manually edit README.md %>
3
+
4
+ ![Apply Measures Now Dialog](./docs/apply_measures_now.png?raw=true)
5
+ *Each parametric schedule will have a series of arguments including one or more profile, and optionally a ceiling and floor value which can be used in the profile formulas.*
6
+
7
+ Additional documentation will follow at a later date.
8
+
9
+ ###### (Automatically generated documentation below)
10
+
11
+ # <%= name %>
12
+
13
+ ## Description
14
+ <%= description %>
15
+
16
+ ## Modeler Description
17
+ <%= modelerDescription %>
18
+
19
+ ## Measure Type
20
+ <%= measureType %>
21
+
22
+ ## Taxonomy
23
+ <%= taxonomy %>
24
+
25
+ ## Arguments
26
+
27
+ <% arguments.each do |argument| %>
28
+ ### <%= argument[:display_name] %>
29
+ <%= argument[:description] %>
30
+ **Name:** <%= argument[:name] %>,
31
+ **Type:** <%= argument[:type] %>,
32
+ **Units:** <%= argument[:units] %>,
33
+ **Required:** <%= argument[:required] %>,
34
+ **Model Dependent:** <%= argument[:model_dependent] %>
35
+
36
+ <% if argument[:type] == "Choice" && !argument[:model_dependent]%>
37
+ **Choice Display Names** <%= argument[:choice_display_names] %>
38
+ <% end %>
39
+
40
+ <% end %>
41
+
42
+ <% if arguments.size == 0 %>
43
+ <%= "This measure does not have any user arguments" %>
44
+ <% end %>
45
+
46
+ <% if outputs.size > 0 %>
47
+ ## Outputs
48
+ <% output_names = [] %>
49
+ <% outputs.each do |output| %>
50
+ <% output_names << output[:display_name] %>
51
+ <% end %>
52
+ <%= output_names.join(", ") %>
53
+ <% end %>
@@ -0,0 +1,224 @@
1
+ # *******************************************************************************
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
+ # All rights reserved.
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # (3) Neither the name of the copyright holder nor the names of any contributors
15
+ # may be used to endorse or promote products derived from this software without
16
+ # specific prior written permission from the respective party.
17
+ #
18
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
19
+ # of modifications or other derivative works may not use the "OpenStudio"
20
+ # trademark, "OS", "os", or any other confusingly similar designation without
21
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
22
+ #
23
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
24
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
27
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
28
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
30
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ # *******************************************************************************
35
+
36
+ # insert your copyright here
37
+
38
+ # see the URL below for information on how to write OpenStudio measures
39
+ # http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/
40
+
41
+ require 'openstudio-standards'
42
+
43
+ # load OpenStudio measure libraries from openstudio-extension gem
44
+ require 'openstudio-extension'
45
+ require 'openstudio/extension/core/os_lib_helper_methods'
46
+
47
+ # start the measure
48
+ class InspectAndEditParametricSchedules < OpenStudio::Measure::ModelMeasure
49
+ # human readable name
50
+ def name
51
+ # Measure name should be the title case of the class name.
52
+ return 'Inspect and Edit Parametric Schedules'
53
+ end
54
+
55
+ # human readable description
56
+ def description
57
+ return 'This model will create arguments out of additional property inputs for parametric schedules in the model. You can use this just to inspect, or you can alter the inputs. It will not make parametric inputs for schedules that are not already setup as parametric. If you want to generate parametric schedules you can first run the Shift Hours of Operation Schedule with default 0 argument values for change in hours of operation.'
58
+ end
59
+
60
+ # human readable description of modeling approach
61
+ def modeler_description
62
+ return 'This can be used in apply measure now, or can be used in a parametric workflow to load in any custom user profiles or floor/ceiling values.'
63
+ end
64
+
65
+ # define the arguments that the user will input
66
+ def arguments(model)
67
+ args = OpenStudio::Measure::OSArgumentVector.new
68
+
69
+ # code to inspect formulas and code floor/ceiling values
70
+ model.getScheduleRulesets.sort.each do |sch|
71
+ # get ceiling and floor
72
+ floor = sch.additionalProperties.getFeatureAsDouble('param_sch_floor')
73
+ ceiling = sch.additionalProperties.getFeatureAsDouble('param_sch_ceiling')
74
+ if floor.is_initialized || ceiling.is_initialized
75
+
76
+ # argument for floor
77
+ arg_name = "#{sch.name} Floor Value"
78
+ floor_val = OpenStudio::Measure::OSArgument.makeDoubleArgument(arg_name.downcase.gsub(' ', '_'), true)
79
+ floor_val.setDisplayName(arg_name)
80
+ floor_val.setDescription('floor can be used by formulas')
81
+ floor_val.setDefaultValue(floor.get)
82
+ args << floor_val
83
+
84
+ # argument for floor
85
+ arg_name = "#{sch.name} Ceiling Value"
86
+ ceiling_val = OpenStudio::Measure::OSArgument.makeDoubleArgument(arg_name.downcase.gsub(' ', '_'), true)
87
+ ceiling_val.setDisplayName(arg_name)
88
+ ceiling_val.setDescription('ceiling can be used by formulas')
89
+ ceiling_val.setDefaultValue(ceiling.get)
90
+ args << ceiling_val
91
+
92
+ end
93
+
94
+ # loop through rules
95
+ sch_days = {}
96
+ sch.scheduleRules.each do |rule|
97
+ if rule.startDate.is_initialized
98
+ start_date = "#{rule.startDate.get.monthOfYear.value}/#{rule.startDate.get.dayOfMonth}"
99
+ else
100
+ start_date = 'na'
101
+ end
102
+ if rule.startDate.is_initialized
103
+ end_date = "#{rule.endDate.get.monthOfYear.value}/#{rule.endDate.get.dayOfMonth}"
104
+ else
105
+ end_date = 'na'
106
+ end
107
+ dow = []
108
+ if rule.applyMonday then dow << 'mon' end
109
+ if rule.applyTuesday then dow << 'tue' end
110
+ if rule.applyWednesday then dow << 'wed' end
111
+ if rule.applyThursday then dow << 'thur' end
112
+ if rule.applyFriday then dow << 'fri' end
113
+ if rule.applySaturday then dow << 'sat' end
114
+ if rule.applySunday then dow << 'sun' end
115
+
116
+ sch_days[rule.daySchedule] = "#{dow.inspect} from #{start_date} through #{end_date}"
117
+ end
118
+
119
+ # add default profile
120
+ sch_days[sch.defaultDaySchedule] = 'default profile'
121
+
122
+ # should appear in similar oder to GUI now with default on the bottom
123
+ sch_days.each do |sch_day, description|
124
+ prop = sch_day.additionalProperties.getFeatureAsString('param_day_profile')
125
+ if prop.is_initialized
126
+
127
+ # argument for formulas
128
+ arg_name = "#{sch.name}_#{sch_day.name}"
129
+ formula = OpenStudio::Measure::OSArgument.makeStringArgument(arg_name.downcase.gsub(' ', '_'), true)
130
+ formula.setDisplayName(arg_name)
131
+ formula.setDescription(description)
132
+ formula.setDefaultValue(prop.to_s)
133
+ args << formula
134
+ end
135
+ end
136
+ end
137
+
138
+ # merge internal loads
139
+ apply_parametric_sch = OpenStudio::Measure::OSArgument.makeBoolArgument('apply_parametric_sch', true)
140
+ apply_parametric_sch.setDisplayName('Apply Parametric Schedules to the Model')
141
+ apply_parametric_sch.setDescription('When this is true the parametric schedules will be regenerated based on modified formulas, ceiling and floor values, and current horus of operation for building.')
142
+ apply_parametric_sch.setDefaultValue(true)
143
+ args << apply_parametric_sch
144
+
145
+ return args
146
+ end
147
+
148
+ # define what happens when the measure is run
149
+ def run(model, runner, user_arguments)
150
+ super(model, runner, user_arguments)
151
+
152
+ # assign the user inputs to variables
153
+ args = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments(model))
154
+ if !args then return false end
155
+
156
+ # setup log messages that will come from standards
157
+ OsLib_HelperMethods.setup_log_msgs(runner, true) # bool is debug
158
+
159
+ # load standards
160
+ standard = Standard.build('90.1-2004') # selected template doesn't matter
161
+
162
+ # change formulas, ceiling, adn floor values from arguments
163
+ counter_parametric_schedules = []
164
+ model.getScheduleRulesets.sort.each do |sch|
165
+ # get ceiling and floor
166
+ floor = sch.additionalProperties.getFeatureAsDouble('param_sch_floor')
167
+ ceiling = sch.additionalProperties.getFeatureAsDouble('param_sch_ceiling')
168
+ if floor.is_initialized || ceiling.is_initialized
169
+
170
+ # argument for floor
171
+ arg_name = "#{sch.name} Floor Value"
172
+ sch.additionalProperties.setFeature('param_sch_floor', args[arg_name.downcase.gsub(' ', '_')])
173
+
174
+ # argument for ceiling
175
+ arg_name = "#{sch.name} Ceiling Value"
176
+ sch.additionalProperties.setFeature('param_sch_ceiling', args[arg_name.downcase.gsub(' ', '_')])
177
+ end
178
+
179
+ # loop through rules
180
+ sch_days = {}
181
+ sch.scheduleRules.each do |rule|
182
+ sch_days[rule.daySchedule] = nil
183
+ end
184
+
185
+ # add default profile
186
+ sch_days[sch.defaultDaySchedule] = 'default profile'
187
+
188
+ # should appear in similar oder to GUI now with default on the bottom
189
+ sch_days.each do |sch_day, not_used|
190
+ prop = sch_day.additionalProperties.getFeatureAsString('param_day_profile')
191
+ if prop.is_initialized
192
+
193
+ # argument for formulas
194
+ arg_name = "#{sch.name}_#{sch_day.name}"
195
+ sch_day.additionalProperties.setFeature('param_day_profile', args[arg_name.downcase.gsub(' ', '_')])
196
+
197
+ # add to counter for initial condition
198
+ counter_parametric_schedules << sch
199
+
200
+ end
201
+ end
202
+ end
203
+
204
+ # report initial condition of model
205
+ runner.registerInitialCondition("The building started with #{counter_parametric_schedules.uniq.size.size} parametric schedules.")
206
+
207
+ # if requested re-generate schedules
208
+ if args['apply_parametric_sch']
209
+ parametric_schedules = standard.model_apply_parametric_schedules(model, ramp_frequency: nil, infer_hoo_for_non_assigned_objects: true, error_on_out_of_order: true)
210
+ runner.registerInfo("Applying #{parametric_schedules.size} parametric schedules.")
211
+ end
212
+
213
+ # report final condition of model
214
+ runner.registerFinalCondition("The building finished with #{parametric_schedules.size} parametric schedules.")
215
+
216
+ # report log messages from standards
217
+ OsLib_HelperMethods.log_msgs
218
+
219
+ return true
220
+ end
221
+ end
222
+
223
+ # register the measure to be used by the application
224
+ InspectAndEditParametricSchedules.new.registerWithApplication
@@ -0,0 +1,131 @@
1
+ <?xml version="1.0"?>
2
+ <measure>
3
+ <schema_version>3.0</schema_version>
4
+ <name>inspect_and_edit_parametric_schedules</name>
5
+ <uid>4b5f610d-caac-47c2-bd5b-610e2fc0768e</uid>
6
+ <version_id>63f5e931-e682-4ed2-8f66-23c0e6f0b82f</version_id>
7
+ <version_modified>20210423T201850Z</version_modified>
8
+ <xml_checksum>57318DBA</xml_checksum>
9
+ <class_name>InspectAndEditParametricSchedules</class_name>
10
+ <display_name>Inspect and Edit Parametric Schedules</display_name>
11
+ <description>This model will create arguments out of additional property inputs for parametric schedules in the model. You can use this just to inspect, or you can alter the inputs. It will not make parametric inputs for schedules that are not already setup as parametric. If you want to generate parametric schedules you can first run the Shift Hours of Operation Schedule with default 0 argument values for change in hours of operation.</description>
12
+ <modeler_description>This can be used in apply measure now, or can be used in a parametric workflow to load in any custom user profiles or floor/ceiling values.</modeler_description>
13
+ <arguments>
14
+ <argument>
15
+ <name>apply_parametric_sch</name>
16
+ <display_name>Apply Parametric Schedules to the Model</display_name>
17
+ <description>When this is true the parametric schedules will be regenerated based on modified formulas, ceiling and floor values, and current horus of operation for building.</description>
18
+ <type>Boolean</type>
19
+ <required>true</required>
20
+ <model_dependent>false</model_dependent>
21
+ <default_value>true</default_value>
22
+ <choices>
23
+ <choice>
24
+ <value>true</value>
25
+ <display_name>true</display_name>
26
+ </choice>
27
+ <choice>
28
+ <value>false</value>
29
+ <display_name>false</display_name>
30
+ </choice>
31
+ </choices>
32
+ </argument>
33
+ </arguments>
34
+ <outputs />
35
+ <provenances />
36
+ <tags>
37
+ <tag>Whole Building.Whole Building Schedules</tag>
38
+ </tags>
39
+ <attributes>
40
+ <attribute>
41
+ <name>Measure Type</name>
42
+ <value>ModelMeasure</value>
43
+ <datatype>string</datatype>
44
+ </attribute>
45
+ <attribute>
46
+ <name>Intended Software Tool</name>
47
+ <value>Apply Measure Now</value>
48
+ <datatype>string</datatype>
49
+ </attribute>
50
+ <attribute>
51
+ <name>Intended Software Tool</name>
52
+ <value>OpenStudio Application</value>
53
+ <datatype>string</datatype>
54
+ </attribute>
55
+ <attribute>
56
+ <name>Intended Software Tool</name>
57
+ <value>Parametric Analysis Tool</value>
58
+ <datatype>string</datatype>
59
+ </attribute>
60
+ <attribute>
61
+ <name>Intended Use Case</name>
62
+ <value>Model Articulation</value>
63
+ <datatype>string</datatype>
64
+ </attribute>
65
+ <attribute>
66
+ <name>Intended Use Case</name>
67
+ <value>Calibration</value>
68
+ <datatype>string</datatype>
69
+ </attribute>
70
+ <attribute>
71
+ <name>Intended Use Case</name>
72
+ <value>Retrofit EE</value>
73
+ <datatype>string</datatype>
74
+ </attribute>
75
+ </attributes>
76
+ <files>
77
+ <file>
78
+ <filename>.gitkeep</filename>
79
+ <filetype>gitkeep</filetype>
80
+ <usage_type>doc</usage_type>
81
+ <checksum>00000000</checksum>
82
+ </file>
83
+ <file>
84
+ <filename>example_parametric_model.osm</filename>
85
+ <filetype>osm</filetype>
86
+ <usage_type>test</usage_type>
87
+ <checksum>A0C68C28</checksum>
88
+ </file>
89
+ <file>
90
+ <filename>apply_measures_now.png</filename>
91
+ <filetype>png</filetype>
92
+ <usage_type>doc</usage_type>
93
+ <checksum>2D9A8051</checksum>
94
+ </file>
95
+ <file>
96
+ <filename>README.md.erb</filename>
97
+ <filetype>erb</filetype>
98
+ <usage_type>readmeerb</usage_type>
99
+ <checksum>F073FF6D</checksum>
100
+ </file>
101
+ <file>
102
+ <filename>README.md</filename>
103
+ <filetype>md</filetype>
104
+ <usage_type>readme</usage_type>
105
+ <checksum>A551610E</checksum>
106
+ </file>
107
+ <file>
108
+ <filename>LICENSE.md</filename>
109
+ <filetype>md</filetype>
110
+ <usage_type>license</usage_type>
111
+ <checksum>A21A3ED2</checksum>
112
+ </file>
113
+ <file>
114
+ <filename>inspect_and_edit_parametric_schedules_test.rb</filename>
115
+ <filetype>rb</filetype>
116
+ <usage_type>test</usage_type>
117
+ <checksum>70619B79</checksum>
118
+ </file>
119
+ <file>
120
+ <version>
121
+ <software_program>OpenStudio</software_program>
122
+ <identifier>3.1.0</identifier>
123
+ <min_compatible>3.1.0</min_compatible>
124
+ </version>
125
+ <filename>measure.rb</filename>
126
+ <filetype>rb</filetype>
127
+ <usage_type>script</usage_type>
128
+ <checksum>6C4E596B</checksum>
129
+ </file>
130
+ </files>
131
+ </measure>