Skip to content

Commit c8f931a

Browse files
Modified temp and voltage displays
1 parent ed8076c commit c8f931a

File tree

4 files changed

+103
-21
lines changed

4 files changed

+103
-21
lines changed

Diff for: backend/test_server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ async def get_tm():
208208
rand_move = random.randint(-1, 1)
209209
f_x += rand_move * .01
210210

211-
if (abs(f_x) > 2):
211+
if (abs(f_x) > 1):
212212
f_x = 0
213213

214214
if (f_x > max_rt):
@@ -220,7 +220,7 @@ async def get_tm():
220220
rand_move = random.randint(-1, 1)
221221
f_y += rand_move * .01
222222

223-
if (abs(f_y) > 2):
223+
if (abs(f_y) > 1):
224224
f_y = 0
225225

226226
if (f_y > max_fr):

Diff for: frontend/src/Components/BatteryStatus.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -77,46 +77,46 @@ const BatteryStatus = forwardRef((props, ref) => {
7777

7878
<div id="voltages">
7979
<p>
80-
<b>ACCUM</b>
80+
Accum (V)
8181
</p>
8282
<p>
83-
<span className="label">Min </span>
84-
<span className="value" style={{'backgroundColor': minCell < Constants.CELL_THRESHOLDS[0] ? color[0] : minCell < Constants.CELL_THRESHOLDS[1] ? color[1] : color[2]}}>
85-
<b>{padDecimal(minCell)}V</b>
83+
<span className="label" id="min-cell-label">Min </span>
84+
<span className="value" id="min-cell-val" style={{'backgroundColor': minCell < Constants.CELL_THRESHOLDS[0] ? color[0] : minCell < Constants.CELL_THRESHOLDS[1] ? color[1] : color[2]}}>
85+
<b>{padDecimal(minCell)}</b>
8686
</span>
8787
</p>
8888
<p>
89-
<span className="label">Total </span><b>{invVolts}V</b>
89+
<span className="label" id="total-label">Total </span><span id="total-val"><b>{invVolts}</b></span>
9090
</p>
9191
<p>
92-
<span className="label">Avg </span>
93-
<span className="value" style={{'backgroundColor': avgCell < Constants.CELL_THRESHOLDS[0] ? color[0] : avgCell < Constants.CELL_THRESHOLDS[1] ? color[1] : color[2]}}>
94-
<b>{padDecimal(avgCell)}V</b>
92+
<span className="label" id="avg-cell-label">Avg </span>
93+
<span className="value" id="avg-cell-val" style={{'backgroundColor': avgCell < Constants.CELL_THRESHOLDS[0] ? color[0] : avgCell < Constants.CELL_THRESHOLDS[1] ? color[1] : color[2]}}>
94+
<b>{padDecimal(avgCell)}</b>
9595
</span>
9696
</p>
9797
</div>
9898

9999
<div id="temps">
100100
<p>
101-
<b>TEMP</b>
101+
Temp (C)
102102
</p>
103103
<p>
104-
<span className="value" style={{'backgroundColor': invTemp > Constants.INV_TEMP_THRESHOLDS[0] ? color[0] : invTemp > Constants.INV_TEMP_THRESHOLDS[1] ? color[1] : color[2]}}>
105-
<b>{invTemp}F</b>
104+
<span className="value" id="inv-temp-val" style={{'backgroundColor': invTemp > Constants.INV_TEMP_THRESHOLDS[0] ? color[0] : invTemp > Constants.INV_TEMP_THRESHOLDS[1] ? color[1] : color[2]}}>
105+
<b>{invTemp}</b>
106106
</span>
107-
<span className="label"> Inv</span>
107+
<span className="label" id="inv-temp-label"> Inv</span>
108108
</p>
109109
<p>
110-
<span className="value" style={{'backgroundColor': accTemp > Constants.ACC_TEMP_THRESHOLDS[0] ? color[0] : accTemp > Constants.ACC_TEMP_THRESHOLDS[1] ? color[1] : color[2]}}>
111-
<b>{accTemp}F</b>
110+
<span className="value" id="accum-temp-val" style={{'backgroundColor': accTemp > Constants.ACC_TEMP_THRESHOLDS[0] ? color[0] : accTemp > Constants.ACC_TEMP_THRESHOLDS[1] ? color[1] : color[2]}}>
111+
<b>{accTemp}</b>
112112
</span>
113-
<span className="label"> Accum</span>
113+
<span className="label" id="accum-temp-label"> Accum</span>
114114
</p>
115115
<p>
116-
<span className="value" style={{'backgroundColor': mtrTemp > Constants.MTR_TEMP_THRESHOLDS[0] ? color[0] : mtrTemp > Constants.MTR_TEMP_THRESHOLDS[1] ? color[1] : color[2]}}>
117-
<b>{mtrTemp}F</b>
116+
<span className="value" id="mtr-temp-val" style={{'backgroundColor': mtrTemp > Constants.MTR_TEMP_THRESHOLDS[0] ? color[0] : mtrTemp > Constants.MTR_TEMP_THRESHOLDS[1] ? color[1] : color[2]}}>
117+
<b>{mtrTemp}</b>
118118
</span>
119-
<span className="label"> Mtr</span>
119+
<span className="label" id="mtr-temp-label"> Mtr</span>
120120
</p>
121121
</div>
122122
</div>

Diff for: frontend/src/Components/StateOfCharge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const StateOfCharge = forwardRef((props, ref) => {
3939
if (tm['batt_pct'] !== undefined && tm['batt_pct'] !== battPct) setBattPct(tm['batt_pct']);
4040
if (tm['mi_est'] !== undefined && tm['mi_est'] !== miEst) setMiEst(tm['mi_est']);
4141
if (tm['lap_est'] !== undefined && tm['lap_est'] !== lapEst) setLapEst(tm['lap_est']);
42-
if (tm['time_est'] !== undefined && tm['time_est'] !== timeEst) { console.log("Updating time est"); setTimeEst(tm['time_est']);};
42+
if (tm['time_est'] !== undefined && tm['time_est'] !== timeEst) setTimeEst(tm['time_est']);;
4343
}
4444
}));
4545

