Skip to content

Commit a525922

Browse files
Mark JessopMark Jessop
authored andcommitted
Merge branch 'testing' of github.com:projecthorus/sondehub-tracker into testing
2 parents d2bce53 + c747716 commit a525922

File tree

4 files changed

+46
-41
lines changed

4 files changed

+46
-41
lines changed

index.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ <h2>Contribute</h2>
129129
<div class="slimContainer">
130130
<h2><i class="icon-settings rfloat"></i>Settings</h2>
131131
<hr/>
132+
<h4>General</h4>
133+
<hr/>
132134
<div class="row option">
133135
<span><b>Interpolate gaps in telemetry</b></span>
134136
<div class="switch off" id="sw_interpolate">
@@ -164,6 +166,8 @@ <h2><i class="icon-settings rfloat"></i>Settings</h2>
164166
<input type="checkbox" id="opt_hide_timebox">
165167
</div>
166168
</div>
169+
<h4>Visibility</h4>
170+
<hr/>
167171
<div class="row option">
168172
<span><b>Hide receivers from the map</b></span>
169173
<div class="switch off" id="sw_hide_receivers">
@@ -186,14 +190,7 @@ <h2><i class="icon-settings rfloat"></i>Settings</h2>
186190
</div>
187191
</div>
188192
<div class="row option">
189-
<span><b>Highlight selected vehicle</b></span>
190-
<div class="switch off" id="sw_hilight_vehicle">
191-
<span class="thumb"></span>
192-
<input type="checkbox" id="opt_hilight_vehicle">
193-
</div>
194-
</div>
195-
<div class="row option">
196-
<span><b>Hide Horizon Rings</b></span>
193+
<span><b>Show Horizon Rings</b></span>
197194
<div class="switch off" id="sw_hide_horizon">
198195
<span class="thumb"></span>
199196
<input type="checkbox" id="opt_hide_horizon">
@@ -213,6 +210,15 @@ <h2><i class="icon-settings rfloat"></i>Settings</h2>
213210
<input type="checkbox" id="opt_layers_launches">
214211
</div>
215212
</div>
213+
<h4>Other</h4>
214+
<hr/>
215+
<div class="row option">
216+
<span><b>Highlight selected vehicle</b></span>
217+
<div class="switch off" id="sw_hilight_vehicle">
218+
<span class="thumb"></span>
219+
<input type="checkbox" id="opt_hilight_vehicle">
220+
</div>
221+
</div>
216222
<h4>Overlays</h4>
217223
<hr/>
218224
<div class="row option">

