added US State information on DX Spots
authorminima <minima>
Sun, 23 Feb 2003 00:32:06 +0000 (00:32 +0000)
committerminima <minima>
Sun, 23 Feb 2003 00:32:06 +0000 (00:32 +0000)
Changes
cmd/Commands_en.hlp
cmd/set/usstate.pl [new file with mode: 0644]
cmd/unset/usstate.pl [new file with mode: 0644]
perl/DXCommandmode.pm
perl/DXUser.pm
perl/Messages

diff --git a/Changes b/Changes
index 036c1043e264e83f686ec3e76b46e14bbe4075d5..0e6b3a6dd5457c3ea2bfa4c7b9a268304fffa50f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,7 +2,9 @@
 1. changed qrz.com address 
 2. added Charlie's [K1XX] new wpxloc.raw data stuff to get WA1, KC3 type 
 callsigns to work better.
-3. Merged in the new (faster) DXUser.pm.
+3. added in set/usstate command which prints any US state information 
+available on both the spotted (LHS of time) and spotter (RHS of time).
+4. Merged in the new (faster) DXUser.pm.
 
 [NOTE] this version will require Storable to be installed. On the
 other hand the code may work without, in a compatible way. This bit hasn't 
@@ -20,6 +22,8 @@ If it fails then you will need to edit your latest user_asc file on (or about)
 line 25 it says: $ref = decode($f[1]); you will need to change that to 
 $ref = asc_decode($f[1]); and then do: perl user_asc
  
+DO MAKE SURE THAT you include subdirectories in your CVS update 
+
 21Feb03=======================================================================
 1. moved the export of the users file to Wednesday night (GMT) to avoid 
 possible crashes and/or delays during a contest weekend.
index 48ae9f788bcde5280535350be40e83bbcde3a14e..fd2a17cb345ce52bec3d0ff6688f986dae8ebf01 100644 (file)
@@ -1668,6 +1668,19 @@ overwritten by any weekly updates that affect this callsign
 
 see also DELETE/USDB
 
+=== 0^SET/DXSTATE^Allow US State info on the end of DX announcements
+=== 0^UNSET/DXSTATE^Stop US State info on the end of DX announcements
+If the spotter's or spotted's US State is known it is output on the 
+end of a DX announcement (there is just enough room). 
+
+A spotter's state will appear on the RHS of the time (like 
+SET/DXGRID) and the spotted's State will appear on the LHS of the
+time field. Any information found will override any locator 
+information from SET/DXGRID.
+
+Some user programs cannot cope with this. You can use this command 
+to reset (or set) this feature.
+
 === 0^SET/WCY^Allow WCY messages to come out on your terminal
 === 0^UNSET/WCY^Stop WCY messages coming out on your terminal
 
diff --git a/cmd/set/usstate.pl b/cmd/set/usstate.pl
new file mode 100644 (file)
index 0000000..dd55cac
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# set the usstate flag
+#
+# Copyright (c) 2000 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+
+return (1, $self->msg('db3', 'FCC USDB')) unless $USDB::present;
+
+@args = $self->call if (!@args || $self->priv < 9);
+
+foreach $call (@args) {
+       $call = uc $call;
+       my $user = DXUser->get_current($call);
+       if ($user) {
+               $user->wantusstate(1);
+               $user->put;
+               push @out, $self->msg('usstates', $call);
+       } else {
+               push @out, $self->msg('e3', "Set US State", $call);
+       }
+}
+return (1, @out);
diff --git a/cmd/unset/usstate.pl b/cmd/unset/usstate.pl
new file mode 100644 (file)
index 0000000..3bfaf6d
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# unset the usstate flag
+#
+# Copyright (c) 2003 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+
+return (1, $self->msg('db3', 'FCC USDB')) unless $USDB::present;
+
+@args = $self->call if (!@args || $self->priv < 9);
+
+foreach $call (@args) {
+       $call = uc $call;
+       my $user = DXUser->get_current($call);
+       if ($user) {
+               $user->wantusstate(0);
+               $user->put;
+               push @out, $self->msg('usstateu', $call);
+       } else {
+               push @out, $self->msg('e3', "Unset US State", $call);
+       }
+}
+return (1, @out);
index 9e9a708e367bd66baf4c6e0a87a6b9d46264d6a5..731379df7ce4571aaec4713354315bd94c96c4b3 100644 (file)
@@ -814,11 +814,31 @@ sub dx_spot
 
 
        my $t = ztime($_[2]);
+       my $loc;
+       my $clth = $self->{consort} eq 'local' ? 29 : 30;
+       my $comment = substr $_[3], 0, $clth; 
+       $comment .= ' ' x ($clth - length($comment));
        my $ref = DXUser->get_current($_[4]);
-       my $loc = $ref->qra if $ref && $ref->qra && $self->{user}->wantgrid;
-       $loc = ' ' . substr($loc, 0, 4) if $loc;
+       if ($ref) {
+               $loc = $ref->qra || '' if $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];
+
+       # USDB stuff
+       if ($USDB::present && $self->{user}->wantusstate) {
+               my ($city, $state) = USDB::get($_[4]);
+               if ($state) {
+                       $loc = ' ' . $state;
+               }
+               ($city, $state) = USDB::get($_[1]);
+               if ($state) {
+                       $comment = substr($comment, 0,  $self->{consort} eq 'local' ? 26 : 27) . ' ' . $state; 
+               }
+       }
+
+       my $buf = sprintf "DX de %-7.7s%11.1f  %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment;
+       
        $buf .= "\a\a" if $self->{beep};
        $buf =~ s/\%5E/^/g;
        $self->local_send('X', $buf);
index f2abe8047e37b4cba0cc096802d02dd8f3545921..0522cf2da2d6ade1dd3d6986434eb6769e37e040 100644 (file)
@@ -83,6 +83,7 @@ $v3 = 0;
                  wantpc16 => '9,Want Users from node,yesno',
                  wantsendpc16 => '9,Send PC16,yesno',
                  wantroutepc19 => '9,Route PC19,yesno',
+                 wantusstate => '9,Show US State,yesno',
                  lastoper => '9,Last for/oper,cldatetime',
                  nothere => '0,Not Here Text',
                  registered => '9,Registered?,yesno',
@@ -669,6 +670,11 @@ sub wantroutepc16
        return _want('routepc16', @_);
 }
 
+sub wantusstate
+{
+       return _want('usstate', @_);
+}
+
 sub wantlogininfo
 {
        my $self = shift;
index e8abfae4d62f72d783a37e2e2b7c12b14e081e94..45f281b6307e5cecc967f23e83286ae05f692995 100644 (file)
@@ -286,6 +286,8 @@ package DXM;
                                unsethop1 => 'usage: unset/hops <call> ann|spots|wwv|wcy',
                                unsethop2 => 'hops unset on $_[1] for $_[0]', 
                                usernf => '*** User record for $_[0] not found ***',
+                               usstates => 'US State display enabled for $_[0]',
+                               usstateu => 'US State display disabled for $_[0]',
                                wcy1 => '$_[0] is missing or out of range',
                                wcy2 => 'Duplicate WCY',
                 wcys => 'WCY enabled for $_[0]',