DSatishchandra's picture
Update app.py
d233a21 verified
raw
history blame contribute delete
1.1 kB
import streamlit as st
from modules.simulator import simulate_data
from modules.filters import apply_filters
from modules.visuals import display_dashboard, display_heatmap
from modules.ai_engine import AIEngine
st.set_page_config(page_title="Pole Monitoring Dashboard", layout="wide")
st.title("πŸ“‘ Pole Monitoring - Real-Time Simulation")
st.sidebar.header("πŸ› οΈ Simulation Controls")
num_poles = st.sidebar.slider("Number of Poles", min_value=5, max_value=50, value=10)
simulate_faults = st.sidebar.checkbox("Simulate Random Faults", value=True)
# Simulate pole data
df = simulate_data(num_poles, simulate_faults)
# AI predictions (optional)
ai_engine = AIEngine()
df = ai_engine.predict_health(df)
st.sidebar.header("πŸ“‚ Filter Data")
alert_filter = st.sidebar.multiselect("Alert Level", ["Green", "Yellow", "Red"], default=["Green", "Yellow", "Red"])
filtered_df = apply_filters(df, alert_filter)
# Dashboard and Heatmap Display
display_dashboard(filtered_df)
display_heatmap(filtered_df)
st.subheader("πŸ“‹ Pole Monitoring Table")
st.dataframe(filtered_df, use_container_width=True)