-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix behavior of Core "Initialize" vs device initialization state #397
Comments
Or should it remain an error to try to "initialize all devices" when not all devices are |
yeah makes sense, I understand now. Also makes sense to probably just stick with it now, no sense in trying to change the config file command format
yep, i see. one likely wouldn't ever run into this except in the MMStudio config wizard, or in the pymmcore-widgets config wizard. (and even then, only in tests when asserting that the state of the microscope model and the MMCore object are indeed the same). Something I'm more than happy to just special case in my tests.
given my current understanding. I think it's probably reasonable enough just to make a note something along the lines of "think of |
Yeah, keeping the behavior seems best; edited the original post accordingly. |
Currently these result in errors, which is good: These are okay but maybe we'll special case them so that ( |
Issues reported by @tlambert03 in #384 (comment).
Core
-Initialize
to1
when any (non-Core) device has already been initialized throws an exception ->need to fix this by tellingdocument that this is expected behaviorinitializeAllDevices()
to skip over devices that are not in theUninitialized
stateCore
-Initialize
results in an error, we should avoid changing its value (for what is's worth; see below)getDeviceInitializationState('Core')
fails -> it should always returnInitializedSuccessfully
load/unload/initialize functions do something reasonable when called onCore
Initialize
is a pseudo-property that does not encode any real state (other than the last written value) but simply performs actions when being set (1
=initializeAllDevices()
;0
=unloadAllDevices()
; the actions are not even symmetric!). Not sure why we even have this, other than as a messy hack to be able to unload/initialize all devices in a single command in config files (it probably would have been better if we just had dedicated config file commands for the two actions).Note that reading the value of
Initialize
will only read out what was last set, regardless of whether direct calls toinitializeAllDevices()
orunloadAllDevices()
were made in the interim. So the read value is not particularly useful.Also note that the
Initialize
property has nothing to do with the initialization state of theCore
device itself. TheCore
device is always loaded and always initialized successfully and cannot be unloaded. (Things wouldn't work otherwise.)Initialize
propertyThe text was updated successfully, but these errors were encountered: