mabuchilab / Instrumental

Python-based instrumentation library from the Mabuchi Lab.
http://instrumental-lib.readthedocs.org/
GNU General Public License v3.0
120 stars 80 forks source link

Add Thorlabs APT controller driver #83

Closed sylvainpelissier closed 5 years ago

sylvainpelissier commented 5 years ago

According to https://www.thorlabs.com/software/apt/APT_Communications_Protocol_Rev_15.pdf documentation.

natezb commented 5 years ago

Thanks for the pull request, I really do appreciate it! However, is there some reason you're using APT instead of the Thorlabs Kinesis software? I think it can support everything APT did. We do have support for some individual Kinesis hardware on master, but there is also a separate kinesis branch for development of a unified Kinesis interface. Development on that is stalled at the moment (due to lack of developer bandwidth), although I do use the branch every day to control my K10CR1 rotation stages.

You can check out #47 for more details on this if you're interested.

sylvainpelissier commented 5 years ago

Hi, thanks for the answer. I use APT commands to have a support on Linux machine (no dll required) and not to have to change my code between WIndows and Linux machine.

natezb commented 5 years ago

I hadn't realized Kinesis was Windows-only, I think that's suitable justification to include this driver. I'll take a deeper look tomorrow when I get a chance.

sylvainpelissier commented 5 years ago

I agree with you but I am not sure to see how to cache the Serial objects within the APT class.

natezb commented 5 years ago

I'll merge this in, make a few changes, and notify you in this thread so you can check them out and test them.

natezb commented 5 years ago

Ok, I cleaned up the driver a bit and added caching of the serial devices. Thanks for the contribution!

For future reference (if someone comes along who has a card-slot type system), I think the right way to implement list_instruments looks like this: