Skip to content

Commit 8ce279b

Browse files
authored
Merge pull request #215 from LukePrior/testing
XDATA + single recovery
2 parents 0364400 + 7eeb217 commit 8ce279b

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

js/tracker.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4767,6 +4767,7 @@ function refreshSingle(serial) {
47674767
success: function(data, textStatus) {
47684768
response = formatData(data, false);
47694769
update(response);
4770+
singleRecovery(serial);
47704771
$("#stText").text("");
47714772
},
47724773
error: function() {
@@ -4896,6 +4897,22 @@ function refreshNewReceivers(initial, serial) {
48964897
});
48974898
}
48984899

4900+
function singleRecovery(serial) {
4901+
4902+
var datastr = "serial=" + serial;
4903+
4904+
$.ajax({
4905+
type: "GET",
4906+
url: recovered_sondes_url,
4907+
data: datastr,
4908+
dataType: "json",
4909+
success: function(response, textStatus) {
4910+
updateRecoveries(response);
4911+
}
4912+
});
4913+
4914+
}
4915+
48994916
function refreshRecoveries() {
49004917

49014918
$.ajax({

js/xdata.js

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,57 @@ function parseXDATA(data){
105105
_current_xdata = data_split[xdata_i];
106106

107107
// Get Instrument ID
108+
// https://gml.noaa.gov/aftp/user/jordan/XDATA%20Instrument%20ID%20Allocation.pdf
109+
// https://www.gruan.org/gruan/editor/documents/gruan/GRUAN-TN-11_GruanToolRs92_v1.0_2020-10-01.pdf
108110
_instrument = _current_xdata.substr(0,2);
109111

110-
if(_instrument === '05'){
112+
if (_instrument === '01') {
113+
// V7
114+
_output = {'xdata_instrument': 'V7'};
115+
} else if (_instrument === '05'){
111116
// OIF411
112117
_xdata_temp = parseOIF411(_current_xdata);
113118
_output = Object.assign(_output,_xdata_temp);
119+
} else if (_instrument === '08'){
120+
// CFH
121+
_output = {'xdata_instrument': 'CFH'};
122+
} else if (_instrument === '10'){
123+
// FPH
124+
_output = {'xdata_instrument': 'FPH'};
125+
} else if (_instrument === '18'){
126+
// COBALD
127+
_output = {'xdata_instrument': 'COBALD'};
128+
} else if (_instrument === '28'){
129+
// SLW
130+
_output = {'xdata_instrument': 'SLW'};
131+
} else if (_instrument === '38'){
132+
// POPS
133+
_output = {'xdata_instrument': 'POPS'};
134+
} else if (_instrument === '39'){
135+
// OPC
136+
_output = {'xdata_instrument': 'OPC'};
137+
} else if (_instrument === '3C'){
138+
// PCFH
139+
_output = {'xdata_instrument': 'PCFH'};
140+
} else if (_instrument === '3D'){
141+
// FLASH-B
142+
_output = {'xdata_instrument': 'FLASH-B'};
143+
} else if (_instrument === '3E'){
144+
// TRAPS
145+
_output = {'xdata_instrument': 'TRAPS'};
146+
} else if (_instrument === '3F'){
147+
// SKYDEW
148+
_output = {'xdata_instrument': 'SKYDEW'};
149+
} else if (_instrument === '41'){
150+
// CICANUM
151+
_output = {'xdata_instrument': 'CICANUM'};
152+
} else if (_instrument === '45'){
153+
// POPS
154+
_output = {'xdata_instrument': 'POPS'};
114155
} else if (_instrument === '80'){
115156
// Unknown!
116157
//console.log("Saw unknown XDATA instrument 0x80.")
117-
} else {
158+
}else {
118159
// Unknown!
119160

120161
}

0 commit comments

Comments
 (0)