Ignore:
Timestamp:
May 1, 2018 9:51:06 AM (6 years ago)
Author:
krzywon
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
72ecbdf2
Parents:
6bd0d81
Message:

Responding to P(r) code review.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    rd79bb7e r6da860a  
    3131MAX_DIST = 140.0 
    3232DICT_KEYS = ["Calculator", "PrPlot", "DataPlot"] 
     33 
     34logger = logging.getLogger(__name__) 
    3335 
    3436 
     
    354356            msg = "Unable to update P{r}. The connection between the main GUI " 
    355357            msg += "and P(r) was severed. Attempting to restart P(r)." 
    356             logging.warning(msg) 
     358            logger.warning(msg) 
    357359            self.setClosable(True) 
    358360            self.close() 
     
    395397        """ 
    396398        from .DMaxExplorerWidget import DmaxWindow 
    397         self.dmaxWindow = DmaxWindow(self._calculator, self.getNFunc(), self) 
     399        self.dmaxWindow = DmaxWindow(pr_state=self._calculator, 
     400                                     nfunc=self.getNFunc(), 
     401                                     parent=self) 
    398402        self.dmaxWindow.show() 
    399403 
     
    459463            nfunc = int(self.noOfTermsInput.text()) 
    460464        except ValueError: 
    461             logging.error("Incorrect number of terms specified: %s" 
     465            logger.error("Incorrect number of terms specified: %s" 
    462466                          %self.noOfTermsInput.text()) 
    463467            self.noOfTermsInput.setText(str(NUMBER_OF_TERMS)) 
     
    581585                self.dataList.setCurrentIndex(index) 
    582586                self.isBatch = True 
     587                # Add the index before calculating in case calculation fails 
     588                self.batchComplete.append(index) 
    583589                break 
    584590        if self.isBatch: 
     
    599605        # Set data before running the calculations 
    600606        self.updateCalculator() 
     607        # Disable calculation buttons to prevent thread interference 
     608        self.calculateAllButton.setEnabled(False) 
     609        self.calculateThisButton.setEnabled(False) 
    601610 
    602611        # If a thread is already started, stop it 
     
    672681        """ 
    673682        alpha, message, elapsed = output_tuple 
     683        self._calculator.alpha = alpha 
     684        self._calculator.elapsed += self._calculator.elapsed 
    674685        if message: 
    675             logging.info(message) 
     686            logger.info(message) 
    676687        self.performEstimateNT() 
    677688 
     
    690701        """ 
    691702        nterms, alpha, message, elapsed = output_tuple 
    692         self._calculator.elapsed = elapsed 
     703        self._calculator.elapsed += elapsed 
    693704        self._calculator.suggested_alpha = alpha 
    694705        self.nTermsSuggested = nterms 
     
    696707        self.updateGuiValues() 
    697708        if message: 
    698             logging.info(message) 
     709            logger.info(message) 
    699710        if self.isBatch: 
    700711            self.acceptAlpha() 
     
    742753            Call-back method for calculation errors 
    743754        """ 
    744         logging.warning(error) 
     755        logger.error(error) 
Note: See TracChangeset for help on using the changeset viewer.