Change DXUser->get* to DXUser::get*
[spider.git] / perl / VE7CC.pm
1 #
2 # VE7CC variations for DXCommandmode
3 #
4 # This is done this way because a) there aren't very many and 
5 # b) because it isn't easy to reliably rebless the object in
6 # flight (as it were).
7 #
8 # This could change.
9 #
10
11 package VE7CC;
12
13 use DXVars;
14 use DXDebug;
15 use DXUtil;
16 use Julian;
17 use Prefix;
18 use DXUser;
19
20 use strict;
21
22 sub dx_spot
23 {
24         my $self = shift;                       # this may be useful some day
25         my $freq = shift;
26         my $spotted = shift;
27         my $t = shift;
28         my $loc_spotted = '';
29         my $loc_spotter = '';
30         my $ref = DXUser::get_current($spotted);
31         if ($ref) {
32                 my $loc = $ref->qra || '';
33                 $loc_spotted =substr($loc, 0, 4) if $loc;
34         }
35
36         # remove any items above the top of the max spot data
37         pop while @_ > 11;
38         
39         # make sure both US states are defined
40         $_[9] ||= '';
41         $_[10] ||= '';
42         
43         my $spotted_cc = (Prefix::cty_data($spotted))[5];
44         my $spotter_cc = (Prefix::cty_data($_[1]))[5];
45         $ref = DXUser::get_current($_[1]);
46         if ($ref) {
47                 my $loc = $ref->qra || '';
48                 $loc_spotter = substr($loc, 0, 4) if $loc;
49         }
50         
51         return sprintf("CC11^%0.1f^%s^", $freq, $spotted) . join('^', cldate($t), ztime($t), @_, $spotted_cc, $spotter_cc, $loc_spotted, $loc_spotter);
52 }
53
54 1;