diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..92a4fa38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/application/config/database.php +/application/config/config.php diff --git a/application/config/config.php b/application/config/config.sample.php similarity index 99% rename from application/config/config.php rename to application/config/config.sample.php index 26613fd1..b0be7d88 100644 --- a/application/config/config.php +++ b/application/config/config.sample.php @@ -28,9 +28,9 @@ $config['callbook'] = "qrz"; // Options are hamio or qrz | 'display_freq' Show or Hide frequnecy info */ -$config['table_name'] = "table_hrd_contacts_v01"; -$config['locator'] = "IO91JS"; -$config['display_freq'] = false; +$config['table_name'] = "TABLE_HRD_CONTACTS_V01"; +$config['locator'] = ""; +$config['display_freq'] = true; /* |-------------------------------------------------------------------------- diff --git a/application/config/database.php b/application/config/database.sample.php similarity index 98% rename from application/config/database.php rename to application/config/database.sample.php index 8a646908..a30cee4f 100644 --- a/application/config/database.php +++ b/application/config/database.sample.php @@ -37,7 +37,7 @@ // The following values will probably need to be changed. $db['default']['username'] = "root"; $db['default']['password'] = ""; -$db['default']['database'] = "2e0sql_log"; +$db['default']['database'] = "log"; // The following values can probably stay the same. $db['default']['hostname'] = "localhost"; diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 6b620a35..b0b44dfd 100644 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -1,10 +1,9 @@ - - + @@ -295,54 +294,12 @@ $("#callsign").focus(); /* Javascript for controlling rig frequency. */ - // Update frequency every second - setInterval(function() { + var updateFromCAT = function() { if($('select.radios option:selected').val() != '0') { // Get frequency $.get('radio/frequency/' + $('select.radios option:selected').val(), function(result) { $('#frequency').val(result); - - result = parseInt(result); - - if(result >= 14000000 && result <= 14400000) { - $(".band").val('20m'); - } - else if(result >= 18000000 && result <= 19000000) { - $(".band").val('17m'); - } - else if(result >= 1810000 && result <= 2000000) { - $(".band").val('160m'); - } - else if(result >= 3000000 && result <= 4000000) { - $(".band").val('80m'); - } - else if(result >= 5250000 && result <= 5450000) { - $(".band").val('60m'); - } - else if(result >= 7000000 && result <= 7500000) { - $(".band").val('40m'); - } - else if(result >= 10000000 && result <= 11000000) { - $(".band").val('30m'); - } - else if(result >= 21000000 && result <= 21600000) { - $(".band").val('15m'); - } - else if(result >= 24000000 && result <= 25000000) { - $(".band").val('12m'); - } - else if(result >= 28000000 && result <= 30000000) { - $(".band").val('10m'); - } - else if(result >= 50000000 && result <= 56000000) { - $(".band").val('6m'); - } - else if(result >= 144000000 && result <= 148000000) { - $(".band").val('2m'); - } - else if(result >= 430000000 && result <= 440000000) { - $(".band").val('70cm'); - } + $(".band").val(frequencyToBand(result)); }); // Get Mode @@ -353,70 +310,14 @@ $(".mode").val(result); } }); - } - }, 1000); + } + }; + // Update frequency every second + setInterval(updateFromCAT, 1000); // If a radios selected from drop down select radio update. - $('.radios').change(function() { - if($('select.radios option:selected').val() != '0') { - // Get frequency - $.get('radio/frequency/' + $('select.radios option:selected').val(), function(result) { - $('#frequency').val(result); - result = parseInt(result); - - if(result >= 14000000 && result <= 14400000) { - $(".band").val('20m'); - } - else if(result >= 18000000 && result <= 19000000) { - $(".band").val('17m'); - } - else if(result >= 1810000 && result <= 2000000) { - $(".band").val('160m'); - } - else if(result >= 3000000 && result <= 4000000) { - $(".band").val('80m'); - } - else if(result >= 5250000 && result <= 5450000) { - $(".band").val('60m'); - } - else if(result >= 7000000 && result <= 7500000) { - $(".band").val('40m'); - } - else if(result >= 10000000 && result <= 11000000) { - $(".band").val('30m'); - } - else if(result >= 21000000 && result <= 21600000) { - $(".band").val('15m'); - } - else if(result >= 24000000 && result <= 25000000) { - $(".band").val('12m'); - } - else if(result >= 28000000 && result <= 30000000) { - $(".band").val('10m'); - } - else if(result >= 50000000 && result <= 56000000) { - $(".band").val('6m'); - } - else if(result >= 144000000 && result <= 148000000) { - $(".band").val('2m'); - } - else if(result >= 430000000 && result <= 440000000) { - $(".band").val('70cm'); - } - }); - - // Get Mode - $.get('radio/mode/' + $('select.radios option:selected').val(), function(result) { - if (result == "LSB" || result == "USB" || result == "SSB") { - $(".mode").val('SSB'); - } else { - $(".mode").val(result); - } - }); - - } - }); + $('.radios').change(updateFromCAT); /* On Page Load */ var catcher = function() { diff --git a/js/radiohelpers.js b/js/radiohelpers.js new file mode 100644 index 00000000..41037733 --- /dev/null +++ b/js/radiohelpers.js @@ -0,0 +1,43 @@ +function frequencyToBand(frequency) { + result = parseInt(frequency); + + if(result >= 14000000 && result <= 14400000) { + return '20m'; + } + else if(result >= 18000000 && result <= 19000000) { + return '17m'; + } + else if(result >= 1810000 && result <= 2000000) { + return '160m'; + } + else if(result >= 3000000 && result <= 4000000) { + return '80m'; + } + else if(result >= 5250000 && result <= 5450000) { + return '60m'; + } + else if(result >= 7000000 && result <= 7500000) { + return '40m'; + } + else if(result >= 10000000 && result <= 11000000) { + return '30m'; + } + else if(result >= 21000000 && result <= 21600000) { + return '15m'; + } + else if(result >= 24000000 && result <= 25000000) { + return '12m'; + } + else if(result >= 28000000 && result <= 30000000) { + return '10m'; + } + else if(result >= 50000000 && result <= 56000000) { + return '6m'; + } + else if(result >= 144000000 && result <= 148000000) { + return '2m'; + } + else if(result >= 430000000 && result <= 440000000) { + return '70cm'; + } +} \ No newline at end of file