Exemple #1
0
 def connectToLogObject(self, format=None):
     """
     Connect text_edit field to LogObject signal. A formatting function, which takes a string as input
     and returns the modified string, can be provided for custom formatting, e.g. for adding a time stamp.
     """
     log = LogObject()
     if format:
         log.connect(lambda s: self.appendText(format(s)))
     else:
         log.connect(lambda s: self.appendText(s + "\n"))
     log.disconnectDefault()
Exemple #2
0
    def __init__(self,
                 app,
                 display,
                 file,
                 save_directory,
                 connection=None,
                 testFile=False):
        super().__init__()
        self.app = app
        self.display = display
        self.figure = None
        self.file = file
        self.save_directory = os.path.abspath(save_directory)
        self.connection = connection
        self.testFile = testFile
        self.alive = True

        self.save_detections = True
        self.save_tracks = True

        if display:
            self.main_window = QtWidgets.QMainWindow()
        else:
            self.main_window = None

        self.playback_manager = PlaybackManager(self.app, self.main_window)

        self.detector = Detector(self.playback_manager)
        self.tracker = Tracker(self.detector)
        self.fish_manager = FishManager(self.playback_manager, self.tracker)
        self.playback_manager.fps = 100

        self.playback_manager.runInThread(self.listenConnection)

        log = LogObject()
        log.disconnectDefault()
        #log.connect(writeToFile)
        log.connect(self.writeToConnection)
        log.print("Process created for file: ", self.file)