diff --git a/daq/src/aaredaq/aaredb.py b/daq/src/aaredaq/aaredb.py index 5039b173..5ce2eb90 100644 --- a/daq/src/aaredaq/aaredb.py +++ b/daq/src/aaredaq/aaredb.py @@ -11,6 +11,7 @@ import requests from aareDBclient import ( SetTellPosition, SampleEventCreate, + SampleEventType, SetTellPositionRequest, CharacterizationParameters, RotationParameters, @@ -89,7 +90,7 @@ class AareWrapper: try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="Mounted"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("Mounted")), ) except Exception as e: print(e) @@ -99,7 +100,7 @@ class AareWrapper: try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="Unmounted"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("Unmounted")), ) except Exception as e: print(e) @@ -109,7 +110,7 @@ class AareWrapper: try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="Centered"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("Centered")), ) except Exception as e: print(e) @@ -120,18 +121,18 @@ class AareWrapper: try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="Collected"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("Collected")), ) except Exception as e: print(e) - def sample_failed(self, s: Optional[SampleShortInfo]): + def sample_failed(self, s: Optional[SampleShortInfo], failed_comment: Optional[str] = None): if s is None: return try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="Failed"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("Failed"), comment=failed_comment), ) except Exception as e: print(e) @@ -142,18 +143,18 @@ class AareWrapper: try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="AXCFailed"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("AXCFailed")), ) except Exception as e: print(e) - def alc_failed(self, s: Optional[SampleShortInfo]): + def alc_failed(self, s: Optional[SampleShortInfo], alc_comment: Optional[str] = None): if s is None: return try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="ALCFailed"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("ALCFailed"), comment=alc_comment), ) except Exception as e: print(e) @@ -164,7 +165,7 @@ class AareWrapper: try: self.__sample_api.create_sample_event( sample_id=s.db_id, - sample_event_create=SampleEventCreate(event_type="Lost"), + sample_event_create=SampleEventCreate(event_type=SampleEventType("Lost")), ) except Exception as e: print(e)