diff --git a/ivolution/FacemovieThread.py b/ivolution/FacemovieThread.py index 6843548..a0e4209 100644 --- a/ivolution/FacemovieThread.py +++ b/ivolution/FacemovieThread.py @@ -65,8 +65,10 @@ class FacemovieThread(threading.Thread, Observable, Observer): #self.console_logger.debug(message) self.my_logger.debug(message) if message[0] == "FILEADD": - print "got it !" self.notify(["Interface", [message[0], message[1], 0]]) + elif message[0] == "FILEDONE": + print "tointerface" + self.notify(["Interface", message]) else: # notify gui about small updates self.notify(["Interface", ["STATUS", message[0], message[1]]]) diff --git a/ivolution/Facemovie_lib.py b/ivolution/Facemovie_lib.py index a30d4b9..b24f9ba 100644 --- a/ivolution/Facemovie_lib.py +++ b/ivolution/Facemovie_lib.py @@ -154,6 +154,7 @@ class FaceMovie(object, Observable, Observer): for a_guy in self.guys: ptr += 1 if self.run: + faceres = 0 a_guy.search_face(self.face_params) # notifying the Observers @@ -162,10 +163,13 @@ class FaceMovie(object, Observable, Observer): if a_guy.has_face(): # face(s) have been found self.console_logger.info("Face found for %s" % (a_guy.name)) self.my_logger.info("Face found for %s" % (a_guy.name)) + faceres = 1 # for notifying else: self.console_logger.warning("No face found for %s. Skipped . . ." % (a_guy.name)) self.my_logger.warning("No face found for %s. Skipped . . ." % (a_guy.name)) + self.notify(["Application", ["FILEDONE", a_guy.name, faceres]]) + def percent(self, num, den): """ Returns a float between 0 and 1, being the percentage given by num / den diff --git a/ivolution/gui_wx/IvolutionWindow.py b/ivolution/gui_wx/IvolutionWindow.py index 3609704..947b7c4 100644 --- a/ivolution/gui_wx/IvolutionWindow.py +++ b/ivolution/gui_wx/IvolutionWindow.py @@ -300,6 +300,8 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable): wx.MutexGuiEnter() # to avoid thread problems self.filelist.InsertItem(item) wx.MutexGuiLeave() + elif message[0] == "FILEDONE": + print "Done : %s" % (message[1]) elif len(message) > 1: # system commands shall be ignored self.console_logger.debug("Unrecognized command")