Permalink
Browse files

DSP components are starting with random options, left rx-rf-gain and …

…rx-rf-iq-correct out, need to configure rx-if-mix -freq.
  • Loading branch information...
1 parent 0c8a2d1 commit 66334884d70381af0bfed1ceb104c957d92ba252 @recri committed May 6, 2012
Showing with 28 additions and 30 deletions.
  1. +1 −1 lib/sdrapp/radio.tcl
  2. +27 −29 lib/sdrui/spectrum.tcl
View
@@ -106,7 +106,7 @@ snit::type sdrapp::radio {
{*}$options(-control) part-activate hw
}
if {$options(-enable-rx)} {
- foreach name {rx-rf-gain rx-rf-iq-correct rx-if-mix rx-if-bpf rx-af-agc} {
+ foreach name {rx-if-mix rx-if-bpf rx-af-agc} {
{*}$options(-control) part-enable $name
}
}
View
@@ -95,7 +95,7 @@ snit::widget sdrui::spectrum {
# imported for here and display
option -rate -default 48000 -type sdrtype::sample-rate -configuremethod Opt-display
- option -period -default 100 -type sdrtype::milliseconds
+ option -period -default 50 -type sdrtype::milliseconds
# from here for capture
option -polyphase -default 1 -type sdrtype::spec-polyphase -configuremethod Opt-capture
@@ -284,10 +284,7 @@ snit::widget sdrui::spectrum {
method capture-is-busy {} { return [lindex [$capture modified] 1] }
method update {} {
- if {[$self capture-is-busy]} {
- set data(after) [after $options(-period) [mymethod update]]
- }
- if {[$capture is-active]} {
+ if { ! [$self capture-is-busy] && [$capture is-active]} {
lassign [$capture get] frame dB
binary scan $dB f* dB
set n [llength $dB]
@@ -305,12 +302,13 @@ snit::widget sdrui::spectrum {
}
#puts "$xy"
$display update $xy
- set data(after) [after $options(-period) [mymethod update]]
}
+ set data(after) [after $options(-period) [mymethod update]]
}
method Deactivate {} {
catch {after cancel $data(after)}
+ unset data(after)
if {[$capture is-active]} { $capture deactivate }
set data(pairs) {}
}
@@ -320,32 +318,32 @@ snit::widget sdrui::spectrum {
if {$input eq {} ||
! [$options(-control) part-is-active $input]} {
$self Deactivate
- return
- }
- # puts "$input is-active"
- set ports [$capture info ports]
- set pairs {}
- foreach port [$options(-control) part-ports $input] {
- lappend pairs {*}[$options(-control) port-active-connections-to [list $input $port]]
- }
- # puts "$input active-connections-to $pairs"
- if {$pairs ne $data(pairs)} {
- if {[llength $pairs] != [llength $ports]} {
- puts "port mismatch between {$pairs} and {$ports}"
- $self Deactivate
- return
+ } else {
+ # puts "$input is-active"
+ set ports [$capture info ports]
+ set pairs {}
+ foreach port [$options(-control) part-ports $input] {
+ lappend pairs {*}[$options(-control) port-active-connections-to [list $input $port]]
}
- if { ! [$capture is-active]} { $capture activate }
- foreach port $ports pair $pairs old $data(pairs) {
- puts "sdrtcl::jack -server $options(-server) connect [join $pair :] spectrum-tap:$port"
- sdrtcl::jack -server $options(-server) connect [join $pair :] spectrum-tap:$port
- if {$old ne {}} {
- puts "sdrtcl::jack -server $options(-server) disconnect [join $old :] spectrum-tap:$port"
- sdrtcl::jack -server $options(-server) disconnect [join $old :] spectrum-tap:$port
+ # puts "$input active-connections-to $pairs"
+ if {$pairs ne $data(pairs)} {
+ if {[llength $pairs] != [llength $ports]} {
+ error "port mismatch between {$pairs} and {$ports}"
+ }
+ if { ! [$capture is-active]} { $capture activate }
+ foreach port $ports pair $pairs old $data(pairs) {
+ puts "sdrtcl::jack -server $options(-server) connect [join $pair :] spectrum-tap:$port"
+ sdrtcl::jack -server $options(-server) connect [join $pair :] spectrum-tap:$port
+ if {$old ne {}} {
+ puts "sdrtcl::jack -server $options(-server) disconnect [join $old :] spectrum-tap:$port"
+ sdrtcl::jack -server $options(-server) disconnect [join $old :] spectrum-tap:$port
+ }
+ }
+ set data(pairs) $pairs
+ if { ! [info exists data(after)]} {
+ set data(after) [after $options(-period) [mymethod update]]
}
}
- set data(pairs) $pairs
- set data(after) [after $options(-period) [mymethod update]]
}
}

0 comments on commit 6633488

Please sign in to comment.