6 # Copyright (c) 2005 Dirk Koopman G1TLH
13 use vars qw($VERSION $BRANCH);
15 main::mkver($VERSION = q$Revision$);
29 unless ($thing->{Aranea}) {
30 my $sd = $thing->{spotdata};
35 push @items, ('b', $sd->[4]) unless $thing->{user};
36 push @items, ('st', sprintf("%X", $sd->[2] / 60), 'o', $sd->[7]) unless $sd->[7] eq $main::mycall;
37 push @items, ('i', $sd->[3]) if $sd->[3];
38 $thing->{Aranea} = Aranea::genmsg($thing, 'DX', @items);
40 return $thing->{Aranea};
47 my $t = hex($thing->{st}) if exists $thing->{st};
48 $t ||= $thing->{time} / 60;
49 my @spot = Spot::prepare(
54 ($thing->{b} || $thing->{fromuser} || $thing->{user} || $thing->{origin}),
55 ($thing->{o} || $thing->{origin}),
57 $thing->{spotdata} = \@spot;
64 unless ($thing->{DXProt}) {
65 my $sd = $thing->{spotdata};
66 my $hops = $thing->{hops} || DXProt::get_hops(11);
67 my $text = $sd->[3] || ' ';
70 $thing->{DXProt} = sprintf "PC11^%.1f^$sd->[1]^%s^%s^$text^$sd->[4]^$sd->[7]^$hops^~", $sd->[0], cldate($t), ztime($t);
72 return $thing->{DXProt};
80 # these are always generated, never cached
81 return unless $dxchan->{dx};
84 if ($dxchan->{ve7cc}) {
85 $buf = VE7CC::dx_spot($dxchan, $thing->{spotdata});
87 $buf = Spot::format_dx_spot($dxchan, $thing->{spotdata});
88 $buf .= "\a\a" if $dxchan->{beep};
101 ($thing->{hops}) = $thing->{DXProt} =~ /\^H(\d+)\^?~?$/ if exists $thing->{DXProt};
110 my $spot = $thing->{spotdata};
111 if (Spot::dup(@$spot[0..4])) {
112 dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr');
119 $thing->broadcast($dxchan);
127 # global spot filtering on INPUT
128 if ($dxchan->{inspotsfilter}) {
129 my ($filter, $hops) = $dxchan->{inspotsfilter}->it($thing->{spotdata});
131 dbg("PCPROT: Rejected by input spot filter") if isdbg('chanerr');
143 # global spot filtering on OUTPUT
144 if ($dxchan->{spotsfilter}) {
145 my ($filter, $hops) = $dxchan->{spotsfilter}->it($thing->{spotdata});
147 dbg("PCPROT: Rejected by output spot filter") if isdbg('chanerr');
150 $thing->{hops} = $hops if $hops;
151 } elsif ($dxchan->{isolate}) {