nion-software / nionswift-instrumentation-kit

Base classes for Nion Swift STEM microscope instrumentation
GNU General Public License v3.0
1 stars 12 forks source link

Pass simulator into CameraDevice when setting up for tests. #107

Closed Brow71189 closed 2 years ago

Brow71189 commented 2 years ago

This is needed for setting up the tests after the changes to nionswift-usim submitted in https://github.com/nion-software/nionswift-usim/pull/34.

cmeyer commented 2 years ago

I'd like to consider doing this a different way... I think encapsulation is broken in the current code and this change just further erodes encapsulation.

My proposal:

Brow71189 commented 2 years ago

Ok I'll make the changes. But this pull request here will still be needed as is, right? Or did you not want to pass the simulator into the camera device? Btw, it is already being tracked in the camera device (there is a field __camera_simulator), the additional "registration" in instrument was just there for backwards-compatibility reasons.

Brow71189 commented 2 years ago
* use `Registry` for lookup by camera type (I think this will work, might need some tweaking to get it right)

How do you mean that? Should we register camera devices under their type instead of the generic camera_module used now? So would we just call it ronchigram_camera_device or something like that in the registry?

cmeyer commented 2 years ago

The simulator can be created inside the camera device init. The overall goal is to reduce/eliminate usim internal/implementation details from instrumentation kit tests.

Brow71189 commented 2 years ago

Not needed anymore with latest commit in the usim PR.