nanophotonics / nplab

Core functions and instrument scripts for the Nanophotonics lab experimental scripts
GNU General Public License v3.0
38 stars 15 forks source link

Andor's ExtendedImageView replaced with blank box when resizing window or changing capture mode #117

Closed eoinell closed 4 years ago

eoinell commented 4 years ago

When using the Andor GUI the image viewbox turns black when the gui is resized, or when switching to FVB or another spectrum acquisition mode. This is reproducible in part with the DummyCameraRoiScale class in camera_scaled_roi, when resizing the image pops in and out of view.

YagoDel commented 4 years ago

Versions for PyQt and pyqtgraph? (I assume this is Python 3 on Windows?)

There's also some changes to pyqtgraph in newer versions that mean the quickMinMax needs to be rewritten (I have the edits ready to push, but haven't yet since I'm not sure if people need the older pyqtgraph)

eoinell commented 4 years ago

qt=5.12.5, pyqt=5.12.3, pyqtgraph=0.10.0

Yes, py3, win10.

We did the python3 update at the same time everyone upgraded to windows 10, I guess if people are still using older versions they're probably using the python2 branch

YagoDel commented 4 years ago

There's a new pyqtgraph (which is the one that changed the quickMinMax)

But that doesn't change the issue here (I've got qt=5.9.7 and pyqtgraph 0.11.0), which at least I've managed to reproduce. It feels like a pyqtgraph bug...

eoinell commented 4 years ago

Agreed it's probably pyqtgraph, although what I don't understand is why it happens here, but not in Spectrometer's ImageView or Camera's.

YagoDel commented 4 years ago

I think the problem is that CameraPreviewWidget is subclassing pygtgraph.GraphicsView and DisplayWidgetRoiScale is subclassing pygtgraph.ImageView (that's the only difference I can see right now). And since then the code in the background is updating things and assuming they are the same type of object, I guess it's messing it up.

Although I'm not sure if that also explains your point about the spectrometer

If this is the problem, I see two possibilities to solve it:

YagoDel commented 4 years ago

In the end it was a signal and queuing problem