js/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,10 +802,10 @@ $(window).ready(function() {
802802
break;
803803
case "opt_hide_horizon":
804804
if(on) {
805-
hideHorizonRings();
805+
showHorizonRings();
806806
}
807807
else {
808-
showHorizonRings();
808+
hideHorizonRings();
809809
}
810810
break;
811811
case "opt_hide_titles":

js/chasecar.lib.js

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ ChaseCar.updatePosition = function(callsign, position) {
4545

4646
ChaseCar.markRecovered = function(){
4747

48-
// Distance limits removed 2021-12-04
49-
//_run_checks = true;
50-
//_range_limit = 200000; // 200 km
48+
// Distance limits reinstated 2021-12-04
49+
_run_checks = true;
50+
_range_limit = 200000; // 200 km
5151

5252
// Get the serial number to be marked recovered
5353
_serial = $("#pr_serial").val().trim();
@@ -88,33 +88,31 @@ ChaseCar.markRecovered = function(){
8888
}
8989

9090
} else {
91-
// NOTE - Distance checks now removed.
92-
9391
// Sonde is on the map, so run some additional checks.
9492
_recov_lat = vehicles[_serial].curr_position['gps_lat'];
9593
_recov_lon = vehicles[_serial].curr_position['gps_lon'];
9694

97-
// // Now get the last position of the sonde.
98-
// _sonde = {
99-
// 'lat':_recov_lat,
100-
// 'lon':_recov_lon,
101-
// 'alt':0.0
102-
// };
103-
104-
// // Now get the chaser position.
105-
// _chaser = {
106-
// 'lat': parseFloat($('#cc_lat').text()),
107-
// 'lon': parseFloat($('#cc_lon').text()),
108-
// 'alt': 0.0
109-
// };
110-
111-
// // Calculate the distance from the sonde
112-
// _lookangles = calculate_lookangles(_chaser, _sonde);
113-
114-
// if( (_lookangles.range > _range_limit ) && _run_checks){
115-
// $('#pr_last_report').text("Outside distance limit.");
116-
// return;
117-
// }
95+
// Now get the last position of the sonde.
96+
_sonde = {
97+
'lat':_recov_lat,
98+
'lon':_recov_lon,
99+
'alt':0.0
100+
};
101+
102+
// Now get the chaser position.
103+
_chaser = {
104+
'lat': parseFloat($('#cc_lat').text()),
105+
'lon': parseFloat($('#cc_lon').text()),
106+
'alt': 0.0
107+
};
108+
109+
// Calculate the distance from the sonde
110+
_lookangles = calculate_lookangles(_chaser, _sonde);
111+
112+
if( (_lookangles.range > _range_limit ) && _run_checks){
113+
$('#pr_last_report').text("Outside distance limit.");
114+
return;
115+
}
118116

119117
if($("#sw_use_car_pos").hasClass('on')){
120118
_recov_lat = parseFloat($('#cc_lat').text());

js/tracker.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ function load() {
717717

718718
map.on('zoomend', function() {
719719
//do check for horizon labels
720-
if (!offline.get("opt_hide_horizon")) {
720+
if (offline.get("opt_hide_horizon")) {
721721
for (key in vehicles) {
722722
if (vehicles[key]["vehicle_type"] == "balloon") {
723723
if (vehicles[key]["horizon_circle"]["_map"])
@@ -3418,7 +3418,7 @@ function addPosition(position) {
34183418
} else {
34193419
map.addLayer(vehicle.marker.shadow);
34203420

3421-
if(offline.get('opt_hide_horizon') == false){
3421+
if(!offline.get('opt_hide_horizon') == false){
34223422
map.addLayer(vehicle.horizon_circle);
34233423
map.addLayer(vehicle.subhorizon_circle);
34243424
map.addLayer(vehicle.horizon_circle_title);
@@ -3492,7 +3492,7 @@ function addPosition(position) {
34923492
interactive: false,
34933493
});
34943494

3495-
if (!offline.get("opt_hide_horizon")) {
3495+
if (offline.get("opt_hide_horizon")) {
34963496
horizon_circle.addTo(map);
34973497
horizon_circle_title.addTo(map);
34983498
}
@@ -3524,7 +3524,7 @@ function addPosition(position) {
35243524
interactive: false,
35253525
});
35263526

3527-
if (!offline.get("opt_hide_horizon")) {
3527+
if (offline.get("opt_hide_horizon")) {
35283528
subhorizon_circle.addTo(map);
35293529
subhorizon_circle_title.addTo(map);
35303530
}
@@ -5374,7 +5374,6 @@ function refreshUI() {
53745374
if(follow_vehicle !== null) update_lookangles(follow_vehicle);
53755375
}
53765376

5377-
53785377
function hideHorizonRings(){
53795378
for(var vcallsign in vehicles) {
53805379
if(vehicles[vcallsign].vehicle_type == "balloon"){
@@ -5385,6 +5384,7 @@ function hideHorizonRings(){
53855384
}
53865385
}
53875386
}
5387+
53885388
function showHorizonRings(){
53895389
for(var vcallsign in vehicles) {
53905390
if(vehicles[vcallsign].vehicle_type == "balloon"){
@@ -5403,6 +5403,7 @@ function hideTitles(){
54035403
}
54045404
}
54055405
}
5406+
54065407
function showTitles(){
54075408
for(var vcallsign in vehicles) {
54085409
if(vehicles[vcallsign].vehicle_type == "balloon" || vehicles[vcallsign].vehicle_type == "car"){

0 commit comments

Comments
 (0)