99 SharedState ,
1010 StateMachineEvents ,
1111)
12- from isar .models .communication .queues .queue_utils import check_for_event , trigger_event
1312from isar .robot .robot_start_mission import RobotStartMissionThread
1413from isar .robot .robot_status import RobotStatusThread
1514from isar .robot .robot_stop_mission import RobotStopMissionThread
@@ -55,7 +54,7 @@ def stop(self) -> None:
5554 self .start_mission_thread = None
5655
5756 def _start_mission_event_handler (self , event : Event [Mission ]) -> None :
58- start_mission = check_for_event ( event )
57+ start_mission = event . consume_event ( )
5958 if start_mission is not None :
6059 if (
6160 self .start_mission_thread is not None
@@ -74,7 +73,7 @@ def _start_mission_event_handler(self, event: Event[Mission]) -> None:
7473 self .start_mission_thread .start ()
7574
7675 def _task_status_request_handler (self , event : Event [str ]) -> None :
77- task_id : str = check_for_event ( event )
76+ task_id : str = event . consume_event ( )
7877 if task_id :
7978 self .robot_task_status_thread = RobotTaskStatusThread (
8079 self .robot_service_events ,
@@ -84,8 +83,8 @@ def _task_status_request_handler(self, event: Event[str]) -> None:
8483 )
8584 self .robot_task_status_thread .start ()
8685
87- def _stop_mission_request_handler (self , event : Event [str ]) -> None :
88- if check_for_event ( event ):
86+ def _stop_mission_request_handler (self , event : Event [bool ]) -> None :
87+ if event . consume_event ( ):
8988 if (
9089 self .stop_mission_thread is not None
9190 and self .stop_mission_thread .is_alive ()
@@ -103,8 +102,8 @@ def _stop_mission_request_handler(self, event: Event[str]) -> None:
103102 error_reason = ErrorReason .RobotStillStartingMissionException ,
104103 error_description = error_description ,
105104 )
106- trigger_event (
107- self . robot_service_events . mission_failed_to_stop , error_message
105+ self . robot_service_events . mission_failed_to_stop . trigger_event (
106+ error_message
108107 )
109108 return
110109 self .stop_mission_thread = RobotStopMissionThread (
0 commit comments