Changeset 17968c3 in sasview for src/sas/qtgui/Perspectives


Ignore:
Timestamp:
Jan 26, 2018 5:52:20 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
9c0ce68
Parents:
c6343a5
Message:

Support for running C&S batch fits - SASVIEW-865

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
2 edited

Legend:

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

    rc6343a5 r17968c3  
    181181        # start the trhrhread with twisted 
    182182        calc_thread = threads.deferToThread(calc_fit.compute) 
    183         calc_thread.addCallback(self.onFitComplete) 
     183        calc_thread.addCallback(completefn) 
    184184        calc_thread.addErrback(self.onFitFailed) 
    185185        #else: 
     
    296296        Respond to the successful fit complete signal 
    297297        """ 
     298        #re-enable the Fit button 
     299        self.cmdFit.setText("Fit") 
     300        self.cmdFit.setEnabled(True) 
     301 
    298302        # get the elapsed time 
    299303        elapsed = result[1] 
     
    315319                tab_object.fitComplete(([[results[i]]], elapsed)) 
    316320 
     321        msg = "Fitting completed successfully in: %s s.\n" % GuiUtils.formatNumber(elapsed) 
     322        self.parent.communicate.statusBarUpdateSignal.emit(msg) 
     323 
    317324    def onBatchFitComplete(self, result): 
    318325        """ 
    319326        Respond to the successful batch fit complete signal 
    320327        """ 
     328        #re-enable the Fit button 
     329        self.cmdFit.setText("Fit") 
     330        self.cmdFit.setEnabled(True) 
     331 
     332        # get the elapsed time 
     333        elapsed = result[1] 
     334 
     335        # ADD THE BATCH FIT VIEW HERE 
     336        # 
     337 
     338        msg = "Fitting completed successfully in: %s s.\n" % GuiUtils.formatNumber(elapsed) 
     339        self.parent.communicate.statusBarUpdateSignal.emit(msg) 
     340 
    321341        pass 
    322342 
    323343    def onFitFailed(self, reason): 
    324344        """ 
    325         """ 
    326         print("FIT FAILED: ", reason) 
     345        Respond to fitting failure. 
     346        """ 
     347        #re-enable the Fit button 
     348        self.cmdFit.setText("Fit") 
     349        self.cmdFit.setEnabled(True) 
     350 
     351        msg = "Fitting failed: %s s.\n" % reason 
     352        self.parent.communicate.statusBarUpdateSignal.emit(msg) 
    327353        pass 
    328354  
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r116dd4c1 r17968c3  
    236236            raise AttributeError(msg) 
    237237 
     238        if is_batch: 
     239            # Just create a new fit tab. No empty batchFit tabs 
     240            self.addFit(data_item, is_batch=is_batch) 
     241            return 
     242 
    238243        items = [data_item] if is_batch else data_item 
    239  
    240244        for data in items: 
    241245            # Find the first unassigned tab. 
    242246            # If none, open a new tab. 
    243             available_tabs = list([tab.acceptsData() for tab in self.tabs]) 
     247            available_tabs = [tab.acceptsData() for tab in self.tabs] 
    244248 
    245249            if numpy.any(available_tabs): 
Note: See TracChangeset for help on using the changeset viewer.