BenediktBurger / pymodaq_plugins_basler

PyMoDAQ plugins for cameras of Basler
MIT License
1 stars 1 forks source link

Camera parameters depend on camera #9

Open rgeneaux opened 3 weeks ago

rgeneaux commented 3 weeks ago

We have some Basler cameras on which the camera gain is "GainRaw" instead of "Gain" (self.controller.camera.GainRaw)

this is the same issue as you had with the exposure, I think? And it is the reason why we don't use the pylablib library directly. Maybe in the generic class we need to test at initialization, which attribute is present or not. Something like

if self.controller.camera.hasattr(GainRaw): gain_name = 'GainRaw' 
else: gain_name = 'Gain'

and then when setting the gain getattr(self.controller.camera, gain_name).setValue(...)

and do the same for Exposure / ExposureRaw as well.

If we do that, maybe we can directly inhereit from DAQ_2DViewer_GenericPylablibCamera? Like that daq_2Dviewer_ThorlabsPLL.py

BenediktBurger commented 3 weeks ago

Does your Basler camera not work with your plugin or with this plugin? Do you suggest to modify your plugin such that it works with Basler as well?

This plugin uses the callback functionality of Basler's cameras, therefore it is more than the pylablib access.

rgeneaux commented 3 weeks ago

Hi,

My Basler camera does not work with this plugin. I needed to rename Gain to GainRaw

Pylablib also uses the callback (it uses the pylon C library), so it is probably equivalent to use the DartCamera or my generic camera class, if we fix the attribute names problem

BenediktBurger commented 3 weeks ago

Pylablib also uses the callback (it uses the pylon C library), so it is probably equivalent to use the DartCamera or my generic camera class, if we fix the attribute names problem

Ok. Let's make a Basler plugin (based on pylablib) in your plugins package using these transitions.