From 1f9712e804601df2e26f70ef88410c94546f44af Mon Sep 17 00:00:00 2001 From: djk Date: Thu, 7 Jan 1999 00:59:59 +0000 Subject: [PATCH] added new commands --- cmd/set/sys_location.pl | 38 ++++++++++++++++++++++++++++++++++++++ cmd/set/sys_qra.pl | 38 ++++++++++++++++++++++++++++++++++++++ cmd/set/wx.pl | 26 ++++++++++++++++++++++++++ cmd/unset/wx.pl | 27 +++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 cmd/set/sys_location.pl create mode 100644 cmd/set/sys_qra.pl create mode 100644 cmd/set/wx.pl create mode 100644 cmd/unset/wx.pl diff --git a/cmd/set/sys_location.pl b/cmd/set/sys_location.pl new file mode 100644 index 00000000..3202a521 --- /dev/null +++ b/cmd/set/sys_location.pl @@ -0,0 +1,38 @@ +# +# set the system latitude and longtitude field +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +return (1, $self->msg('e5')) if $self->priv < 9; + +my $call = $main::mycall; +my $user; + +# remove leading and trailing spaces +$line =~ s/^\s+//; +$line =~ s/\s+$//; + +return (1, $self->msg('loce1')) if !$line; +return (1, $self->msg('loce2', $line)) unless $line =~ /\d+ \d+ [NnSs] \d+ \d+ [EeWw]/o; + +$user = DXUser->get_current($call); +if ($user) { + $line = uc $line; + my ($lat, $long) = DXBearing::stoll($line); + $user->lat($lat); + $user->long($long); + DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me); + if (!$user->qra) { + my $qra = DXBearing::lltos($lat, $long); + $user->qra($qra); + } + + $user->put(); + return (1, $self->msg('sloc', $lat, $long)); +} else { + return (1, $self->msg('namee2', $call)); +} diff --git a/cmd/set/sys_qra.pl b/cmd/set/sys_qra.pl new file mode 100644 index 00000000..c19f6f71 --- /dev/null +++ b/cmd/set/sys_qra.pl @@ -0,0 +1,38 @@ +# +# set the cluster qra locator field +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +return (1, $self->msg('e5')) if $self->priv < 9; + +my $call = $main::mycall; +my $user; + +# remove leading and trailing spaces +$line =~ s/^\s+//; +$line =~ s/\s+$//; + +return (1, $self->msg('qrae1')) if !$line; +return (1, $self->msg('qrae2', $line)) unless DXBearing::is_qra($line); + +$user = DXUser->get_current($call); +if ($user) { + $line = uc $line; + $user->qra($line); + if (!$user->lat && !$user->long) { + my ($lat, $long) = DXBearing::qratoll($line); + $user->lat($lat); + $user->long($long); + my $s = DXBearing::lltos($lat, $long); + DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $s), $DXProt::me); + } + + $user->put(); + return (1, $self->msg('sqra', $line)); +} else { + return (1, $self->msg('namee2', $call)); +} diff --git a/cmd/set/wx.pl b/cmd/set/wx.pl new file mode 100644 index 00000000..b570a9da --- /dev/null +++ b/cmd/set/wx.pl @@ -0,0 +1,26 @@ +# +# set the wx flag +# +# Copyright (c) 1999 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call; +my @out; + +@args = $self->call if (!@args || $self->priv < 9); + +foreach $call (@args) { + $call = uc $call; + my $chan = DXChannel->get($call); + if ($chan) { + $chan->wx(1); + push @out, $self->msg('wxs', $call); + } else { + push @out, $self->msg('e3', "Set WX Spots", $call); + } +} +return (1, @out); diff --git a/cmd/unset/wx.pl b/cmd/unset/wx.pl new file mode 100644 index 00000000..3d874d17 --- /dev/null +++ b/cmd/unset/wx.pl @@ -0,0 +1,27 @@ +# +# set the wx flag +# +# Copyright (c) 1999 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call; +my @out; + +@args = $self->call if (!@args || $self->priv < 9); + +foreach $call (@args) { + $call = uc $call; + my $chan = DXChannel->get($call); + if ($chan) { + $chan->wx(0); + push @out, $self->msg('wxu', $call); + } else { + push @out, $self->msg('e3', "Unset WX Spots", $call); + } +} +return (1, @out); + -- 2.43.0