honeybee-openstudio 2.17.5 → 2.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/honeybee-openstudio.gemspec +1 -1
- data/lib/from_openstudio.rb +17 -0
- data/lib/from_openstudio/construction/air.rb +55 -0
- data/lib/from_openstudio/construction/opaque.rb +56 -0
- data/lib/from_openstudio/construction/shade.rb +82 -0
- data/lib/from_openstudio/construction/window.rb +56 -0
- data/lib/from_openstudio/construction_set.rb +141 -0
- data/lib/from_openstudio/geometry/aperture.rb +4 -1
- data/lib/from_openstudio/geometry/door.rb +6 -1
- data/lib/from_openstudio/geometry/face.rb +4 -1
- data/lib/from_openstudio/geometry/shade.rb +7 -1
- data/lib/from_openstudio/material/opaque_no_mass.rb +17 -12
- data/lib/from_openstudio/material/window_glazing.rb +1 -1
- data/lib/from_openstudio/model.rb +88 -2
- data/lib/honeybee.rb +2 -1
- data/lib/honeybee/_defaults/model.json +277 -133
- data/lib/honeybee/construction_set.rb +1 -1
- data/lib/honeybee/internalmass.rb +42 -0
- data/lib/honeybee/material/opaque_no_mass.rb +1 -1
- data/lib/to_openstudio.rb +2 -1
- data/lib/to_openstudio/construction/windowshade.rb +1 -1
- data/lib/to_openstudio/construction_set.rb +2 -0
- data/lib/to_openstudio/geometry/room.rb +11 -2
- data/lib/to_openstudio/internalmass.rb +56 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 033a258c4b365b57e5985771e4b9c78b565f43e042ef0fe5e37ee378458842f0
|
4
|
+
data.tar.gz: 35df9c37614ef5bb2846475cd79a29490835808e156d8a570aaa12352dcb5205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 575891d5a88970749d0177c9463db77529cd37e1a118940f8dd68f0a77ee33bd6ade3fe291ec07d655dddb1b0342ef9dede96139b397759d3442a54008a5e3c3
|
7
|
+
data.tar.gz: faf995c65be826b73ca7140fd77a7f6c55f87e2150abbe48b0374063329fc9a6d8ba58ab04cb79f60e8fc2b6115aa1f96570e3c8de880dc07835f6f352958d0c
|
data/honeybee-openstudio.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'honeybee-openstudio'
|
7
|
-
spec.version = '2.
|
7
|
+
spec.version = '2.20.0'
|
8
8
|
spec.authors = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
|
9
9
|
spec.email = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
|
10
10
|
|
data/lib/from_openstudio.rb
CHANGED
@@ -35,6 +35,7 @@ require 'honeybee'
|
|
35
35
|
# extend the compound objects that house the other objects
|
36
36
|
require 'from_openstudio/model'
|
37
37
|
require 'from_openstudio/model_object'
|
38
|
+
require 'from_openstudio/construction_set'
|
38
39
|
|
39
40
|
# extend the geometry objects
|
40
41
|
require 'from_openstudio/geometry/aperture'
|
@@ -43,6 +44,22 @@ require 'from_openstudio/geometry/face'
|
|
43
44
|
require 'from_openstudio/geometry/room'
|
44
45
|
require 'from_openstudio/geometry/shade'
|
45
46
|
|
47
|
+
# extend the construction objects
|
48
|
+
require 'from_openstudio/construction/opaque'
|
49
|
+
require 'from_openstudio/construction/window'
|
50
|
+
require 'from_openstudio/construction/shade'
|
51
|
+
require 'from_openstudio/construction/air'
|
52
|
+
|
53
|
+
# import the material objects
|
54
|
+
require 'from_openstudio/material/opaque'
|
55
|
+
require 'from_openstudio/material/opaque_no_mass'
|
56
|
+
require 'from_openstudio/material/window_gas'
|
57
|
+
require 'from_openstudio/material/window_gas_mixture'
|
58
|
+
require 'from_openstudio/material/window_gas_custom'
|
59
|
+
require 'from_openstudio/material/window_blind'
|
60
|
+
require 'from_openstudio/material/window_glazing'
|
61
|
+
require 'from_openstudio/material/window_simpleglazsys'
|
62
|
+
|
46
63
|
# extend the simulation objects
|
47
64
|
require 'from_openstudio/simulation/design_day'
|
48
65
|
require 'from_openstudio/simulation/parameter_model'
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# *******************************************************************************
|
2
|
+
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
+
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
# *******************************************************************************
|
31
|
+
|
32
|
+
require 'honeybee/construction/air'
|
33
|
+
require 'to_openstudio/model_object'
|
34
|
+
|
35
|
+
module Honeybee
|
36
|
+
class AirBoundaryConstructionAbridged < ModelObject
|
37
|
+
|
38
|
+
def self.from_construction(construction)
|
39
|
+
# create an empty hash
|
40
|
+
hash = {}
|
41
|
+
hash[:type] = 'AirBoundaryConstructionAbridged'
|
42
|
+
# set hash values from OpenStudio Object
|
43
|
+
hash[:identifier] = construction.nameString
|
44
|
+
# check if boost optional object is empty
|
45
|
+
unless construction.simpleMixingSchedule.empty?
|
46
|
+
schedule = construction.simpleMixingSchedule.get
|
47
|
+
hash[:air_mixing_schedule] = schedule.nameString
|
48
|
+
end
|
49
|
+
#TODO: Add air_mixing_per_area
|
50
|
+
|
51
|
+
hash
|
52
|
+
end
|
53
|
+
|
54
|
+
end # AirBoundaryConstructionAbridged
|
55
|
+
end # Honeybee
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# *******************************************************************************
|
2
|
+
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
+
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
# *******************************************************************************
|
31
|
+
|
32
|
+
require 'honeybee/construction/opaque'
|
33
|
+
require 'to_openstudio/model_object'
|
34
|
+
|
35
|
+
module Honeybee
|
36
|
+
class OpaqueConstructionAbridged < ModelObject
|
37
|
+
|
38
|
+
def self.from_construction(construction)
|
39
|
+
# create an empty hash
|
40
|
+
hash = {}
|
41
|
+
hash[:type] = 'OpaqueConstructionAbridged'
|
42
|
+
# set hash values from OpenStudio Object
|
43
|
+
hash[:identifier] = construction.nameString
|
44
|
+
hash[:materials] = []
|
45
|
+
# get construction layers
|
46
|
+
layers = construction.layers
|
47
|
+
layers.each do |layer|
|
48
|
+
name = layer.nameString
|
49
|
+
hash[:materials] << name
|
50
|
+
end
|
51
|
+
|
52
|
+
hash
|
53
|
+
end
|
54
|
+
|
55
|
+
end # OpaqueConstructionAbridged
|
56
|
+
end # Honeybee
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# *******************************************************************************
|
2
|
+
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
+
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
# *******************************************************************************
|
31
|
+
|
32
|
+
require 'honeybee/construction/shade'
|
33
|
+
require 'from_openstudio/model_object'
|
34
|
+
|
35
|
+
module Honeybee
|
36
|
+
class ShadeConstruction < ModelObject
|
37
|
+
|
38
|
+
def self.from_construction(construction)
|
39
|
+
# create an empty hash
|
40
|
+
hash = {}
|
41
|
+
hash[:type] = 'ShadeConstruction'
|
42
|
+
# set hash values from OpenStudio Object
|
43
|
+
hash[:identifier] = construction.nameString
|
44
|
+
# get outermost construction layers
|
45
|
+
layer = construction.layers[0]
|
46
|
+
if layer.to_StandardGlazing.is_initialized
|
47
|
+
layer = layer.to_StandardGlazing.get
|
48
|
+
hash[:is_specular] = true
|
49
|
+
# set reflectance properties from outermost layer
|
50
|
+
unless layer.frontSideSolarReflectanceatNormalIncidence.empty?
|
51
|
+
hash[:solar_reflectance] = layer.frontSideSolarReflectanceatNormalIncidence.get
|
52
|
+
end
|
53
|
+
unless layer.frontSideVisibleReflectanceatNormalIncidence.empty?
|
54
|
+
hash[:visible_reflectance] = layer.frontSideVisibleReflectanceatNormalIncidence.get
|
55
|
+
end
|
56
|
+
elsif layer.to_StandardOpaqueMaterial.is_initialized
|
57
|
+
layer = layer.to_StandardOpaqueMaterial.get
|
58
|
+
hash[:is_specular] = false
|
59
|
+
# set reflectance properties from outermost layer
|
60
|
+
unless layer.solarReflectance.empty?
|
61
|
+
hash[:solar_reflectance] = layer.solarReflectance.get
|
62
|
+
end
|
63
|
+
unless layer.visibleReflectance.empty?
|
64
|
+
hash[:visible_reflectance] = layer.visibleReflectance
|
65
|
+
end
|
66
|
+
elsif layer.to_MasslessOpaqueMaterial.is_initialized
|
67
|
+
layer = layer.to_MasslessOpaqueMaterial.get
|
68
|
+
hash[:is_specular] = false
|
69
|
+
# set reflectance properties from outermost layer
|
70
|
+
unless layer.solarAbsorptance.empty?
|
71
|
+
hash[:solar_reflectance] = 1 - layer.solarAbsorptance.get
|
72
|
+
end
|
73
|
+
unless layer.visibleAbsorptance.empty?
|
74
|
+
hash[:visible_reflectance] = 1 - layer.visibleAbsorptance.get
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
hash
|
79
|
+
end
|
80
|
+
|
81
|
+
end # ShadeConstruction
|
82
|
+
end # Honeybee
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# *******************************************************************************
|
2
|
+
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
+
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
# *******************************************************************************
|
31
|
+
|
32
|
+
require 'honeybee/construction/window'
|
33
|
+
require 'to_openstudio/model_object'
|
34
|
+
|
35
|
+
module Honeybee
|
36
|
+
class WindowConstructionAbridged
|
37
|
+
|
38
|
+
def self.from_construction(construction)
|
39
|
+
# create an empty hash
|
40
|
+
hash = {}
|
41
|
+
hash[:type] = 'WindowConstructionAbridged'
|
42
|
+
# set hash values from OpenStudio Object
|
43
|
+
hash[:identifier] = construction.nameString
|
44
|
+
hash[:materials] = []
|
45
|
+
# get construction layers
|
46
|
+
layers = construction.layers
|
47
|
+
layers.each do |layer|
|
48
|
+
name = layer.nameString
|
49
|
+
hash[:materials] << name
|
50
|
+
end
|
51
|
+
|
52
|
+
hash
|
53
|
+
end
|
54
|
+
|
55
|
+
end # WindowConstructionAbridged
|
56
|
+
end # Honeybee
|
@@ -0,0 +1,141 @@
|
|
1
|
+
# *******************************************************************************
|
2
|
+
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
+
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
# *******************************************************************************
|
31
|
+
|
32
|
+
require 'honeybee/construction_set'
|
33
|
+
require 'from_openstudio/model_object'
|
34
|
+
|
35
|
+
module Honeybee
|
36
|
+
class ConstructionSetAbridged < ModelObject
|
37
|
+
|
38
|
+
def self.from_construction_set(construction_set)
|
39
|
+
# create an empty hash
|
40
|
+
hash = {}
|
41
|
+
hash[:type] = 'ConstructionSetAbridged'
|
42
|
+
# set hash values from OpenStudio Object
|
43
|
+
hash[:identifier] = construction_set.nameString
|
44
|
+
hash[:wall_set] = {}
|
45
|
+
hash[:floor_set] = {}
|
46
|
+
hash[:aperture_set] = {}
|
47
|
+
hash[:door_set] = {}
|
48
|
+
hash[:roof_ceiling_set] = {}
|
49
|
+
|
50
|
+
# get interior surface constructions
|
51
|
+
unless construction_set.defaultInteriorSurfaceConstructions.empty?
|
52
|
+
int_surf_construction = construction_set.defaultInteriorSurfaceConstructions.get
|
53
|
+
# get interior wall construction
|
54
|
+
unless int_surf_construction.wallConstruction.empty?
|
55
|
+
int_wall_const = int_surf_construction.wallConstruction.get
|
56
|
+
hash[:wall_set][:interior_construction] = int_wall_const.nameString
|
57
|
+
end
|
58
|
+
# get interior floor construction
|
59
|
+
unless int_surf_construction.floorConstruction.empty?
|
60
|
+
int_floor_const = int_surf_construction.floorConstruction.get
|
61
|
+
hash[:floor_set][:interior_construction] = int_floor_const.nameString
|
62
|
+
end
|
63
|
+
# get interior roofceiling construction
|
64
|
+
unless int_surf_construction.roofCeilingConstruction.empty?
|
65
|
+
int_roof_const = int_surf_construction.roofCeilingConstruction.get
|
66
|
+
hash[:roof_ceiling_set][:interior_construction] = int_roof_const.nameString
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# get interior subsurface constructions
|
71
|
+
unless construction_set.defaultInteriorSubSurfaceConstructions.empty?
|
72
|
+
int_subsurf_const = construction_set.defaultInteriorSubSurfaceConstructions.get
|
73
|
+
# TODO: check outdoor boundary condition for fixed window and operable window and assign to
|
74
|
+
# interior_construction for aperture
|
75
|
+
# get interior fixed window construction
|
76
|
+
unless int_subsurf_const.fixedWindowConstruction.empty?
|
77
|
+
int_wind_const = int_subsurf_const.fixedWindowConstruction.get
|
78
|
+
hash[:aperture_set][:window_construction] = int_wind_const.nameString
|
79
|
+
end
|
80
|
+
# get interior door construction
|
81
|
+
unless int_subsurf_const.doorConstruction.empty?
|
82
|
+
int_door_const = int_subsurf_const.doorConstruction.get
|
83
|
+
hash[:door_set][:interior_construction] = int_door_const.nameString
|
84
|
+
end
|
85
|
+
# get interior glass door construction
|
86
|
+
unless int_subsurf_const.glassDoorConstruction.empty?
|
87
|
+
int_glass_door_const = int_subsurf_const.glassDoorConstruction.get
|
88
|
+
hash[:door_set][:interior_glass_construction] = int_glass_door_const.nameString
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# get exterior surface constructions
|
93
|
+
unless construction_set.defaultExteriorSurfaceConstructions.empty?
|
94
|
+
ext_surf_const = construction_set.defaultExteriorSurfaceConstructions.get
|
95
|
+
# get exterior wall construction
|
96
|
+
unless ext_surf_const.wallConstruction.empty?
|
97
|
+
ext_wall_const = ext_surf_const.wallConstruction.get
|
98
|
+
hash[:wall_set][:exterior_construction] = ext_wall_const.nameString
|
99
|
+
end
|
100
|
+
# get exterior floor construction
|
101
|
+
unless ext_surf_const.floorConstruction.empty?
|
102
|
+
ext_floor_const = ext_surf_const.floorConstruction.get
|
103
|
+
hash[:floor_set][:exterior_construction] = ext_floor_const.nameString
|
104
|
+
end
|
105
|
+
# get exterior roofceiling construction
|
106
|
+
unless ext_surf_const.roofCeilingConstruction.empty?
|
107
|
+
ext_roof_const = ext_surf_const.roofCeilingConstruction.get
|
108
|
+
hash[:roof_ceiling_set][:exterior_construction] = ext_roof_const.nameString
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# get exterior subsurface construction
|
113
|
+
unless construction_set.defaultExteriorSubSurfaceConstructions.empty?
|
114
|
+
ext_subsurf_const = construction_set.defaultExteriorSubSurfaceConstructions.get
|
115
|
+
# get exterior operable window construction
|
116
|
+
unless ext_subsurf_const.operableWindowConstruction.empty?
|
117
|
+
ext_wind_const = ext_subsurf_const.operableWindowConstruction.get
|
118
|
+
hash[:aperture_set][:operable_construction] = ext_wind_const.nameString
|
119
|
+
end
|
120
|
+
# get exterior skylight construction
|
121
|
+
unless ext_subsurf_const.skylightConstruction.empty?
|
122
|
+
ext_skylight_const = ext_subsurf_const.skylightConstruction.get
|
123
|
+
hash[:aperture_set][:skylight_construction] = ext_skylight_const.nameString
|
124
|
+
end
|
125
|
+
# get exterior door construction
|
126
|
+
unless ext_subsurf_const.doorConstruction.empty?
|
127
|
+
ext_door_const = ext_subsurf_const.doorConstruction.get
|
128
|
+
hash[:door_set][:exterior_construction] = ext_door_const.nameString
|
129
|
+
end
|
130
|
+
# get exterior overhead door construction
|
131
|
+
unless ext_subsurf_const.overheadDoorConstruction.empty?
|
132
|
+
ext_ovhd_door_const = ext_subsurf_const.overheadDoorConstruction.get
|
133
|
+
hash[:door_set][:overhead_construction] = ext_ovhd_door_const.nameString
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
hash
|
138
|
+
|
139
|
+
end
|
140
|
+
end # ConstructionSetAbridged
|
141
|
+
end # Honeybee
|