Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py

    r14e1ff0 r33c0561  
    128128        self.is_chain_fitting = False 
    129129 
    130         # Is the fit job running? 
    131         self.is_running = False 
    132         self.calc_fit = None 
    133  
    134130        # Remember previous content of modified cell 
    135131        self.current_cell = "" 
     
    261257        Perform the constrained/simultaneous fit 
    262258        """ 
    263         # Stop if we're running 
    264         if self.is_running: 
    265             self.is_running = False 
    266             #re-enable the Fit button 
    267             self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    268             self.cmdFit.setText("Fit") 
    269             # stop the fitpages 
    270             self.calc_fit.stop() 
    271             return 
    272  
    273259        # Find out all tabs to fit 
    274260        tabs_to_fit = self.getTabsForFit() 
     
    324310 
    325311        # new fit thread object 
    326         self.calc_fit = FitThread(handler=handler, 
     312        calc_fit = FitThread(handler=handler, 
    327313                             fn=sim_fitter_list, 
    328314                             batch_inputs=batch_inputs, 
     
    335321        if LocalConfig.USING_TWISTED: 
    336322            # start the trhrhread with twisted 
    337             self.calc_fit = threads.deferToThread(self.calc_fit.compute) 
    338             self.calc_fit.addCallback(completefn) 
    339             self.calc_fit.addErrback(self.onFitFailed) 
     323            calc_thread = threads.deferToThread(calc_fit.compute) 
     324            calc_thread.addCallback(completefn) 
     325            calc_thread.addErrback(self.onFitFailed) 
    340326        else: 
    341327            # Use the old python threads + Queue 
    342             self.calc_fit.queue() 
    343             self.calc_fit.ready(2.5) 
    344  
    345         # modify the Fit button 
     328            calc_fit.queue() 
     329            calc_fit.ready(2.5) 
     330 
     331 
     332        #disable the Fit button 
    346333        self.cmdFit.setStyleSheet('QPushButton {color: red;}') 
    347         self.cmdFit.setText('Stop fit') 
     334        self.cmdFit.setText('Running...') 
    348335        self.parent.communicate.statusBarUpdateSignal.emit('Fitting started...') 
    349         self.is_running = True 
     336        self.cmdFit.setEnabled(False) 
    350337 
    351338    def onHelp(self): 
     
    470457        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    471458        self.cmdFit.setText("Fit") 
     459        self.cmdFit.setEnabled(True) 
    472460 
    473461        # Notify the parent about completed fitting 
     
    515503        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    516504        self.cmdFit.setText("Fit") 
     505        self.cmdFit.setEnabled(True) 
    517506 
    518507        # Notify the parent about completed fitting 
     
    549538        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    550539        self.cmdFit.setText("Fit") 
     540        self.cmdFit.setEnabled(True) 
    551541 
    552542        # Notify the parent about completed fitting 
     
    968958        if isBatch: 
    969959            self.chkChain.setChecked(is_chain) 
    970  
    971     def getReport(self): 
    972         """ 
    973         Wrapper for non-existent functionality. 
    974         Tell the user to use the reporting tool 
    975         on separate fit pages. 
    976         """ 
    977         msg = "Please use Report Results directly on fit pages" 
    978         msg += " involved in the Constrained and Simultaneous fitting process." 
    979         msgbox = QtWidgets.QMessageBox(self) 
    980         msgbox.setIcon(QtWidgets.QMessageBox.Warning) 
    981         msgbox.setText(msg) 
    982         msgbox.setWindowTitle("Fit Report") 
    983         _ = msgbox.exec_() 
    984         return 
Note: See TracChangeset for help on using the changeset viewer.