fix async send data

This commit is contained in:
2025-06-18 09:02:29 +02:00
parent 01cbc7f13e
commit bf02475d5e

View File

@@ -150,8 +150,28 @@ class FalconSuperXASDirect(PSIDeviceBase, FalconControlDirect):
"""Falcon implementierung at SuperXAS. prefix: 'X10DA-SITORO:'"""
preview = Cpt(PreviewSignal, name="preview", ndim=1, doc="Preview signal for Falcon detector")
async_data = Cpt(
AsyncSignal, ndim=0, max_size=int(1e6), doc="Asynchronous data signal for Falcon detector"
icr = Cpt(
AsyncSignal, name="icr", ndim=0, max_size=int(1e6), doc="Async input count rate signal"
)
ocr = Cpt(
AsyncSignal, name="ocr", ndim=0, max_size=int(1e6), doc="Async output count rate signal"
)
elap_real_time = Cpt(
AsyncSignal,
name="elap_real_time",
ndim=0,
max_size=int(1e6),
doc="Async elapsed real time signal",
)
roi0_count = Cpt(
AsyncSignal, name="roi0_count", ndim=0, max_size=int(1e6), doc="Async ROI 0 count signal"
)
dead_cor_roi0_count = Cpt(
AsyncSignal,
name="dead_cor_roi0_count",
ndim=0,
max_size=int(1e6),
doc="Async dead time corrected ROI 0 count signal",
)
########################################
@@ -237,26 +257,45 @@ class FalconSuperXASDirect(PSIDeviceBase, FalconControlDirect):
This method blocks until the acquiring status is DONE.
"""
CompareStatus(self.acquiring, FalconAcquiringStatus.DONE).wait(self._pv_timeout)
data = {
self.mca1.rois.roi0.count.name: {
"value": self.mca1.rois.roi0.count.get(),
"timestamp": time.time(),
},
self.mca1.elapsed_real_time.name: {
"value": self.mca1.elapsed_real_time.get(),
"timestamp": time.time(),
},
self.dxp1.input_count_rate.name: {
"value": self.dxp1.input_count_rate.get(),
"timestamp": time.time(),
},
self.dxp1.output_count_rate.name: {
"value": self.dxp1.output_count_rate.get(),
"timestamp": time.time(),
},
self.dead_time_cor_cnts1.name: {
"value": self.dead_time_cor_cnts1.get(),
"timestamp": time.time(),
},
}
self.async_data.put(data)
logger.info(f"Sending data for {self.name} at {time.time()}")
self.icr.put(
{
self.dxp1.input_count_rate.name: {
"value": self.dxp1.input_count_rate.get(),
"timestamp": time.time(),
}
}
)
self.ocr.put(
{
self.dxp1.output_count_rate.name: {
"value": self.dxp1.output_count_rate.get(),
"timestamp": time.time(),
}
}
)
self.elap_real_time.put(
{
self.mca1.elapsed_real_time.name: {
"value": self.mca1.elapsed_real_time.get(),
"timestamp": time.time(),
}
}
)
self.roi0_count.put(
{
self.mca1.rois.roi0.count.name: {
"value": self.mca1.rois.roi0.count.get(),
"timestamp": time.time(),
}
}
)
self.dead_cor_roi0_count.put(
{
self.dead_time_cor_cnts1.name: {
"value": self.dead_time_cor_cnts1.get(),
"timestamp": time.time(),
}
}
)
logger.info(f"Data sent for {self.name} at {time.time()}")