Skip to content

Commit 7c11aa7

Browse files
Mark JessopMark Jessop
authored andcommitted
Move recovery reporting to ballon tab. Add planned recovery option, and handling of planned tag
1 parent a167ff2 commit 7c11aa7

File tree

5 files changed

+129
-59
lines changed

5 files changed

+129
-59
lines changed

index.template.html

Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,66 @@
8989

9090
<div id="recoveriesbox" style="display: none" class="flatpage">
9191
<div class="slimContainer">
92-
<h2><i class="icon-habhub rfloat"></i>Recoveries</h2>
92+
<h3><i class="icon-habhub rfloat"></i>Report Recovery</h3>
9393
<hr/>
94-
<p>Recovery reports can be added on the Chase-Car pane.</p>
94+
<div class="row">
95+
<span>You can report a recovery here. Enter the serial number (e.g. 'S1234567'), tick recovered/not recovered, and add some notes. <a href="https://github.com/projecthorus/sondehub-infra/wiki/Radiosonde-Serial-Numbers" target="_blank" rel="noopener">Click here</a> for information on how to locate a sonde's serial number.</a> If the sonde is not on the map, type its serial into the top-left search box (may require landscape mode on mobile) and press enter to retrieve historical data. You can then mark it as recovered or planned. Optionally, you can use your location instead of the sonde's last location.</span>
96+
</div>
97+
<div class="row">
98+
<span><b>Serial</b></span>
99+
<span class="r"><input type="text" id="pr_serial" style="width: 140px;"/></span>
100+
</div>
101+
<div class="row">
102+
<span><b>Recovered By</b></span>
103+
<span class="r"><input type="text" id="recovery_callsign" style="width: 140px;" maxlength="15"/></span>
104+
</div>
105+
<div class="row option">
106+
<span><b>Recovery Success</b></span>
107+
<div class="switchyn on" id="sw_recovery_ok">
108+
<span class="thumb"></span>
109+
<input type="checkbox" id="recovery_ok">
110+
</div>
111+
</div>
112+
<div class="row option">
113+
<span><b>Recovery Planned</b></span>
114+
<div class="switchyn off" id="sw_recovery_planned">
115+
<span class="thumb"></span>
116+
<input type="checkbox" id="recovery_planned">
117+
</div>
118+
</div>
119+
<div class="row option">
120+
<span><b>Use Car Position</b></span>
121+
<div class="switch off" id="sw_use_car_pos">
122+
<span class="thumb"></span>
123+
<input type="checkbox" id="use_car_pos">
124+
</div>
125+
</div>
126+
<div class="row">
127+
<span><b>Notes</b></span>
128+
</div>
129+
<div class="row">
130+
<span>
131+
<!--<input type="text" id="pr_notes" style="width: 140px;"/>-->
132+
<textarea name="pr_notes" id="pr_notes" style="width:280px;height:60px;"></textarea>
133+
</span>
134+
</div>
135+
<div class="row">
136+
<span><b>Report Result</b></span>
137+
<span class="r" id="pr_last_report">none</span>
138+
</div>
139+
<div class="row">
140+
<div class="g-recaptcha" data-sitekey="6LcEkBUbAAAAABTgn2lktm6UPeP0lbyqIDBBujSF"></div>
141+
</div>
142+
<div class="row">
143+
<span class="r"><input type="button" value="Submit" id="pr_submit" onclick="ChaseCar.markRecovered();"/></span>
144+
</div>
95145
<hr/>
96-
<div id="recovery-list"><img style="width:90px;height:30px;display:block;margin:auto;" src="img/hab-spinner.gif"/><br></div>
97-
</div>
98-
<div class="slimContainer">
99-
<h2>Statistics</h2>
146+
<h3>Statistics</h3>
100147
<hr/>
101148
<div id="leaderboard-list"><img style="width:90px;height:30px;display:block;margin:auto;" src="img/hab-spinner.gif"/><br></div>
149+
<hr/>
150+
<h3>Recoveries</h3>
151+
<div id="recovery-list"><img style="width:90px;height:30px;display:block;margin:auto;" src="img/hab-spinner.gif"/><br></div>
102152
</div>
103153
</div>
104154
<div id="aboutbox" style="display: none" class="flatpage">
@@ -119,7 +169,7 @@ <h4>Radiosondes?</h4>
119169
<br/>
120170

