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

threading #4

Open a-rouxel opened 3 years ago

a-rouxel commented 3 years ago

Hi,

First of all, thanks for your module it is very helpful.

I managed to make it work a few months ago but when i tried to install it on a new computer this week, i got this error :

/tmp/build/80754af9/wxpython_1547931003892/work/ext/wxWidgets/src/unix/threadpsx.cpp(1810): assert "wxThread::IsMain()" failed in OnExit(): only main thread can be here [in thread 7fe42f4e6740] /tmp/build/80754af9/wxpython_1547931003892/work/ext/wxWidgets/src/common/socket.cpp(767): assert "wxIsMainThread()" failed in IsInitialized(): unsafe to call from other threads [in thread 7fe42f4e6740]

It comes up when i try to call the function : "slmpy.SLMdisplay()"

I know it is linked to multithreading but i didn't manage to solve the issue.

If you have an idea...

Thanks !

a-rouxel commented 3 years ago

PS : it works fine in command line. I just cant manage to make you example work inside a classic python script. I know it is linked to my lack of knowledge in multithreading ...

wavefrontshaping commented 3 years ago

Hi,

This error is "normal", cf my reply to this issue It will be displayed when you exit the program, your error is elsewhere, but I cannot help without seeing the code. Please provide a minimal reproducable example for this issue.