Closed Brow71189 closed 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:
__simulator
and read only property simulator
__cameras
in the simulator instrument device_get_camera_simulator
calls with camera_device.simulator
or similarget_camera_data
with camera_device.get_camera_data
or similarget_camera_dimensional_calibrations
parse_camera_values
to ask the camera device for dimensional calibrationsRegistry
for lookup by camera type (I think this will work, might need some tweaking to get it right)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.
* 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?
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.
Not needed anymore with latest commit in the usim PR.
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.