python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.
https://www.python-microscope.org
GNU General Public License v3.0
69 stars 41 forks source link

Ximea trig fix #126

Closed iandobbie closed 4 years ago

iandobbie commented 4 years ago

The triggers were no longer being set properly as the setting had been a enum and somewhere along the way the api changed it to a string.

carandraug commented 4 years ago

Do we know when their API changed. Since this is a recent change, we should be checking for this and either fail if the version is too old, or somehow make it work for both cases.

carandraug commented 4 years ago

I have checked on Ximea and I couldn't find any Changelog type of file with changes. Nick's install is version 4.16.0 and works fine. The latest with this issue is version 4.19.09. This is just for reference, I think we need to check for the behaviour we expect not version number.

carandraug commented 4 years ago

I'm not sure change on upstream is the issue here. Currently, the code compares the return value from Camera.get_trigger_source() to XI_TRG_SOFTWARE (and other trigger enums) but XI_TRG_SOFTWARE is not defined anywhere on the module.

carandraug commented 4 years ago

Looking at the logs, I don't think the trigger source stuff ever worked on the ximea camera. There's variables being used that are not defined anywhere. Commit c4d5f3eab3b30a9428db1 uses XI_TG_SOURCE but its value is commented out (could be import from ximea.xidefs) while commit 6da68530c42847737417d8b3a5e uses XI_TRG_SOFTWARE which are keys on the not defined XY_TG_SOURCE dict.

I went to DeepSIM to find how the hell this was working there and I found out that the implementation is completely different. Nick's master branch has a whole different development history since October 2018.

I'm closing this PR, this is not the fix we are looking for.