forked from s_ranjbar/city_retrofit
Correct idf_helper class
This commit is contained in:
parent
8d14b040ed
commit
11fcd27926
|
@ -24,11 +24,19 @@ class IdfHelper:
|
|||
self._idf.newidfobject(key='ZONE', Name=building_name, Ceiling_Height='autocalculate', Volume='autocalculate',
|
||||
Floor_Area='autocalculate', Part_of_Total_Floor_Area='yes', )
|
||||
|
||||
@staticmethod
|
||||
def _matrix_to_list(points):
|
||||
points_list = []
|
||||
for point in points:
|
||||
point_tuple = (point[0], point[1], point[2])
|
||||
points_list.append(point_tuple)
|
||||
return points_list
|
||||
|
||||
def add_surface(self, surface, building_name):
|
||||
self._idf.newidfobject('BUILDINGSURFACE:DETAILED', Name=surface.name, Surface_Type=surface.type,
|
||||
wall = self._idf.newidfobject('BUILDINGSURFACE:DETAILED', Name=surface.name, Surface_Type=surface.type,
|
||||
Zone_Name=building_name, )
|
||||
# Why is this thing here?
|
||||
# self.wall.setcoords(surface.points_list.toList())
|
||||
self._matrix_to_list(surface.points)
|
||||
wall.setcoords(IdfHelper._matrix_to_list(surface.points))
|
||||
|
||||
def run(self, window_ratio=0.35):
|
||||
self._idf.set_default_constructions()
|
||||
|
@ -47,4 +55,5 @@ class IdfHelper:
|
|||
list_values = [v for v in data.values()]
|
||||
heating = [(float(x)) / 3600000.0 for x in list_values[0]]
|
||||
cooling = [(float(x)) / 3600000.0 for x in list_values[1]]
|
||||
print("text")
|
||||
return heating, cooling
|
||||
|
|
|
@ -40,5 +40,5 @@ class TestIdf(TestCase):
|
|||
_idf.add_zone(building.name)
|
||||
for surface in building.surfaces:
|
||||
_idf.add_surface(surface, building.name)
|
||||
_idf.run()
|
||||
print(_idf.run())
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user