Update app.py
Browse files
app.py
CHANGED
|
@@ -43,59 +43,67 @@ st.markdown("""
|
|
| 43 |
}
|
| 44 |
|
| 45 |
.main .block-container {
|
| 46 |
-
padding-top:
|
| 47 |
-
padding-bottom:
|
| 48 |
max-width: 1400px !important;
|
| 49 |
}
|
| 50 |
|
| 51 |
/* Hide Streamlit UI */
|
| 52 |
#MainMenu, footer, header {visibility: hidden;}
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
/* Title */
|
| 55 |
.main-title {
|
| 56 |
font-family: 'Orbitron', sans-serif;
|
| 57 |
-
font-size:
|
| 58 |
font-weight: 900;
|
| 59 |
text-align: center;
|
| 60 |
background: linear-gradient(135deg, #00d4ff, #0090ff);
|
| 61 |
-webkit-background-clip: text;
|
| 62 |
-webkit-text-fill-color: transparent;
|
| 63 |
-
margin-bottom: 0.
|
| 64 |
text-transform: uppercase;
|
| 65 |
-
letter-spacing:
|
| 66 |
}
|
| 67 |
|
| 68 |
.subtitle {
|
| 69 |
font-family: 'Rajdhani', sans-serif;
|
| 70 |
-
font-size: 0.
|
| 71 |
text-align: center;
|
| 72 |
color: #8b95a5;
|
| 73 |
-
margin-bottom:
|
| 74 |
}
|
| 75 |
|
| 76 |
/* Parameter Card */
|
| 77 |
.param-card {
|
| 78 |
background: linear-gradient(135deg, rgba(26, 31, 58, 0.6), rgba(10, 14, 39, 0.8));
|
| 79 |
-
border:
|
| 80 |
-
border-radius:
|
| 81 |
-
padding: 0.
|
| 82 |
-
margin-bottom: 0.
|
| 83 |
}
|
| 84 |
|
| 85 |
.param-header {
|
| 86 |
display: flex;
|
| 87 |
align-items: center;
|
| 88 |
-
margin-bottom: 0.
|
| 89 |
}
|
| 90 |
|
| 91 |
.param-icon {
|
| 92 |
-
font-size:
|
| 93 |
-
margin-right: 0.
|
| 94 |
}
|
| 95 |
|
| 96 |
.param-name {
|
| 97 |
font-family: 'Rajdhani', sans-serif;
|
| 98 |
-
font-size: 0.
|
| 99 |
font-weight: 600;
|
| 100 |
color: #8b95a5;
|
| 101 |
text-transform: uppercase;
|
|
@@ -103,10 +111,30 @@ st.markdown("""
|
|
| 103 |
|
| 104 |
.param-value-display {
|
| 105 |
font-family: 'Orbitron', sans-serif;
|
| 106 |
-
font-size:
|
| 107 |
font-weight: 700;
|
| 108 |
text-align: center;
|
| 109 |
-
margin: 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
}
|
| 111 |
|
| 112 |
/* Status Colors */
|
|
@@ -118,43 +146,43 @@ st.markdown("""
|
|
| 118 |
/* Engine Status */
|
| 119 |
.engine-status-container {
|
| 120 |
text-align: center;
|
| 121 |
-
padding:
|
| 122 |
-
margin:
|
| 123 |
}
|
| 124 |
|
| 125 |
.engine-icon-display {
|
| 126 |
-
font-size:
|
| 127 |
-
margin: 0.
|
| 128 |
-
filter: drop-shadow(0 0
|
| 129 |
}
|
| 130 |
|
| 131 |
.probability-text {
|
| 132 |
font-family: 'Orbitron', sans-serif;
|
| 133 |
-
font-size: 1.
|
| 134 |
font-weight: 700;
|
| 135 |
-
margin: 0.
|
| 136 |
}
|
| 137 |
|
| 138 |
.status-badge {
|
| 139 |
display: inline-block;
|
| 140 |
-
padding: 0.
|
| 141 |
font-family: 'Rajdhani', sans-serif;
|
| 142 |
-
font-size:
|
| 143 |
font-weight: 700;
|
| 144 |
-
border-radius:
|
| 145 |
border: 2px solid;
|
| 146 |
text-transform: uppercase;
|
| 147 |
-
margin: 0.
|
| 148 |
}
|
| 149 |
|
| 150 |
/* Alert Box */
|
| 151 |
.alert-box {
|
| 152 |
-
padding: 0.
|
| 153 |
-
border-radius:
|
| 154 |
-
margin: 0.
|
| 155 |
font-family: 'Rajdhani', sans-serif;
|
| 156 |
-
font-size: 0.
|
| 157 |
-
border-left:
|
| 158 |
}
|
| 159 |
|
| 160 |
.alert-warning {
|
|
@@ -171,63 +199,70 @@ st.markdown("""
|
|
| 171 |
|
| 172 |
/* Recommendation Item */
|
| 173 |
.rec-item {
|
| 174 |
-
padding: 0.
|
| 175 |
-
margin: 0.
|
| 176 |
background: rgba(0, 212, 255, 0.05);
|
| 177 |
-
border-left:
|
| 178 |
-
border-radius:
|
| 179 |
font-family: 'Rajdhani', sans-serif;
|
| 180 |
-
font-size: 0.
|
| 181 |
color: #e0e6ed;
|
| 182 |
}
|
| 183 |
|
| 184 |
/* Feature Importance */
|
| 185 |
.feature-bar {
|
| 186 |
-
height:
|
| 187 |
background: linear-gradient(90deg, var(--color), transparent);
|
| 188 |
-
border-radius:
|
| 189 |
-
margin: 0.
|
| 190 |
position: relative;
|
| 191 |
-
padding: 0.
|
| 192 |
font-family: 'Rajdhani', sans-serif;
|
| 193 |
-
font-size: 0.
|
| 194 |
color: white;
|
| 195 |
}
|
| 196 |
|
| 197 |
/* Analysis Details */
|
| 198 |
.detail-box {
|
| 199 |
background: linear-gradient(135deg, rgba(26, 31, 58, 0.4), rgba(10, 14, 39, 0.6));
|
| 200 |
-
border-left:
|
| 201 |
-
border-radius:
|
| 202 |
-
padding: 0.
|
| 203 |
-
margin: 0.
|
| 204 |
}
|
| 205 |
|
| 206 |
.detail-title {
|
| 207 |
font-family: 'Rajdhani', sans-serif;
|
| 208 |
-
font-size:
|
| 209 |
font-weight: 700;
|
| 210 |
color: #00d4ff;
|
| 211 |
-
margin-bottom: 0.
|
| 212 |
text-transform: uppercase;
|
| 213 |
}
|
| 214 |
|
| 215 |
.detail-content {
|
| 216 |
font-family: 'Rajdhani', sans-serif;
|
| 217 |
-
font-size: 0.
|
| 218 |
color: #b8c5d6;
|
| 219 |
-
line-height: 1.
|
| 220 |
}
|
| 221 |
|
| 222 |
/* Section Headers */
|
| 223 |
h3 {
|
| 224 |
font-family: 'Rajdhani', sans-serif !important;
|
| 225 |
-
font-size:
|
| 226 |
color: #00d4ff !important;
|
| 227 |
-
margin-top: 0.
|
| 228 |
-
margin-bottom: 0.
|
| 229 |
text-transform: uppercase;
|
| 230 |
-
letter-spacing:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
}
|
| 232 |
</style>
|
| 233 |
""", unsafe_allow_html=True)
|
|
@@ -238,10 +273,10 @@ def create_gauge(value, max_value, color):
|
|
| 238 |
fig = go.Figure(go.Indicator(
|
| 239 |
mode="gauge+number",
|
| 240 |
value=value,
|
| 241 |
-
number={'font': {'size':
|
| 242 |
gauge={
|
| 243 |
'axis': {'range': [0, max_value], 'tickwidth': 1},
|
| 244 |
-
'bar': {'color': color, 'thickness': 0.
|
| 245 |
'bgcolor': "rgba(26, 31, 58, 0.3)",
|
| 246 |
'borderwidth': 1,
|
| 247 |
'bordercolor': "rgba(255, 255, 255, 0.1)",
|
|
@@ -254,7 +289,7 @@ def create_gauge(value, max_value, color):
|
|
| 254 |
))
|
| 255 |
|
| 256 |
fig.update_layout(
|
| 257 |
-
height=
|
| 258 |
margin=dict(l=5, r=5, t=5, b=5),
|
| 259 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 260 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
@@ -358,8 +393,14 @@ def main():
|
|
| 358 |
with col1:
|
| 359 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 360 |
st.markdown('<div class="param-header"><span class="param-icon">⚡</span><span class="param-name">Engine RPM</span></div>', unsafe_allow_html=True)
|
| 361 |
-
|
| 362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
rpm = rpm_slider if rpm_slider != rpm_input else rpm_input
|
| 364 |
st.markdown(f'<div class="param-value-display" style="color: #00d4ff;">{rpm}</div>', unsafe_allow_html=True)
|
| 365 |
st.plotly_chart(create_gauge(rpm, 2500, "#00d4ff"), use_container_width=True, config={'displayModeBar': False})
|
|
@@ -368,8 +409,13 @@ def main():
|
|
| 368 |
with col2:
|
| 369 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 370 |
st.markdown('<div class="param-header"><span class="param-icon">⛽</span><span class="param-name">Fuel Pressure (Bar)</span></div>', unsafe_allow_html=True)
|
| 371 |
-
|
| 372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
fuel_p = fuel_slider if fuel_slider != fuel_input else fuel_input
|
| 374 |
st.markdown(f'<div class="param-value-display" style="color: #ff6b35;">{fuel_p:.1f}</div>', unsafe_allow_html=True)
|
| 375 |
st.plotly_chart(create_gauge(fuel_p, 25, "#ff6b35"), use_container_width=True, config={'displayModeBar': False})
|
|
@@ -378,8 +424,13 @@ def main():
|
|
| 378 |
with col3:
|
| 379 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 380 |
st.markdown('<div class="param-header"><span class="param-icon">🛢️</span><span class="param-name">Oil Pressure (Bar)</span></div>', unsafe_allow_html=True)
|
| 381 |
-
|
| 382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
oil_p = oil_p_slider if oil_p_slider != oil_p_input else oil_p_input
|
| 384 |
st.markdown(f'<div class="param-value-display" style="color: #ffaa00;">{oil_p:.2f}</div>', unsafe_allow_html=True)
|
| 385 |
st.plotly_chart(create_gauge(oil_p, 10, "#ffaa00"), use_container_width=True, config={'displayModeBar': False})
|
|
@@ -391,8 +442,13 @@ def main():
|
|
| 391 |
with col4:
|
| 392 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 393 |
st.markdown('<div class="param-header"><span class="param-icon">🌡️</span><span class="param-name">Coolant Temp (°C)</span></div>', unsafe_allow_html=True)
|
| 394 |
-
|
| 395 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 396 |
coolant_temp = coolant_t_slider if coolant_t_slider != coolant_t_input else coolant_t_input
|
| 397 |
st.markdown(f'<div class="param-value-display" style="color: #ff3366;">{coolant_temp:.1f}</div>', unsafe_allow_html=True)
|
| 398 |
st.plotly_chart(create_gauge(coolant_temp, 200, "#ff3366"), use_container_width=True, config={'displayModeBar': False})
|
|
@@ -401,8 +457,13 @@ def main():
|
|
| 401 |
with col5:
|
| 402 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 403 |
st.markdown('<div class="param-header"><span class="param-icon">💧</span><span class="param-name">Coolant Pressure (Bar)</span></div>', unsafe_allow_html=True)
|
| 404 |
-
|
| 405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 406 |
coolant_p = coolant_p_slider if coolant_p_slider != coolant_p_input else coolant_p_input
|
| 407 |
st.markdown(f'<div class="param-value-display" style="color: #00ff88;">{coolant_p:.2f}</div>', unsafe_allow_html=True)
|
| 408 |
st.plotly_chart(create_gauge(coolant_p, 10, "#00ff88"), use_container_width=True, config={'displayModeBar': False})
|
|
@@ -411,8 +472,13 @@ def main():
|
|
| 411 |
with col6:
|
| 412 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 413 |
st.markdown('<div class="param-header"><span class="param-icon">🔥</span><span class="param-name">Oil Temp (°C)</span></div>', unsafe_allow_html=True)
|
| 414 |
-
|
| 415 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
oil_temp = oil_t_slider if oil_t_slider != oil_t_input else oil_t_input
|
| 417 |
st.markdown(f'<div class="param-value-display" style="color: #a855f7;">{oil_temp:.1f}</div>', unsafe_allow_html=True)
|
| 418 |
st.plotly_chart(create_gauge(oil_temp, 150, "#a855f7"), use_container_width=True, config={'displayModeBar': False})
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
.main .block-container {
|
| 46 |
+
padding-top: 0.5rem !important;
|
| 47 |
+
padding-bottom: 0.5rem !important;
|
| 48 |
max-width: 1400px !important;
|
| 49 |
}
|
| 50 |
|
| 51 |
/* Hide Streamlit UI */
|
| 52 |
#MainMenu, footer, header {visibility: hidden;}
|
| 53 |
|
| 54 |
+
/* Hide all dividers and extra spacing */
|
| 55 |
+
hr {display: none !important;}
|
| 56 |
+
|
| 57 |
+
/* Compact sections */
|
| 58 |
+
[data-testid="stVerticalBlock"] > [style*="flex-direction: column;"] > [data-testid="stVerticalBlock"] {
|
| 59 |
+
gap: 0.2rem !important;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
/* Title */
|
| 63 |
.main-title {
|
| 64 |
font-family: 'Orbitron', sans-serif;
|
| 65 |
+
font-size: 1.4rem;
|
| 66 |
font-weight: 900;
|
| 67 |
text-align: center;
|
| 68 |
background: linear-gradient(135deg, #00d4ff, #0090ff);
|
| 69 |
-webkit-background-clip: text;
|
| 70 |
-webkit-text-fill-color: transparent;
|
| 71 |
+
margin-bottom: 0.2rem;
|
| 72 |
text-transform: uppercase;
|
| 73 |
+
letter-spacing: 1px;
|
| 74 |
}
|
| 75 |
|
| 76 |
.subtitle {
|
| 77 |
font-family: 'Rajdhani', sans-serif;
|
| 78 |
+
font-size: 0.75rem;
|
| 79 |
text-align: center;
|
| 80 |
color: #8b95a5;
|
| 81 |
+
margin-bottom: 0.5rem;
|
| 82 |
}
|
| 83 |
|
| 84 |
/* Parameter Card */
|
| 85 |
.param-card {
|
| 86 |
background: linear-gradient(135deg, rgba(26, 31, 58, 0.6), rgba(10, 14, 39, 0.8));
|
| 87 |
+
border: 1px solid rgba(0, 212, 255, 0.2);
|
| 88 |
+
border-radius: 6px;
|
| 89 |
+
padding: 0.4rem 0.5rem;
|
| 90 |
+
margin-bottom: 0.3rem;
|
| 91 |
}
|
| 92 |
|
| 93 |
.param-header {
|
| 94 |
display: flex;
|
| 95 |
align-items: center;
|
| 96 |
+
margin-bottom: 0.2rem;
|
| 97 |
}
|
| 98 |
|
| 99 |
.param-icon {
|
| 100 |
+
font-size: 1rem;
|
| 101 |
+
margin-right: 0.3rem;
|
| 102 |
}
|
| 103 |
|
| 104 |
.param-name {
|
| 105 |
font-family: 'Rajdhani', sans-serif;
|
| 106 |
+
font-size: 0.7rem;
|
| 107 |
font-weight: 600;
|
| 108 |
color: #8b95a5;
|
| 109 |
text-transform: uppercase;
|
|
|
|
| 111 |
|
| 112 |
.param-value-display {
|
| 113 |
font-family: 'Orbitron', sans-serif;
|
| 114 |
+
font-size: 1rem;
|
| 115 |
font-weight: 700;
|
| 116 |
text-align: center;
|
| 117 |
+
margin: 0.2rem 0;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
/* Make inputs inline and compact */
|
| 121 |
+
.stNumberInput, .stSlider {
|
| 122 |
+
margin-bottom: 0 !important;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
.stNumberInput > div, .stSlider > div {
|
| 126 |
+
margin-bottom: 0 !important;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
.stNumberInput input {
|
| 130 |
+
height: 2rem !important;
|
| 131 |
+
font-size: 0.8rem !important;
|
| 132 |
+
padding: 0.2rem 0.5rem !important;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/* Remove spacing between inputs */
|
| 136 |
+
[data-testid="column"] {
|
| 137 |
+
padding: 0.2rem !important;
|
| 138 |
}
|
| 139 |
|
| 140 |
/* Status Colors */
|
|
|
|
| 146 |
/* Engine Status */
|
| 147 |
.engine-status-container {
|
| 148 |
text-align: center;
|
| 149 |
+
padding: 0.5rem;
|
| 150 |
+
margin: 0.3rem 0;
|
| 151 |
}
|
| 152 |
|
| 153 |
.engine-icon-display {
|
| 154 |
+
font-size: 3.5rem;
|
| 155 |
+
margin: 0.2rem 0;
|
| 156 |
+
filter: drop-shadow(0 0 15px currentColor);
|
| 157 |
}
|
| 158 |
|
| 159 |
.probability-text {
|
| 160 |
font-family: 'Orbitron', sans-serif;
|
| 161 |
+
font-size: 1.2rem;
|
| 162 |
font-weight: 700;
|
| 163 |
+
margin: 0.2rem 0;
|
| 164 |
}
|
| 165 |
|
| 166 |
.status-badge {
|
| 167 |
display: inline-block;
|
| 168 |
+
padding: 0.3rem 1rem;
|
| 169 |
font-family: 'Rajdhani', sans-serif;
|
| 170 |
+
font-size: 0.8rem;
|
| 171 |
font-weight: 700;
|
| 172 |
+
border-radius: 15px;
|
| 173 |
border: 2px solid;
|
| 174 |
text-transform: uppercase;
|
| 175 |
+
margin: 0.2rem 0;
|
| 176 |
}
|
| 177 |
|
| 178 |
/* Alert Box */
|
| 179 |
.alert-box {
|
| 180 |
+
padding: 0.3rem 0.6rem;
|
| 181 |
+
border-radius: 4px;
|
| 182 |
+
margin: 0.2rem 0;
|
| 183 |
font-family: 'Rajdhani', sans-serif;
|
| 184 |
+
font-size: 0.75rem;
|
| 185 |
+
border-left: 3px solid;
|
| 186 |
}
|
| 187 |
|
| 188 |
.alert-warning {
|
|
|
|
| 199 |
|
| 200 |
/* Recommendation Item */
|
| 201 |
.rec-item {
|
| 202 |
+
padding: 0.3rem 0.5rem;
|
| 203 |
+
margin: 0.2rem 0;
|
| 204 |
background: rgba(0, 212, 255, 0.05);
|
| 205 |
+
border-left: 2px solid #00d4ff;
|
| 206 |
+
border-radius: 3px;
|
| 207 |
font-family: 'Rajdhani', sans-serif;
|
| 208 |
+
font-size: 0.75rem;
|
| 209 |
color: #e0e6ed;
|
| 210 |
}
|
| 211 |
|
| 212 |
/* Feature Importance */
|
| 213 |
.feature-bar {
|
| 214 |
+
height: 18px;
|
| 215 |
background: linear-gradient(90deg, var(--color), transparent);
|
| 216 |
+
border-radius: 3px;
|
| 217 |
+
margin: 0.2rem 0;
|
| 218 |
position: relative;
|
| 219 |
+
padding: 0.1rem 0.4rem;
|
| 220 |
font-family: 'Rajdhani', sans-serif;
|
| 221 |
+
font-size: 0.7rem;
|
| 222 |
color: white;
|
| 223 |
}
|
| 224 |
|
| 225 |
/* Analysis Details */
|
| 226 |
.detail-box {
|
| 227 |
background: linear-gradient(135deg, rgba(26, 31, 58, 0.4), rgba(10, 14, 39, 0.6));
|
| 228 |
+
border-left: 2px solid #00d4ff;
|
| 229 |
+
border-radius: 4px;
|
| 230 |
+
padding: 0.4rem 0.6rem;
|
| 231 |
+
margin: 0.2rem 0;
|
| 232 |
}
|
| 233 |
|
| 234 |
.detail-title {
|
| 235 |
font-family: 'Rajdhani', sans-serif;
|
| 236 |
+
font-size: 0.8rem;
|
| 237 |
font-weight: 700;
|
| 238 |
color: #00d4ff;
|
| 239 |
+
margin-bottom: 0.3rem;
|
| 240 |
text-transform: uppercase;
|
| 241 |
}
|
| 242 |
|
| 243 |
.detail-content {
|
| 244 |
font-family: 'Rajdhani', sans-serif;
|
| 245 |
+
font-size: 0.75rem;
|
| 246 |
color: #b8c5d6;
|
| 247 |
+
line-height: 1.4;
|
| 248 |
}
|
| 249 |
|
| 250 |
/* Section Headers */
|
| 251 |
h3 {
|
| 252 |
font-family: 'Rajdhani', sans-serif !important;
|
| 253 |
+
font-size: 0.9rem !important;
|
| 254 |
color: #00d4ff !important;
|
| 255 |
+
margin-top: 0.3rem !important;
|
| 256 |
+
margin-bottom: 0.3rem !important;
|
| 257 |
text-transform: uppercase;
|
| 258 |
+
letter-spacing: 0.5px;
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
/* Compact button */
|
| 262 |
+
.stButton > button {
|
| 263 |
+
padding: 0.4rem 1rem !important;
|
| 264 |
+
font-size: 0.85rem !important;
|
| 265 |
+
margin: 0.3rem 0 !important;
|
| 266 |
}
|
| 267 |
</style>
|
| 268 |
""", unsafe_allow_html=True)
|
|
|
|
| 273 |
fig = go.Figure(go.Indicator(
|
| 274 |
mode="gauge+number",
|
| 275 |
value=value,
|
| 276 |
+
number={'font': {'size': 12, 'color': color}},
|
| 277 |
gauge={
|
| 278 |
'axis': {'range': [0, max_value], 'tickwidth': 1},
|
| 279 |
+
'bar': {'color': color, 'thickness': 0.5},
|
| 280 |
'bgcolor': "rgba(26, 31, 58, 0.3)",
|
| 281 |
'borderwidth': 1,
|
| 282 |
'bordercolor': "rgba(255, 255, 255, 0.1)",
|
|
|
|
| 289 |
))
|
| 290 |
|
| 291 |
fig.update_layout(
|
| 292 |
+
height=80,
|
| 293 |
margin=dict(l=5, r=5, t=5, b=5),
|
| 294 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 295 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
|
|
| 393 |
with col1:
|
| 394 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 395 |
st.markdown('<div class="param-header"><span class="param-icon">⚡</span><span class="param-name">Engine RPM</span></div>', unsafe_allow_html=True)
|
| 396 |
+
|
| 397 |
+
# Inputs side by side
|
| 398 |
+
input_col1, input_col2 = st.columns([1, 3])
|
| 399 |
+
with input_col1:
|
| 400 |
+
rpm_input = st.number_input("", 0, 2500, 750, 50, key="rpm_num", label_visibility="collapsed")
|
| 401 |
+
with input_col2:
|
| 402 |
+
rpm_slider = st.slider("", 0, 2500, rpm_input, 50, key="rpm_sld", label_visibility="collapsed")
|
| 403 |
+
|
| 404 |
rpm = rpm_slider if rpm_slider != rpm_input else rpm_input
|
| 405 |
st.markdown(f'<div class="param-value-display" style="color: #00d4ff;">{rpm}</div>', unsafe_allow_html=True)
|
| 406 |
st.plotly_chart(create_gauge(rpm, 2500, "#00d4ff"), use_container_width=True, config={'displayModeBar': False})
|
|
|
|
| 409 |
with col2:
|
| 410 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 411 |
st.markdown('<div class="param-header"><span class="param-icon">⛽</span><span class="param-name">Fuel Pressure (Bar)</span></div>', unsafe_allow_html=True)
|
| 412 |
+
|
| 413 |
+
input_col1, input_col2 = st.columns([1, 3])
|
| 414 |
+
with input_col1:
|
| 415 |
+
fuel_input = st.number_input("", 0.0, 25.0, 6.2, 0.1, key="fuel_num", label_visibility="collapsed")
|
| 416 |
+
with input_col2:
|
| 417 |
+
fuel_slider = st.slider("", 0.0, 25.0, fuel_input, 0.1, key="fuel_sld", label_visibility="collapsed")
|
| 418 |
+
|
| 419 |
fuel_p = fuel_slider if fuel_slider != fuel_input else fuel_input
|
| 420 |
st.markdown(f'<div class="param-value-display" style="color: #ff6b35;">{fuel_p:.1f}</div>', unsafe_allow_html=True)
|
| 421 |
st.plotly_chart(create_gauge(fuel_p, 25, "#ff6b35"), use_container_width=True, config={'displayModeBar': False})
|
|
|
|
| 424 |
with col3:
|
| 425 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 426 |
st.markdown('<div class="param-header"><span class="param-icon">🛢️</span><span class="param-name">Oil Pressure (Bar)</span></div>', unsafe_allow_html=True)
|
| 427 |
+
|
| 428 |
+
input_col1, input_col2 = st.columns([1, 3])
|
| 429 |
+
with input_col1:
|
| 430 |
+
oil_p_input = st.number_input("", 0.0, 10.0, 3.16, 0.1, key="oil_p_num", label_visibility="collapsed")
|
| 431 |
+
with input_col2:
|
| 432 |
+
oil_p_slider = st.slider("", 0.0, 10.0, oil_p_input, 0.1, key="oil_p_sld", label_visibility="collapsed")
|
| 433 |
+
|
| 434 |
oil_p = oil_p_slider if oil_p_slider != oil_p_input else oil_p_input
|
| 435 |
st.markdown(f'<div class="param-value-display" style="color: #ffaa00;">{oil_p:.2f}</div>', unsafe_allow_html=True)
|
| 436 |
st.plotly_chart(create_gauge(oil_p, 10, "#ffaa00"), use_container_width=True, config={'displayModeBar': False})
|
|
|
|
| 442 |
with col4:
|
| 443 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 444 |
st.markdown('<div class="param-header"><span class="param-icon">🌡️</span><span class="param-name">Coolant Temp (°C)</span></div>', unsafe_allow_html=True)
|
| 445 |
+
|
| 446 |
+
input_col1, input_col2 = st.columns([1, 3])
|
| 447 |
+
with input_col1:
|
| 448 |
+
coolant_t_input = st.number_input("", 0.0, 200.0, 80.0, 1.0, key="coolant_t_num", label_visibility="collapsed")
|
| 449 |
+
with input_col2:
|
| 450 |
+
coolant_t_slider = st.slider("", 0.0, 200.0, coolant_t_input, 1.0, key="coolant_t_sld", label_visibility="collapsed")
|
| 451 |
+
|
| 452 |
coolant_temp = coolant_t_slider if coolant_t_slider != coolant_t_input else coolant_t_input
|
| 453 |
st.markdown(f'<div class="param-value-display" style="color: #ff3366;">{coolant_temp:.1f}</div>', unsafe_allow_html=True)
|
| 454 |
st.plotly_chart(create_gauge(coolant_temp, 200, "#ff3366"), use_container_width=True, config={'displayModeBar': False})
|
|
|
|
| 457 |
with col5:
|
| 458 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 459 |
st.markdown('<div class="param-header"><span class="param-icon">💧</span><span class="param-name">Coolant Pressure (Bar)</span></div>', unsafe_allow_html=True)
|
| 460 |
+
|
| 461 |
+
input_col1, input_col2 = st.columns([1, 3])
|
| 462 |
+
with input_col1:
|
| 463 |
+
coolant_p_input = st.number_input("", 0.0, 10.0, 2.16, 0.1, key="coolant_p_num", label_visibility="collapsed")
|
| 464 |
+
with input_col2:
|
| 465 |
+
coolant_p_slider = st.slider("", 0.0, 10.0, coolant_p_input, 0.1, key="coolant_p_sld", label_visibility="collapsed")
|
| 466 |
+
|
| 467 |
coolant_p = coolant_p_slider if coolant_p_slider != coolant_p_input else coolant_p_input
|
| 468 |
st.markdown(f'<div class="param-value-display" style="color: #00ff88;">{coolant_p:.2f}</div>', unsafe_allow_html=True)
|
| 469 |
st.plotly_chart(create_gauge(coolant_p, 10, "#00ff88"), use_container_width=True, config={'displayModeBar': False})
|
|
|
|
| 472 |
with col6:
|
| 473 |
st.markdown('<div class="param-card">', unsafe_allow_html=True)
|
| 474 |
st.markdown('<div class="param-header"><span class="param-icon">🔥</span><span class="param-name">Oil Temp (°C)</span></div>', unsafe_allow_html=True)
|
| 475 |
+
|
| 476 |
+
input_col1, input_col2 = st.columns([1, 3])
|
| 477 |
+
with input_col1:
|
| 478 |
+
oil_t_input = st.number_input("", 0.0, 150.0, 80.0, 1.0, key="oil_t_num", label_visibility="collapsed")
|
| 479 |
+
with input_col2:
|
| 480 |
+
oil_t_slider = st.slider("", 0.0, 150.0, oil_t_input, 1.0, key="oil_t_sld", label_visibility="collapsed")
|
| 481 |
+
|
| 482 |
oil_temp = oil_t_slider if oil_t_slider != oil_t_input else oil_t_input
|
| 483 |
st.markdown(f'<div class="param-value-display" style="color: #a855f7;">{oil_temp:.1f}</div>', unsafe_allow_html=True)
|
| 484 |
st.plotly_chart(create_gauge(oil_temp, 150, "#a855f7"), use_container_width=True, config={'displayModeBar': False})
|