- Timestamp:
- Mar 17, 2016 10:22:35 AM (9 years ago)
- Branches:
- master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- c10d9d6c
- Parents:
- 261e075
- git-author:
- Piotr Rozyczko <piotr.rozyczko@…> (03/17/16 10:12:28)
- git-committer:
- Piotr Rozyczko <piotr.rozyczko@…> (03/17/16 10:22:35)
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fit_thread.py
rd85c194 raac161f1 96 96 #some mssg and reset progress bar. 97 97 98 # Shouldn't this be re-raising? ConsoleUpdate doesn't act on it. 99 # raise KeyboardInterrupt 98 100 if self.handler is not None: 99 101 self.handler.stop(msg=msg) -
src/sas/sasgui/perspectives/fitting/fitting.py
- Property mode changed from 100644 to 100755
rd85c194 raac161f1 1483 1483 try: 1484 1484 index = 0 1485 # Update potential simfit page(s) 1486 if self.sim_page is not None: 1487 self.sim_page._on_fit_complete() 1488 if self.batch_page: 1489 self.batch_page._on_fit_complete() 1490 # Update all fit pages 1485 1491 for uid in page_id: 1486 1492 res = result[index] -
src/sas/sasgui/perspectives/fitting/simfitpage.py
rd85c194 raac161f1 91 91 ## selected mdoel to fit 92 92 self.model_toFit = [] 93 ## Control the fit state 94 self.fit_started = False 93 95 ## number of constraint 94 96 self.nb_constraint = 0 … … 423 425 424 426 """ 427 if self.fit_started: 428 self._stop_fit() 429 self.fit_started = False 430 return 431 425 432 flag = False 426 433 # check if the current page a simultaneous fit page or a batch page … … 439 446 self.manager.schedule_for_fit(value=1, uid=item[2]) 440 447 try: 448 self.fit_started = True 449 wx.CallAfter(self.set_fitbutton) 441 450 if not self.manager.onFit(uid=self.uid): 442 451 return … … 447 456 msg = "Select at least one model check box to fit " 448 457 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 458 459 def _on_fit_complete(self): 460 """ 461 Set the completion flag and display the updated fit button label. 462 """ 463 self.fit_started = False 464 self.set_fitbutton() 465 466 def _stop_fit(self, event=None): 467 """ 468 Attempt to stop the fitting thread 469 """ 470 if event != None: 471 event.Skip() 472 self.manager.stop_fit(self.uid) 473 self.manager._reset_schedule_problem(value=0) 474 self._on_fit_complete() 475 476 def set_fitbutton(self): 477 """ 478 Set fit button label depending on the fit_started 479 """ 480 label = "Stop" if self.fit_started else "Fit" 481 color = "red" if self.fit_started else "black" 482 483 self.btFit.SetLabel(label) 484 self.btFit.SetForegroundColour(color) 485 self.btFit.Enable(True) 449 486 450 487 def _onHelp(self, event):
Note: See TracChangeset
for help on using the changeset viewer.