portugueslab / stytra

A modular package to control stimulation and track behaviour
http://www.portugueslab.com/stytra/
GNU General Public License v3.0
41 stars 26 forks source link

Gracefully handle CalibrationException #59

Closed nvbln closed 2 years ago

nvbln commented 2 years ago

Catches the CalibrationException and reports it to the user, after which no calibration will be done, instead of crashing.

nvbln commented 2 years ago

It's a bit more complicated than blocking or non-blocking. The main loop is indeed blocked, but the GUI isn't (it continues running inside the new exec()) (see here) This can also be observed when running the code, behind the dialog the GUI keeps on running smoothly. It just cannot be interacted with, as was my intention. If you'd rather stay on the cautious side, using show() instead would be a bit more complicated, but should be possible.

vigji commented 2 years ago

Yum, right, Qt5 event loops can always be messy :) well, this should be mostly user experience-oriented as it won't really affect experiments, so if when you test it it feels fine even waiting some seconds before clicking, then it's good to go this way!