File: printsections.pm

package info (click to toggle)
xtlf 0.0%2B1.03beta-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,140 kB
  • ctags: 233
  • sloc: perl: 6,072; sh: 160; makefile: 42
file content (70 lines) | stat: -rw-r--r-- 2,072 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /usr/bin/perl -w


# Ham Radio section mults overview module printsections.pm by PA0R.

# This program is published under the GPL license.
#   Copyright (C)  2006
#       Rein Couperus PA0R (rein at couperus.com)
# 
# *    printsections.pm is free software; you can redistribute it and/or modify
# *    it under the terms of the GNU General Public License as published by
# *    the Free Software Foundation; either version 2 of the License, or
# *    (at your option) any later version.
# *
# *    printsections.pm is distributed in the hope that it will be useful,
# *    but WITHOUT ANY WARRANTY; without even the implied warranty of
# *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# *    GNU General Public License for more details.
# *
# *    You should have received a copy of the GNU General Public License
# *    along with this program; if not, write to the Free Software
# *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# Date: 03-04-06

#####################################################
sub printsections {
#####################################################
my $Band = shift @_;
my @sectionlist = getsectioninfo();

$maxsections = $#sectionlist;
my $outmultline;
my $mult;
my $outputline = "";
$j=0;

$Multssectionbuffer->set_text("");
my $iter = $Multssectionbuffer->get_iter_at_offset (0);

	if ($resultsmethod eq "sqp") {
		$sectionband = "99";
	} else {
		$sectionband = $Band;
	}

	foreach $section (@sectionlist) {
		if (checksection($section, $sectionband)) { 
			$mult = sprintf ("%s ",$section) unless $section eq "-end-";
			$mult .= "     ";
			$mult = substr ($mult, 0, 6);
			$Multssectionbuffer->insert_with_tags_by_name ($iter, $mult,"grey_char");
		} else {
			$mult = sprintf ("%s ",$section) unless $section eq "-end-";
			$mult .= "     ";
			$mult = substr ($mult, 0, 6);
			$Multssectionbuffer->insert_with_tags_by_name ($iter, $mult, "green_char");
		}
		
		$outputline .= $mult;
		$j++;
		if ($j > 9) { 
			$j = 0;
			$Multssectionbuffer->insert($iter, "\n");
		}
	}

}

1;