DAQ: added aaredb events to send an error message event to the db

This commit is contained in:
2025-07-17 14:27:19 +02:00
parent 177199c60a
commit afbd07a79d
+22
View File
@@ -122,6 +122,28 @@ class AareWrapper:
except Exception as e:
print(e)
def sample_failed(self, s: Optional[SampleShortInfo]):
if s is None:
return
try:
self.__sample_api.create_sample_event(
sample_id=s.db_id,
sample_event_create=SampleEventCreate(event_type="Failed"),
)
except Exception as e:
print(e)
def sample_lost(self, s: Optional[SampleShortInfo]):
if s is None:
return
try:
self.__sample_api.create_sample_event(
sample_id=s.db_id,
sample_event_create=SampleEventCreate(event_type="Lost"),
)
except Exception as e:
print(e)
def upload_image(self, sample_id: int, filename: str, bgr_image: np.ndarray):
_, buffer = cv2.imencode('.jpg', bgr_image)
jpeg_bytes = io.BytesIO(buffer)