Code version: Both Git repos pulled on 05 May 2021
Background: I’m working on support for the PureFocus PF-850 autofocus, which needs a device adapter and a setup plugin. We’ve got a load of configuration settings which need saving, so I’m using a config group and putting all the settings in a preset for that config group.
Because of how the PF-850 works, bulk changes of settings need the unit to be ready to accept the changes. The unit has to be stopped from servoing whilst all the changes go in, and then re-enabled when all the settings are done. There don’t seem to be suitable callbacks for this on the device adapter side. However MMCore does produce MMEvents into the Java side, so I looked at whether I could have my plugin register for events and set a “change in progress” property in the device adapter. I was particularly looking for the DefaultConfigGroupChangedEvent event which would give me my “changes are coming” trigger.
Problem: What I’ve found is that these core events aren’t being generated. It’s not just that they aren’t reaching the plugin - I’ve put a breakpoint in the DefaultConfigGroupChangedEvent () constructor and it’s never hit.
Looking into this, I’m suspecting the cause is in MMCore. Breakpointing CMMCore::setConfig(), I can see that being hit when I select a new config group preset, but no callback. Looking through CMMCore for anywhere kicking off the callbacks, the only places I can see which actually produce callbacks are “CMMCore::setChannelGroup()” calling “onChannelGroupChanged” and “CMMCore::loadSystemConfigurationImpl” calling “onSystemConfigurationLoaded”. This ties in with my plugin seeing DefaultSystemConfigurationLoadedEvent but no other core events.
Is it correct that CMMCore is not calling other callbacks, and hence the associated core events are not being produced? Or is there something I’m doing wrong with this?
Or is it just that I shouldn’t be doing this in the first place, and there’s a better solution which I’ve not found yet?