def _validate(self): """ Ensure that the worker is ready to be started. :return: True if the worker can be started safely. """ if self.view.is_searching(): create_error_message(self.view, "Mantid is searching for data files. Please wait.") return False if not self.view.get_focus_valid(): create_error_message(self.view, "Check run numbers/path is valid.") return False if not self.view.get_vanadium_valid(): create_error_message(self.view, "Check vanadium run number/path is valid.") return False if not self.current_calibration.is_valid(): create_error_message( self.view, "Create or Load a calibration via the Calibration tab before focusing.") return False if self.current_calibration.get_instrument() != self.instrument: create_error_message( self.view, "Please make sure the selected instrument matches instrument for the current calibration.\n" "The instrument for the current calibration is: " + self.current_calibration.get_instrument()) return False return True
def _validate(self): if self._is_searching(): create_error_message( self.view, "Mantid is searching for files. Please wait.") return False elif not self._files_are_valid(): create_error_message(self.view, "Entered files are not valid.") return False return True
def _validate(self): # Do nothing if run numbers are invalid or view is searching. if self.view.is_searching(): create_error_message(self.view, "Mantid is searching for data files. Please wait.") return False if not self.view.get_sample_valid(): create_error_message(self.view, "Check run numbers/path is valid.") return False if self.view.get_crop_checked(): if self.cropping_widget.get_custom_calfile_enabled() and not self.cropping_widget.is_calfile_valid(): create_error_message(self.view, "Check custom calfile path is valid.") return False if self.cropping_widget.get_custom_spectra_enabled() and not self.cropping_widget.is_spectra_valid(): create_error_message(self.view, "Check custom spectra are valid.") return False return True