Correct idf_helper class

This commit is contained in:
Guille 2020-10-22 12:00:53 -04:00
parent 8d14b040ed
commit 11fcd27926
2 changed files with 13 additions and 4 deletions

View File

@ -24,11 +24,19 @@ class IdfHelper:
self._idf.newidfobject(key='ZONE', Name=building_name, Ceiling_Height='autocalculate', Volume='autocalculate', self._idf.newidfobject(key='ZONE', Name=building_name, Ceiling_Height='autocalculate', Volume='autocalculate',
Floor_Area='autocalculate', Part_of_Total_Floor_Area='yes', ) 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): 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, ) Zone_Name=building_name, )
# Why is this thing here? self._matrix_to_list(surface.points)
# self.wall.setcoords(surface.points_list.toList()) wall.setcoords(IdfHelper._matrix_to_list(surface.points))
def run(self, window_ratio=0.35): def run(self, window_ratio=0.35):
self._idf.set_default_constructions() self._idf.set_default_constructions()
@ -47,4 +55,5 @@ class IdfHelper:
list_values = [v for v in data.values()] list_values = [v for v in data.values()]
heating = [(float(x)) / 3600000.0 for x in list_values[0]] heating = [(float(x)) / 3600000.0 for x in list_values[0]]
cooling = [(float(x)) / 3600000.0 for x in list_values[1]] cooling = [(float(x)) / 3600000.0 for x in list_values[1]]
print("text")
return heating, cooling return heating, cooling

View File

@ -40,5 +40,5 @@ class TestIdf(TestCase):
_idf.add_zone(building.name) _idf.add_zone(building.name)
for surface in building.surfaces: for surface in building.surfaces:
_idf.add_surface(surface, building.name) _idf.add_surface(surface, building.name)
_idf.run() print(_idf.run())