121171
<h4>Found a Radiosonde?</h4>
122-
Click the 'car' icon on the top-right to submit a recovery notification.
172+
<b>Please click the 'balloon' icon on the top-right to submit a recovery notification!</b>
123173

124174
<h4>Support Us!</h4>
125175
If you use SondeHub regularly, please consider <a href="https://www.patreon.com/sondehub" target="_blank" rel="noopener">supporting us on Patreon</a>, or with a <a href="https://sondehub.org/go/donate" target="_blank" rel="noopener">donation on Paypal</a>.</br>
@@ -351,48 +401,7 @@ <h2><i class="icon-car rfloat"></i>Chase Mode</h2>
351401
<span class="r" id="cc_speed">none</span>
352402
</div>
353403
<hr>
354-
<h3>Report Recovery</h3>
355-
<hr>
356-
<div class="row">
357-
<span>You can report a recovery here. Enter the serial number (e.g. 'S1234567'), tick recovered/not recovered, and add some notes. <a href="https://github.com/projecthorus/sondehub-infra/wiki/Radiosonde-Serial-Numbers" target="_blank" rel="noopener">Click here</a> for information on how to locate a sonde's serial number.</a> If the sonde is not on the map, type its serial into the top-left search box and press enter to retrieve historical data. You can then mark it as recovered. Optionally, you can use your location instead of the sonde's last location.</span>
358-
</div>
359-
<div class="row">
360-
<span><b>Serial</b></span>
361-
<span class="r"><input type="text" id="pr_serial" style="width: 140px;"/></span>
362-
</div>
363-
<div class="row option">
364-
<span><b>Recovery Success</b></span>
365-
<div class="switchyn on" id="sw_recovery_ok">
366-
<span class="thumb"></span>
367-
<input type="checkbox" id="recovery_ok">
368-
</div>
369-
</div>
370-
<div class="row option">
371-
<span><b>Use Car Position</b></span>
372-
<div class="switch off" id="sw_use_car_pos">
373-
<span class="thumb"></span>
374-
<input type="checkbox" id="use_car_pos">
375-
</div>
376-
</div>
377-
<div class="row">
378-
<span><b>Notes</b></span>
379-
</div>
380-
<div class="row">
381-
<span>
382-
<!--<input type="text" id="pr_notes" style="width: 140px;"/>-->
383-
<textarea name="pr_notes" id="pr_notes" style="width:280px;height:60px;"></textarea>
384-
</span>
385-
</div>
386-
<div class="row">
387-
<span><b>Report Result</b></span>
388-
<span class="r" id="pr_last_report">none</span>
389-
</div>
390-
<div class="row">
391-
<div class="g-recaptcha" data-sitekey="6LcEkBUbAAAAABTgn2lktm6UPeP0lbyqIDBBujSF"></div>
392-
</div>
393-
<div class="row">
394-
<span class="r"><input type="button" value="Submit" id="pr_submit" onclick="ChaseCar.markRecovered();"/></span>
395-
</div>
404+
Recovery reporting is now on the recoveries tab! (Balloon icon)
396405

397406
</div>
398407
</div>

