def __init__(self, mprx): super(GenericWorker, self).__init__() self.omnirobot_proxy = mprx["OmniRobotProxy"] self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.defaultMachine= QtCore.QStateMachine() self.compute_state = QtCore.QState(self.defaultMachine) self.initialize_state = QtCore.QState(self.defaultMachine) self.finalize_state = QtCore.QFinalState(self.defaultMachine) #------------------ #Initialization State machine self.initialize_state.addTransition(self.t_initialize_to_compute, self.compute_state) self.compute_state.addTransition(self.t_compute_to_compute, self.compute_state) self.compute_state.addTransition(self.t_compute_to_finalize, self.finalize_state) self.compute_state.entered.connect(self.sm_compute) self.initialize_state.entered.connect(self.sm_initialize) self.finalize_state.entered.connect(self.sm_finalize) self.timer.timeout.connect(self.t_compute_to_compute) self.defaultMachine.setInitialState(self.initialize_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.imupub_proxy = mprx["IMUPubPub"] self.ui = Ui_guiDlg() self.ui.setupUi(self) self.show() self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.defaultMachine = QtCore.QStateMachine() self.compute_state = QtCore.QState(self.defaultMachine) self.initialize_state = QtCore.QState(self.defaultMachine) self.finalize_state = QtCore.QFinalState(self.defaultMachine) #------------------ #Initialization State machine self.initialize_state.addTransition(self.t_initialize_to_compute, self.compute_state) self.compute_state.addTransition(self.t_compute_to_compute, self.compute_state) self.compute_state.addTransition(self.t_compute_to_finalize, self.finalize_state) self.compute_state.entered.connect(self.sm_compute) self.initialize_state.entered.connect(self.sm_initialize) self.finalize_state.entered.connect(self.sm_finalize) self.timer.timeout.connect(self.t_compute_to_compute) self.defaultMachine.setInitialState(self.initialize_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.ui = Ui_guiDlg() self.ui.setupUi(self) self.show() self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.myStateMachine = QtCore.QStateMachine() self.two_state = QtCore.QState(self.myStateMachine) self.three_state = QtCore.QState(self.myStateMachine) self.four_state = QtCore.QState(self.myStateMachine) self.one_state = QtCore.QState(self.myStateMachine) self.five_state = QtCore.QFinalState(self.myStateMachine) #------------------ #Initialization State machine self.one_state.addTransition(self.t_one_to_two, self.two_state) self.two_state.addTransition(self.t_two_to_three, self.three_state) self.three_state.addTransition(self.t_three_to_four, self.four_state) self.four_state.addTransition(self.t_four_to_one, self.one_state) self.four_state.addTransition(self.t_four_to_five, self.five_state) self.two_state.entered.connect(self.sm_two) self.three_state.entered.connect(self.sm_three) self.four_state.entered.connect(self.sm_four) self.one_state.entered.connect(self.sm_one) self.five_state.entered.connect(self.sm_five) self.myStateMachine.setInitialState(self.one_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.peopleserver_proxy = mprx["PeopleServerProxy"] self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.peopleCounterMachine = QtCore.QStateMachine() self.processing_video_state = QtCore.QState(self.peopleCounterMachine) self.initialize_video_state = QtCore.QState(self.peopleCounterMachine) self.finalize_video_state = QtCore.QFinalState( self.peopleCounterMachine) self.detecting_state = QtCore.QState(self.processing_video_state) self.tracking_state = QtCore.QState(self.processing_video_state) self.update_state = QtCore.QState(self.processing_video_state) self.reading_frames_state = QtCore.QState(self.processing_video_state) #------------------ #Initialization State machine self.initialize_video_state.addTransition( self.initialize_videotoprocessing_video, self.processing_video_state) self.initialize_video_state.addTransition( self.initialize_videotofinalize_video, self.finalize_video_state) self.processing_video_state.addTransition( self.processing_videotofinalize_video, self.finalize_video_state) self.reading_frames_state.addTransition(self.reading_framestodetecting, self.detecting_state) self.reading_frames_state.addTransition(self.reading_framestotracking, self.tracking_state) self.detecting_state.addTransition(self.detectingtoupdate, self.update_state) self.tracking_state.addTransition(self.trackingtoupdate, self.update_state) self.update_state.addTransition(self.updatetoreading_frames, self.reading_frames_state) self.processing_video_state.entered.connect(self.sm_processing_video) self.initialize_video_state.entered.connect(self.sm_initialize_video) self.finalize_video_state.entered.connect(self.sm_finalize_video) self.reading_frames_state.entered.connect(self.sm_reading_frames) self.detecting_state.entered.connect(self.sm_detecting) self.tracking_state.entered.connect(self.sm_tracking) self.update_state.entered.connect(self.sm_update) self.peopleCounterMachine.setInitialState(self.initialize_video_state) self.processing_video_state.setInitialState(self.reading_frames_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.camerargbdsimple_proxy = mprx["CameraRGBDSimpleProxy"] self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.rodMachine= QtCore.QStateMachine() self.detectCircle_state = QtCore.QState(self.rodMachine) self.moveArm_state = QtCore.QState(self.rodMachine) self.takeRod_state = QtCore.QState(self.rodMachine) self.moveRod_state = QtCore.QState(self.rodMachine) self.dropRod_state = QtCore.QState(self.rodMachine) self.initialize_state = QtCore.QState(self.rodMachine) self.finalize_state = QtCore.QFinalState(self.rodMachine) #------------------ #Initialization State machine self.initialize_state.addTransition(self.t_initialize_to_detectCircle, self.detectCircle_state) self.detectCircle_state.addTransition(self.t_detectCircle_to_moveArm, self.moveArm_state) self.moveArm_state.addTransition(self.t_moveArm_to_takeRod, self.takeRod_state) self.takeRod_state.addTransition(self.t_takeRod_to_moveRod, self.moveRod_state) self.moveRod_state.addTransition(self.t_moveRod_to_dropRod, self.dropRod_state) self.dropRod_state.addTransition(self.t_dropRod_to_finalize, self.finalize_state) self.detectCircle_state.entered.connect(self.sm_detectCircle) self.moveArm_state.entered.connect(self.sm_moveArm) self.takeRod_state.entered.connect(self.sm_takeRod) self.moveRod_state.entered.connect(self.sm_moveRod) self.dropRod_state.entered.connect(self.sm_dropRod) self.initialize_state.entered.connect(self.sm_initialize) self.finalize_state.entered.connect(self.sm_finalize) self.rodMachine.setInitialState(self.initialize_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.camerasimple_proxy = mprx["CameraSimpleProxy"] self.rgbd_proxy = mprx["RGBDProxy"] self.aprilbasedlocalization_proxy = mprx["AprilBasedLocalizationPub"] self.ui = Ui_guiDlg() self.ui.setupUi(self) self.show() self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.defaultMachine = QtCore.QStateMachine() self.compute_state = QtCore.QState(self.defaultMachine) self.initialize_state = QtCore.QState(self.defaultMachine) self.finalize_state = QtCore.QFinalState(self.defaultMachine) #------------------ #Initialization State machine self.initialize_state.addTransition(self.t_initialize_to_compute, self.compute_state) self.compute_state.addTransition(self.t_compute_to_compute, self.compute_state) self.compute_state.addTransition(self.t_compute_to_finalize, self.finalize_state) self.compute_state.entered.connect(self.sm_compute) self.initialize_state.entered.connect(self.sm_initialize) self.finalize_state.entered.connect(self.sm_finalize) self.timer.timeout.connect(self.t_compute_to_compute) self.defaultMachine.setInitialState(self.initialize_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.Application = QtCore.QStateMachine() self.app_state = QtCore.QState(self.Application) self.the_end_state = QtCore.QFinalState(self.Application) self.component_state = QtCore.QState(self.app_state) self.load_image_state = QtCore.QState(self.app_state) self.watch_live_state = QtCore.QState(self.app_state) self.exception_handler_state = QtCore.QState(self.app_state) self.app_init_state = QtCore.QState(self.app_state) self.getting_frames_state = QtCore.QState(self.component_state) self.loading_streams_state = QtCore.QState(self.component_state) self.closing_state = QtCore.QFinalState(self.component_state) self.get_frames_state = QtCore.QState(self.watch_live_state) self.watch_init_state = QtCore.QState(self.watch_live_state) self.close_state = QtCore.QFinalState(self.watch_live_state) #------------------ #Initialization State machine self.app_state.addTransition(self.apptoapp, self.app_state) self.app_state.addTransition(self.apptothe_end, self.the_end_state) self.app_init_state.addTransition(self.app_inittocomponent, self.component_state) self.app_init_state.addTransition(self.app_inittoload_image, self.load_image_state) self.app_init_state.addTransition(self.app_inittowatch_live, self.watch_live_state) self.app_init_state.addTransition(self.app_inittoexception_handler, self.exception_handler_state) self.component_state.addTransition(self.componenttoexception_handler, self.exception_handler_state) self.load_image_state.addTransition(self.load_imagetoexception_handler, self.exception_handler_state) self.watch_live_state.addTransition(self.watch_livetoexception_handler, self.exception_handler_state) self.exception_handler_state.addTransition( self.exception_handlertocomponent, self.component_state) self.exception_handler_state.addTransition( self.exception_handlertowatch_live, self.watch_live_state) self.exception_handler_state.addTransition( self.exception_handlertoapp_init, self.app_init_state) self.loading_streams_state.addTransition( self.loading_streamstogetting_frames, self.getting_frames_state) self.getting_frames_state.addTransition( self.getting_framestogetting_frames, self.getting_frames_state) self.getting_frames_state.addTransition(self.getting_framestoclosing, self.closing_state) self.watch_init_state.addTransition(self.watch_inittoget_frames, self.get_frames_state) self.get_frames_state.addTransition(self.get_framestoget_frames, self.get_frames_state) self.get_frames_state.addTransition(self.get_framestoclose, self.close_state) self.app_state.entered.connect(self.sm_app) self.the_end_state.entered.connect(self.sm_the_end) self.app_init_state.entered.connect(self.sm_app_init) self.component_state.entered.connect(self.sm_component) self.load_image_state.entered.connect(self.sm_load_image) self.watch_live_state.entered.connect(self.sm_watch_live) self.exception_handler_state.entered.connect(self.sm_exception_handler) self.loading_streams_state.entered.connect(self.sm_loading_streams) self.closing_state.entered.connect(self.sm_closing) self.getting_frames_state.entered.connect(self.sm_getting_frames) self.watch_init_state.entered.connect(self.sm_watch_init) self.close_state.entered.connect(self.sm_close) self.get_frames_state.entered.connect(self.sm_get_frames) self.Application.setInitialState(self.app_state) self.app_state.setInitialState(self.app_init_state) self.component_state.setInitialState(self.loading_streams_state) self.watch_live_state.setInitialState(self.watch_init_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.Application = QtCore.QStateMachine() self.lambscan_state = QtCore.QState(self.Application) self.init_state = QtCore.QState(self.Application) self.end_state = QtCore.QFinalState(self.Application) self.get_frames_state = QtCore.QState(self.lambscan_state) self.processing_and_filter_state = QtCore.QState(self.lambscan_state) self.save_state = QtCore.QState(self.lambscan_state) self.send_message_state = QtCore.QState(self.lambscan_state) self.exception_state = QtCore.QState(self.lambscan_state) self.start_streams_state = QtCore.QState(self.lambscan_state) self.exit_state = QtCore.QFinalState(self.lambscan_state) #------------------ #Initialization State machine self.init_state.addTransition(self.t_init_to_lambscan, self.lambscan_state) self.lambscan_state.addTransition(self.t_lambscan_to_end, self.end_state) self.start_streams_state.addTransition( self.t_start_streams_to_get_frames, self.get_frames_state) self.start_streams_state.addTransition( self.t_start_streams_to_exception, self.exception_state) self.start_streams_state.addTransition( self.t_start_streams_to_send_message, self.send_message_state) self.get_frames_state.addTransition( self.t_get_frames_to_processing_and_filter, self.processing_and_filter_state) self.get_frames_state.addTransition(self.t_get_frames_to_exception, self.exception_state) self.get_frames_state.addTransition(self.t_get_frames_to_get_frames, self.get_frames_state) self.get_frames_state.addTransition(self.t_get_frames_to_exit, self.exit_state) self.processing_and_filter_state.addTransition( self.t_processing_and_filter_to_get_frames, self.get_frames_state) self.processing_and_filter_state.addTransition( self.t_processing_and_filter_to_save, self.save_state) self.save_state.addTransition(self.t_save_to_get_frames, self.get_frames_state) self.save_state.addTransition(self.t_save_to_exception, self.exception_state) self.exception_state.addTransition(self.t_exception_to_start_streams, self.start_streams_state) self.exception_state.addTransition(self.t_exception_to_get_frames, self.get_frames_state) self.exception_state.addTransition(self.t_exception_to_send_message, self.send_message_state) self.exception_state.addTransition(self.t_exception_to_save, self.save_state) self.send_message_state.addTransition(self.t_send_message_to_exit, self.exit_state) self.lambscan_state.entered.connect(self.sm_lambscan) self.init_state.entered.connect(self.sm_init) self.end_state.entered.connect(self.sm_end) self.start_streams_state.entered.connect(self.sm_start_streams) self.exit_state.entered.connect(self.sm_exit) self.get_frames_state.entered.connect(self.sm_get_frames) self.processing_and_filter_state.entered.connect( self.sm_processing_and_filter) self.save_state.entered.connect(self.sm_save) self.send_message_state.entered.connect(self.sm_send_message) self.exception_state.entered.connect(self.sm_exception) self.Application.setInitialState(self.init_state) self.lambscan_state.setInitialState(self.start_streams_state)
def __init__(self, mprx): super(GenericWorker, self).__init__() self.ui = Ui_guiDlg() self.ui.setupUi(self) self.show() self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.QTimer(self) #State Machine self.myStateMachine = QtCore.QStateMachine() self.four_state = QtCore.QState(self.myStateMachine) self.one_state = QtCore.QState(self.myStateMachine) self.five_state = QtCore.QFinalState(self.myStateMachine) self.two_state = QtCore.QState(QtCore.QState.ParallelStates, self.myStateMachine) self.three_state = QtCore.QState(QtCore.QState.ParallelStates, self.myStateMachine) self.test2sub1_state = QtCore.QState(self.two_state) self.test2sub2_state = QtCore.QState(self.two_state) self.test2sub21_state = QtCore.QState(self.test2sub2_state) self.test2sub22_state = QtCore.QFinalState(self.test2sub2_state) self.test3sub1_state = QtCore.QState(self.three_state) self.test3sub2_state = QtCore.QState(self.three_state) self.test3sub3_state = QtCore.QState(self.three_state) self.test4sub2_state = QtCore.QState(self.four_state) self.test4sub1_state = QtCore.QState(self.four_state) #------------------ #Initialization State machine self.one_state.addTransition(self.onetotwo, self.two_state) self.two_state.addTransition(self.twotothree, self.three_state) self.three_state.addTransition(self.threetofour, self.four_state) self.four_state.addTransition(self.fourtoone, self.one_state) self.four_state.addTransition(self.fourtofive, self.five_state) self.test2sub1_state.addTransition(self.test2sub1totest2sub1, self.test2sub1_state) self.test2sub2_state.addTransition(self.test2sub2totest2sub2, self.test2sub2_state) self.test2sub21_state.addTransition(self.test2sub21totest2sub21, self.test2sub21_state) self.test2sub21_state.addTransition(self.test2sub21totest2sub22, self.test2sub22_state) self.test3sub1_state.addTransition(self.test3sub1totest3sub1, self.test3sub1_state) self.test3sub2_state.addTransition(self.test3sub2totest3sub2, self.test3sub2_state) self.test4sub1_state.addTransition(self.test4sub1totest4sub2, self.test4sub2_state) self.test4sub2_state.addTransition(self.test4sub2totest4sub1, self.test4sub1_state) self.two_state.entered.connect(self.sm_two) self.three_state.entered.connect(self.sm_three) self.four_state.entered.connect(self.sm_four) self.one_state.entered.connect(self.sm_one) self.five_state.entered.connect(self.sm_five) self.test2sub1_state.entered.connect(self.sm_test2sub1) self.test2sub2_state.entered.connect(self.sm_test2sub2) self.test2sub21_state.entered.connect(self.sm_test2sub21) self.test2sub22_state.entered.connect(self.sm_test2sub22) self.test3sub1_state.entered.connect(self.sm_test3sub1) self.test3sub2_state.entered.connect(self.sm_test3sub2) self.test3sub3_state.entered.connect(self.sm_test3sub3) self.test4sub1_state.entered.connect(self.sm_test4sub1) self.test4sub2_state.entered.connect(self.sm_test4sub2) self.myStateMachine.setInitialState(self.one_state) self.test2sub2_state.setInitialState(self.test2sub21_state) self.four_state.setInitialState(self.test4sub1_state)