Refactor/mcs card refactoring first light
Summary
This MR includes a refactoring of the MCS
integration, the DDG
integration as well as a rewritten integration of the IDSCamera
. All devices now work pretty good, although there still remain minor issues that need to be investigated separately.
Pipeline for 3.12 fails due to issues of the gitlab runner.
MCS Card
closes #3 (closed)
The integration looks solid. The logic is couple to the integration of DDG1. I tried to document this in code as good as possible, but it might be good to write additional information together with how the device is cabled.
DDG
closes #5 (closed) #8 (closed)
I investigated the failure of long scans. They are resolved now. The issue was in how to handle feedback from the EpicsIOC nicely during triggering. I believe this to be quite robust now, however, please keep in mind that the sleeps are actually in the polling. I am not quite sure whether this is due to shortcomings of the hardware itself, or EPICS on top.
To further optimize this, I can only think of bypassing communication via EPICS fully, which could be relatively quick, but is postponed for the moment as this requires more work and it seems to run now quite smoothly.
IDS Camera
#closes #9 (closed) #10 (closed)
The new integration ids_camera_new
is basically a cleanup of the procedure in the old camera. I kept the old integration with a deprecation warning, as Mirko may like to test it with his integrations @holler .
I am thinking about contacting IDS to ask them a couple of questions. One for instance would be how to properly kill existing connections to a camera, as I have seen this to be an issue while integrating the device. I tried to make this as safe as possible by registering a cleanup hook that destroys the connection to the camera. However, as this command is taking some time, there is a side-effect that killing the DeviceServer may take additional time. If one is impatient, one may actually kill and restart too quickly which results in the camera not properly connecting upon initialization.
PS: the device_config has now the field live_mode
which essentially prepares the camera to stream directly. This interface is also exposed to the CLI. In addition, I added a roi_signal (asynchronous) that sends the normalized sum of intensity over the flattened image to BEC IF the camera is in live_mode. The roi can either be set through .set_rect_roi(x,y,widht,height)
, or by directly setting a 2D mask of appropriate size .mask = np.zeros(img_shape)
. You can receive the last image via get_last_image()
to generate the mask.