LJMUAstroecology / flirpy

Python library to interact with FLIR camera cores
Other
191 stars 54 forks source link

Enumerate all devices, not just the first one #24

Open jveitchmichaelis opened 4 years ago

jveitchmichaelis commented 4 years ago

See discussion in: https://github.com/LJMUAstroecology/flirpy/pull/19

Currently the device finding code locates the first camera (e.g. if the user doesn't specify a device). It's also a good idea to return all the cameras for those folks who have multiple cameras connected. The proposal is to extend find_devices to instead return a list.

The default action if calling setup_video(None) will be to take the first value in that list, if it exists. Or if you have several cameras, you would be able to do:

devices = boson.find_devices()
cameras = ...
for dev in devices:
    camera = Boson()
    camera.setup_video(dev)
    cameras.append(camera)

The only trouble with this approach is that it's difficult to associate the port numbers with the cameras (except maybe on Linux). I don't know if it will be trivial on Windows without digging into the COM.

We will probably need to do something like: