refactor and test mcs ophyd class
Background
The mcs card is a multi channel scalar card. It can take up to 32 inputs from scalars, allows counting with an internal (50MHz) & external clock and readouts can be triggered externally (individual signals for active counting -> gate signal + pixel/counter advance signal). At cSAXS, it was used to readout the direct beam intensity from electronics connected to a scintillator.
However, in principle it is not limited to this and can take up to 32 individual signals, for which the readout would be synchronised provided by this card.
This means that a beam monitor such as bpm4i, could be in principle hooked up to this card and read out in well defined time sequences.
Goal
Refactor and test the class. In this context, it should be evaluated whether it can be considered as a detector from our point of view. Before spending too much time on this, I would be happy for input based on the upper explanation. Would we consider this to be a detector in the broader context, or not.
Why do I think it could be a detector class
It follows a similar class structure already, with the following commands
stage
unstage
_prep_det
_prep_readout (like _prep_fw)
finished
stop
... etc
Data is being send to REDIS as a stream (see example below):
def _send_data_to_bec(self) -> None:
if self.scaninfo.scan_msg is None:
return
metadata = self.scaninfo.scan_msg.metadata
metadata.update(
{
"async_update": "append",
"num_lines": self.num_lines.get(),
}
)
msg = BECMessage.DeviceMessage(
signals=dict(self.mca_data),
metadata=self.scaninfo.scan_msg.metadata,
).dumps()
self._producer.xadd(
topic=MessageEndpoints.device_async_readback(
scanID=self.scaninfo.scanID, device=self.name
),
msg={"data": msg},
expire=self._stream_ttl,
)