Dheeraj-13 commited on
Commit
feeee2f
·
1 Parent(s): 984fc08

Fix UI: Dynamic metric deltas

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. mi_platform/ui/dashboard.py +8 -8
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  FROM python:3.10-slim-bullseye
2
 
3
  WORKDIR /app
4
- ENV CACHE_BUST=20251216_1520
5
 
6
  # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
 
1
  FROM python:3.10-slim-bullseye
2
 
3
  WORKDIR /app
4
+ ENV CACHE_BUST=20251216_1527
5
 
6
  # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
mi_platform/ui/dashboard.py CHANGED
@@ -136,14 +136,14 @@ with tab2:
136
  feature_cols = [c for c in df_process.columns if c not in ['Timestamp', 'Time', 'Pass/Fail']][:4]
137
 
138
  col1, col2, col3, col4 = st.columns(4)
139
- with col1:
140
- st.metric("Chamber Pressure", f"{df_window[feature_cols[0]].iloc[-1]:.2f}", delta="0.05")
141
- with col2:
142
- st.metric("Gas Flow Rate", f"{df_window[feature_cols[1]].iloc[-1]:.2f}", delta="-0.12")
143
- with col3:
144
- st.metric("RF Power", f"{df_window[feature_cols[2]].iloc[-1]:.2f}", delta="0.01")
145
- with col4:
146
- st.metric("Wafer Temp", f"{df_window[feature_cols[3]].iloc[-1]:.2f}", delta="1.2")
147
 
148
  # Charts
149
  st.subheader("Sensor Trends")
 
136
  feature_cols = [c for c in df_process.columns if c not in ['Timestamp', 'Time', 'Pass/Fail']][:4]
137
 
138
  col1, col2, col3, col4 = st.columns(4)
139
+ for i, col_name in enumerate(["Chamber Pressure", "Gas Flow Rate", "RF Power", "Wafer Temp"]):
140
+ col = feature_cols[i]
141
+ curr = df_window[col].iloc[-1]
142
+ prev = df_window[col].iloc[-2] if len(df_window) > 1 else curr
143
+ delta = curr - prev
144
+
145
+ with [col1, col2, col3, col4][i]:
146
+ st.metric(col_name, f"{curr:.2f}", delta=f"{delta:.2f}")
147
 
148
  # Charts
149
  st.subheader("Sensor Trends")