2 # show the station details
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
6 # Modifications by Iain Philipps G0RDI, 07-Dec-1998
9 my ($self, $line) = @_;
10 my @f = split /\s+/, uc $line;
14 push @f, $self->call unless @f;
16 if (@f <= 2 && uc $f[0] eq 'ALL') {
17 return (1, $self->msg('e6')) if $self->remotecmd && $self->priv < 6;
18 return (1, $self->msg('e6')) if $self->priv < 5;
20 my $exp = shellregex(uc shift @f) if @f;
23 @calls = grep {m{$exp}} DXUser::get_all_calls();
25 @calls = DXUser::get_all_calls();
28 foreach $call (@calls) {
29 my $ref = DXUser::get_current($call);
32 my $long = $ref->long;
33 my $sort = $ref->sort || "";
34 my $name = $ref->name || "";
35 my $qth = $ref->qth || "";
36 my $homenode = $ref->homenode || "";
37 my $qra = $ref->qra || "";
38 my $latlong = DXBearing::lltos($lat, $long) if $lat && $long;
39 $latlong = "" unless $latlong;
41 push @out, sprintf "%-9s %s %-12.12s %-27.27s %-9s %s %s", $call, $sort, $name, $qth, $homenode, $latlong, $qra;
45 my $ref = DXUser::get_current($call);
47 my $name = $ref->name;
50 my $long = $ref->long;
51 my $node = $ref->node;
52 my $homenode = $ref->homenode;
53 my $lastin = $ref->lastin;
54 my $latlong = DXBearing::lltos($lat, $long) if $lat || $long;
55 my $last = DXUtil::cldatetime($lastin) if $ref->lastin;
57 $qra = DXBearing::lltoqra($lat, $long) if !$qra && ($lat || $long);
59 my ($dx, $bearing, $miles);
61 my ($hlat, $hlong) = ($self->user->lat, $self->user->long);
62 ($hlat, $hlong) = DXBearing::qratoll($self->user->qra) if $self->user->qra && !$hlat && !$hlong;
63 if (!$hlat && !$hlong) {
64 $from = "From $main::mycall";
65 $hlat = $main::mylatitude;
66 $hlong = $main::mylongitude;
68 ($bearing, $dx) = DXBearing::bdist($hlat, $hlong, $lat, $long);
69 $miles = $dx * 0.62133785;
72 my $cref = Route::get($call);
73 my $seek = $cref->isa('Route::Node') ? $call : join(',', $cref->parents) if $cref;
76 push @out, sprintf("%-13s: %s (%s %s)", $self->msg('user'), $call, $self->msg('at'), $seek);
78 push @out, sprintf("%-13s: %s", $self->msg('user'), $call);
80 push @out, sprintf("%-13s: %s", $self->msg('name1'), $name) if $name;
81 push @out, sprintf("%-13s: %s", $self->msg('lastconn'), $last) if $last;
82 push @out, sprintf("%-13s: %s", 'QTH', $qth) if $qth;
83 push @out, sprintf("%-13s: %s", $self->msg('location'), "$latlong ($qra)") if $latlong || $qra ;
84 push @out, sprintf("%-13s: %.0f Deg. %.0f Mi. %.0f Km.", $self->msg('heading'), $bearing, $miles, $dx) if $latlong;
85 push @out, sprintf("%-13s: %s", $self->msg('homenode2'), $homenode) if $homenode;
87 push @out, $self->msg('usernf', $call);