js/app.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,23 @@ $(window).ready(function() {
748748
// turning the switch on
749749
} else {
750750
e.removeClass('off').addClass('on');
751+
// Remove any planned recovery check.
752+
$("#sw_recovery_planned").removeClass('on').addClass('off');
753+
}
754+
});
755+
// Logic to switch the recovery Planned button
756+
$("#sw_recovery_planned").click(function() {
757+
var e = $(this);
758+
759+
// turning the switch off
760+
if(e.hasClass('on')) {
761+
e.removeClass('on').addClass('off');
762+
763+
// turning the switch on
764+
} else {
765+
e.removeClass('off').addClass('on');
766+
// Set recovery OK to false.
767+
$("#sw_recovery_ok").removeClass('on').addClass('off');
751768
}
752769
});
753770
// Logic to switch the use car position button
@@ -768,11 +785,21 @@ $(window).ready(function() {
768785
callsign = $(this).val().trim();
769786
offline.set('callsign', callsign); // put in localStorage
770787
CHASE_listenerSent = false;
788+
$('#recovery_callsign').val(callsign);
789+
});
790+
791+
$("#recovery_callsign").on('change keyup', function() {
792+
callsign = $(this).val().trim();
793+
offline.set('callsign', callsign); // put in localStorage
794+
CHASE_listenerSent = false;
795+
$('#cc_callsign').val(callsign);
771796
});
772797

798+
773799
// load value from localStorage
774800
callsign = offline.get('callsign');
775801
$('#cc_callsign').val(callsign);
802+
$('#recovery_callsign').val(callsign);
776803

777804
// settings page
778805

js/chasecar.lib.js

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

