mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-22 08:13:41 +00:00
bug fix for getFreqFromBand
This commit is contained in:
parent
4d997c1e70
commit
bb5355d32f
@ -57,7 +57,7 @@ class Bands extends CI_Model {
|
||||
$results = array();
|
||||
|
||||
foreach($result as $band) {
|
||||
$results['b'.strtoupper($band->band)] = array('cw' => $band->cw, 'ssb' => $band->ssb, 'digi' => $band->data);
|
||||
$results['b'.strtoupper($band->band)] = array('CW' => $band->cw, 'SSB' => $band->ssb, 'DIGI' => $band->data);
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script type="text/javascript">
|
||||
var Bands = <?php echo json_encode($bands); ?>;
|
||||
var user_id = <?php echo $this->session->userdata('user_id'); ?>;
|
||||
console.log("Bands Data:", Bands);
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
|
@ -123,6 +123,7 @@ function handleInput() {
|
||||
var rst_r = null;
|
||||
items = row.startsWith("day ") ? [row] : row.split(" ");
|
||||
var itemNumber = 0;
|
||||
var freq = 0;
|
||||
items.forEach((item) => {
|
||||
if (item === "") {
|
||||
return;
|
||||
@ -415,11 +416,15 @@ function getBandFromFreq(freq) {
|
||||
}
|
||||
|
||||
function getFreqFromBand(band, mode) {
|
||||
const settingsMode = getSettingsMode(mode.toUpperCase());
|
||||
const id = "#" + band + settingsMode;
|
||||
if ($(id).length) {
|
||||
return $(id).val();
|
||||
}
|
||||
var settingsMode = getSettingsMode(mode.toUpperCase());
|
||||
var settingsBand = "b" + band.toUpperCase();
|
||||
var bandData = Bands[settingsBand];
|
||||
|
||||
if (bandData) {
|
||||
return bandData[settingsMode] / 1000000;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getSettingsMode(mode) {
|
||||
|
Loading…
Reference in New Issue
Block a user