Skip to content

Commit 0b39169

Browse files
authored
Merge pull request #213 from projecthorus/testing
More chase icons, distance limit, settings reorganise, hide horizon default
2 parents bdad29b + c747716 commit 0b39169

File tree

6 files changed

+47
-42
lines changed

6 files changed

+47
-42
lines changed

img/markers/car-purple.png

20.8 KB
Loading

img/markers/car-teal.png

21 KB
Loading

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: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var graph_vehicle = null;
6363
var manual_pan = false;
6464

6565
var car_index = 0;
66-
var car_colors = ["blue", "red", "green", "yellow"];
66+
var car_colors = ["blue", "red", "green", "yellow", "teal", "purple"];
6767
var balloon_index = 0;
6868
var balloon_colors_name = ["red", "blue", "green", "yellow", "purple", "orange", "cyan"];
6969
var balloon_colors = ["#f00", "blue", "green", "#FDFC30", "#c700e6", "#ff8a0f", "#0fffca"];
@@ -715,7 +715,7 @@ function load() {
715715

716716
map.on('zoomend', function() {
717717
//do check for horizon labels
718-
if (!offline.get("opt_hide_horizon")) {
718+
if (offline.get("opt_hide_horizon")) {
719719
for (key in vehicles) {
720720
if (vehicles[key]["vehicle_type"] == "balloon") {
721721
if (vehicles[key]["horizon_circle"]["_map"])
@@ -3416,7 +3416,7 @@ function addPosition(position) {
34163416
} else {
34173417
map.addLayer(vehicle.marker.shadow);
34183418

3419-
if(offline.get('opt_hide_horizon') == false){
3419+
if(!offline.get('opt_hide_horizon') == false){
34203420
map.addLayer(vehicle.horizon_circle);
34213421
map.addLayer(vehicle.subhorizon_circle);
34223422
map.addLayer(vehicle.horizon_circle_title);
@@ -3490,7 +3490,7 @@ function addPosition(position) {
34903490
interactive: false,
34913491
});
34923492

3493-
if (!offline.get("opt_hide_horizon")) {
3493+
if (offline.get("opt_hide_horizon")) {
34943494
horizon_circle.addTo(map);
34953495
horizon_circle_title.addTo(map);
34963496
}
@@ -3522,7 +3522,7 @@ function addPosition(position) {
35223522
interactive: false,
35233523
});
35243524

3525-
if (!offline.get("opt_hide_horizon")) {
3525+
if (offline.get("opt_hide_horizon")) {
35263526
subhorizon_circle.addTo(map);
35273527
subhorizon_circle_title.addTo(map);
35283528
}
@@ -5372,7 +5372,6 @@ function refreshUI() {
53725372
if(follow_vehicle !== null) update_lookangles(follow_vehicle);
53735373
}
53745374

5375-
53765375
function hideHorizonRings(){
53775376
for(var vcallsign in vehicles) {
53785377
if(vehicles[vcallsign].vehicle_type == "balloon"){
@@ -5383,6 +5382,7 @@ function hideHorizonRings(){
53835382
}
53845383
}
53855384
}
5385+
53865386
function showHorizonRings(){
53875387
for(var vcallsign in vehicles) {
53885388
if(vehicles[vcallsign].vehicle_type == "balloon"){
@@ -5401,6 +5401,7 @@ function hideTitles(){
54015401
}
54025402
}
54035403
}
5404+
54045405
function showTitles(){
54055406
for(var vcallsign in vehicles) {
54065407
if(vehicles[vcallsign].vehicle_type == "balloon" || vehicles[vcallsign].vehicle_type == "car"){

0 commit comments

Comments
 (0)