QT Gui Sink

Is there a way to control the update rate on the QT Gui sink? I have it
running on the E100, but it would be helpful if I could slow down the
update rate.

Philip

On 04/02/2011 08:11 AM, Philip B. wrote:

There’s a set_update_time() method, but it’s not exported through
SWIG. The default is 0.1second.


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium

On Sun, Apr 3, 2011 at 11:57 AM, Marcus D. Leech [email protected]
wrote:

[email protected]
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org

Right, and I believe it even works correctly now… The original API had
the
update time information as part of the constructor, but I didn’t see
that as
the correct thing to do, but I also did not think to export it.

I am working on updating the QtGUI, hopefully to resolve the
segmentation
fault issue when you close it. I’ll wrap this function and export it so
you
can use it later.

Tom

On 04/04/2011 08:06 AM, Tom R. wrote:

Right, and I believe it even works correctly now… The original API had the
update time information as part of the constructor, but I didn’t see that as
the correct thing to do, but I also did not think to export it.

I am working on updating the QtGUI, hopefully to resolve the segmentation
fault issue when you close it. I’ll wrap this function and export it so you
can use it later.

On further study, it appears the sink constantly does the fft
calculation and only updates the display periodically.

What would be helpful for me is only run the fft when you update the
display. Calculating the fft continuously is a waste of time. (Well, for
an fft you display)

Philip

Hi Philip,

As Marcus and Tom have noted the SetUpdateTime() method can be used to
set
the display update time (but not the FFT calculation rate, which I think
is
what you want).

As this method is a slot it is possible to call it from your application
without any mods to the QT Gui sink, here’s a simple example of how to
do
it:-

In pyqt_example.py

def init(self, display, control):
QtGui.QWidget.init(self, None)
self.setWindowTitle(‘PyQt Test GUI’)

  self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, 

self)
self.boxlayout.addWidget(display, 1)
self.boxlayout.addWidget(control)

  self.resize(800, 500)

Change update rate to 1 second

self.connect(self, QtCore.SIGNAL(“SetUpdateTime(double)”),
display, QtCore.SLOT(“SetUpdateTime(double)”))

self.emit(QtCore.SIGNAL(“SetUpdateTime(double)”), 1)

I’m not sure if that’s helpful in your case however it may be
interesting as
the same technique can be used for any of the slots in
spectrumdisplayform.h

BR,

Mike VK2XMC