openstudio-standards 0.8.5 → 0.8.7
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/test_performance_expected_dd_results.csv +90 -90
- data/lib/openstudio-standards/btap/activity.rb +858 -61
- data/lib/openstudio-standards/btap/attributes.rb +297 -103
- data/lib/openstudio-standards/btap/bridging.rb +1335 -593
- data/lib/openstudio-standards/btap/btap.rb +60 -181
- data/lib/openstudio-standards/btap/carbon/btap_carbon.rb +199 -142
- data/lib/openstudio-standards/btap/common/constructions.json +1275 -0
- data/lib/openstudio-standards/btap/common/costs.csv +1969 -0
- data/lib/openstudio-standards/btap/common/costs_local_factors.csv +2315 -0
- data/lib/openstudio-standards/btap/common/materials_glazing.csv +61 -0
- data/lib/openstudio-standards/btap/{common_resources → common}/materials_hvac.csv +1685 -1685
- data/lib/openstudio-standards/btap/{common_resources → common}/materials_lighting.csv +266 -266
- data/lib/openstudio-standards/btap/common/materials_opaque.csv +214 -0
- data/lib/openstudio-standards/btap/common/necb_building_types.csv +35 -0
- data/lib/openstudio-standards/btap/common/necb_space_types.csv +110 -0
- data/lib/openstudio-standards/btap/common/thermal_bridging.csv +73 -0
- data/lib/openstudio-standards/btap/costing/btap_costing.rb +346 -429
- data/lib/openstudio-standards/btap/costing/database.rb +104 -0
- data/lib/openstudio-standards/btap/costing/daylighting_sensor_control_costing.rb +356 -344
- data/lib/openstudio-standards/btap/costing/dcv_costing.rb +282 -296
- data/lib/openstudio-standards/btap/costing/envelope_costing.rb +179 -192
- data/lib/openstudio-standards/btap/costing/heating_cooling_costing.rb +2477 -2316
- data/lib/openstudio-standards/btap/costing/led_lighting_costing.rb +127 -142
- data/lib/openstudio-standards/btap/costing/lighting_costing.rb +216 -198
- data/lib/openstudio-standards/btap/costing/nv_costing.rb +522 -523
- data/lib/openstudio-standards/btap/costing/pv_ground_costing.rb +649 -649
- data/lib/openstudio-standards/btap/costing/shw_costing.rb +626 -625
- data/lib/openstudio-standards/btap/costing/thermal_bridging_costing.rb +72 -0
- data/lib/openstudio-standards/btap/costing/ventilation_costing.rb +2363 -2361
- data/lib/openstudio-standards/btap/deprecated.rb +1033 -0
- data/lib/openstudio-standards/btap/envelope.rb +313 -572
- data/lib/openstudio-standards/btap/fileio.rb +152 -1070
- data/lib/openstudio-standards/btap/geometry.rb +486 -766
- data/lib/openstudio-standards/btap/linear_regression.rb +130 -0
- data/lib/openstudio-standards/btap/paths.rb +46 -0
- data/lib/openstudio-standards/btap/qaqc/analysis.rb +163 -0
- data/lib/openstudio-standards/btap/qaqc/data.rb +2293 -0
- data/lib/openstudio-standards/btap/qaqc/datapoint.rb +641 -0
- data/lib/openstudio-standards/btap/schedules.rb +11 -611
- data/lib/openstudio-standards/btap/structure.rb +574 -189
- data/lib/openstudio-standards/constructions/materials/information.rb +1 -1
- data/lib/openstudio-standards/create_typical/create_typical.rb +1 -1
- data/lib/openstudio-standards/exterior_lighting/create.rb +135 -85
- data/lib/openstudio-standards/exterior_lighting/data/typical_exterior_lighting.json +20 -0
- data/lib/openstudio-standards/exterior_lighting/information.rb +23 -2
- data/lib/openstudio-standards/geometry/create.rb +7 -3
- data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.Model.rb +3 -2
- data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Model.rb +3 -2
- data/lib/openstudio-standards/prototypes/common/data/thermostat_schedule_lookup.json +84 -84
- data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +4 -4
- data/lib/openstudio-standards/refrigeration/create_walkin.rb +45 -5
- data/lib/openstudio-standards/refrigeration/data/refrigerated_walkins.csv +75 -75
- data/lib/openstudio-standards/schedules/parametric.rb +6 -0
- data/lib/openstudio-standards/service_water_heating/create_typical.rb +10 -3
- data/lib/openstudio-standards/service_water_heating/create_water_heating_loop.rb +30 -14
- data/lib/openstudio-standards/service_water_heating/information.rb +4 -1
- data/lib/openstudio-standards/sql_file/unmet_hours.rb +2 -1
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +3 -1
- data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +3 -1
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.boilers.json +12 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.construction_properties.json +18432 -3072
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.boilers.json +26 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.construction_properties.json +8532 -1422
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.boilers.json +26 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.construction_properties.json +8532 -1422
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.boilers.json +16 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.computer_room_acs.json +30 -30
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.construction_properties.json +7560 -1260
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.PumpVariableSpeed.rb +1 -2
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.boilers.json +16 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.construction_properties.json +7560 -1260
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.AirLoopHVAC.rb +3 -3
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.PumpVariableSpeed.rb +1 -2
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.boilers.json +22 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.construction_properties.json +7236 -1206
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.furnaces.json +223 -19
- data/lib/openstudio-standards/standards/ashrae_90_1/data/ashrae_90_1.schedules.json +37 -1
- data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm_2019/data/ashrae_90_1_prm_2019.boilers.json +3 -0
- data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm_2019/data/ashrae_90_1_prm_2019.construction_properties.json +6900 -1150
- data/lib/openstudio-standards/standards/cbes/data/cbes.schedules.json +1 -1
- data/lib/openstudio-standards/standards/deer/data/deer.schedules.json +1 -1
- data/lib/openstudio-standards/standards/necb/BTAP1980TO2010/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/BTAPPRE1980/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +6 -4
- data/lib/openstudio-standards/standards/necb/NECB2011/NECB2011_QAQC.json +2988 -0
- data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +25 -3
- data/lib/openstudio-standards/standards/necb/NECB2011/building_envelope.rb +672 -534
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/Hospital.osm +1791 -1792
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LEEPMultiTower.osm +7 -1
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LEEPTownHouse.osm +7 -1
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LargeHotel.osm +5 -6
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LargeOffice.osm +8 -9
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/NorthernEducation.osm +10 -4
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/NorthernHealthCare.osm +14 -15
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/Outpatient.osm +7 -1
- data/lib/openstudio-standards/standards/necb/NECB2011/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +14 -6
- data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +542 -130
- data/lib/openstudio-standards/standards/necb/NECB2011/qaqc/necb_qaqc.rb +30 -63
- data/lib/openstudio-standards/standards/necb/NECB2011/service_water_heating.rb +7 -2
- data/lib/openstudio-standards/standards/necb/NECB2015/data/surface_thermal_transmittance.json +90 -0
- data/lib/openstudio-standards/standards/necb/NECB2015/necb_2015.rb +8 -6
- data/lib/openstudio-standards/standards/necb/NECB2017/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/NECB2017/necb_2017.rb +2 -1
- data/lib/openstudio-standards/standards/necb/NECB2020/building_envelope.rb +0 -117
- data/lib/openstudio-standards/standards/necb/NECB2020/data/surface_thermal_transmittance.json +76 -45
- data/lib/openstudio-standards/standards/necb/NECB2020/necb_2020.rb +218 -0
- data/lib/openstudio-standards/standards/necb/common/construction_defaults.osm +12 -7
- data/lib/openstudio-standards/standards/standard.rb +1 -1
- data/lib/openstudio-standards/version.rb +1 -1
- data/lib/openstudio-standards.rb +9 -4
- metadata +59 -66
- data/data/inventory/thermal_bridging.csv +0 -90
- data/data/standards/OpenStudio_Standards-ashrae_90_1-ALL-comstock(space_types).xlsx +0 -0
- data/data/standards/openstudio_standards_duplicates_log.csv +0 -7962
- data/lib/openstudio-standards/btap/NECB_building_types.csv +0 -35
- data/lib/openstudio-standards/btap/NECB_space_types.csv +0 -109
- data/lib/openstudio-standards/btap/WeatherData1.json +0 -2110
- data/lib/openstudio-standards/btap/WeatherData1.xlsx +0 -0
- data/lib/openstudio-standards/btap/btap_result.rb +0 -1144
- data/lib/openstudio-standards/btap/btap_test_helper.rb +0 -86
- data/lib/openstudio-standards/btap/common_paths.rb +0 -81
- data/lib/openstudio-standards/btap/common_resources/ConstructionProperties.csv +0 -52
- data/lib/openstudio-standards/btap/common_resources/Constructions.csv +0 -37
- data/lib/openstudio-standards/btap/common_resources/construction_sets.csv +0 -1270
- data/lib/openstudio-standards/btap/common_resources/constructions_glazing.csv +0 -121
- data/lib/openstudio-standards/btap/common_resources/constructions_opaque.csv +0 -2256
- data/lib/openstudio-standards/btap/common_resources/costs.csv +0 -1897
- data/lib/openstudio-standards/btap/common_resources/costs_local_factors.csv +0 -2315
- data/lib/openstudio-standards/btap/common_resources/materials_glazing.csv +0 -35
- data/lib/openstudio-standards/btap/common_resources/materials_opaque.csv +0 -164
- data/lib/openstudio-standards/btap/costing/btap_measure_helper.rb +0 -359
- data/lib/openstudio-standards/btap/costing/btap_workflow.rb +0 -117
- data/lib/openstudio-standards/btap/costing/copy_test_results_files_to_expected_results.rb +0 -11
- data/lib/openstudio-standards/btap/costing/cost_building_from_file.rb +0 -136
- data/lib/openstudio-standards/btap/costing/costing_database_wrapper.rb +0 -173
- data/lib/openstudio-standards/btap/costing/dummy.epw +0 -8768
- data/lib/openstudio-standards/btap/costing/dummy.osm +0 -5320
- data/lib/openstudio-standards/btap/costing/neb_end_use_prices.csv +0 -42
- data/lib/openstudio-standards/btap/costing/necb_2011_spacetype_info.csv +0 -225
- data/lib/openstudio-standards/btap/costing/necb_reference_runs.csv +0 -28705
- data/lib/openstudio-standards/btap/costing/parallel_tests.rb +0 -92
- data/lib/openstudio-standards/btap/costing/test_list.txt +0 -15
- data/lib/openstudio-standards/btap/costing/test_run_all_test_locally.rb +0 -27
- data/lib/openstudio-standards/btap/costing/test_run_costing_tests.rb +0 -80
- data/lib/openstudio-standards/btap/necb_2011_spacetype_info.csv +0 -225
- data/lib/openstudio-standards/btap/utilities/Add_template_field_to_json.rb +0 -22
- data/lib/openstudio-standards/btap/utilities/convert_surfaces_to_adiabatic_necb_8426.rb +0 -204
- data/lib/openstudio-standards/btap/utilities/generate_space_types.rb +0 -8
- data/lib/openstudio-standards/btap/utilities/necb_to_epw_map.rb +0 -50
- data/lib/openstudio-standards/btap/utilities/os_sim_extract.rb +0 -48
- data/lib/openstudio-standards/btap/utilities/rename_surfaces.rb +0 -24
- data/lib/openstudio-standards/btap/utilities/round_surf_coords.rb +0 -32
- data/lib/openstudio-standards/btap/utilities/sched_create.rb +0 -145
- data/lib/openstudio-standards/btap/utilities/set_mult_to_adiabatic.rb +0 -53
- data/lib/openstudio-standards/btap/utilities/space_type.rb +0 -78
- data/lib/openstudio-standards/btap/utilities/weatherData1_xlsx_to_json.rb +0 -56
- data/lib/openstudio-standards/btap/vintagizer.rb +0 -161
- data/lib/openstudio-standards/btap/visualization.rb +0 -72
- data/lib/openstudio-standards/standards/necb/NECB2011/data/necb_2011_spacetype_info.csv +0 -225
- data/lib/openstudio-standards/standards/necb/common/btap_analysis.rb +0 -79
- data/lib/openstudio-standards/standards/necb/common/btap_data.rb +0 -2656
- data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +0 -653
- data/lib/openstudio-standards/standards/necb/common/necb_reference_runs.csv +0 -28705
- data/lib/openstudio-standards/standards/necb/common/utility_pricing_2025-02-20.csv +0 -92
- /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_frame.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_glazing.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_opaque.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/hvac_vent_ahu.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/lighting.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/lighting_sets.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/locations.csv +0 -0
- /data/lib/openstudio-standards/btap/{costing → common}/mech_sizing.json +0 -0
|
@@ -1,156 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
end
|
|
10
|
-
# puts standards_template
|
|
11
|
-
|
|
12
|
-
#-------------------------------------------------------------------------------------------------------------------
|
|
13
|
-
led_cost_total = 0.0
|
|
14
|
-
#-------------------------------------------------------------------------------------------------------------------
|
|
15
|
-
model.getSpaces.sort.each do |space|
|
|
16
|
-
|
|
17
|
-
##### Find height of the space
|
|
18
|
-
max_space_height_m = 0.0
|
|
19
|
-
space.surfaces.sort.select { |surface| surface.surfaceType == 'Wall' }.each do |wall_surface|
|
|
20
|
-
# Find the vertex with the max z value.
|
|
21
|
-
vertex_with_max_height = wall_surface.vertices.max_by(&:z)
|
|
22
|
-
# Replace max if this surface has something bigger.
|
|
23
|
-
max_space_height_m = vertex_with_max_height.z if vertex_with_max_height.z > max_space_height_m
|
|
1
|
+
module BTAP
|
|
2
|
+
class Costing
|
|
3
|
+
def cost_audit_led_lighting(model:, prototype_creator:)
|
|
4
|
+
a = 0 # This is for reporting purposes.
|
|
5
|
+
standards_template = model.building.get.standardsTemplate.to_s
|
|
6
|
+
if standards_template.include?('NECB')
|
|
7
|
+
# insert a space between NECB and 2011/2015/2017
|
|
8
|
+
standards_template = standards_template.gsub(/NECB(\d)/, 'NECB \1')
|
|
24
9
|
end
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# puts floor_area_m2
|
|
10
|
+
|
|
11
|
+
led_cost_total = 0.0
|
|
12
|
+
model.getSpaces.sort.each do |space|
|
|
13
|
+
|
|
14
|
+
# Find height of the space.
|
|
15
|
+
max_space_height_m = 0.0
|
|
16
|
+
space.surfaces.sort.select { |surface| surface.surfaceType == 'Wall' }.each do |wall_surface|
|
|
17
|
+
|
|
18
|
+
# Find the vertex with the max z value.
|
|
19
|
+
vertex_with_max_height = wall_surface.vertices.max_by(&:z)
|
|
20
|
+
|
|
21
|
+
# Replace max if this surface has something bigger.
|
|
22
|
+
max_space_height_m = vertex_with_max_height.z if vertex_with_max_height.z > max_space_height_m
|
|
39
23
|
end
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
##### Figure out if the space has LED lighting; and calculate its associated cost
|
|
52
|
-
space_type.get.lights.sort.each do |light|
|
|
53
|
-
space_lights_definition = light.lightsDefinition
|
|
54
|
-
space_lights_definition_name = space_lights_definition.name
|
|
55
|
-
# puts space_lights_definition_name
|
|
56
|
-
|
|
57
|
-
if space_lights_definition_name.to_s.include?('LED lighting')
|
|
58
|
-
led_cost_space = 0.0
|
|
59
|
-
##### COSTING-related step: Find fixture type that should be used in the space based on space_type, template, and lights_type
|
|
60
|
-
search_fixture_type = {
|
|
61
|
-
row_id_1: space_type_name,
|
|
62
|
-
row_id_2: standards_template,
|
|
63
|
-
row_id_3: 'LED'
|
|
64
|
-
}
|
|
65
|
-
sheet_name = 'lighting_sets'
|
|
66
|
-
if max_space_height_ft < 7.88
|
|
67
|
-
column_search = 'Fixture_type_less_than_7.88ft_ht'
|
|
68
|
-
elsif max_space_height_ft >= 7.88 && max_space_height_ft < 15.75
|
|
69
|
-
column_search = 'Fixture_type_7.88_to_15.75ft_ht'
|
|
70
|
-
else #i.e. max_space_height_ft >= 15.75ft_ht
|
|
71
|
-
column_search = 'Fixture_type_greater_than_>15.75ft_ht'
|
|
72
|
-
end
|
|
73
|
-
row_search_1 = 'space_type'
|
|
74
|
-
row_search_2 = 'template'
|
|
75
|
-
row_search_3 = 'Type'
|
|
76
|
-
fixture_type = get_fixture_type_id(fixture_info: search_fixture_type, sheet_name: sheet_name, row_name_1: row_search_1, row_name_2: row_search_2, row_name_3: row_search_3, column_search: column_search)
|
|
77
|
-
# puts "fixture_type - #{fixture_type}"
|
|
78
|
-
|
|
79
|
-
##### COSTING-related step: Find 'id_layers' and 'Id_layers_quantity_multipliers' based on fixture_type; and calculate LED cost
|
|
80
|
-
search_id_layers = @costing_database['raw']['lighting'].select { |data|
|
|
81
|
-
data['lighting_type_id'].to_f.round(1) == fixture_type.to_f.round(1)
|
|
82
|
-
}.first
|
|
83
|
-
if search_id_layers.nil?
|
|
84
|
-
puts("No data found for #{search_id_layers}!")
|
|
85
|
-
raise
|
|
86
|
-
end
|
|
87
|
-
ids = search_id_layers['id_layers'].to_s.split(',')
|
|
88
|
-
# puts "id_layers - #{ids}"
|
|
89
|
-
|
|
90
|
-
search_id_layers_quantity_multipliers = @costing_database['raw']['lighting'].select { |data|
|
|
91
|
-
data['lighting_type_id'].to_f.round(1) == fixture_type.to_f.round(1)
|
|
92
|
-
}.first
|
|
93
|
-
if search_id_layers_quantity_multipliers.nil?
|
|
94
|
-
puts("No data found for #{search_id_layers_quantity_multipliers}!")
|
|
95
|
-
raise
|
|
96
|
-
end
|
|
97
|
-
id_quants = search_id_layers_quantity_multipliers['Id_layers_quantity_multipliers'].to_s.split(',')
|
|
98
|
-
# puts "id_layers_quantity_multipliers - #{id_quants}"
|
|
99
|
-
|
|
100
|
-
overall_mult = 1.0
|
|
101
|
-
|
|
102
|
-
index_id_quant = 0.0
|
|
103
|
-
ids.each do |id|
|
|
104
|
-
quantity_led = id_quants[index_id_quant].to_f * overall_mult * floor_area_ft2
|
|
105
|
-
# id_description_search = @costing_database['raw']['materials_lighting'].select { |data|
|
|
106
|
-
# data['lighting_type_id'].to_f.round(1) == id.to_f.round(1)
|
|
107
|
-
# }.first
|
|
108
|
-
# id_description = id_description_search['description']
|
|
109
|
-
|
|
110
|
-
search_led = {
|
|
111
|
-
row_id_1: nil,
|
|
112
|
-
row_id_2: id
|
|
113
|
-
}
|
|
114
|
-
sheet_name = 'materials_lighting'
|
|
115
|
-
column_1 = nil
|
|
116
|
-
column_2 = 'lighting_type_id'
|
|
117
|
-
tags = ['lighting', 'led_lighting']
|
|
118
|
-
led_costing = assembly_cost(cost_info:search_led,
|
|
119
|
-
sheet_name:sheet_name,
|
|
120
|
-
column_1:column_1,
|
|
121
|
-
column_2:column_2,
|
|
122
|
-
quantity:quantity_led,
|
|
123
|
-
tags: tags)
|
|
124
|
-
led_cost_space += led_costing
|
|
125
|
-
index_id_quant += 1.0
|
|
24
|
+
max_space_height_ft = (OpenStudio.convert(max_space_height_m, 'm', 'ft').get)
|
|
25
|
+
|
|
26
|
+
# Find space's floor area.
|
|
27
|
+
floor_surface = nil
|
|
28
|
+
floor_area_m2 = 0.0
|
|
29
|
+
floor_vertices = []
|
|
30
|
+
space.surfaces.sort.each do |surface|
|
|
31
|
+
if surface.surfaceType == 'Floor'
|
|
32
|
+
floor_surface = surface
|
|
33
|
+
floor_area_m2 += surface.netArea
|
|
126
34
|
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
floor_area_ft2 = (OpenStudio.convert(floor_area_m2, 'm^2', 'ft^2').get)
|
|
127
38
|
|
|
128
|
-
|
|
39
|
+
# Find type of the space.
|
|
40
|
+
space_type = space.spaceType()
|
|
41
|
+
space_type_name = space_type.get.standardsSpaceType
|
|
129
42
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
43
|
+
# Figure out if the space has LED lighting; and calculate its associated cost
|
|
44
|
+
space_type.get.lights.sort.each do |light|
|
|
45
|
+
space_lights_definition = light.lightsDefinition
|
|
46
|
+
space_lights_definition_name = space_lights_definition.name
|
|
134
47
|
|
|
135
|
-
|
|
48
|
+
if space_lights_definition_name.to_s.include?('LED lighting')
|
|
49
|
+
led_cost_space = 0.0
|
|
50
|
+
|
|
51
|
+
# Costing-related step: Find fixture type that should be used in the
|
|
52
|
+
# space based on space_type, template, and lights_type
|
|
53
|
+
search_fixture_type = {
|
|
54
|
+
row_id_1: space_type_name,
|
|
55
|
+
row_id_2: standards_template,
|
|
56
|
+
row_id_3: 'LED'
|
|
57
|
+
}
|
|
136
58
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
59
|
+
sheet_name = 'lighting_sets'
|
|
60
|
+
if max_space_height_ft < 7.88
|
|
61
|
+
column_search = 'Fixture_type_less_than_7.88ft_ht'
|
|
62
|
+
elsif max_space_height_ft >= 7.88 && max_space_height_ft < 15.75
|
|
63
|
+
column_search = 'Fixture_type_7.88_to_15.75ft_ht'
|
|
64
|
+
else #i.e. max_space_height_ft >= 15.75ft_ht
|
|
65
|
+
column_search = 'Fixture_type_greater_than_>15.75ft_ht'
|
|
66
|
+
end
|
|
67
|
+
row_search_1 = 'space_type'
|
|
68
|
+
row_search_2 = 'template'
|
|
69
|
+
row_search_3 = 'Type'
|
|
70
|
+
fixture_type = get_fixture_type_id(fixture_info: search_fixture_type,
|
|
71
|
+
sheet_name: sheet_name,
|
|
72
|
+
row_name_1: row_search_1,
|
|
73
|
+
row_name_2: row_search_2,
|
|
74
|
+
row_name_3: row_search_3,
|
|
75
|
+
column_search: column_search)
|
|
76
|
+
|
|
77
|
+
# Costing-related step: Find 'id_layers' and
|
|
78
|
+
# 'id_layers_quantity_multipliers' based on fixture_type; and
|
|
79
|
+
# calculate LED cost
|
|
80
|
+
search_id_layers = @costing_database['raw']['lighting'].select { |data|
|
|
81
|
+
data['lighting_type_id'].to_f.round(1) == fixture_type.to_f.round(1)
|
|
82
|
+
}.first
|
|
83
|
+
if search_id_layers.nil?
|
|
84
|
+
raise("No data found for #{search_id_layers}!")
|
|
85
|
+
end
|
|
86
|
+
ids = search_id_layers['id_layers'].to_s.split(',')
|
|
87
|
+
|
|
88
|
+
search_id_layers_quantity_multipliers = @costing_database['raw']['lighting'].select { |data|
|
|
89
|
+
data['lighting_type_id'].to_f.round(1) == fixture_type.to_f.round(1)
|
|
90
|
+
}.first
|
|
91
|
+
if search_id_layers_quantity_multipliers.nil?
|
|
92
|
+
raise("No data found for #{search_id_layers_quantity_multipliers}!")
|
|
93
|
+
end
|
|
94
|
+
id_quants = search_id_layers_quantity_multipliers['Id_layers_quantity_multipliers'].to_s.split(',')
|
|
95
|
+
|
|
96
|
+
overall_mult = 1.0
|
|
97
|
+
|
|
98
|
+
index_id_quant = 0.0
|
|
99
|
+
ids.each do |id|
|
|
100
|
+
quantity_led = id_quants[index_id_quant].to_f * overall_mult * floor_area_ft2
|
|
101
|
+
|
|
102
|
+
search_led = { row_id_1: nil, row_id_2: id }
|
|
103
|
+
sheet_name = 'materials_lighting'
|
|
104
|
+
column_1 = nil
|
|
105
|
+
column_2 = 'lighting_type_id'
|
|
106
|
+
tags = ['lighting', 'led_lighting']
|
|
107
|
+
led_costing = assembly_cost(cost_info: search_led,
|
|
108
|
+
sheet_name: sheet_name,
|
|
109
|
+
column_1: column_1,
|
|
110
|
+
column_2: column_2,
|
|
111
|
+
quantity: quantity_led,
|
|
112
|
+
tags: tags)
|
|
113
|
+
|
|
114
|
+
led_cost_space += led_costing
|
|
115
|
+
index_id_quant += 1.0
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
led_cost_total += led_cost_space
|
|
119
|
+
|
|
120
|
+
@costing_report["lighting"]["led_lighting"] << {
|
|
121
|
+
'space' => space.name.to_s,
|
|
122
|
+
'led_costing' => led_cost_space,
|
|
123
|
+
}
|
|
140
124
|
|
|
141
|
-
|
|
142
|
-
#-------------------------------------------------------------------------------------------------------------------
|
|
125
|
+
a += 1
|
|
143
126
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
end
|
|
127
|
+
end # if space_lights_definition_name.to_s.include?('LED lighting')
|
|
128
|
+
end # space_type.get.lights.sort.each do |light|
|
|
129
|
+
end # model.getSpaces.sort.each do |space|
|
|
149
130
|
|
|
150
|
-
|
|
131
|
+
if a > 0
|
|
132
|
+
@costing_report["lighting"]["led_lighting"] << { 'total_cost' => led_cost_total }
|
|
133
|
+
end
|
|
151
134
|
|
|
152
|
-
|
|
135
|
+
puts "\nLED lighting costing data successfully generated. Total LED lighting costs: $#{led_cost_total.round(2)}"
|
|
153
136
|
|
|
154
|
-
|
|
137
|
+
return led_cost_total
|
|
155
138
|
|
|
139
|
+
end # cost_audit_led_lighting(model, prototype_creator)
|
|
140
|
+
end
|
|
156
141
|
end
|