def update_room_presets_and_units(preset, search, floor_area_text, ceiling_height_text, curr_floor_area, curr_ceiling_height): desc_file = ess.get_desc_file(ess.get_lang(search)) my_units = ess.get_units(search) curr_units = ess.did_switch_units(search, floor_area_text, ceiling_height_text) did_switch = False if curr_units != "": did_switch = True [floor_area, ceiling_height] = ess.convert_units(curr_units, my_units, curr_floor_area, curr_ceiling_height) if my_units == "british": text_output = [desc_file.floor_area_text, desc_file.ceiling_height_text] else: text_output = [desc_file.floor_area_text_metric, desc_file.ceiling_height_text_metric] # Update the room and behavior options based on the selected preset if preset == 'custom': if did_switch: return floor_area, ceiling_height, dash.no_update, \ dash.no_update, dash.no_update, dash.no_update, text_output[0], text_output[1] else: return dash.no_update, dash.no_update, dash.no_update, \ dash.no_update, dash.no_update, dash.no_update, text_output[0], text_output[1] else: curr_settings = ess.room_preset_settings[preset] if not did_switch: if my_units == "british": floor_area = curr_settings['floor-area'] ceiling_height = curr_settings['ceiling-height'] elif my_units == "metric": floor_area = round(curr_settings['floor-area-metric'], 2) ceiling_height = round(curr_settings['ceiling-height-metric'], 2) return floor_area, ceiling_height, curr_settings['ventilation'], \ curr_settings['recirc-rate'], curr_settings['filtration'], curr_settings['rh'], \ text_output[0], text_output[1]
def update_filt_disp(merv, search): desc_file = ess.get_desc_file(ess.get_lang(search)) return [desc_file.filt_type_output_base.format(merv)]
def update_recirc_disp(recirc_rate, search): desc_file = ess.get_desc_file(ess.get_lang(search)) if hasattr(desc_file, 'recirc_type_output_units'): return [html.Span([desc_file.recirc_type_output_base.format(recirc_rate), desc_file.recirc_type_output_units])] else: return [desc_file.recirc_type_output_base.format(recirc_rate)]
def update_vent_disp(air_exchange_rate, search): desc_file = ess.get_desc_file(ess.get_lang(search)) if hasattr(desc_file, 'vent_type_output_units'): return [html.Span([desc_file.vent_type_output_base.format(air_exchange_rate), desc_file.vent_type_output_units])] else: return [desc_file.vent_type_output_base.format(air_exchange_rate)]