1 fine slider Element and 1 rough slider Element to adjust ONE frequnecy


#1

Hi All,

i want to make 2 sliders depending on each other.
Both schould adjust the same frequency. One Slider
for the rough counts and the other one fo the fine counts.

How to realize that ?

I tried this but without success.

Here is a part of my code,
#######################################################################
class uebertragungschar_LF_RX(grc_wxgui.top_block_gui):

def __init__(self, options):
    grc_wxgui.top_block_gui.__init__(self,
       __title__+' - '+__author__+' - '+__version__)

    ##################################################
    # Parameters
    ##################################################

. . .
self.usrp_freq_min = options.usrp_freq_min
self.usrp_freq_max = options.usrp_freq_max

    ##################################################
    # Variables
    ##################################################
    self.usrp_freq = 10e3

. . .

    ##################################################
    # Controls
    ##################################################
    self._usrp_freq_control = grc_wxgui.slider_horizontal_control(
        window=self.GetWin(),
        callback=self.set_usrp_freq,
        label="Oszillatorfrequenz Grob",
        value=self.usrp_freq,
        min=self.usrp_freq_min,
        max=self.usrp_freq_max,
        num_steps=290,
        slider_length=400,
    )
    self.Add(self._usrp_freq_control)
    self._usrp_freq_fine_control = 

grc_wxgui.slider_horizontal_control(
window=self.GetWin(),
callback=self.set_usrp_freq,
label=“Oszillatorfrequenz Fein”,
value=self.usrp_freq,
min=self._usrp_freq_control.get_value()-1.45e3,
max=self._usrp_freq_control.get_value()+1.45e3,
num_steps=29,
slider_length=400,
)
self.Add(self._usrp_freq_fine_control)

. . .

def set_usrp_freq(self, freq):
    self.usrp_freq = freq
    self.set_middle_freq_fft_plot(self.usrp_freq)
    self.usrp_simple_source_x.set_frequency(self.usrp_freq)
    self._usrp_freq_fine_control.set_value(freq)

. . .

if name == ‘main’:
parser = OptionParser()
. . .
parser.add_option("–usrp_freq_min", dest=“usrp_freq_min”,
type=“float”,
default=0)
parser.add_option("–usrp_freq_max", dest=“usrp_freq_max”,
type=“float”,
default=29e6)
(options, args) = parser.parse_args()
tb = uebertragungschar_LF_RX(options)
tb.Run()
#######################################################################

Regards Markus


#2

I attached an example flow graph, take a look. This way may work better
for you. -Josh