2020-06-09 14:07:47 -04:00
|
|
|
"""
|
|
|
|
Configuration helper
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
|
|
"""
|
2020-06-05 12:24:03 -04:00
|
|
|
import configparser
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
2020-06-11 16:22:58 -04:00
|
|
|
class ConfigurationHelper:
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configuration class
|
|
|
|
"""
|
2020-06-05 12:24:03 -04:00
|
|
|
def __init__(self):
|
|
|
|
base_path = Path().resolve().parent
|
2020-06-10 13:08:51 -04:00
|
|
|
config_file = Path(base_path / 'libs/config/configuration.ini').resolve()
|
2020-06-05 12:24:03 -04:00
|
|
|
self._config = configparser.ConfigParser()
|
|
|
|
self._config.read(config_file)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def h_i(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured internal convective coefficient in W/m2K
|
|
|
|
:return: float
|
|
|
|
"""
|
2020-06-05 12:24:03 -04:00
|
|
|
return self._config.getfloat('convective_fluxes', 'h_i')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def h_e(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured external convective coefficient in W/m2K
|
|
|
|
:return: float
|
|
|
|
"""
|
2020-06-05 12:24:03 -04:00
|
|
|
return self._config.getfloat('convective_fluxes', 'h_e')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def frame_ratio(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured frame ratio
|
|
|
|
:return: float
|
|
|
|
"""
|
2020-06-09 15:17:19 -04:00
|
|
|
return self._config.getfloat('windows', 'frame_ratio')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def heated(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured heated flag
|
|
|
|
:return: Boolean
|
|
|
|
"""
|
2020-06-09 15:17:19 -04:00
|
|
|
return self._config.getboolean('thermal_zones', 'heated')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def cooled(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured cooled flag
|
|
|
|
:return: Boolean
|
|
|
|
"""
|
2020-06-09 15:17:19 -04:00
|
|
|
return self._config.getboolean('thermal_zones', 'cooled')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_thermal_bridge_u_value(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured additional thermal bridge u value W/m2K
|
|
|
|
:return:
|
|
|
|
"""
|
2020-06-09 15:17:19 -04:00
|
|
|
return self._config.getfloat('thermal_zones', 'additional_thermal_bridge_u_value')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def indirectly_heated_area_ratio(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured indirectly heated area ratio
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
|
2020-06-09 15:17:19 -04:00
|
|
|
return self._config.getfloat('thermal_zones', 'indirectly_heated_area_ratio')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def infiltration_rate_system_on(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured infiltration rate system on in air change per hour
|
|
|
|
:return: float
|
|
|
|
"""
|
2020-06-09 15:17:19 -04:00
|
|
|
return self._config.getfloat('thermal_zones', 'infiltration_rate_system_on')
|
|
|
|
|
|
|
|
@property
|
|
|
|
def outside_solar_absorptance(self):
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configured infiltration rate system off in air change per hour
|
|
|
|
:return: float
|
|
|
|
"""
|
2020-06-09 15:17:19 -04:00
|
|
|
return self._config.getfloat('thermal_zones', 'outside_solar_absorptance')
|