| """ |
| Heating Load Calculator Page |
| |
| This module implements the heating load calculator interface for the HVAC Load Calculator web application. |
| It provides a step-by-step form for inputting building information and calculates heating loads |
| using the ASHRAE method. |
| """ |
|
|
| import streamlit as st |
| import pandas as pd |
| import numpy as np |
| import plotly.express as px |
| import plotly.graph_objects as go |
| import json |
| import os |
| import sys |
| from pathlib import Path |
| from datetime import datetime |
|
|
| |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
|
|
| |
| from heating_load import HeatingLoadCalculator |
| from reference_data import ReferenceData |
| from utils.validation import validate_input, ValidationWarning |
| from utils.export import export_data |
|
|
|
|
| def load_session_state(): |
| """Initialize or load session state variables.""" |
| |
| if 'heating_form_data' not in st.session_state: |
| st.session_state.heating_form_data = { |
| 'building_info': {}, |
| 'building_envelope': {}, |
| 'windows': {}, |
| 'ventilation': {}, |
| 'occupancy': {}, |
| 'results': {} |
| } |
| |
| |
| if 'heating_warnings' not in st.session_state: |
| st.session_state.heating_warnings = { |
| 'building_info': [], |
| 'building_envelope': [], |
| 'windows': [], |
| 'ventilation': [], |
| 'occupancy': [] |