public void FaceRecognitionProgressThreadDoWorkTest() { MainWindow window = new MainWindow(); Nkujukira.Demo.Singletons.Singleton.InitializeStuff(); FaceRecognitionProgressThread thread = new FaceRecognitionProgressThread(); thread.StartWorking(); Assert.IsTrue(thread.IsRunning()); thread.RequestStop(); }
//THIS STOPS A RUNNING THREAD GIVEN ITS iD public static bool StopThread(String thread_id) { switch (thread_id) { case ThreadFactory.PERP_ALERT_THREAD: if (perp_alert_thread != null) { perp_alert_thread.RequestStop(); } break; case ThreadFactory.STUDENT_ALERT_THREAD: if (student_alert_thread != null) { student_alert_thread.RequestStop(); } break; case ThreadFactory.CAMERA_THREAD: if (cam_output != null) { cam_output.RequestStop(); } break; case ThreadFactory.CAMERA_THREAD_USING_VIDEO: if (cam_output_using_video != null) { cam_output_using_video.RequestStop(); } ; break; case ThreadFactory.LIVE_DISPLAY_UPDATER: if (live_display_updater != null) { live_display_updater.RequestStop(); } break; case ThreadFactory.REVIEW_DISPLAY_UPDATER: if (review_display_updater != null) { review_display_updater.RequestStop(); } break; case ThreadFactory.REVIEW_FACE_DETECTOR: if (review_face_detector != null) { review_face_detector.RequestStop(); } break; case ThreadFactory.LIVE_FACE_DETECTOR: if (live_face_detector != null) { live_face_detector.RequestStop(); } break; case ThreadFactory.PERP_RECOGNIZER: if (perp_recognizer != null) { perp_recognizer.RequestStop(); } break; case ThreadFactory.FACE_DRAWER: break; case ThreadFactory.PROGRESS_THREAD: if (face_recog_progress != null) { face_recog_progress.RequestStop(); face_recog_progress_2.RequestStop(); } break; case ThreadFactory.FOOTAGE_SAVER: if (footage_saver != null) { footage_saver.RequestStop(); } break; case ThreadFactory.VIDEO_THREAD: if (video_from_file_grabber != null) { video_from_file_grabber.RequestStop(); } break; case ThreadFactory.VIDEO_THREAD_USING_CAMERA: if (video_from_camera != null) { video_from_camera.RequestStop(); } break; } return(true); }