Changeset c71b20a in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Sep 9, 2018 4:23:00 AM (6 years ago)
Author:
ibressler
Children:
8e674ccf
Parents:
2b8286c
git-author:
Ingo Breßler <dev@…> (09/09/18 03:45:26)
git-committer:
Ingo Breßler <dev@…> (09/09/18 04:23:00)
Message:

FittingWidget?: showing also new plots on recalc conditionally

  • cherry-picked from ESS_GUI_poly_plot branch
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r0dcb71d rc71b20a  
    10881088            return True 
    10891089 
     1090    def updateDataVisibility(self, updateOnly): 
     1091        self.dataUpdateOnly = updateOnly 
     1092        for dataitem in self.all_data: 
     1093            data = GuiUtils.dataFromItem(dataitem) 
     1094            data.hidden = self.dataUpdateOnly 
     1095            self.updateModelIndex(data) 
     1096 
    10901097    def updateData(self): 
    10911098        """ 
     
    10931100        """ 
    10941101        # Update the chart 
     1102        self.updateDataVisibility(True) 
    10951103        if self.data_is_loaded: 
    10961104            self.cmdPlot.setText("Show Plot") 
     
    18131821        self.cmdPlot.setText("Show Plot") 
    18141822        # Force data recalculation so existing charts are updated 
    1815         self.showPlot() 
     1823#        self.showPlot() 
    18161824        # This is an important processEvent. 
    18171825        # This allows charts to be properly updated in order 
    18181826        # of plots being applied. 
    1819         QtWidgets.QApplication.processEvents() 
     1827#        QtWidgets.QApplication.processEvents() 
    18201828        self.recalculatePlotData() 
    18211829 
     
    22702278        Create a model or theory index with passed Data1D/Data2D 
    22712279        """ 
     2280        # set some flag which decides if new plots should be created or 
     2281        # just existing ones updated, selectively hiding indiv. plot will also work 
     2282        fitted_data.hidden = getattr(self, 'dataUpdateOnly', True) 
    22722283        if self.data_is_loaded: 
    22732284            if not fitted_data.name: 
     
    24402451        for plot in new_plots: 
    24412452            self.communicate.plotUpdateSignal.emit([plot]) 
     2453        # enable plots to be shown next time if updateData() wasn't called 
     2454        self.updateDataVisibility(False) 
    24422455 
    24432456    def complete2D(self, return_data): 
Note: See TracChangeset for help on using the changeset viewer.