wavefrontshaping / slmPy

A simple Python module based on wxPython to interact with spatial light modulators handled as secondary monitors.
Other
63 stars 26 forks source link

Multiple SLMdisplay instances #6

Closed krokosik closed 3 years ago

krokosik commented 3 years ago

Hi, I'm trying to use two SLMs in an experiment, but once the second SLMdisplay object gets instantiated, they stop responding to image changes. I have tried changing EVT_NEW_IMAGE to an instance variable, but to no avail and I am of the opinion that wx may be to blame, as it does not support multiple wx.app instances.

Perhaps you had some luck running two SLMs from a single program? Any help would be greatly appreciated.

krokosik commented 3 years ago

I have solved the problem by running each instance in a separate process.

fschiffers commented 2 years ago

could you provide more information how this was done ?

krokosik commented 2 years ago

I don't work on that project anymore and don't have access to the code, but from what I recall we wrapped each SLM in a worker run using Python's multiprocessing library. The images to be displayed were sent using a pipe, but something was wrong with that solution and we changed the lib from multiprocessing to pyqtgraph.multiprocess