Changes in / [f810eb6:60e20d8] in sasview
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py
r13ee4d9 r14e1ff0 128 128 self.is_chain_fitting = False 129 129 130 # Is the fit job running? 131 self.is_running = False 132 self.calc_fit = None 133 130 134 # Remember previous content of modified cell 131 135 self.current_cell = "" … … 257 261 Perform the constrained/simultaneous fit 258 262 """ 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 259 273 # Find out all tabs to fit 260 274 tabs_to_fit = self.getTabsForFit() … … 310 324 311 325 # new fit thread object 312 calc_fit = FitThread(handler=handler,326 self.calc_fit = FitThread(handler=handler, 313 327 fn=sim_fitter_list, 314 328 batch_inputs=batch_inputs, … … 321 335 if LocalConfig.USING_TWISTED: 322 336 # start the trhrhread with twisted 323 calc_thread = threads.deferToThread(calc_fit.compute)324 calc_thread.addCallback(completefn)325 calc_thread.addErrback(self.onFitFailed)337 self.calc_fit = threads.deferToThread(self.calc_fit.compute) 338 self.calc_fit.addCallback(completefn) 339 self.calc_fit.addErrback(self.onFitFailed) 326 340 else: 327 341 # Use the old python threads + Queue 328 calc_fit.queue() 329 calc_fit.ready(2.5) 330 331 332 #disable the Fit button 342 self.calc_fit.queue() 343 self.calc_fit.ready(2.5) 344 345 # modify the Fit button 333 346 self.cmdFit.setStyleSheet('QPushButton {color: red;}') 334 self.cmdFit.setText(' Running...')347 self.cmdFit.setText('Stop fit') 335 348 self.parent.communicate.statusBarUpdateSignal.emit('Fitting started...') 336 self. cmdFit.setEnabled(False)349 self.is_running = True 337 350 338 351 def onHelp(self): … … 457 470 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 458 471 self.cmdFit.setText("Fit") 459 self.cmdFit.setEnabled(True)460 472 461 473 # Notify the parent about completed fitting … … 503 515 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 504 516 self.cmdFit.setText("Fit") 505 self.cmdFit.setEnabled(True)506 517 507 518 # Notify the parent about completed fitting … … 538 549 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 539 550 self.cmdFit.setText("Fit") 540 self.cmdFit.setEnabled(True)541 551 542 552 # Notify the parent about completed fitting -
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
rfb39f28 r14e1ff0 406 406 tab_object.enableInteractiveElements() 407 407 408 pass409 410 408 def getCurrentStateAsXml(self): 411 409 """
Note: See TracChangeset
for help on using the changeset viewer.