Changeset 557fc498 in sasview
- Timestamp:
- Sep 13, 2018 8:17:42 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 855e7ad
- Parents:
- 1a15ada
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r6889ba2 r557fc498 1377 1377 self.communicate.statusBarUpdateSignal.emit('Fitting started...') 1378 1378 self.fit_started = True 1379 1379 1380 # Disable some elements 1380 self. setFittingStarted()1381 self.disableInteractiveElements() 1381 1382 1382 1383 def stopFit(self): … … 1387 1388 return 1388 1389 self.calc_fit.stop() 1389 #self.fit_started=False1390 1390 #re-enable the Fit button 1391 self. setFittingStopped()1391 self.enableInteractiveElements() 1392 1392 1393 1393 msg = "Fitting cancelled." … … 1403 1403 """ 1404 1404 """ 1405 self. setFittingStopped()1405 self.enableInteractiveElements() 1406 1406 msg = "Fitting failed with: "+ str(reason) 1407 1407 self.communicate.statusBarUpdateSignal.emit(msg) … … 1420 1420 """ 1421 1421 #re-enable the Fit button 1422 self. setFittingStopped()1422 self.enableInteractiveElements() 1423 1423 1424 1424 if len(result) == 0: … … 1492 1492 """ 1493 1493 #re-enable the Fit button 1494 self. setFittingStopped()1494 self.enableInteractiveElements() 1495 1495 1496 1496 if len(result) == 0: … … 2363 2363 weight = FittingUtilities.getWeight(data=data, is2d=self.is2D, flag=self.weighting) 2364 2364 2365 # Disable buttons/table 2366 self.disableInteractiveElements() 2365 2367 # Awful API to a backend method. 2366 2368 calc_thread = self.methodCalculateForData()(data=data, … … 2404 2406 Thread returned error 2405 2407 """ 2408 # Bring the GUI to normal state 2409 self.enableInteractiveElements() 2406 2410 print("Calculate Data failed with ", reason) 2407 2411 … … 2416 2420 Plot the current 1D data 2417 2421 """ 2422 # Bring the GUI to normal state 2423 self.enableInteractiveElements() 2424 2418 2425 fitted_data = self.logic.new1DPlot(return_data, self.tab_id) 2419 2426 residuals = self.calculateResiduals(fitted_data) … … 2445 2452 Plot the current 2D data 2446 2453 """ 2454 # Bring the GUI to normal state 2455 self.enableInteractiveElements() 2456 2447 2457 fitted_data = self.logic.new2DPlot(return_data) 2448 2458 residuals = self.calculateResiduals(fitted_data) … … 2515 2525 Thread threw an exception. 2516 2526 """ 2527 # Bring the GUI to normal state 2528 self.enableInteractiveElements() 2517 2529 # TODO: remimplement thread cancellation 2518 2530 logger.error("".join(traceback.format_exception(etype, value, tb))) … … 2892 2904 self.setMagneticModel() 2893 2905 2894 def setFittingStarted(self): 2895 """ 2896 Set buttion caption on fitting start 2906 def setInteractiveElements(self, enabled=True): 2907 """ 2908 Switch interactive GUI elements on/off 2909 """ 2910 assert isinstance(enabled, bool) 2911 2912 self.lstParams.setEnabled(enabled) 2913 self.lstPoly.setEnabled(enabled) 2914 self.lstMagnetic.setEnabled(enabled) 2915 2916 self.cbCategory.setEnabled(enabled) 2917 self.cbModel.setEnabled(enabled) 2918 self.cbStructureFactor.setEnabled(enabled) 2919 2920 self.chkPolydispersity.setEnabled(enabled) 2921 self.chkMagnetism.setEnabled(enabled) 2922 self.chk2DView.setEnabled(enabled) 2923 2924 def enableInteractiveElements(self): 2925 """ 2926 Set buttion caption on fitting/calculate finish 2927 Enable the param table(s) 2928 """ 2929 # Notify the user that fitting is available 2930 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 2931 self.cmdFit.setText("Fit") 2932 self.fit_started = False 2933 self.setInteractiveElements(True) 2934 2935 def disableInteractiveElements(self): 2936 """ 2937 Set buttion caption on fitting/calculate start 2938 Disable the param table(s) 2897 2939 """ 2898 2940 # Notify the user that fitting is being run … … 2900 2942 self.cmdFit.setStyleSheet('QPushButton {color: red;}') 2901 2943 self.cmdFit.setText('Stop fit') 2902 2903 def setFittingStopped(self): 2904 """ 2905 Set button caption on fitting stop 2906 """ 2907 # Notify the user that fitting is available 2908 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 2909 self.cmdFit.setText("Fit") 2910 self.fit_started = False 2944 self.setInteractiveElements(False) 2911 2945 2912 2946 def readFitPage(self, fp):
Note: See TracChangeset
for help on using the changeset viewer.