Merge pull request #867 from phl0/zeroFrequency

Just give empty result on frequency being 0
This commit is contained in:
Florian (DF2ET)
2024-09-03 19:50:14 +02:00
committed by GitHub
2 changed files with 17 additions and 10 deletions

View File

@@ -258,6 +258,10 @@ class Frequency {
*/
function qrg_conversion($frequency, $r_option = 1, $source_unit = 'Hz', $target_unit = NULL) {
if ($frequency == 0) {
return null;
}
$CI = &get_instance();
// Get the band

View File

@@ -89,16 +89,19 @@
</tr>
<?php if($this->config->item('display_freq') == true) { ?>
<tr>
<td><?= __("Frequency"); ?></td>
<td><?php echo $this->frequency->qrg_conversion($row->COL_FREQ); ?></td>
</tr>
<?php if($row->COL_FREQ_RX != 0) { ?>
<tr>
<td><?= __("Frequency (RX)"); ?></td>
<td><?php echo $this->frequency->qrg_conversion($row->COL_FREQ_RX); ?></td>
</tr>
<?php }} ?>
<?php if($row->COL_FREQ != 0) { ?>
<tr>
<td><?= __("Frequency"); ?></td>
<td><?php echo $this->frequency->qrg_conversion($row->COL_FREQ); ?></td>
</tr>
<?php } ?>
<?php if($row->COL_FREQ_RX != 0) { ?>
<tr>
<td><?= __("Frequency (RX)"); ?></td>
<td><?php echo $this->frequency->qrg_conversion($row->COL_FREQ_RX); ?></td>
</tr>
<?php } ?>
<?php } ?>
<tr>
<td><?= __("Mode"); ?></td>