adding measures to floor class

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-05 13:43:35 +01:00
parent efbcd0f0b8
commit b04cf15ad2
2 changed files with 11 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import pandas as pd
from BaseUtility import Definitions
from datatypes.enums import QuantityUnits
from backend.app.plan.schemas import MEASURE_MAP
from backend.Property import Property
from recommendations.recommendation_utils import (
r_value_per_mm_to_u_value, calculate_u_value_uplift, is_diminishing_returns, update_lowest_selected_u_value,
@ -70,7 +71,13 @@ class FloorRecommendations(Definitions):
# TODO: To be completed
self.exposed_floor_non_insulation_materials = []
def recommend(self, phase=0):
def recommend(self, phase=0, measures=None):
measures = MEASURE_MAP["floor_insulation"] if measures is None else measures
if not measures:
return
u_value = self.property.floor["thermal_transmittance"]
property_type = self.property.data["property-type"]
floor_area = self.property.insulation_floor_area
@ -124,7 +131,7 @@ class FloorRecommendations(Definitions):
self.property.floor["is_suspended"] or
self.property.floor["is_to_unheated_space"] or
self.property.floor["is_to_external_air"]
):
) and "suspended_floor_insulation" in measures:
# Given the U-value, we recommend underfloor insulation
self.recommend_floor_insulation(
phase=phase,
@ -134,7 +141,7 @@ class FloorRecommendations(Definitions):
)
return
if self.property.floor["is_solid"]:
if self.property.floor["is_solid"] and "solid_floor_insulation" in measures:
# Given the U-value, we recommend solid floor insulation options which are usually solid foam
self.recommend_floor_insulation(
u_value=u_value,

View file

@ -127,7 +127,7 @@ class Recommendations:
property_recommendations.append(self.ventilation_recomender.recommendation)
if "floor_insulation" in measures:
self.floor_recommender.recommend(phase=phase)
self.floor_recommender.recommend(phase=phase, measures=measures)
if self.floor_recommender.recommendations:
property_recommendations.append(self.floor_recommender.recommendations)
phase += 1