FiloCara / pyOptris

This package provides a pythonic interface to the Evocortex libirimager direct binding.
8 stars 2 forks source link

ctypes.c_float required in set_radiation_parameters #2

Closed arvedes closed 1 year ago

arvedes commented 1 year ago

I just updated pyOptris in multilog. With the latest version I've got the following error (Windows, libirimager-8.8.5):

multilog\multilog\pyOptris\direct_binding.py", line 278, in set_radiation_parameters
    return lib.evo_irimager_set_radiation_parameters(
ctypes.ArgumentError: argument 1: <class 'TypeError'>: Don't know how to convert parameter 1

Therefore I changed the function to use ctypes.c_float:

def set_radiation_parameters(
    emissivity: float, transmissivity: float, ambientTemperature: float
) -> int:
    return lib.evo_irimager_set_radiation_parameters(
        ctypes.c_float(emissivity),
        ctypes.c_float(transmissivity),
        ctypes.c_float(ambientTemperature),
    )
FiloCara commented 1 year ago

Thanks for finding the issue. There was the same problem in the "set_focus_motor_position". I do not think I have ever used thee function before...