4646
ChaseCar.markRecovered = function(){
4747

48-
// Distance limits reinstated 2021-12-04
49-
_run_checks = true;
48+
// Remove range checks - 2025-01-24
49+
_range_check = false;
5050
_range_limit = 500000; // 200 km
5151

5252
// Get the serial number to be marked recovered
@@ -55,15 +55,15 @@ ChaseCar.markRecovered = function(){
5555
_notes = $("#pr_notes").val().trim();
5656

5757
// Check it exists.
58-
if(_serial.includes("chase") && _run_checks){
58+
if(_serial.includes("chase")){
5959
$('#pr_last_report').text("Invalid sonde callsign.");
6060
return;
6161
}
6262

63-
_callsign = $("#cc_callsign").val().trim();
63+
_callsign = $("#recovery_callsign").val().trim();
6464
if (_callsign == "" || _callsign == undefined || _callsign.length == 0)
6565
{
66-
$('#pr_last_report').text("Enter a callsign in the chase-car section above!");
66+
$('#pr_last_report').text("Enter a callsign/name in the 'Recovered by' field!");
6767
return;
6868
}
6969

@@ -109,7 +109,7 @@ ChaseCar.markRecovered = function(){
109109
// Calculate the distance from the sonde
110110
_lookangles = calculate_lookangles(_chaser, _sonde);
111111

112-
if( (_lookangles.range > _range_limit ) && _run_checks){
112+
if( (_lookangles.range > _range_limit ) && _range_check){
113113
$('#pr_last_report').text("Outside distance limit (500km).");
114114
return;
115115
}
@@ -120,13 +120,18 @@ ChaseCar.markRecovered = function(){
120120
}
121121
}
122122

123+
// Logic to make recovery & planned mutually exclusive is in app.js
124+
_recovered = $("#sw_recovery_ok").hasClass('on');
125+
_planned = $("#sw_recovery_planned").hasClass('on');
126+
123127

124128
var _doc = {
125129
"serial": _serial,
126130
"lat": _recov_lat,
127131
"lon": _recov_lon,
128132
"alt": 0.0,
129-
"recovered": $("#sw_recovery_ok").hasClass('on'),
133+
"recovered": _recovered,
134+
"planned": _planned,
130135
"recovered_by": _callsign,
131136
"description": _notes
132137
};
@@ -142,6 +147,7 @@ ChaseCar.markRecovered = function(){
142147

143148
$('#pr_last_report').text("Submitting report...");
144149

150+
145151
$.ajax({
146152
type: "PUT",
147153
url: ChaseCar.recovery_uri,

js/sondehub.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4699,8 +4699,17 @@ function updateRecoveryMarker(recovery) {
46994699

47004700
div = document.createElement('div');
47014701

4702+
_recovered_text = recovery.recovered ? " Recovered" : " Not Recovered";
4703+
4704+
// Override text is planned field exists and is true
4705+
if(recovery.hasOwnProperty('planned')){
4706+
if(recovery.planned == true){
4707+
_recovered_text = " Recovery Planned";
4708+
}
4709+
}
4710+
47024711
html = "<div style='line-height:16px;position:relative;'>";
4703-
html += "<div><b>"+recovery.serial+(recovery.recovered ? " Recovered" : " Not Recovered")+"</b></div>";
4712+
html += "<div><b>"+recovery.serial+_recovered_text+"</b></div>";
47044713
html += "<hr style='margin:5px 0px'>";
47054714
html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i>&nbsp;</b>"+format_coordinates(recovery.lat, recovery.lon, recovery.serial)+"</div>";
47064715

@@ -4755,6 +4764,7 @@ function updateRecoveryMarker(recovery) {
47554764
recovery.recovered = r[i].recovered;
47564765
recovery.description = r[i].description;
47574766
recovery.datetime = r[i].datetime;
4767+
recovery.planned = r[i].planned;
47584768
recovery.fresh = true;
47594769
updateRecoveryMarker(recovery);
47604770

@@ -4808,8 +4818,17 @@ function updateRecoveryPane(r){
48084818
recoveries[r_index] = {marker: null, infobox: null};
48094819
}
48104820

4821+
_recovered_text = r[i].recovered ? " Recovered by " : " Not Recovered by ";
4822+
4823+
// Override text is planned field exists and is true
4824+
if(r[i].hasOwnProperty('planned')){
4825+
if(r[i].planned == true){
4826+
_recovered_text = " Recovery Planned by ";
4827+
}
4828+
}
4829+
48114830
html += "<div style='line-height:16px;position:relative;'>";
4812-
html += "<div><b><u>"+r[i].serial+(r[i].recovered ? " Recovered by " : " Not Recovered by ")+r[i].recovered_by+"</u></b></div>";
4831+
html += "<div><b><u>"+r[i].serial+(_recovered_text)+r[i].recovered_by+"</u></b></div>";
48134832
html += "<div style='margin-bottom:5px;'><b><button style='margin-bottom:0px;' onclick='panToRecovery(\"" + r[i].serial + "\")'><i class='icon-location'></i></button>&nbsp;</b>"+format_coordinates(lat, lon, r[i].serial)+"</div>";
48144833

48154834
var imp = offline.get('opt_imperial');

js/station.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,16 @@ function drawHistorical (data, station) {
195195
html += "<hr style='margin:0px;margin-top:5px'>";
196196

197197
if (recovered) {
198-
html += "<div><b>"+(recovery_info.recovered ? "Recovered by " : "Not Recovered by ")+recovery_info.recovered_by+"</u></b></div>";
198+
_recovered_text = recovery_info.recovered ? "Recovered by " : "Not Recovered by ";
199+
200+
// Override text is planned field exists and is true
201+
if(recovery_info.hasOwnProperty('planned')){
202+
if(recovery_info.planned == true){
203+
_recovered_text = "Recovery Planned by ";
204+
}
205+
}
206+
207+
html += "<div><b>"+(_recovered_text)+recovery_info.recovered_by+"</u></b></div>";
199208
html += "<div><b>Recovery time:&nbsp;</b>"+formatDate(stringToDateUTC(recovery_info.datetime))+"</div>";
200209
html += "<div><b>Recovery location:&nbsp;</b>"+recovery_info.position[1]+", "+recovery_info.position[0] + "</div>";
201210
html += "<div><b>Recovery notes:&nbsp;</b>"+recovery_info.description+"</div>";

0 commit comments

Comments
 (0)