is_heated and is_cooled pass from thermal_zone to usage_zone

This commit is contained in:
Pilar 2021-08-12 11:42:47 -04:00
parent 6970bac1f0
commit 17477bc049
5 changed files with 44 additions and 42 deletions

View File

@ -76,9 +76,9 @@ class Building(CityObject):
Get building heated flag Get building heated flag
:return: Boolean :return: Boolean
""" """
for thermal_zone in self.thermal_zones: for usage_zone in self.usage_zones:
if thermal_zone.is_heated: if usage_zone.is_heated:
return thermal_zone.is_heated return usage_zone.is_heated
return False return False
@property @property
@ -87,9 +87,9 @@ class Building(CityObject):
Get building cooled flag Get building cooled flag
:return: Boolean :return: Boolean
""" """
for thermal_zone in self.thermal_zones: for usage_zone in self.usage_zones:
if thermal_zone.is_cooled: if usage_zone.is_cooled:
return thermal_zone.is_cooled return usage_zone.is_cooled
return False return False
@property @property

View File

@ -29,8 +29,6 @@ class ThermalZone:
self._volume = volume self._volume = volume
self._volume_geometry = None self._volume_geometry = None
self._id = None self._id = None
self._is_heated = False
self._is_cooled = False
@property @property
def id(self): def id(self):
@ -42,38 +40,6 @@ class ThermalZone:
self._id = uuid.uuid4() self._id = uuid.uuid4()
return self._id return self._id
@property
def is_heated(self):
"""
Get thermal zone heated flag
:return: Boolean
"""
return self._is_heated
@is_heated.setter
def is_heated(self, value):
"""
Set thermal zone heated flag
:param value: Boolean
"""
self._is_heated = value
@property
def is_cooled(self):
"""
Get thermal zone cooled flag
:return: Boolean
"""
return self._is_cooled
@is_cooled.setter
def is_cooled(self, value):
"""
Set thermal zone cooled flag
:param value: Boolean
"""
self._is_cooled = value
@property @property
def is_mechanically_ventilated(self): def is_mechanically_ventilated(self):
""" """

View File

@ -37,6 +37,8 @@ class UsageZone:
self._schedules = None self._schedules = None
self._volume = None self._volume = None
self._volume_geometry = None self._volume_geometry = None
self._is_heated = False
self._is_cooled = False
@property @property
def id(self): def id(self):
@ -343,3 +345,36 @@ class UsageZone:
:param value: float :param value: float
""" """
self._volume = value self._volume = value
@property
def is_heated(self):
"""
Get thermal zone heated flag
:return: Boolean
"""
return self._is_heated
@is_heated.setter
def is_heated(self, value):
"""
Set thermal zone heated flag
:param value: Boolean
"""
self._is_heated = value
@property
def is_cooled(self):
"""
Get thermal zone cooled flag
:return: Boolean
"""
return self._is_cooled
@is_cooled.setter
def is_cooled(self, value):
"""
Set thermal zone cooled flag
:param value: Boolean
"""
self._is_cooled = value

View File

@ -110,8 +110,6 @@ class TestGeometryFactory(TestCase):
for thermal_zone in building.thermal_zones: for thermal_zone in building.thermal_zones:
self.assertIsNotNone(thermal_zone.bounded, 'thermal_zone bounded is none') self.assertIsNotNone(thermal_zone.bounded, 'thermal_zone bounded is none')
self.assertIsNotNone(thermal_zone.floor_area, 'thermal_zone floor_area is none') self.assertIsNotNone(thermal_zone.floor_area, 'thermal_zone floor_area is none')
self.assertIsNotNone(thermal_zone.is_heated, 'thermal_zone heated is none')
self.assertIsNotNone(thermal_zone.is_cooled, 'thermal_zone cooled is none')
self.assertIsNone(thermal_zone.additional_thermal_bridge_u_value, self.assertIsNone(thermal_zone.additional_thermal_bridge_u_value,
'thermal_zone additional_thermal_bridge_u_value is not none') 'thermal_zone additional_thermal_bridge_u_value is not none')
self.assertIsNone(thermal_zone.effective_thermal_capacity, self.assertIsNone(thermal_zone.effective_thermal_capacity,

View File

@ -55,6 +55,9 @@ class TestUsageFactory(TestCase):
self.assertIsNotNone(usage_zone.dhw_average_volume_pers_day, 'usage is none') self.assertIsNotNone(usage_zone.dhw_average_volume_pers_day, 'usage is none')
self.assertIsNotNone(usage_zone.dhw_preparation_temperature, 'usage is none') self.assertIsNotNone(usage_zone.dhw_preparation_temperature, 'usage is none')
self.assertIsNotNone(usage_zone.electrical_app_average_consumption_sqm_year, 'usage is none') self.assertIsNotNone(usage_zone.electrical_app_average_consumption_sqm_year, 'usage is none')
self.assertIsNotNone(usage_zone.is_heated, 'thermal_zone heated is none')
self.assertIsNotNone(usage_zone.is_cooled, 'thermal_zone cooled is none')
# case 2: CA # case 2: CA
file = 'one_building_in_kelowna.gml' file = 'one_building_in_kelowna.gml'