Ignore:
Timestamp:
Feb 2, 2018 9:21:48 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:
a90c9c5
Parents:
5e66738
Message:

More code review related fixes

File:
1 edited

Legend:

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

    r63319b0 r14ec91c5  
    2323 
    2424import sas.qtgui.Utilities.GuiUtils as GuiUtils 
     25import sas.qtgui.Utilities.LocalConfig as LocalConfig 
     26 
    2527from sas.qtgui.Utilities.CategoryInstaller import CategoryInstaller 
    2628from sas.qtgui.Plotting.PlotterData import Data1D 
     
    4143from sas.qtgui.Perspectives.Fitting.ViewDelegate import PolyViewDelegate 
    4244from sas.qtgui.Perspectives.Fitting.ViewDelegate import MagnetismViewDelegate 
    43 from sas.qtgui.Perspectives.Fitting.Constraints import Constraint 
     45from sas.qtgui.Perspectives.Fitting.Constraint import Constraint 
    4446from sas.qtgui.Perspectives.Fitting.MultiConstraint import MultiConstraint 
    4547 
     
    5355DEFAULT_POLYDISP_FUNCTION = 'gaussian' 
    5456 
    55 USING_TWISTED = True 
    56 #USING_TWISTED = False 
    5757 
    5858class ToolTippedItemModel(QtGui.QStandardItemModel): 
     
    10861086        batch_outputs = {} 
    10871087        #--------------------------------- 
    1088         if USING_TWISTED: 
     1088        if LocalConfig.USING_TWISTED: 
    10891089            handler = None 
    10901090            updater = None 
     
    11141114                            completefn=completefn) 
    11151115 
    1116         if USING_TWISTED: 
     1116        if LocalConfig.USING_TWISTED: 
    11171117            # start the trhrhread with twisted 
    11181118            calc_thread = threads.deferToThread(calc_fit.compute) 
    1119             calc_thread.addCallback(self.fitComplete) 
     1119            calc_thread.addCallback(completefn) 
    11201120            calc_thread.addErrback(self.fitFailed) 
    11211121        else: 
     
    11241124            calc_fit.ready(2.5) 
    11251125 
    1126  
    1127         #disable the Fit button 
    1128         self.cmdFit.setText('Running...') 
    11291126        self.communicate.statusBarUpdateSignal.emit('Fitting started...') 
    1130         self.cmdFit.setEnabled(False) 
     1127        # Disable some elements 
     1128        self.setFittingStarted() 
    11311129 
    11321130    def updateFit(self): 
     
    11471145        """ 
    11481146        #re-enable the Fit button 
    1149         self.cmdFit.setText("Fit") 
    1150         self.cmdFit.setEnabled(True) 
     1147        self.setFittingStopped() 
    11511148 
    11521149        print ("BATCH FITTING FINISHED") 
     
    11601157        """ 
    11611158        #re-enable the Fit button 
    1162         self.cmdFit.setText("Fit") 
    1163         self.cmdFit.setEnabled(True) 
     1159        self.setFittingStopped() 
    11641160 
    11651161        assert result is not None 
     
    22322228        self.setMagneticModel() 
    22332229 
     2230    def setFittingStarted(self): 
     2231        """ 
     2232        Set item enablement on fitting start 
     2233        """ 
     2234        #disable the Fit button 
     2235        self.cmdFit.setText('Running...') 
     2236        self.cmdFit.setEnabled(False) 
     2237 
     2238    def setFittingStopped(self): 
     2239        """ 
     2240        Set item enablement on fitting stop 
     2241        """ 
     2242        #enable the Fit button 
     2243        self.cmdFit.setText("Fit") 
     2244        self.cmdFit.setEnabled(True) 
     2245 
    22342246    def readFitPage(self, fp): 
    22352247        """ 
Note: See TracChangeset for help on using the changeset viewer.