@@ -65,7 +65,7 @@ function parseOIF411(xdata, pressure){
6565 return { } ;
6666 }
6767
68- _output = { 'xdata_instrument' : 'OIF411' } ;
68+ var _output = { 'xdata_instrument' : 'OIF411' } ;
6969
7070 // Instrument number is common to all XDATA types.
7171 _output [ 'oif411_instrument_number' ] = parseInt ( xdata . substr ( 2 , 2 ) , 16 ) ;
@@ -160,7 +160,7 @@ function parseCFH(xdata) {
160160 return { } ;
161161 }
162162
163- _output = { 'xdata_instrument' : 'CFH' } ;
163+ var _output = { 'xdata_instrument' : 'CFH' } ;
164164
165165 // Instrument number is common to all XDATA types.
166166 _output [ 'cfh_instrument_number' ] = parseInt ( xdata . substr ( 2 , 2 ) , 16 ) ;
@@ -214,7 +214,7 @@ function parseCOBALD(xdata) {
214214 return { } ;
215215 }
216216
217- _output = { 'xdata_instrument' : 'COBALD' } ;
217+ var _output = { 'xdata_instrument' : 'COBALD' } ;
218218
219219 // Instrument number is common to all XDATA types.
220220 _output [ 'cobald_instrument_number' ] = parseInt ( xdata . substr ( 2 , 2 ) , 16 ) ;
@@ -230,19 +230,19 @@ function parseCOBALD(xdata) {
230230 _internal_temperature = _internal_temperature / 8 ; // Degrees C
231231 _output [ 'cobald_internal_temperature' ] = Math . round ( _internal_temperature * 10 ) / 10 ; // 1 DP
232232
233- // Blue backskatter
234- _blue_backskatter = parseInt ( xdata . substr ( 10 , 6 ) , 16 ) ;
235- if ( ( _blue_backskatter & 0x800000 ) > 0 ) {
236- _blue_backskatter = _blue_backskatter - 0x1000000 ;
233+ // Blue backscatter
234+ _blue_backscatter = parseInt ( xdata . substr ( 10 , 6 ) , 16 ) ;
235+ if ( ( _blue_backscatter & 0x800000 ) > 0 ) {
236+ _blue_backscatter = _blue_backscatter - 0x1000000 ;
237237 }
238- _output [ 'cobald_blue_backskatter ' ] = _blue_backskatter ;
238+ _output [ 'cobald_blue_backscatter ' ] = _blue_backscatter ;
239239
240- // Red backskatter
241- _red_backskatter = parseInt ( xdata . substr ( 16 , 6 ) , 16 ) ;
242- if ( ( _red_backskatter & 0x800000 ) > 0 ) {
243- _red_backskatter = _red_backskatter - 0x1000000 ;
240+ // Red backckatter
241+ _red_backscatter = parseInt ( xdata . substr ( 16 , 6 ) , 16 ) ;
242+ if ( ( _red_backscatter & 0x800000 ) > 0 ) {
243+ _red_backscatter = _red_backscatter - 0x1000000 ;
244244 }
245- _output [ 'cobald_red_backskatter ' ] = _red_backskatter ;
245+ _output [ 'cobald_red_backscatter ' ] = _red_backscatter ;
246246
247247 // Blue monitor
248248 _blue_monitor = parseInt ( xdata . substr ( 22 , 4 ) , 16 ) ;
@@ -291,7 +291,7 @@ function parseXDATA(data, pressure){
291291 // V7
292292 // 0102 time=1001 cnt=0 rpm=0
293293 // 0102 time=1001 cnt=7 rpm=419
294- _output = { 'xdata_instrument' : 'V7' } ;
294+ _output [ 'xdata_instrument' ] = 'V7' ;
295295 } else if ( _instrument === '05' ) {
296296 // OIF411
297297 _xdata_temp = parseOIF411 ( _current_xdata , pressure ) ;
@@ -302,42 +302,42 @@ function parseXDATA(data, pressure){
302302 _output = Object . assign ( _output , _xdata_temp ) ;
303303 } else if ( _instrument === '10' ) {
304304 // FPH
305- _output = { 'xdata_instrument' : 'FPH' } ;
305+ _output [ 'xdata_instrument' ] = 'FPH' ;
306306 } else if ( _instrument === '19' ) {
307307 // COBALD
308308 _xdata_temp = parseCOBALD ( _current_xdata ) ;
309309 _output = Object . assign ( _output , _xdata_temp ) ;
310310 } else if ( _instrument === '28' ) {
311311 // SLW
312- _output = { 'xdata_instrument' : 'SLW' } ;
312+ _output [ 'xdata_instrument' ] = 'SLW' ;
313313 } else if ( _instrument === '38' ) {
314314 // POPS
315- _output = { 'xdata_instrument' : 'POPS' } ;
315+ _output [ 'xdata_instrument' ] = 'POPS' ;
316316 } else if ( _instrument === '39' ) {
317317 // OPC
318- _output = { 'xdata_instrument' : 'OPC' } ;
318+ _output [ 'xdata_instrument' ] = 'OPC' ;
319319 } else if ( _instrument === '3C' ) {
320320 // PCFH
321321 // 3c010000184b4b5754
322322 // 3c0103ce7b58647a98748befff
323323 // 3c010148719fff8e54b9af627e249fe0
324324 // 3c01028d696fff8db4b7865980cdbbb3
325- _output = { 'xdata_instrument' : 'PCFH' } ;
325+ _output [ 'xdata_instrument' ] = 'PCFH' ;
326326 } else if ( _instrument === '3D' ) {
327327 // FLASH-B
328- _output = { 'xdata_instrument' : 'FLASH-B' } ;
328+ _output [ 'xdata_instrument' ] = 'FLASH-B' ;
329329 } else if ( _instrument === '3E' ) {
330330 // TRAPS
331- _output = { 'xdata_instrument' : 'TRAPS' } ;
331+ _output [ 'xdata_instrument' ] = 'TRAPS' ;
332332 } else if ( _instrument === '3F' ) {
333333 // SKYDEW
334- _output = { 'xdata_instrument' : 'SKYDEW' } ;
334+ _output [ 'xdata_instrument' ] = 'SKYDEW' ;
335335 } else if ( _instrument === '41' ) {
336336 // CICANUM
337- _output = { 'xdata_instrument' : 'CICANUM' } ;
337+ _output [ 'xdata_instrument' ] = 'CICANUM' ;
338338 } else if ( _instrument === '45' ) {
339339 // POPS
340- _output = { 'xdata_instrument' : 'POPS' } ;
340+ _output [ 'xdata_instrument' ] = 'POPS' ;
341341 } else if ( _instrument === '80' ) {
342342 // Unknown!
343343 //console.log("Saw unknown XDATA instrument 0x80.")
0 commit comments