Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -172,3 +172,19 @@ if selected_site in SITES:
|
|
172 |
}
|
173 |
}
|
174 |
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
}
|
173 |
}
|
174 |
))
|
175 |
+
|
176 |
+
# ---- Fault Summary Counts ----
|
177 |
+
st.subheader("📊 Fault Summary (Current Site)")
|
178 |
+
colA, colB, colC = st.columns(3)
|
179 |
+
colA.metric("High Vibration (>3g)", site_df[site_df['Vibration (g)'] > 3].shape[0])
|
180 |
+
colB.metric("Power Insufficient", site_df[site_df['Power Status'] == 'Insufficient'].shape[0])
|
181 |
+
colC.metric("Camera Offline", site_df[site_df['Camera Status'] == 'Offline'].shape[0])
|
182 |
+
|
183 |
+
# ---- Toggle for Map ----
|
184 |
+
show_all = st.toggle("Show All Poles on Map (regardless of faults)", value=False)
|
185 |
+
|
186 |
+
# Update fault_df based on toggle
|
187 |
+
if show_all:
|
188 |
+
fault_df = site_df
|
189 |
+
else:
|
190 |
+
fault_df = site_df[site_df.apply(fault_condition, axis=1)]
|