Diff for: frontend/src/Styles/BatteryStatus.css

+82
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,95 @@
1717
position: absolute;
1818
top: 35%;
1919
left: 0;
20+
height: 30%;
21+
width: 12%;
22+
}
23+
24+
#min-cell-label {
25+
margin: 0 0 0 5px;
26+
position: absolute;
27+
bottom: 57%;
28+
left: 0%;
29+
}
30+
31+
#min-cell-val {
32+
position: absolute;
33+
bottom: 57%;
34+
right: -010%;
35+
}
36+
37+
#total-label {
38+
margin: 0 0 0 5px;
39+
position: absolute;
40+
bottom: 35%;
41+
left: 0%;
42+
}
43+
44+
#total-val {
45+
position: absolute;
46+
bottom: 35%;
47+
right: 0%;
48+
}
49+
50+
#avg-cell-label {
51+
margin: 0 0 0 5px;
52+
position: absolute;
53+
bottom: 13%;
54+
left: 0;
55+
}
56+
57+
#avg-cell-val {
58+
position: absolute;
59+
bottom: 13%;
60+
right: 10%;
2061
}
2162

2263
#temps {
2364
position: absolute;
2465
top: 35%;
2566
right: 0;
2667
text-align: right;
68+
height: 30%;
69+
width: 12%;
70+
}
71+
72+
#inv-temp-label {
73+
margin: 0 5px 0 0;
74+
position: absolute;
75+
bottom: 57%;
76+
right: 0%;
77+
}
78+
79+
#inv-temp-val {
80+
position: absolute;
81+
bottom: 57%;
82+
left: -10%;
83+
}
84+
85+
#accum-temp-label {
86+
margin: 0 5px 0 0;
87+
position: absolute;
88+
bottom: 35%;
89+
right: 0%;
90+
}
91+
92+
#accum-temp-val {
93+
position: absolute;
94+
bottom: 35%;
95+
left: 0%;
96+
}
97+
98+
#mtr-temp-label {
99+
margin: 0 5px 0 0;
100+
position: absolute;
101+
bottom: 13%;
102+
right: 0;
103+
}
104+
105+
#mtr-temp-val {
106+
position: absolute;
107+
bottom: 13%;
108+
left: 10%;
27109
}
28110

29111
.value {

0 commit comments

Comments
 (0)