6 # Copyright (c) 2005 Dirk Koopman G1TLH
13 use vars qw($VERSION $BRANCH);
14 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
15 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
16 $main::build += $VERSION;
17 $main::branch += $BRANCH;
31 unless ($thing->{Aranea}) {
32 my $sd = $thing->{spotdata};
37 push @items, ('b', $sd->[4]) unless $thing->{user};
38 push @items, ('st', sprintf("%X", $sd->[2] / 60), 'o', $sd->[7]) unless $sd->[7] eq $main::mycall;
39 push @items, ('i', $sd->[3]) if $sd->[3];
40 $thing->{Aranea} = Aranea::genmsg($thing, 'DX', @items);
42 return $thing->{Aranea};
49 my $t = hex($thing->{st}) if exists $thing->{st};
50 $t ||= $thing->{time} / 60;
51 my @spot = Spot::prepare(
56 ($thing->{b} || $thing->{fromuser} || $thing->{user} || $thing->{origin}),
57 ($thing->{o} || $thing->{origin}),
59 $thing->{spotdata} = \@spot;
66 unless ($thing->{DXProt}) {
67 my $sd = $thing->{spotdata};
68 my $hops = $thing->{hops} || DXProt::get_hops(11);
69 my $text = $sd->[3] || ' ';
72 $thing->{DXProt} = sprintf "PC11^%.1f^$sd->[1]^%s^%s^$text^$sd->[4]^$sd->[7]^$hops^~", $sd->[0], cldate($t), ztime($t);
74 return $thing->{DXProt};
82 # these are always generated, never cached
83 return unless $dxchan->{dx};
86 if ($dxchan->{ve7cc}) {
87 $buf = VE7CC::dx_spot($dxchan, $thing->{spotdata});
89 $buf = Spot::format_dx_spot($dxchan, $thing->{spotdata});
90 $buf .= "\a\a" if $dxchan->{beep};
101 $thing->{$k} = shift;
103 ($thing->{hops}) = $thing->{DXProt} =~ /\^H(\d+)\^?~?$/ if exists $thing->{DXProt};
112 my $spot = $thing->{spotdata};
113 if (Spot::dup(@$spot[0..4])) {
114 dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr');
121 $thing->broadcast($dxchan);
129 # global spot filtering on INPUT
130 if ($dxchan->{inspotsfilter}) {
131 my ($filter, $hops) = $dxchan->{inspotsfilter}->it($thing->{spotdata});
133 dbg("PCPROT: Rejected by input spot filter") if isdbg('chanerr');
145 # global spot filtering on INPUT
146 if ($dxchan->{inspotsfilter}) {
147 my ($filter, $hops) = $dxchan->{inspotsfilter}->it($thing->{spotdata});
149 dbg("PCPROT: Rejected by input spot filter") if isdbg('chanerr');
152 $thing->{hops} = $hops if $hops;
153 } elsif ($dxchan->{isolate}) {