nicost / micro-manager

Microscope control and image acquisition integrated with ImageJ.
http://www.micro-manager.org
16 stars 11 forks source link

GetLoadedDeviceOfType doesn't return a vector of strings as comment suggests #88

Closed HarmlessHarm closed 4 years ago

HarmlessHarm commented 4 years ago

https://github.com/nicost/micro-manager/blob/81eea2d445f755beb6d1c384f40eb2155c6ab5cf/MMDevice/DeviceBase.h#L973-L975

This function doesn't return a vector of loaded devices of type as the comment suggests, but requires an index to return the *char of the device at given index.

nicost commented 4 years ago

Thanks! I pushed a better comment into the svn repo. It looks like the function was changed and the comment was not. B.t.w., it is not clear to me how to get the number of loaded devices of the given type (which seems to be needed to use this function without resorting to awful approaches). Let me know if that is indeed so, and I can add that function (GetNumberOfLoadedDevicesOfType or something like that).

HarmlessHarm commented 4 years ago

At the moment this function is used in the multiCamera device in utilities adapter. The function is wrapped in a while true loop which breaks when no device is returned.

nicost commented 4 years ago

That does sound like an awful approach (and I was probably the one who wrote it;). I'll leave it as is for now.