discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] gain slider issues


From: Eric Hill Matlis
Subject: Re: [Discuss-gnuradio] gain slider issues
Date: Fri, 27 Oct 2006 10:50:02 -0400 (EDT)

Oh, and what is this line for:

        self.gain_control.set_k(10**(self.gain/10))

I commented it out and didn't notice any change in behavior...

By the way- have you had issues with cpuspeed? Normally on my system the processor is clocked down from 2.2 GHz to 1 GHz. I have another gnuradio application which does not cause cpuspeed to ramp up the cpu clock when I run the script. However, if I call a second script simultaneously to tie up the cpu, then the processor ramps up, and BOTH scripts go faster. I have an Athlon64 X2 processor running Fedora Core 5. It seems to me that if a given process could run faster at a higher clock speed, then the system should be smart enough to clock the cpu faster.

thanks,

eric

On Thu, 26 Oct 2006, Charles Swiger wrote:

On Thu, 2006-10-26 at 16:00 -0400, Eric Hill Matlis wrote:
I'm having some python coding issues with a slider I'm trying to
implement.  The code is based on usrp_wfm_rcv_pll.py, which uses the
powermate to adjust either frequency or volume.  I would like to replace
the volume slider with a gain slider, which exists in the original but
which is not controlled by the powermate.

My code is below, and the symptoms are that while the new gain slider
moves, the value shown does not update until I click the powermate button
to switch to frequency control.  Any suggestions?


Hi Eric - All you need is to put an "update_status_bar()" in the
knob rotate handler. Change this:


     def on_rotate (self, event):
         self.rot += event.delta
         if (self.state == "FREQ"):
             if self.rot >= 3:
                 self.set_freq(self.freq + .001e6)
                 self.rot -= 3
             elif self.rot <=-3:
                 self.set_freq(self.freq - .001e6)
                 self.rot += 3
         else:
             step = self.subdev.gain_range()[2]
             if self.rot >= 3:
                 self.set_gain(self.gain + step)
                 self.rot -= 3
             elif self.rot <=-3:
                 self.set_gain(self.gain - step)
                 self.rot += 3


To this:

   def on_rotate (self, event):
       self.rot += event.delta
       if (self.state == "FREQ"):
           if self.rot >= 3:
               self.set_freq(self.freq + .001e6)
               self.rot -= 3
           elif self.rot <=-3:
               self.set_freq(self.freq - .001e6)
               self.rot += 3
       else:
           step = self.subdev.gain_range()[2]
           if self.rot >= 3:
               self.set_gain(self.gain + step)
               self.rot -= 3
           elif self.rot <=-3:
               self.set_gain(self.gain - step)
               self.rot += 3
           self.update_status_bar ()



Then it works, and will update the gain displayed in the status bar on
every call to on_rotate() when gain is being adjusted.


--Chuck








reply via email to

[Prev in Thread] Current Thread [Next in Thread]