Forum: GNU Radio 1 fine slider Element and 1 rough slider Element to adjust ONE frequnecy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
feldmaus (Guest)
on 2009-02-27 17:37
(Received via mailing list)
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
Josh B. (Guest)
on 2009-02-27 23:46
(Received via mailing list)
Attachment: adjust_fine_freq.grc (0 Bytes)
I attached an example flow graph, take a look. This way may work better
for you. -Josh
This topic is locked and can not be replied to.