def newTracker(self): # Prompt the user for the file name tracker_name, ok = qtw.QInputDialog.getText(self, "Tracker Name", "Name of the new tracker?") if ok: # Raise an error if the 'Default' tracker is selected if tracker_name == 'Default': errorMessage('Forbidden Action',"The settings of the Default tracker cannot be edited.") else: # Check if the name is in the list _write = True trackers_list = listTrackerConfigs() if tracker_name in trackers_list: _write = warningProceedMessage('Existing Tracker','The selected tracker name ('+tracker_name+') is already in the memory. Do you want to replace it?') if _write: # Update the selection self.updateDetectionSession() # Collect the settings self.current_tracker = tracker_name self.trajectory_session.name = tracker_name self.trajectory_session.modified = True # Save the tracker session in file editTrackerConfig(self.trajectory_session)
def processStack(self): # Save the current settings in the class self.saveSettings() # Ask the user to save the new settings as well if needed if self.trajectory_session.modified: # Prompt if warningProceedMessage( 'Save Tracker', 'Do you want to save the batch settings of the tracker in the memory?' ): editTrackerConfig(self.trajectory_session) # Retrieve the displayed stack tab_id = self.parent.imageTabDisplay.currentIndex() self.image_class = self.parent.imageTabDisplay.displayedTabs[ tab_id].image_class # Open the progress bar window openWindow(self.parent, TrackpyProgressBarWindow, 'progress_bar', image_class=self.image_class, trackpy_session=self.detection_session, scheduler=self)
def editTracker(self): # Raise an error if the 'Default' tracker is selected if self.current_tracker == 'Default': errorMessage('Forbidden Action',"The settings of the Default tracker cannot be edited.") else: if warningProceedMessage('Overwrite Tracker','Are you sure you want to replace the settings of the tracker '+self.current_tracker+' in the memory?'): # Update the selection self.updateDetectionSession() # Edit the tracker settings self.trajectory_session.modified = True editTrackerConfig(self.trajectory_session)