On Tue, Sep 17, 2013 at 11:55 AM, Chad Kidder <cckid...@gmail.com> wrote:
> I'm following the MPL Qt4 example given at
> http://matplotlib.org/examples/user_interfaces/embedding_in_qt4.html and
> it looks like I am timing out somewhere in the setup. The error I am
> getting is:
>
> RuntimeError: super-class __init__() of type MyDynamicMplCanvas was never
> called
>
> It's timing out on a function that goes and talks to a piece of test
> equipment to get some data to plot. That function takes on the order of a
> second to complete and is located in compute_initial_figure(self): for the
> previously mentioned class. I will need to make these calls whenever I go
> into the update routine and they may take a few seconds to update.
>
> First, where is the "timeout" that I am violating? Second, how do I fix
> this? Thanks for your help.
>
>
> --Chad Kidder
>
>
Hi Chad,
I think the timeout is right over here:
class MyDynamicMplCanvas(MyMplCanvas):
"""A canvas that updates itself every second with a new plot."""
def __init__(self, *args, **kwargs):
MyMplCanvas.__init__(self, *args, **kwargs)
timer = QtCore.QTimer(self)
QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"),
self.update_figure)
timer.start(1000)
My suspicion would be to either bump up that timer to take more than a
second, or come up with a different signal function to more intelligently
handle refreshes.
Cheers!
Ben Root
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users