@@ -240,9 +240,8 @@ function handleInput() {
240240 item . match ( / ^ s a t e l l i t e $ / i) ||
241241 item . match ( / ^ s a t $ / i)
242242 ) {
243- // Set band to SAT and prop_mode
243+ // Set prop_mode to SAT
244244 console . log ( "SAT keyword detected" ) ;
245- band = "SAT" ;
246245 prop_mode = "SAT" ;
247246 freq = 0 ;
248247 } else if ( item . match ( / ^ \d + \. \d + $ / ) ) {
@@ -267,7 +266,7 @@ function handleInput() {
267266 ) {
268267 sotaWwff = item . toUpperCase ( ) ;
269268 } else if (
270- band === "SAT" &&
269+ prop_mode === "SAT" &&
271270 item . match ( / ^ [ A - Z 0 - 9 ] + - \d + [ A - Z ] * $ / i)
272271 ) {
273272 // Satellite name (e.g., AO-7, ISS, FO-29)
@@ -283,7 +282,7 @@ function handleInput() {
283282 console . log ( "Satellite NOT found in database. Available:" , Object . keys ( satelliteData ) . length , "satellites" ) ;
284283 }
285284 } else if (
286- band === "SAT" &&
285+ prop_mode === "SAT" &&
287286 item . match ( / ^ ( I S S | A R I S S ) $ / i)
288287 ) {
289288 // Handle satellites without numbers (ISS, ARISS)
@@ -292,7 +291,7 @@ function handleInput() {
292291 // Update visual feedback
293292 updateSatelliteFeedback ( sat_name , null ) ;
294293 } else if (
295- band === "SAT" &&
294+ prop_mode === "SAT" &&
296295 sat_name &&
297296 item . match ( / ^ [ U V L S C X ] ( \/ [ U V L S C X ] ) ? $ / i)
298297 ) {
@@ -301,10 +300,11 @@ function handleInput() {
301300 // Update visual feedback with selected mode
302301 updateSatelliteFeedback ( sat_name , sat_mode ) ;
303302 // Now populate frequencies from satellite_data.json
304- console . log ( "Looking up satellite:" , sat_name , "mode:" , sat_mode , "band:" , band ) ;
303+ console . log ( "Looking up satellite:" , sat_name , "mode:" , sat_mode ) ;
305304 if ( satelliteData [ sat_name ] && satelliteData [ sat_name ] . Modes && satelliteData [ sat_name ] . Modes [ sat_mode ] ) {
306305 var modeData = satelliteData [ sat_name ] . Modes [ sat_mode ] [ 0 ] ;
307306 freq = modeData . Uplink_Freq / 1000000 ;
307+ band = getBandFromFreq ( freq ) ;
308308 freq_rx = modeData . Downlink_Freq / 1000000 ;
309309 band_rx = getBandFromFreq ( freq_rx ) ;
310310
@@ -315,7 +315,7 @@ function handleInput() {
315315 } else {
316316 mode = modeData . Uplink_Mode ;
317317 }
318- console . log ( "Satellite data found. Freq:" , freq , "Mode:" , mode , "Band RX:" , band_rx ) ;
318+ console . log ( "Satellite data found. Freq:" , freq , "Mode:" , mode , "Band:" , band , "Band RX:", band_rx ) ;
319319 } else {
320320 // Satellite mode not found in database, but still valid
321321 // User will need to manually set mode if not in database
@@ -353,7 +353,7 @@ function handleInput() {
353353 console . log ( "Processing QSO for callsign:" , callsign , "Band:" , band , "Mode:" , mode , "Freq:" , freq , "Sat:" , sat_name , sat_mode ) ;
354354 // For satellite QSOs, freq should already be set from satellite mode lookup
355355 // For regular QSOs, calculate freq if not provided
356- if ( band === "SAT" ) {
356+ if ( prop_mode === "SAT" ) {
357357 // Satellite QSO - freq and mode should be set from satellite mode lookup
358358 // If not set (satellite not in database), freq will be 0 or empty
359359 if ( ! freq || freq === 0 || freq === "" ) {
@@ -659,6 +659,16 @@ function getBandFromFreq(freq) {
659659 return "2m" ;
660660 } else if ( freq > 430 && freq < 460 ) {
661661 return "70cm" ;
662+ } else if ( freq > 1240 && freq < 1300 ) {
663+ return "23cm" ;
664+ } else if ( freq > 2300 && freq < 2450 ) {
665+ return "13cm" ;
666+ } else if ( freq > 3300 && freq < 3500 ) {
667+ return "9cm" ;
668+ } else if ( freq > 5650 && freq < 5925 ) {
669+ return "6cm" ;
670+ } else if ( freq > 10000 && freq < 10500 ) {
671+ return "3cm" ;
662672 }
663673
664674 return "" ;
0 commit comments