X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FThingy%2FDx.pm;h=1311e8f15fa6e99fd776d276703781f5f1a5818f;hb=319cdc6c2167b84d93ee1d9c6d219405f4272b82;hp=9b7a181becf7da0cfceece21e28600f1c0935ee9;hpb=5b3c2c5e342c23fbab96b7573c5963344617878f;p=spider.git diff --git a/perl/Thingy/Dx.pm b/perl/Thingy/Dx.pm index 9b7a181b..1311e8f1 100644 --- a/perl/Thingy/Dx.pm +++ b/perl/Thingy/Dx.pm @@ -11,10 +11,8 @@ use strict; package Thingy::Dx; use vars qw($VERSION $BRANCH); -$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); -$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); -$main::build += $VERSION; -$main::branch += $BRANCH; + +main::mkver($VERSION = q$Revision$); use DXChannel; use DXDebug; @@ -30,14 +28,14 @@ sub gen_Aranea my $thing = shift; unless ($thing->{Aranea}) { my $sd = $thing->{spotdata}; - my @items = ( - f=>$sd->[0], - c=>$sd->[1], - ); - push @items, ('b', $sd->[4]) unless $thing->{user}; - push @items, ('st', sprintf("%X", $sd->[2] / 60), 'o', $sd->[7]) unless $sd->[7] eq $main::mycall; - push @items, ('i', $sd->[3]) if $sd->[3]; - $thing->{Aranea} = Aranea::genmsg($thing, 'DX', @items); + $thing->{f} = $sd->[0]; + $thing->{c} = $sd->[1]; + $thing->{b} = $sd->[4] unless $thing->{user}; + my $t = $sd->[2]; + $thing->{t} = sprintf("%X", $t) unless $t eq int($main::systime / 60); + $thing->{o} = $sd->[7] unless $sd->[7] eq $main::mycall; + $thing->{i} = $sd->[3] if $sd->[3]; + $thing->{Aranea} = Aranea::genmsg($thing, [qw(f c b t o i)]); } return $thing->{Aranea}; } @@ -46,8 +44,8 @@ sub from_Aranea { my $thing = shift; return unless $thing; - my $t = hex($thing->{st}) if exists $thing->{st}; - $t ||= $thing->{time} / 60; + my $t = hex($thing->{t}) if exists $thing->{t}; + $t ||= int($thing->{time} / 60); # if it is an aranea generated my @spot = Spot::prepare( $thing->{f}, $thing->{c}, @@ -67,9 +65,9 @@ sub gen_DXProt my $sd = $thing->{spotdata}; my $hops = $thing->{hops} || DXProt::get_hops(11); my $text = $sd->[3] || ' '; - $text =~ s/\^/%5E/g; + $text =~ s/\^/\%5E/g; my $t = $sd->[2]; - $thing->{DXProt} = sprintf "PC11^%.1f^$sd->[1]^%s^%s^$text^$sd->[4]^$sd->[7]^$hops^~", $sd->[0], cldate($t), ztime($t); + $thing->{DXProt} = sprintf "PC11^%.1f^$sd->[1]^%s^%s^%s^$sd->[4]^$sd->[7]^$hops^~", $sd->[0], cldate($t), ztime($t), $text; } return $thing->{DXProt}; } @@ -86,7 +84,7 @@ sub gen_DXCommandmode if ($dxchan->{ve7cc}) { $buf = VE7CC::dx_spot($dxchan, $thing->{spotdata}); } else { - $buf = $dxchan->format_dx_spot($thing->{spotdata}); + $buf = Spot::format_dx_spot($dxchan, $thing->{spotdata}); $buf .= "\a\a" if $dxchan->{beep}; $buf =~ s/\%5E/^/g; } @@ -142,11 +140,11 @@ sub out_filter my $thing = shift; my $dxchan = shift; - # global spot filtering on INPUT - if ($dxchan->{inspotsfilter}) { - my ($filter, $hops) = $dxchan->{inspotsfilter}->it($thing->{spotdata}); + # global spot filtering on OUTPUT + if ($dxchan->{spotsfilter}) { + my ($filter, $hops) = $dxchan->{spotsfilter}->it($thing->{spotdata}); unless ($filter) { - dbg("PCPROT: Rejected by input spot filter") if isdbg('chanerr'); + dbg("PCPROT: Rejected by output spot filter") if isdbg('chanerr'); return; } $thing->{hops} = $hops if $hops;