openUC2/ImSwitchConfig

clear frame buffer

Opened this issue · 1 comments

@beniroquai
clear frame buffer, so that Python selects the correct image

I think I found the error in @ranranking's setup (too). So the issue may be that multiple instances are trying to access the getLatestFrame function and then weird things happen to the frameID.

To get rid of it, we should check the frameid externally like this:

                            mFrame = None
                            lastFrameNumber = -1
                            for iFrame in range(self.nsimFrameSyncVal):
                                mFrame, frameNumber = self.detector.getLatestFrame(returnFrameNumber=True)
                                if frameNumber == lastFrameNumber:
                                    time.sleep(0.05)
                                    continue  
                                lastFrameNumber = frameNumber
                                print(f"Frame number: {frameNumber}") 

I'm still testing, but I guess this is it.