rearrange spot broadcast so that it copes according to terminal type
authorminima <minima>
Wed, 14 Nov 2001 12:40:43 +0000 (12:40 +0000)
committerminima <minima>
Wed, 14 Nov 2001 12:40:43 +0000 (12:40 +0000)
Changes
cmd/dx.pl
perl/DXCommandmode.pm
perl/Spot.pm

diff --git a/Changes b/Changes
index 9c42d4661df17e7d2a4239f129998ed726f6e1b4..bf7b49c8f5890ac9e256b7de574c6a7438f2db2a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+14Nov01=======================================================================
+1. make the number of characters of the dx comment dependant on the type of
+connection. This should mean that 'legacy' user programs can cope.
 07Nov01=======================================================================
 1. fix is_pctext so that it actually catches corrupt spots and announces.
 2. fix console.pl so that you can type in '0' again
index 3876ff1f643228248b7c65a2cd79812cebb88994..a7dc99ada65910c810fb45b8d31cb339de175067 100644 (file)
--- a/cmd/dx.pl
+++ b/cmd/dx.pl
@@ -52,7 +52,6 @@ if (is_freq($f[1]) && $f[0] =~ m{^[\w\d]+(?:/[\w\d]+){0,2}$}) {
        return (1, $self->msg('dx3'));
 }
 
-
 # make line the rest of the line
 $line = $f[2] || " ";
 @f = split /\s+/, $line;
@@ -97,14 +96,16 @@ push @out, $self->msg('dx1', $freq) unless $valid;
 # check we have a callsign :-)
 if ($spotted le ' ') {
        push @out, $self->msg('dx2');
-       
        $valid = 0;
 }
 
 return (1, @out) unless $valid;
 
-
 # Store it here (but only if it isn't baddx)
+my $t = (int ($main::systime/60)) * 60;
+return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $t, $line);
+my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall);
+
 if ($DXProt::baddx->in($spotted) || $freq =~ /^69/ || $localonly) {
 
        # heaven forfend that we get a 69Mhz band :-)
@@ -112,12 +113,9 @@ if ($DXProt::baddx->in($spotted) || $freq =~ /^69/ || $localonly) {
                $self->badcount(($self->badcount||0) + 1);
        }
 
-       my $buf = Spot::formatb($self->user->wantgrid, $freq, $spotted, $main::systime, $line, $spotter);
-       push @out, $buf;
+       $self->dx_spot(undef, undef, @spot);
+       return (1);
 } else {
-       my $t = (int ($main::systime/60)) * 60;
-       return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $t, $line);
-       my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall);
        if (@spot) {
                # store it 
                Spot::add(@spot);
index c03885526a9ed96664d31f75e31a7995eac48bf8..791256dc7090a45b864e1c1ca230565d43d207ee 100644 (file)
@@ -786,7 +786,13 @@ sub dx_spot
                return unless $filter;
        }
 
-       my $buf = Spot::formatb($self->{user}->wantgrid, $_[0], $_[1], $_[2], $_[3], $_[4]);
+
+       my $t = ztime($_[2]);
+       my $ref = DXUser->get_current($_[4]);
+       my $loc = $ref->qra if $ref && $ref->qra && $self->{user}->wantgrid;
+       $loc = ' ' . substr($loc, 0, 4) if $loc;
+       $loc = "" unless $loc;
+       my $buf = sprintf "DX de %-7.7s%11.1f  %-12.12s %-*s $t$loc", "$_[4]:", $_[0], $_[1], $self->{consort} eq 'local' ? 29 : 30, $_[3];
        $buf .= "\a\a" if $self->{beep};
        $buf =~ s/\%5E/^/g;
        $self->local_send('X', $buf);
index 963ed4a5895945f9cbf2bf8a7f5bf0900e8a3b10..fb5683fb5e07b6e9e4656a31977afac323c6376c 100644 (file)
@@ -264,18 +264,6 @@ sub ftor
        return $out;
 }
 
-# format a spot for user output in 'broadcast' mode
-sub formatb
-{
-       my $wantgrid = shift;
-       my $t = ztime($_[2]);
-       my $ref = DXUser->get_current($_[4]);
-       my $loc = $ref->qra if $ref && $ref->qra && $wantgrid;
-       $loc = ' ' . substr($ref->qra, 0, 4) if $loc;
-       $loc = "" unless $loc;
-       return sprintf "DX de %-7.7s%11.1f  %-12.12s %-29s %s$loc", "$_[4]:", $_[0], $_[1], $_[3], $t ;
-}
-
 # format a spot for user output in list mode
 sub formatl
 {