# ───────────────────────────────────────────────────────────────────────────── # Building Acoustics Analysis Tool · Streamlit 1.35 # RT60 · Background-Noise · Speech-Intelligibility # Version: V4-2025 # Date: July 2025 # ───────────────────────────────────────────────────────────────────────────── import streamlit as st from config import MAJOR_TABS, DEFAULTS from sections import ( section_instructions, section_initial_data, section_initial_checks, section_acoustic_treatment, section_final_checks, section_faq, nav_to, nav_buttons ) from report import generate_docx # ── page config (unchanged) ──────────────────────────────────────────────── st.set_page_config("Building Acoustics Analysis Tool", "🏫", layout="wide", initial_sidebar_state="expanded") # ── ensure session-state keys exist ──────────────────────────────────────── for k, v in DEFAULTS.items(): st.session_state.setdefault(k, v) # ── sidebar navigation ───────────────────────────────────────────────────── with st.sidebar: st.header("Navigation") for tab in MAJOR_TABS: st.button(tab, on_click=nav_to, args=(tab,)) st.markdown("---") st.write("Version: V4-2025") if st.session_state.major_tab == "Final Compliance Checks": st.download_button("📥 Word Report", generate_docx(), "Acoustics_Report.docx", "application/vnd.openxmlformats-officedocument." "wordprocessingml.document") # ── router ───────────────────────────────────────────────────────────────── ROUTES = { "Instructions": section_instructions, "Initial Data Entry": section_initial_data, "Initial Compliance Checks": section_initial_checks, "Acoustic Treatment": section_acoustic_treatment, "Final Compliance Checks": section_final_checks, "FAQ / Help": section_faq, } ROUTES[st.session_state.major_tab]() # ── footer ───────────────────────────────────────────────────────────────── st.write("---") st.write("Developed by Dr Abdul-Manan Sadick · Deakin University · 2025")