openstudio-standards 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/standards/OpenStudio_Standards.xlsx +0 -0
- data/lib/openstudio-standards/btap/compliance.rb +17 -7
- data/lib/openstudio-standards/btap/hvac.rb +6 -5
- data/lib/openstudio-standards/btap/measures.rb +137 -102
- data/lib/openstudio-standards/hvac_sizing/Siz.Model.rb +2 -2
- data/lib/openstudio-standards/prototypes/Prototype.FanVariableVolume.rb +1 -1
- data/lib/openstudio-standards/prototypes/Prototype.Model.rb +96 -31
- data/lib/openstudio-standards/prototypes/Prototype.Model.swh.rb +1 -1
- data/lib/openstudio-standards/prototypes/Prototype.building_specific_methods.rb +163 -0
- data/lib/openstudio-standards/prototypes/Prototype.full_service_restaurant.rb +54 -52
- data/lib/openstudio-standards/prototypes/Prototype.high_rise_apartment.rb +28 -26
- data/lib/openstudio-standards/prototypes/Prototype.hospital.rb +41 -39
- data/lib/openstudio-standards/prototypes/Prototype.large_hotel.rb +19 -17
- data/lib/openstudio-standards/prototypes/Prototype.large_office.rb +16 -13
- data/lib/openstudio-standards/prototypes/Prototype.medium_office.rb +13 -11
- data/lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb +33 -31
- data/lib/openstudio-standards/prototypes/Prototype.outpatient.rb +66 -64
- data/lib/openstudio-standards/prototypes/Prototype.primary_school.rb +8 -88
- data/lib/openstudio-standards/prototypes/Prototype.quick_service_restaurant.rb +54 -52
- data/lib/openstudio-standards/prototypes/Prototype.retail_standalone.rb +13 -11
- data/lib/openstudio-standards/prototypes/Prototype.retail_stripmall.rb +15 -13
- data/lib/openstudio-standards/prototypes/Prototype.secondary_school.rb +11 -9
- data/lib/openstudio-standards/prototypes/Prototype.small_hotel.rb +13 -11
- data/lib/openstudio-standards/prototypes/Prototype.small_office.rb +7 -5
- data/lib/openstudio-standards/prototypes/Prototype.utilities.rb +18 -13
- data/lib/openstudio-standards/prototypes/Prototype.warehouse.rb +11 -9
- data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +23 -12
- data/lib/openstudio-standards/standards/Standards.Fan.rb +7 -4
- data/lib/openstudio-standards/standards/Standards.Model.rb +4 -4
- data/lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb +9 -4
- data/lib/openstudio-standards/utilities/simulation.rb +6 -1
- data/lib/openstudio-standards/version.rb +1 -1
- data/lib/openstudio-standards/weather/Weather.Model.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b08625a687a26b2b2bd1bfb397a5d58a2a021d0b
|
4
|
+
data.tar.gz: b5f0a2617f203d619d52acff7ed23def375cf52f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46a1fdba2ba4f46244127348a3f80f7512e7baf02121d182fabdb22e3252ed981db0ff0c1e9a4388e2e39281f777ad95330bbed2e94664dafdd4b9ae5193a640
|
7
|
+
data.tar.gz: 932107495b5cb807f3c48f8e229bfa2f2b78c7e72baddf4466eb7516a839162bb4ba0154872bfac59f9f39e08d2b2602eec6f93fbf380edbd0dc2ce61f9533e7
|
Binary file
|
@@ -608,7 +608,7 @@ module BTAP
|
|
608
608
|
|
609
609
|
|
610
610
|
|
611
|
-
def self.necb_spacetype_system_selection(model, heatingDesignLoad = nil,coolingDesignLoad = nil, runner = nil )
|
611
|
+
def self.necb_spacetype_system_selection( model, heatingDesignLoad = nil,coolingDesignLoad = nil, runner = nil )
|
612
612
|
spacezoning_data = Struct.new(
|
613
613
|
:space, # the space object
|
614
614
|
:space_name, # the space name
|
@@ -651,8 +651,9 @@ module BTAP
|
|
651
651
|
space_system_index = nil
|
652
652
|
else
|
653
653
|
space_type_property = space.model.find_object($os_standards["space_types"], { "template" => 'NECB 2011', "space_type" => space.spaceType.get.standardsSpaceType.get,"building_type" => space.spaceType.get.standardsBuildingType.get })
|
654
|
+
raise("could not find necb system selection type for space: #{space.name} and spacetype #{space.spaceType.get.standardsSpaceType.get}") if space_type_property.nil?
|
654
655
|
necb_hvac_system_selection_type = space_type_property['necb_hvac_system_selection_type']
|
655
|
-
|
656
|
+
|
656
657
|
end
|
657
658
|
|
658
659
|
|
@@ -734,7 +735,7 @@ module BTAP
|
|
734
735
|
when "Warehouse Area - refrigerated"
|
735
736
|
system = 5
|
736
737
|
when "Wildcard"
|
737
|
-
system =
|
738
|
+
system = nil
|
738
739
|
else
|
739
740
|
raise ("NECB HVAC System Selection Type #{necb_hvac_system_selection_type} not valid")
|
740
741
|
end
|
@@ -866,11 +867,14 @@ module BTAP
|
|
866
867
|
|
867
868
|
#Deal with Wildcard spaces. Might wish to have logic to do coridors first.
|
868
869
|
space_zoning_data_array.each do |space_zone_data|
|
869
|
-
|
870
|
+
#If it is a wildcard space.
|
871
|
+
if space_zone_data.system_number.nil?
|
870
872
|
#iterate through all adjacent spaces from largest shared wall area to smallest.
|
871
873
|
# Set system type to match first space system that is not nil.
|
872
874
|
space_zone_data.space.get_adjacent_spaces_with_shared_wall_areas(true).each do |adj_space|
|
875
|
+
#if there are no adjacent zones near a wh
|
873
876
|
raise ("Could not determine adj space to space #{space_zone_data.space.name.get}") if adj_space.nil?
|
877
|
+
|
874
878
|
adj_space_data = space_zoning_data_array.find { |data| data.space == adj_space[0] }
|
875
879
|
if adj_space_data.system_number.nil?
|
876
880
|
next
|
@@ -915,7 +919,7 @@ module BTAP
|
|
915
919
|
#puts "Spacename: #{space_info.space.name}:#{space_info.space.spaceType.get.name}"
|
916
920
|
if space_info.system_number == system_number and
|
917
921
|
space_info.space.spaceType.get.name.get.include?("- undefined -") == false and
|
918
|
-
space_info.
|
922
|
+
space_info.space.buildingStory.get == story and
|
919
923
|
BTAP::Compliance::NECB2011::determine_necb_schedule_type(space_info.space).to_s == schedule_type and
|
920
924
|
space_info.horizontal_placement == horizontal_placement
|
921
925
|
|
@@ -982,8 +986,14 @@ module BTAP
|
|
982
986
|
thermal_zone_ideal_loads = OpenStudio::Model::ZoneHVACIdealLoadsAirSystem.new(model)
|
983
987
|
thermal_zone_ideal_loads.addToThermalZone(thermal_zone)
|
984
988
|
end
|
985
|
-
end
|
986
|
-
|
989
|
+
end
|
990
|
+
#Check to ensure that all spaces are assigned to zones except undefined ones.
|
991
|
+
model.getSpaces.each do |space|
|
992
|
+
if space.thermalZone.empty? and space.spaceType.get.name.get != 'Space Function - undefined -'
|
993
|
+
raise( "space #{space.name} with spacetype #{space.spaceType.get.name.get}" )
|
994
|
+
end
|
995
|
+
end
|
996
|
+
end #
|
987
997
|
end
|
988
998
|
end #Compliance
|
989
999
|
end
|
@@ -3065,7 +3065,6 @@ module BTAP
|
|
3065
3065
|
htg_coil.setMinimumOutdoorDryBulbTemperatureforCompressorOperation(-10.0)
|
3066
3066
|
sizing_zone.setZoneHeatingSizingFactor(1.3)
|
3067
3067
|
sizing_zone.setZoneCoolingSizingFactor(1.0)
|
3068
|
-
puts 'test1111'
|
3069
3068
|
else
|
3070
3069
|
raise("#{heating_coil_type} is not a valid heating coil type.)")
|
3071
3070
|
end
|
@@ -3106,8 +3105,8 @@ puts 'test1111'
|
|
3106
3105
|
# supply air temperature based on the needs of this zone
|
3107
3106
|
setpoint_mgr_single_zone_reheat = OpenStudio::Model::SetpointManagerSingleZoneReheat.new(model)
|
3108
3107
|
setpoint_mgr_single_zone_reheat.setControlZone(zone)
|
3109
|
-
setpoint_mgr_single_zone_reheat.setMinimumSupplyAirTemperature(
|
3110
|
-
setpoint_mgr_single_zone_reheat.setMaximumSupplyAirTemperature(
|
3108
|
+
setpoint_mgr_single_zone_reheat.setMinimumSupplyAirTemperature(13)
|
3109
|
+
setpoint_mgr_single_zone_reheat.setMaximumSupplyAirTemperature(43)
|
3111
3110
|
setpoint_mgr_single_zone_reheat.addToNode(air_loop.supplyOutletNode)
|
3112
3111
|
|
3113
3112
|
# Create a diffuser and attach the zone/diffuser pair to the air loop
|
@@ -3441,8 +3440,9 @@ puts 'test1111'
|
|
3441
3440
|
setpoint_mgr_single_zone_reheat = OpenStudio::Model::SetpointManagerSingleZoneReheat.new(model)
|
3442
3441
|
setpoint_mgr_single_zone_reheat.setControlZone(zone)
|
3443
3442
|
setpoint_mgr_single_zone_reheat.setMinimumSupplyAirTemperature(13.0)
|
3443
|
+
setpoint_mgr_single_zone_reheat.setMaximumSupplyAirTemperature(43.0)
|
3444
3444
|
setpoint_mgr_single_zone_reheat.addToNode(air_loop.supplyOutletNode)
|
3445
|
-
|
3445
|
+
|
3446
3446
|
|
3447
3447
|
#Create sensible heat exchanger
|
3448
3448
|
# heat_exchanger = BTAP::Resources::HVAC::Plant::add_hrv(model)
|
@@ -3623,7 +3623,8 @@ puts 'test1111'
|
|
3623
3623
|
#TODO: schedule based on whether the zone is occupied or not as stipulated in 8.4.4.22 of NECB2011
|
3624
3624
|
min_flow_rate = 0.002*zone.floorArea
|
3625
3625
|
vav_terminal.setFixedMinimumAirFlowRate(min_flow_rate)
|
3626
|
-
|
3626
|
+
vav_terminal.setMaximumReheatAirTemperature(43)
|
3627
|
+
vav_terminal.setDamperHeatingAction("Reverse")
|
3627
3628
|
|
3628
3629
|
#Set zone baseboards
|
3629
3630
|
if ( baseboard_type == "Electric") then
|
@@ -22,15 +22,109 @@
|
|
22
22
|
# and open the template in the editor.
|
23
23
|
require "#{File.dirname(__FILE__)}/btap"
|
24
24
|
|
25
|
+
class OSMArg
|
26
|
+
ARGUMENT_TYPES = [
|
27
|
+
"BOOL",
|
28
|
+
"STRING",
|
29
|
+
"INTEGER",
|
30
|
+
"FLOAT",
|
31
|
+
"STRINGCHOICE",
|
32
|
+
"WSCHOICE"
|
33
|
+
]
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
attr_accessor :runner,
|
38
|
+
:variable_name,
|
39
|
+
:type,
|
40
|
+
:required,
|
41
|
+
:model_dependant,
|
42
|
+
:display_name,
|
43
|
+
:default_value,
|
44
|
+
:min_value,
|
45
|
+
:max_value,
|
46
|
+
:string_choice_array,
|
47
|
+
:os_object_type
|
48
|
+
|
49
|
+
def self.bool( variable_name,display_name,required,default_value )
|
50
|
+
raise "#{default_value} defaut value is not a bool." unless default_value.is_a?(Bool)
|
51
|
+
default_value.respond_to?(:to_s)
|
52
|
+
arg = OSMArg.new( "BOOL", variable_name, display_name, required)
|
53
|
+
arg.default_value = default_value
|
54
|
+
return arg
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.string( variable_name,display_name,required,default_value )
|
58
|
+
raise "#{default_value} defaut value is not a string." unless default_value.respond_to?(:to_s)
|
59
|
+
arg = OSMArg.new( "STRING", variable_name, display_name, required)
|
60
|
+
arg.default_value = default_value
|
61
|
+
return arg
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.integer( variable_name,display_name,required,default_value,min_value,max_value )
|
65
|
+
raise "#{default_value} defaut value is not a integer." unless default_value.respond_to?(:to_i)
|
66
|
+
arg = OSMArg.new( "INTEGER", variable_name, display_name, required)
|
67
|
+
arg.default_value = default_value
|
68
|
+
arg.min_value = min_value
|
69
|
+
arg.max_value = max_value
|
70
|
+
return arg
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.float( variable_name, display_name, required,default_value,min_value, max_value )
|
74
|
+
raise "#{default_value} defaut value is not a float." unless default_value.respond_to?(:to_f)
|
75
|
+
arg = OSMArg.new( "INTEGER", variable_name, display_name, required)
|
76
|
+
arg.default_value = default_value
|
77
|
+
arg.min_value = min_value
|
78
|
+
arg.max_value = max_value
|
79
|
+
return arg
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.choice(variable_name,display_name,required,default_value,string_choice_array)
|
83
|
+
raise "#{default_value} defaut value is not an array." unless default_value.is_a?(Array)
|
84
|
+
arg = OSMArg.new( "STRINGCHOICE", variable_name, display_name, required)
|
85
|
+
arg.default_value = default_value
|
86
|
+
arg.string_choice_array = string_choice_array
|
87
|
+
return arg
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.wschoice( variable_name, display_name, required, default_value, os_object_type)
|
91
|
+
arg = OSMArg.new( "WSCHOICE", variable_name, display_name, required )
|
92
|
+
arg.default_value = default_value
|
93
|
+
arg.os_object_type = os_object_type
|
94
|
+
return arg
|
95
|
+
end
|
96
|
+
|
97
|
+
def initialize( type, variable_name, display_name, required )
|
98
|
+
self.type = type
|
99
|
+
self.variable_name = variable_name
|
100
|
+
self.display_name = display_name
|
101
|
+
self.required = required
|
102
|
+
self.model_dependant = false
|
103
|
+
if self.type == "WSCHOICE"
|
104
|
+
self.model_dependant = true
|
105
|
+
else
|
106
|
+
self.model_dependant = false
|
107
|
+
end
|
108
|
+
return self
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
|
25
114
|
|
26
115
|
|
27
116
|
module BTAP
|
28
117
|
module Measures
|
29
118
|
module OSMeasures
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
30
123
|
class BTAPModelUserScript < OpenStudio::Ruleset::ModelUserScript
|
31
124
|
#if and E+ measure replace OpenStudio::Ruleset::ModelUserScript with OpenStudio::Ruleset::WorkspaceUserScript
|
32
125
|
#Array containing information of all inputs required by measure.
|
33
126
|
attr_accessor :argument_array_of_arrays
|
127
|
+
attr_accessor :argument_array
|
34
128
|
attr_accessor :file
|
35
129
|
#Name of measure
|
36
130
|
#attr_accessor :name
|
@@ -38,6 +132,7 @@ module BTAP
|
|
38
132
|
#if and E+ measure replace OpenStudio::Ruleset::ModelUserScript with OpenStudio::Ruleset::WorkspaceUserScript
|
39
133
|
def name
|
40
134
|
"BTAPModelUserScript"
|
135
|
+
OSMArgument.new
|
41
136
|
end
|
42
137
|
|
43
138
|
#this method will output the ruby macro to perform the change.
|
@@ -52,61 +147,6 @@ module BTAP
|
|
52
147
|
BTAP::runner_register("MACRO", "\##{self.class.name} Measure End", runner)
|
53
148
|
end
|
54
149
|
|
55
|
-
def arguments(model,argument_array_of_arrays)
|
56
|
-
#IF and E+ measure replace model with workspace as the argument
|
57
|
-
|
58
|
-
#Create an argument vector
|
59
|
-
args = OpenStudio::Ruleset::OSArgumentVector.new
|
60
|
-
|
61
|
-
@argument_array_of_arrays = argument_array_of_arrays
|
62
|
-
|
63
|
-
#***boilerplate code starts. Do not edit...
|
64
|
-
# this converts the 2D array to a array hash for better readability and makes
|
65
|
-
# column data accessible by name.
|
66
|
-
@argument_array_of_hashes = []
|
67
|
-
@argument_array_of_arrays[1..-1].each do |row| # [1..-1] skips the first row
|
68
|
-
hsh = {}; @argument_array_of_arrays[0].each_with_index{ |header, idx| hsh[header] = row[idx] }
|
69
|
-
@argument_array_of_hashes << hsh
|
70
|
-
end
|
71
|
-
|
72
|
-
#iterate through array of hashes and make arguments based on type and set
|
73
|
-
# max and min values where applicable.
|
74
|
-
@argument_array_of_hashes.each do |row|
|
75
|
-
arg = nil
|
76
|
-
case row["type"]
|
77
|
-
when "BOOL"
|
78
|
-
arg = OpenStudio::Ruleset::OSArgument::makeBoolArgument(row["variable_name"],row["required"],row["model_dependant"])
|
79
|
-
when "STRING"
|
80
|
-
arg = OpenStudio::Ruleset::OSArgument::makeStringArgument(row["variable_name"],row["required"],row["model_dependant"])
|
81
|
-
when "INTEGER"
|
82
|
-
arg = OpenStudio::Ruleset::OSArgument::makeIntegerArgument(row["variable_name"],row["required"],row["model_dependant"])
|
83
|
-
arg.setMaxValue( row["max_value"].to_i ) unless row["min_value"].nil?
|
84
|
-
arg.setMaxValue( row["max_value"].to_i ) unless row["max_value"].nil?
|
85
|
-
when "FLOAT"
|
86
|
-
arg = OpenStudio::Ruleset::OSArgument::makeDoubleArgument(row["variable_name"],row["required"],row["model_dependant"])
|
87
|
-
arg.setMaxValue( row["max_value"].to_f ) unless row["min_value"].nil?
|
88
|
-
arg.setMaxValue( row["max_value"].to_f ) unless row["max_value"].nil?
|
89
|
-
when "STRINGCHOICE"
|
90
|
-
# #add string choices one by one.
|
91
|
-
chs = OpenStudio::StringVector.new
|
92
|
-
row["string_choice_array"].each {|choice| chs << choice}
|
93
|
-
arg = OpenStudio::Ruleset::OSArgument::makeChoiceArgument(row["variable_name"], chs,row["required"],row["model_dependant"])
|
94
|
-
when "PATH"
|
95
|
-
arg = OpenStudio::Ruleset::OSArgument::makePathArgument("alternativeModelPath",true,"osm")
|
96
|
-
when "WSCHOICE"
|
97
|
-
arg = OpenStudio::Ruleset::makeChoiceArgumentOfWorkspaceObjects( row["variable_name"], row["os_object_type"].to_IddObjectType , model, row["required"])
|
98
|
-
end
|
99
|
-
# #common argument aspects.
|
100
|
-
unless arg.nil?
|
101
|
-
arg.setDisplayName(row["display_name"])
|
102
|
-
arg.setDefaultValue(row["default_value"]) unless row["default_value"].nil?
|
103
|
-
args << arg
|
104
|
-
end
|
105
|
-
end
|
106
|
-
return args
|
107
|
-
end
|
108
|
-
|
109
|
-
|
110
150
|
def set_user_arguments_and_apply(model,argument_values,runner)
|
111
151
|
message = "Settting Arguments"
|
112
152
|
runner.nil? ? puts(message) : runner.registerInfo(message)
|
@@ -158,48 +198,44 @@ module BTAP
|
|
158
198
|
generate_ruby_macro(model,runner)
|
159
199
|
return result
|
160
200
|
end # end method run
|
161
|
-
|
162
|
-
def argument_setter(args)
|
201
|
+
|
202
|
+
def argument_setter(model,args)
|
163
203
|
#***boilerplate code starts. Do not edit...
|
164
|
-
|
165
|
-
# column data accessible by name.
|
166
|
-
@argument_array_of_hashes = []
|
167
|
-
@argument_array_of_arrays[1..-1].each do |row| # [1..-1] skips the first row
|
168
|
-
hsh = {}; @argument_array_of_arrays[0].each_with_index{ |header, idx| hsh[header] = row[idx] }
|
169
|
-
@argument_array_of_hashes << hsh
|
170
|
-
end
|
204
|
+
|
171
205
|
|
172
206
|
#iterate through array of hashes and make arguments based on type and set
|
173
207
|
# max and min values where applicable.
|
174
|
-
@
|
208
|
+
@argument_array.each do |row|
|
209
|
+
#strip out first char that contains the @ symbol
|
210
|
+
row.variable_name[0] = ''
|
175
211
|
arg = nil
|
176
|
-
case row
|
212
|
+
case row.type
|
177
213
|
when "BOOL"
|
178
|
-
arg = OpenStudio::Ruleset::OSArgument::makeBoolArgument(row
|
214
|
+
arg = OpenStudio::Ruleset::OSArgument::makeBoolArgument(row.variable_name,row.required,row.model_dependant)
|
179
215
|
when "STRING"
|
180
|
-
arg = OpenStudio::Ruleset::OSArgument::makeStringArgument(row
|
216
|
+
arg = OpenStudio::Ruleset::OSArgument::makeStringArgument(row.variable_name,row.required,row.model_dependant)
|
181
217
|
when "INTEGER"
|
182
|
-
arg = OpenStudio::Ruleset::OSArgument::makeIntegerArgument(row
|
183
|
-
arg.setMaxValue( row
|
184
|
-
arg.setMaxValue( row
|
218
|
+
arg = OpenStudio::Ruleset::OSArgument::makeIntegerArgument(row.variable_name,row.required,row.model_dependant)
|
219
|
+
arg.setMaxValue( row.max_value.to_i ) unless row.min_value.nil?
|
220
|
+
arg.setMaxValue( row.max_value.to_i ) unless row.max_value.nil?
|
185
221
|
when "FLOAT"
|
186
|
-
arg = OpenStudio::Ruleset::OSArgument::makeDoubleArgument(row
|
187
|
-
arg.setMaxValue( row
|
188
|
-
arg.setMaxValue( row
|
222
|
+
arg = OpenStudio::Ruleset::OSArgument::makeDoubleArgument(row.variable_name,row.required,row.model_dependant)
|
223
|
+
arg.setMaxValue( row.max_value.to_f ) unless row.min_value.nil?
|
224
|
+
arg.setMaxValue( row.max_value.to_f ) unless row.max_value.nil?
|
189
225
|
when "STRINGCHOICE"
|
190
226
|
# #add string choices one by one.
|
191
227
|
chs = OpenStudio::StringVector.new
|
192
|
-
row
|
193
|
-
arg = OpenStudio::Ruleset::OSArgument::makeChoiceArgument(row
|
228
|
+
row.string_choice_array.each {|choice| chs << choice}
|
229
|
+
arg = OpenStudio::Ruleset::OSArgument::makeChoiceArgument(row.variable_name, chs,row.required,row.model_dependant)
|
194
230
|
when "PATH"
|
195
231
|
arg = OpenStudio::Ruleset::OSArgument::makePathArgument("alternativeModelPath",true,"osm")
|
196
232
|
when "WSCHOICE"
|
197
|
-
arg = OpenStudio::Ruleset::makeChoiceArgumentOfWorkspaceObjects( row
|
233
|
+
arg = OpenStudio::Ruleset::makeChoiceArgumentOfWorkspaceObjects( row.variable_name, row.os_object_type.to_IddObjectType , model, row.required)
|
198
234
|
end
|
199
235
|
# #common argument aspects.
|
200
236
|
unless arg.nil?
|
201
|
-
arg.setDisplayName(row
|
202
|
-
arg.setDefaultValue(row
|
237
|
+
arg.setDisplayName(row.display_name)
|
238
|
+
arg.setDefaultValue(row.default_value) unless row.default_value.nil?
|
203
239
|
args << arg
|
204
240
|
end
|
205
241
|
end
|
@@ -208,11 +244,11 @@ module BTAP
|
|
208
244
|
|
209
245
|
def argument_getter(model, runner,user_arguments)
|
210
246
|
@arg_table = []
|
211
|
-
unless @
|
212
|
-
@
|
213
|
-
name = row
|
247
|
+
unless @argument_array == nil
|
248
|
+
@argument_array.each do |row|
|
249
|
+
name = row.variable_name
|
214
250
|
|
215
|
-
case row
|
251
|
+
case row.type
|
216
252
|
when "BOOL"
|
217
253
|
value = runner.getBoolArgumentValue(name, user_arguments)
|
218
254
|
instance_variable_set("@#{name}",value)
|
@@ -225,8 +261,8 @@ module BTAP
|
|
225
261
|
value = runner.getIntegerArgumentValue(name, user_arguments)
|
226
262
|
instance_variable_set("@#{name}",value)
|
227
263
|
@arg_table << [name,value]
|
228
|
-
if ( not row
|
229
|
-
runner.registerError("#{row
|
264
|
+
if ( not row.min_value.nil? and instance_variable_get("@#{name}") < row.min_value ) or ( not row.max_value.nil? and instance_variable_get("@#{name}") > row.max_value )
|
265
|
+
runner.registerError("#{row.display_name} must be greater than or equal to #{row.min_value} and less than or equal to #{row.max_value}. You entered #{instance_variable_get("@#{name}")}.")
|
230
266
|
return false
|
231
267
|
end
|
232
268
|
when "FLOAT"
|
@@ -234,8 +270,8 @@ module BTAP
|
|
234
270
|
instance_variable_set("@#{name}",value)
|
235
271
|
@arg_table << [name,value]
|
236
272
|
|
237
|
-
if ( not row
|
238
|
-
runner.registerError("#{row
|
273
|
+
if ( not row.min_value.nil? and instance_variable_get("@#{name}") < row.min_value ) or ( not row.max_value.nil? and instance_variable_get("@#{name}") > row.max_value )
|
274
|
+
runner.registerError("#{row.display_name} must be greater than or equal to #{row.min_value} and less than or equal to #{row.max_value}. You entered #{instance_variable_get("@#{name}")}.")
|
239
275
|
return false
|
240
276
|
end
|
241
277
|
when "STRINGCHOICE"
|
@@ -254,7 +290,6 @@ module BTAP
|
|
254
290
|
return @arg_table
|
255
291
|
end
|
256
292
|
|
257
|
-
|
258
293
|
end
|
259
294
|
#Measure Template simplified.
|
260
295
|
class TemplateModelMeasure < BTAPModelUserScript
|
@@ -265,17 +300,19 @@ module BTAP
|
|
265
300
|
|
266
301
|
def arguments(model)
|
267
302
|
|
268
|
-
#
|
269
|
-
@
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
303
|
+
#bool
|
304
|
+
@argument_array << OSMArgument.bool(variable_name,display_name,required,default_value)
|
305
|
+
#string
|
306
|
+
@argument_array << OSMArgument.string(variable_name,display_name,required,default_value)
|
307
|
+
#integer
|
308
|
+
@argument_array << OSMArgument.integer(variable_name,display_name,required,default_value,min_value,max_value)
|
309
|
+
#float
|
310
|
+
@argument_array << OSMArgument.float(variable_name,display_name,required,default_value,min_value,max_value)
|
311
|
+
#Choice
|
312
|
+
@argument_array << OSMArgument.choice(variable_name,display_name,required,default_value,string_choice_array)
|
313
|
+
#Workspace choice (using zones as an example)
|
314
|
+
@argument_array << OSMArgument.wschoice(variable_name,display_name,required,default_value,string_choice_array)
|
315
|
+
args = super(model,@argument_array)
|
279
316
|
return args
|
280
317
|
end
|
281
318
|
|
@@ -404,9 +441,7 @@ module BTAP
|
|
404
441
|
end
|
405
442
|
end
|
406
443
|
end
|
407
|
-
|
408
|
-
|
409
|
-
end
|
444
|
+
|
410
445
|
class CSV_Measures
|
411
446
|
def initialize(
|
412
447
|
csv_file,
|