I’m currently writing a device adapter (and eventually a configuration GUI) for Prior’s PureFocus 850 laser autofocus system. I’m running into some strangeness with hub device adapters though.
The autofocus system of course does autofocussing. It can also apply an offset to Z-stack. And it stores 6 presets for different objectives, selectable from the PC (in MM) or a keypad. The MM documentation says that this is where you’d use a hub, with all the various features configured/managed as child device adapters which are peripherals under that hub. So that’s what I’ve done.
Where this has gone strange is that I’m adding this to the existing “Prior” adapter project. When I register the hub device (InitializeModuleData() calling RegisterDevice() for the various supported devices), all the existing Prior devices vanish from the hardware configuration wizard, and only the hub is visible. When I comment out registering the hub, all the existing devices come back again.
Is this some undocumented (or at least obscure) feature of MM where a hub automatically hides everything else from the same DLL, on the assumption that everything in that DLL will be a peripheral of that hub? I can’t see anything about this in the manuals, or in the example Arduino project.
Also on a similar theme of hubs, it would be good if the device type set in RegisterDevice() (used when searching for a device) did not have to tie up with the device type reported by the adapter (used to tell MMCore what features it supports). I would ideally like people searching for the PureFocus to find it under “Autofocus”, not under “Hub”.
Or am I going about this the wrong way, and there’s an easier way to skin this particular cat?