Changeset 14ec91c5 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Feb 2, 2018 9:21:48 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r63319b0 r14ec91c5 23 23 24 24 import sas.qtgui.Utilities.GuiUtils as GuiUtils 25 import sas.qtgui.Utilities.LocalConfig as LocalConfig 26 25 27 from sas.qtgui.Utilities.CategoryInstaller import CategoryInstaller 26 28 from sas.qtgui.Plotting.PlotterData import Data1D … … 41 43 from sas.qtgui.Perspectives.Fitting.ViewDelegate import PolyViewDelegate 42 44 from sas.qtgui.Perspectives.Fitting.ViewDelegate import MagnetismViewDelegate 43 from sas.qtgui.Perspectives.Fitting.Constraint simport Constraint45 from sas.qtgui.Perspectives.Fitting.Constraint import Constraint 44 46 from sas.qtgui.Perspectives.Fitting.MultiConstraint import MultiConstraint 45 47 … … 53 55 DEFAULT_POLYDISP_FUNCTION = 'gaussian' 54 56 55 USING_TWISTED = True56 #USING_TWISTED = False57 57 58 58 class ToolTippedItemModel(QtGui.QStandardItemModel): … … 1086 1086 batch_outputs = {} 1087 1087 #--------------------------------- 1088 if USING_TWISTED:1088 if LocalConfig.USING_TWISTED: 1089 1089 handler = None 1090 1090 updater = None … … 1114 1114 completefn=completefn) 1115 1115 1116 if USING_TWISTED:1116 if LocalConfig.USING_TWISTED: 1117 1117 # start the trhrhread with twisted 1118 1118 calc_thread = threads.deferToThread(calc_fit.compute) 1119 calc_thread.addCallback( self.fitComplete)1119 calc_thread.addCallback(completefn) 1120 1120 calc_thread.addErrback(self.fitFailed) 1121 1121 else: … … 1124 1124 calc_fit.ready(2.5) 1125 1125 1126 1127 #disable the Fit button1128 self.cmdFit.setText('Running...')1129 1126 self.communicate.statusBarUpdateSignal.emit('Fitting started...') 1130 self.cmdFit.setEnabled(False) 1127 # Disable some elements 1128 self.setFittingStarted() 1131 1129 1132 1130 def updateFit(self): … … 1147 1145 """ 1148 1146 #re-enable the Fit button 1149 self.cmdFit.setText("Fit") 1150 self.cmdFit.setEnabled(True) 1147 self.setFittingStopped() 1151 1148 1152 1149 print ("BATCH FITTING FINISHED") … … 1160 1157 """ 1161 1158 #re-enable the Fit button 1162 self.cmdFit.setText("Fit") 1163 self.cmdFit.setEnabled(True) 1159 self.setFittingStopped() 1164 1160 1165 1161 assert result is not None … … 2232 2228 self.setMagneticModel() 2233 2229 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 2234 2246 def readFitPage(self, fp): 2235 2247 """
Note: See TracChangeset
for help on using the changeset viewer.