X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=be5feee32b2915308464961f9884c5b4e9dee218;hb=3e075e9d00d74fd477c44db2b29eb3eac9d6d88a;hp=e702222267a6b12e404c6d5647add1deb9b40d89;hpb=febdc9bd8f6cd065d217ba089fab4361e9980f35;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index e7022222..be5feee3 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -99,6 +99,8 @@ $count = 0; dxcc => '0,Country Code', itu => '0,ITU Zone', cq => '0,CQ Zone', + enhanced => '5,Enhanced Client,yesno', + senddbg => '8,Sending Debug,yesno', ); # object destruction @@ -110,7 +112,7 @@ sub DESTROY delete $self->{$_}; } } - dbg('chan', "DXChannel $self->{call} destroyed ($count)"); + dbg("DXChannel $self->{call} destroyed ($count)") if isdbg('chan'); $count--; } @@ -146,7 +148,7 @@ sub alloc } $count++; - dbg('chan', "DXChannel $self->{call} created ($count)"); + dbg("DXChannel $self->{call} created ($count)") if isdbg('chan'); bless $self, $pkg; return $channels{$call} = $self; } @@ -297,7 +299,30 @@ sub send_now my @lines = split /\n/; for (@lines) { $conn->send_now("$sort$call|$_"); - dbg('chan', "-> $sort $call $_"); + dbg("-> $sort $call $_") if isdbg('chan'); + } + } + $self->{t} = time; +} + +# +# send later with letter (more control) +# + +sub send_later +{ + my $self = shift; + my $conn = $self->{conn}; + return unless $conn; + my $sort = shift; + my $call = $self->{call}; + + for (@_) { +# chomp; + my @lines = split /\n/; + for (@lines) { + $conn->send_later("$sort$call|$_"); + dbg("-> $sort $call $_") if isdbg('chan'); } } $self->{t} = time; @@ -318,7 +343,7 @@ sub send # this is always later and always data my @lines = split /\n/; for (@lines) { $conn->send_later("D$call|$_"); - dbg('chan', "-> D $call $_"); + dbg("-> D $call $_") if isdbg('chan'); } } $self->{t} = time; @@ -366,7 +391,7 @@ sub state $self->{oldstate} = $self->{state}; $self->{state} = shift; $self->{func} = '' unless defined $self->{func}; - dbg('state', "$self->{call} channel func $self->{func} state $self->{oldstate} -> $self->{state}\n"); + dbg("$self->{call} channel func $self->{func} state $self->{oldstate} -> $self->{state}\n") if isdbg('state'); # if there is any queued up broadcasts then splurge them out here if ($self->{delayed} && ($self->{state} eq 'prompt' || $self->{state} eq 'talk')) { @@ -453,12 +478,12 @@ sub decode_input # the above regexp must work unless (defined $sort && defined $call && defined $line) { # $data =~ s/([\x00-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg; - dbg('err', "DUFF Line on $chcall: $data"); + dbg("DUFF Line on $chcall: $data") if isdbg('err'); return (); } if(ref($dxchan) && $call ne $chcall) { - dbg('err', "DUFF Line come in for $call on wrong channel $chcall" ); + dbg("DUFF Line come in for $call on wrong channel $chcall") if isdbg('err'); return(); }