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};
31 $thing->{f} = $sd->[0];
32 $thing->{c} = $sd->[1];
33 $thing->{b} = $sd->[4] unless $thing->{user};
34 my $t = int($sd->[2] / 60);
35 $thing->{t} = sprintf("%X", $t) unless $t eq int($main::systime / 60);
36 $thing->{o} = $sd->[7] unless $sd->[7] eq $main::mycall;
37 $thing->{i} = $sd->[3] if $sd->[3];
38 $thing->{Aranea} = Aranea::genmsg($thing, [qw(f c b t o i)]);
40 return $thing->{Aranea};
47 my $t = hex($thing->{t}) if exists $thing->{t};
48 $t ||= int($thing->{time} / 60); # if it is an aranea generated
49 my $by = $thing->{b} || $thing->{fromuser} || $thing->{user} || $thing->{origin};
50 my @spot = Spot::prepare(
56 ($thing->{o} || $thing->{origin}),
58 $spot[4] = $by; # don't modify the spotter SSID
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^%s^$sd->[4]^$sd->[7]^$hops^~", $sd->[0], cldate($t), ztime($t), $text;
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,5])) {
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 OUTPUT
146 if ($dxchan->{spotsfilter}) {
147 my ($filter, $hops) = $dxchan->{spotsfilter}->it($thing->{spotdata});
149 dbg("PCPROT: Rejected by output spot filter") if isdbg('chanerr');
152 $thing->{hops} = $hops if $hops;
153 } elsif ($dxchan->{isolate}) {