Changeset d48cc19 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- May 2, 2017 9:04: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:
- 02ddfb4
- Parents:
- 0a6e097
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r61a92d4 rd48cc19 74 74 self.weighting = 0 75 75 76 # Data for chosen model 77 self.model_data = None 78 76 79 # Which tab is this widget displayed in? 77 80 self.tab_id = id … … 250 253 """ 251 254 self.cmdFit.setEnabled(False) 252 self.cmdPlot.setEnabled( True)255 self.cmdPlot.setEnabled(False) 253 256 self.options_widget.cmdComputePoints.setVisible(False) # probably redundant 254 257 self.chkPolydispersity.setEnabled(True) … … 305 308 self.has_error_column = False 306 309 310 # Set enablement on calculate/plot 311 self.cmdPlot.setEnabled(True) 312 307 313 # SasModel -> QModel 308 314 self.SASModelToQModel(model) 309 315 310 316 if self.data_is_loaded: 317 self.cmdPlot.setText("Show Plot") 311 318 self.calculateQGridForModel() 312 319 else: 320 self.cmdPlot.setText("Calculate") 313 321 # Create default datasets if no data passed 314 322 self.createDefaultDataset() … … 569 577 Plot the current set of data 570 578 """ 579 # Regardless of previous state, this should now be `plot show` functionality only 580 self.cmdPlot.setText("Show Plot") 581 self.recalculatePlotData() 582 self.showPlot() 583 584 def recalculatePlotData(self): 585 """ 586 Generate a new dataset for model 587 """ 571 588 if not self.data_is_loaded: 572 589 self.createDefaultDataset() 573 590 self.calculateQGridForModel() 591 592 def showPlot(self): 593 """ 594 Show the current plot in MPL 595 """ 596 # Show the chart if ready 597 data_to_show = self.data if self.data_is_loaded else self.model_data 598 if data_to_show is not None: 599 self.communicate.plotRequestedSignal.emit([data_to_show]) 574 600 575 601 def onOptionsUpdate(self): … … 582 608 self.lblMinRangeDef.setText(str(self.q_range_min)) 583 609 self.lblMaxRangeDef.setText(str(self.q_range_max)) 584 self. onPlot()610 self.recalculatePlotData() 585 611 586 612 def setDefaultStructureCombo(self): … … 766 792 # Force the chart update when actual parameters changed 767 793 if model_column == 1: 768 self. onPlot()794 self.recalculatePlotData() 769 795 770 796 def checkboxSelected(self, item): … … 891 917 Plot the current 1D data 892 918 """ 893 fitted_plot = self.logic.new1DPlot(return_data, self.tab_id) 894 self.calculateResiduals(fitted_plot) 919 fitted_data = self.logic.new1DPlot(return_data, self.tab_id) 920 self.calculateResiduals(fitted_data) 921 self.model_data = fitted_data 895 922 896 923 def complete2D(self, return_data): … … 900 927 fitted_data = self.logic.new2DPlot(return_data) 901 928 self.calculateResiduals(fitted_data) 929 self.model_data = fitted_data 902 930 903 931 def calculateResiduals(self, fitted_data): … … 914 942 self.lblChi2Value.setText(chi2_repr) 915 943 944 self.communicate.plotUpdateSignal.emit([fitted_data]) 945 916 946 # Plot residuals if actual data 917 947 if self.data_is_loaded: … … 920 950 self.createNewIndex(residuals_plot) 921 951 self.communicate.plotUpdateSignal.emit([residuals_plot]) 922 923 self.communicate.plotUpdateSignal.emit([fitted_data])924 952 925 953 def calcException(self, etype, value, tb):
Note: See TracChangeset
for help on using the changeset viewer.