@@ -34,6 +34,14 @@ var launches = null;
3434var receiverCanvas = null ;
3535
3636var sondePrefix = [ "RS92" , "RS92-SGP" , "RS92-NGP" , "RS41" , "RS41-SG" , "RS41-SGP" , "RS41-SGM" , "DFM" , "DFM06" , "DFM09" , "DFM17" , "M10" , "M20" , "iMet-4" , "iMet-54" , "LMS6" , "LMS6-400" , "LMS6-1680" , "iMS-100" , "MRZ" , "chase" ] ;
37+ var sondeCodes = {
38+ "07" :"iMet-1" , "11" :"LMS6-403" , "13" :"RS92" , "14" :"RS92" , "17" :"DFM-09" , "19" :"MRZ-N1" , "22" :"RS-11G" , "23" :"RS41" , "24" :"RS41" , "34" :"iMet-4" , "35" :"iMS-100" , "41" :"RS41" , "42" :"RS41" , "52" :"RS92-NGP" , "54" :"DFM-17" ,
39+ "62" :"MRZ-3MK" , "63" :"M20" , "77" :"M10" , "82" :"LMS6-1680" , "84" :"iMet-54"
40+ } ;
41+ var unsupportedSondeCodes = {
42+ "15" :"PAZA-12M" , "16" :"PAZA-22" , "18" :"DFM-06" , "20" :"MK3" , "21" :"1524LA LORAN-C/GL5000" , "26" :"SRS-C34" , "27" :"AVK-MRZ" , "28" :"AVK–AK2-02" , "29" :"MARZ2-2" , "30" :"RS2-80" , "33" :"GTS1-2/GFE(L)" , "45" :"CF-06" , "58" :"AVK-BAR" ,
43+ "59" :"M2K2-R" , "68" :"AVK-RZM-2" , "69" :"MARL-A/Vektor-M-RZM-2" , "73" :"MARL-A" , "78" :"RS90" , "80" :"RS92" , "88" :"MARL-A/Vektor-M-MRZ" , "89" :"MARL-A/Vektor-M-BAR" , "97" :"iMet-2" , "99" :"iMet-2"
44+ } ;
3745
3846var got_positions = false ;
3947var zoomed_in = false ;
@@ -821,28 +829,27 @@ function showLaunchSites() {
821829 for ( var key in json ) {
822830 if ( json . hasOwnProperty ( key ) ) {
823831 var latlon = [ json [ key ] . lat , json [ key ] . lon ] ;
824- var sondes = json [ key ] . rs_types . toString ( ) ;
825- sondes = sondes . replace ( new RegExp ( "\\b07\\b" ) , "iMet-1 (possible to track)" ) ;
826- sondes = sondes . replace ( new RegExp ( "\\b11\\b" ) , "LMS6-403 (possible to track)" ) ;
827- sondes = sondes . replace ( new RegExp ( "\\b13\\b" ) , "RS92 (possible to track)" ) ;
828- sondes = sondes . replace ( new RegExp ( "\\b14\\b" ) , "RS92 (possible to track)" ) ;
829- sondes = sondes . replace ( new RegExp ( "\\b17\\b" ) , "DFM-09 (possible to track)" ) ;
830- sondes = sondes . replace ( new RegExp ( "\\b19\\b" ) , "MRZ-N1 (possible to track)" ) ;
831- sondes = sondes . replace ( new RegExp ( "\\b21\\b" ) , "RS-11G (possible to track)" ) ;
832- sondes = sondes . replace ( new RegExp ( "\\b22\\b" ) , "RS-11G (possible to track)" ) ;
833- sondes = sondes . replace ( new RegExp ( "\\b23\\b" ) , "RS41 (possible to track)" ) ;
834- sondes = sondes . replace ( new RegExp ( "\\b24\\b" ) , "RS41 (possible to track)" ) ;
835- sondes = sondes . replace ( new RegExp ( "\\b34\\b" ) , "iMet-4 (possible to track)" ) ;
836- sondes = sondes . replace ( new RegExp ( "\\b35\\b" ) , "iMS-100 (possible to track)" ) ;
837- sondes = sondes . replace ( new RegExp ( "\\b41\\b" ) , "RS41 (possible to track)" ) ;
838- sondes = sondes . replace ( new RegExp ( "\\b42\\b" ) , "RS41 (possible to track)" ) ;
839- sondes = sondes . replace ( new RegExp ( "\\b52\\b" ) , "RS92-NGP (possible to track)" ) ;
840- sondes = sondes . replace ( new RegExp ( "\\b54\\b" ) , "DFM-17 (possible to track)" ) ;
841- sondes = sondes . replace ( new RegExp ( "\\b62\\b" ) , "MRZ-3MK (possible to track)" ) ;
842- sondes = sondes . replace ( new RegExp ( "\\b63\\b" ) , "M20 (possible to track)" ) ;
843- sondes = sondes . replace ( new RegExp ( "\\b77\\b" ) , "M10 (possible to track)" ) ;
844- sondes = sondes . replace ( new RegExp ( "\\b82\\b" ) , "LMS6-1680 (possible to track)" ) ;
845- sondes = sondes . replace ( new RegExp ( "\\b84\\b" ) , "iMet-54 (possible to track)" ) ;
832+ var sondes = json [ key ] . rs_types ;
833+ var sondesList = "" ;
834+ for ( var y = 0 ; y < sondes . length ; y ++ ) {
835+ if ( Array . isArray ( sondes [ y ] ) == false ) {
836+ sondes [ y ] = [ sondes [ y ] ] ;
837+ }
838+ if ( sondeCodes . hasOwnProperty ( sondes [ y ] [ 0 ] ) ) {
839+ sondesList += sondeCodes [ sondes [ y ] [ 0 ] ]
840+ if ( sondes [ y ] . length > 1 ) {
841+ sondesList += " (" + sondes [ y ] [ 1 ] + " MHz)" ;
842+ }
843+ } else if ( unsupportedSondeCodes . hasOwnProperty ( sondes [ y ] [ 0 ] ) ) {
844+ sondesList += unsupportedSondeCodes [ sondes [ y ] [ 0 ] ] ;
845+ sondesList += " (cannot track)" ;
846+ } else {
847+ sondesList += sondes [ y ] [ 0 ] + " (unknown WMO code)" ;
848+ }
849+ if ( y < sondes . length - 1 ) {
850+ sondesList += ", " ;
851+ }
852+ }
846853 var marker = new L . circleMarker ( latlon , { color : '#696969' , fillColor : "white" , radius : 8 } ) ;
847854 var popup = new L . popup ( { autoClose : false , closeOnClick : false } ) ;
848855 marker . bindPopup ( popup ) ;
@@ -871,11 +878,11 @@ function showLaunchSites() {
871878 if ( tempDate ) {
872879 if ( date < tempDate ) {
873880 tempDate = date ;
874- popupContent = "<font style='font-size: 13px'>" + json [ key ] . station_name + "</font><br><br><b>Sondes launched:</b> " + sondes + "<br><b>Next launch:</b> " + date . toString ( ) ;
881+ popupContent = "<font style='font-size: 13px'>" + json [ key ] . station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList + "<br><b>Next launch:</b> " + date . toString ( ) ;
875882 }
876883 } else {
877884 tempDate = date ;
878- popupContent = "<font style='font-size: 13px'>" + json [ key ] . station_name + "</font><br><br><b>Sondes launched:</b> " + sondes + "<br><b>Next launch:</b> " + date . toString ( ) ;
885+ popupContent = "<font style='font-size: 13px'>" + json [ key ] . station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList + "<br><b>Next launch:</b> " + date . toString ( ) ;
879886 }
880887 }
881888 var ascent_rate = 5 ;
@@ -921,7 +928,7 @@ function showLaunchSites() {
921928 popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='https://github.com/projecthorus/sondehub-tracker/issues/114' target='_blank'>here</a>" ;
922929 popupContent += "<br><button onclick='launchSitePredictions(\"" + json [ key ] [ 'times' ] . toString ( ) + "\", \"" + latlon . toString ( ) + "\", \"" + ascent_rate + ":" + descent_rate + ":" + burst_altitude + "\", \"" + launches . getLayerId ( marker ) + "\")' style='margin-bottom:0;'>Generate Predictions</button>" ;
923930 } else {
924- popupContent = "<font style='font-size: 13px'>" + json [ key ] . station_name + "</font><br><br><b>Sondes launched:</b> " + sondes ;
931+ popupContent = "<font style='font-size: 13px'>" + json [ key ] . station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList ;
925932 popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='https://github.com/projecthorus/sondehub-tracker/issues/114' target='_blank'>here</a>" ;
926933 }
927934 popup . setContent ( popupContent ) ;
0 commit comments