Skip to content

Commit 89ecc5c

Browse files
committed
Merge branch 'late_night_nav_testing'
2 parents 06bc5a9 + f4acc50 commit 89ecc5c

32 files changed

+306
-471
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"retrieval_timeout": 60000, "telemetry_port": 7000, "command_port": 6000, "heartbeat_timeout": 5000, "pod_address": "127.0.0.1", "pod_driver": "Simulation", "controlLaptopIpAddr": "192.168.0.2"}
1+
{"command_port": 6000, "retrieval_timeout": 60000, "pod_address": "127.0.0.1", "pod_driver": "Simulation", "controlLaptopIpAddr": "192.168.0.6", "telemetry_port": 7000, "heartbeat_timeout": 5000}

OnLand/ControlLaptop/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class OverridesForm(FlaskForm):
77
lp_1 = BooleanField("N0 : Low Pressure 1")
88
lp_2 = BooleanField("N1 : Low Pressure 2")
99
lp_3 = BooleanField("N2 : Low Pressure 3")
10-
lp_4 = BooleanField("N3 : Low Pressure 3")
10+
lp_4 = BooleanField("N3 : Regulated Pressure")
1111
hp = BooleanField("N4 : High Pressure")
1212
hp_temp = BooleanField("N5 : Tank Temperature")
1313
bms_values = BooleanField("C2: BMS Values")
@@ -46,7 +46,7 @@ class FlightProfileForm(FlaskForm):
4646
flight_distance = IntegerField('Flight Distance (m)', validators=[DataRequired("Required"), NumberRange(0, 2300, "0 < Flight Distance < 2300 ")])
4747
taxi = BooleanField("Taxi")
4848
tube_pressure = IntegerField(' Tube Pressure ', default=0)
49-
max_velocity = IntegerField('Max Velocity', validators=[DataRequired("Required"), NumberRange(-1, 200, " 0 < Max velocity < 200 ")])
49+
max_velocity = IntegerField('Max Velocity', validators=[DataRequired("Required"), NumberRange(-1, 500, " 0 < Max velocity < 200 ")])
5050
brake_distance = IntegerField('Braking Distance', validators=[DataRequired("Required"), NumberRange(-1, 500, " 0 < Braking Distance < 500 ")])
5151

5252

