2 # set the want rbn (at all)
4 # Copyright (c) 2020 - Dirk Koopman
9 my ($self, $line) = @_;
10 my @args = split /\s+/, uc $line;
17 dbg('set/skimmer @args = "' . join(', ', @args) . '"') if isdbg('set/skim');
21 dbg("set/skimmer \$a = $a") if isdbg('set/skim');;
22 if ($a !~ /^(?:FT|BCN|BEA|DXF|CW|PSK|MSK|FSK|RTT|NO)/ && is_callsign($a)) {
23 return (1, $self->msg('e5')) if $a ne $self->call && $self->priv < 9;
29 dbg("set/skimmer \$a = $a") if isdbg('set/skim');;
31 my ($want) = $a =~ /^(FT|BCN|BEA|DXF|CW|PSK|MSK|FSK|RTT|NO)/;
32 return (1, $self->msg('e39', $a)) unless $want;
36 dbg('set/skimmer @calls = "' . join(', ', @calls) . '"') if isdbg('set/skim');
37 dbg('set/skimmer @want = "' . join(', ', @want) . '"') if isdbg('set/skim');
41 push @calls, $self->call unless @calls;
43 foreach $call (@calls) {
45 my $user = DXUser::get_current($call);
48 dbg(sprintf("set/skimmer before rbn:%d ft:%d bcn:%d cw:%d psk:%d rtty:%d",
55 )) if isdbg('set/skim');
65 $user->wantrbn(0) if /^NO/;
66 $user->wantft(1) if /^FT/;
67 $user->wantbeacon(1) if /^BCN|BEA|DXF/;
68 $user->wantcw(1) if /^CW/;
69 $user->wantpsk(1) if /^PSK|MSK|FSK/;
70 $user->wantrtty(1) if /^RT/;
72 } elsif ($user->wantrbn) {
86 dbg(sprintf("set/skimmer after rbn:%d ft:%d bcn:%d cw:%d psk:%d rtty:%d",
93 )) if isdbg('set/skim');
97 @want = (); # variable reuse!!
98 push @want, 'CW' if $user->wantcw;
99 push @want, 'BEACONS' if $user->wantbeacon;
100 push @want, 'PSK, FSK' if $user->wantpsk;
101 push @want, 'RTTY' if $user->wantrtty;
102 push @want, 'FT8 & FT4' if $user->wantft;
103 $s = join(', ', @want) if @want && $user->wantrbn;
106 dbg("set/skimmer \$s = $s") if isdbg('set/skim');;
107 dbg('set/skimmer @want NOW = "' . join(', ', @want) . '"') if isdbg('set/skim');
109 $s ||= $user->wantrbn ? 'ALL MODES' : 'NONE';
111 push @out, $self->msg('skims', $call, $s);
114 push @out, $self->msg('e3', "Set Skimmer", $call);