DAQ: added aaredb events to send an error message event to the db
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user