#!/usr/pkg/bin/perl
use strict;
# $Id: tokyo-contest-log,v 1.1 2011/11/24 07:38:08 makoto Exp $
#open(DATA) || die "problem opening: $!\n";
## mon day time callsign sent rcvd multi MHz mode pts
## 8 16 2133 JA2MYA 599TK 599GF GF 1.9 CW 1
my ($freq, $mode, $date, $time, $mycall, $hisrst, $nr, $callsign, $rst, $exchange);
my ($yy,$mon, $dd, $time, $multi,$pts);
my $dummy;
my %QSO; # $QSO{$callsign}{$freq} databse
my %MULTI; # $MULTI{$exchange}{$freq} database
my %MULTICOUNT; # $MULTICOUNT{$band}
my %POINT; # $POINT{$band}
my %QSOCOUNT; # $QSOCOUNT{$band}
my $FORMAT = " %02d,%02d,%04d,%-10s,%s,%-9s,%-5s,%4d,%4s,%3d,%s\n"; # debug
$FORMAT = "%02d,%02d,%04d,%s,%s,%s,%s,%d,%s,%d,%s\n"; # real;
my $FORMATs= "%3s,%3s,%04s,%-10s,%-5s,%-6s,%5s,%3s,%4s,%3s,%s\n";
my $remarks;
my @lines;
# ------------------------------------------
sub get_band($){
my ($freq) = shift;
my ($band);
if ($freq == 144 ) { $band = 144;}
elsif ($freq == 432 ) { $band = 430;}
elsif ($freq < 2000 ) { $band = 1.9;}
elsif ($freq < 4000 ) { $band = 3.5;}
elsif ($freq < 8000 ) { $band = 7;}
elsif ($freq < 15000 ) { $band = 14;}
elsif ($freq < 22000 ) { $band = 21;}
elsif ($freq < 30000 ) { $band = 28;}
elsif ($freq < 54000 ) { $band = 50;}
elsif ($freq <146000 ) { $band = 144;}
elsif ($freq <440000 ) { $band = 430;}
else { $band = 1200;}
return $band;
}
# 1.8 3.5 7 14 21 28 50 144 430 1200 2400 5600
sub print_score(){
my ($qso, $pts, $multi);
foreach my $band ( sort {$a <=> $b} keys %POINT ) {
printf (" %d,%d,%d\n",
$band,
$QSOCOUNT{$band},
$POINT{$band},
$MULTICOUNT{$band} );
$qso +=$QSOCOUNT{$band};
$pts +=$POINT{$band};
$multi +=$MULTICOUNT{$band};
}
printf ("%d,%d,%d\n", $qso, $pts, $multi);
printf ("%d\n", $pts * $multi);
}
# ------------------------------------------
while (<>) {
if ( /^QSO: / ) {
($dummy, $freq, $mode, $date, $time, $mycall, $hisrst, $nr, $callsign, $rst, $exchange)
= split;
($yy,$mon,$dd) = split '-', $date;
$time += 900;
# $freq = int($freq/1000);
$freq = get_band($freq);
if ($mode eq 'PH') {$mode = 'SSB';};
$exchange =~ s/[LPMH]$//; # just for in casen
if ($QSO{$callsign}{$freq} == 0) {
$QSO{$callsign}{$freq}++;
if ( $MULTI{$exchange}{$freq} == 0) {
$MULTI{$exchange}{$freq}++; # record for this combination
$multi = $exchange;
$MULTICOUNT{$freq}++;
}
else {$multi = ''};
$exchange =~ s/ //g;
# tokyo contest special
if (length($exchange) == 2 ) {$pts = 1;}
else {$pts = 2;}
# tokyo contest special
}
else { $pts = 0;}
$POINT{$freq} += $pts;
$QSOCOUNT{$freq} ++;
$remarks = '';
if ($pts == 0) { $remarks = 'may not be complete QSO'}
push(@lines, sprintf($FORMAT,
$mon, $dd, $time, $callsign, $hisrst.$nr, $rst.$exchange, $multi, $freq, $mode, $pts, $remarks));
}
}
summary_one();
print_score();
summary_two();
printf("$FORMATs",
'mon', 'day', 'time', 'callsign','sent', 'rcvd', 'multi', 'MHz', 'mode', 'pts', 'remarks');
print @lines;
print "\n";
exit;
sub summary_one(){
print <
コンテストの名称
参加部門種目コードナンバー
参加部門種目名称
コールサイン
運用者のコールサイン
SUMMARY1
}
sub summary_two(){
#
#
#
print <フィールドデーコンテストの場合の局種係数
総得点
連絡先住所
電話番号
局免許者の氏名(社団の名称)
E-mailアドレス
局免許者の無線従事者資格
コンテスト中使用した最大空中線電力(W)
定格出力or実測出力
運用地
使用電源
使用した設備
意見
運用者のコールサイン(氏名)および無線従事者の資格
登録クラブ番号
登録クラブ名称
私は、JARL制定のコンテスト規約および電波法令に従い運用した結果、
ここに提出するサマリーシートおよびログシートなどが事実と相違ないものであることを、
私の名誉において誓います。
署名
SUMMARY2
}
# 必須:総得点:34241 (各バンドで得た得点の和×各バンドで得たマルチの和)
# 任意:バンドごとの交信局数,得点,およびマルチ数 (書いて頂いたほうが、集計作業の参考になります)
# マルチバンドの例
# FREQ QSO POINT MULTI
# 1.9MHz 35 35 25
# 3.5MHz 70 78 22
# 7 MHz 200 240 50
# Total 305 353 97 34241
# シングルバンド(7MHz) の例(CHK-LOGを含む)
# FREQ QSO POINT MULTI
# 1.9MHz 35 0 0
# 3.5MHz 70 0 0
# 7 MHz 200 240 50
# Total 305 240 50 12000
__DATA__
__END__
3)KCJ標準様式のログシート (ZLOGの使用が一番多いようですのでZLOG様式を標準とします)
mon day time callsign sent rcvd multi MHz mode pts
8 16 2133 JA2MYA 599TK 599GF GF 1.9 CW 1
http://www.jarl.or.jp/Japanese/1_Tanoshimo/1-1_Contest/e-log.htm
http://www.jarl-tokyo.com/densishinsei.html
jarltokyo@gmail.com
月 日 時刻 コールサイン 送信 No. 受信 No. マルチ 周波数 モード 得点 備考