OnLand/ControlLaptop/static/assets/js/SensorTable.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,34 +102,42 @@ socket.on('pod_telemetry', function (data) {
102102
// highlight pod states when they are none
103103
if(value_name === 'podState') {
104104
if(value === 'psNone') {
105-
$("#podState").css("background-color", "#F2DEDE");
105+
$(".podState").addClass("danger");
106+
$(".podState").removeClass("success");
106107
}
107108
else {
108-
$("#podState").css("background-color", "#FFFFFF");
109+
$(".podState").addClass("success");
110+
$(".podState").removeClass("danger");
109111
}
110112
}
111113
if(value_name === 'brakeNodeState') {
112114
if(value === 'bnsNone') {
113-
$("#brakeNodeState").css("background-color", "#F2DEDE");
115+
$(".brakeNodeState").addClass("danger");
116+
$(".brakeNodeState").removeClass("success");
114117
}
115118
else {
116-
$("#brakeNodeState").css("background-color", "#FFFFFF");
119+
$(".brakeNodeState").addClass("success");
120+
$(".brakeNodeState").removeClass("danger");
117121
}
118122
}
119123
if(value_name === 'lvdcNodeState') {
120124
if(value === 'lvdcNone') {
121-
$("#lvdcNodeState").css("background-color", "#F2DEDE");
125+
$(".lvdcNodeState").addClass("danger");
126+
$(".lvdcNodeState").removeClass("success");
122127
}
123128
else {
124-
$("#lvdcNodeState").css("background-color", "#FFFFFF");
129+
$(".lvdcNodeState").addClass("success");
130+
$(".lvdcNodeState").removeClass("danger");
125131
}
126132
}
127133
if(value_name === 'navNodeState') {
128134
if(value === 'navNone') {
129-
$("#navNodeState").css("background-color", "#F2DEDE");
135+
$(".navNodeState").addClass("danger");
136+
$(".navNodeState").removeClass("success");
130137
}
131138
else {
132-
$("#navNodeState").css("background-color", "#FFFFFF");
139+
$(".navNodeState").addClass("success");
140+
$(".navNodeState").removeClass("danger");
133141
}
134142
}
135143

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$( document ).ready(function() {
2+
socket.emit('join_room', 'telemetry_updates');
3+
});
4+
5+
6+
socket.on('pod_telemetry', function (data) {
7+
let value, value_cell, value_name, current_state;
8+
data = JSON.parse(data);
9+
10+
cells = data['hvBatteryCellVoltages']
11+
12+
for (let id = 0; id <= 191; id++) {
13+
temp = cells[id]
14+
document.getElementById(id).innerHTML = temp.toFixed(4)
15+
16+
if (temp > 175) {
17+
$(`.${id}`).addClass("danger")
18+
$(`.${id}`).removeClass("success")
19+
}
20+
else {
21+
$(`.${id}`).addClass("success")
22+
$(`.${id}`).removeClass("danger")
23+
}
24+
}
25+
});

OnLand/ControlLaptop/templates/_cards/HV_values.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="card " style="height:53%;">
1+
<div class="card " style="height:40%;">
22
<div class="header">
33
<h4 class="title">High Voltage Overview</h4>
44
</div>

OnLand/ControlLaptop/templates/_cards/LV_values.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="card " style="height:53%;">
1+
<div class="card " style="height:40%;">
22
<div class="header">
33
<h4 class="title">Low Voltage Overview</h4>
44
</div>

OnLand/ControlLaptop/templates/archived/battery_header.html renamed to OnLand/ControlLaptop/templates/_cards/battery_header.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ <h2 style="display: inline"><small>A</small></h2>
2929
<label for="maxT">Max Temp</label>
3030
<input class="form-control" id="maxT">
3131
</div>
32-
<div class="form-group col-md-1"></div>
33-
<div class="form-group col-md-2">
34-
<label for="maxD">Max Differential</label>
35-
<input class="form-control" id="maxD">
36-
</div>
3732
</div>
3833
<div class="text-right">
3934
<button type="submit" class='btn btn-primary btn-fill btn-md'>Apply</button>

OnLand/ControlLaptop/templates/_cards/inverter_values.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="card " style="height:53%;">
1+
<div class="card " style="height:40%;">
22
<div class="header">
33
<h4 class="title">Inverter Overview</h4> Connected : <span id="inverterHeartbeat" class="telemetry-value boolean"></span>
44
</div>

OnLand/ControlLaptop/templates/_cards/sensor_values.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="card " style="height:53%;">
1+
<div class="card " style="height:40%;">
22
<div class="header">
33
<h4 class="title">Sensor Overview</h4>
44
</div>

OnLand/ControlLaptop/templates/_cards/states.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ <h4 class="title">States</h4>
66
<div class="content row0">
77
<table class="table" id="pod-state-values">
88
<tbody>
9-
<tr>
9+
<tr class="podState">
1010
<th scope="row"></th>
1111
<td><b>Flight Computer</b></td>
1212
<td><span id="podState" class="telemetry-value">--</span></td>
1313
</tr>
14-
<tr>
14+
<tr class="brakeNodeState">
1515
<th scope="row"></th>
1616
<td><b>Brake Node</b></td>
1717
<td><span id="brakeNodeState" class="telemetry-value">--</span></td>
1818
</tr>
19-
<tr>
19+
<tr class="lvdcNodeState">
2020
<th scope="row"></th>
2121
<td><b>LVDC Node</b></td>
2222
<td><span id="lvdcNodeState" class="telemetry-value">--</span></td>
2323
</tr>
24-
<tr>
24+
<tr class="navNodeState">
2525
<th scope="row"></th>
2626
<td><b>Navigation Node</b></td>
2727
<td><span id="navNodeState" class="telemetry-value">--</span></td>

0 commit comments

Comments
 (0)