Changeset 7d077d1 in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Mar 31, 2017 3:29:50 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
0274aea
Parents:
0268aed
Message:

When chart is shown - react and show changes to Qmodel

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
3 edited

Legend:

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

    r0268aed r7d077d1  
    103103        self._data.ymax = ymax 
    104104 
    105     def new1DPlot(self, return_data): 
     105    def new1DPlot(self, return_data, tab_id): 
    106106        """ 
    107107        Create a new 1D data instance based on fitting results 
     
    121121 
    122122        new_plot.group_id = data.group_id 
    123         #new_plot.id = str(self.tab_id) + " " + data.name 
     123        new_plot.id = str(tab_id) + " " + data.name 
    124124        new_plot.name = model.name + " [" + data.name + "]" 
    125125        new_plot.title = new_plot.name 
     
    135135        Create a new 2D data instance based on fitting results 
    136136        """ 
    137  
    138137        image, data, page_id, model, state, toggle_mode_on,\ 
    139138        elapsed, index, fid, qmin, qmax, weight, \ 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r0268aed r7d077d1  
    224224def residualsData1D(reference_data, current_data): 
    225225    """ 
     226    Calculate the residuals for difference of two Data1D sets 
    226227    """ 
    227228    # temporary default values for index and weight 
     
    265266def residualsData2D(reference_data, current_data): 
    266267    """ 
     268    Calculate the residuals for difference of two Data2D sets 
    267269    """ 
    268270    # temporary default values for index and weight 
     
    304306    data_copy = deepcopy(current_data) 
    305307    # Get data: data I, theory I, and data dI in order 
    306  
    307308    method_name = current_data.__class__.__name__ 
    308309    residuals_dict = {"Data1D": residualsData1D, 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r0268aed r7d077d1  
    586586        # multishell params in self.kernel_module.details[??] = value 
    587587 
     588        # Force the chart update 
     589        self.onPlot() 
     590 
    588591    def nameForFittedData(self, name): 
    589592        """ 
     
    605608                fitted_data.name = name 
    606609                fitted_data.filename = name 
     610                fitted_data.symbol = "Line" 
    607611            self.updateModelIndex(fitted_data) 
    608612        else: 
     
    625629            name = fitted_data.name 
    626630        # Make this a line if no other defined 
    627         if fitted_data.symbol is None: 
     631        if hasattr(fitted_data, 'symbol') and fitted_data.symbol is None: 
    628632            fitted_data.symbol = 'Line' 
    629633        # Notify the GUI manager so it can update the main model in DataExplorer 
    630634        GuiUtils.updateModelItemWithPlot(self._index, QtCore.QVariant(fitted_data), name) 
     635        # Force redisplay 
    631636 
    632637    def createTheoryIndex(self, fitted_data): 
     
    680685        Plot the current 1D data 
    681686        """ 
    682         fitted_plot = self.logic.new1DPlot(return_data) 
     687        fitted_plot = self.logic.new1DPlot(return_data, self.tab_id) 
    683688        self.calculateResiduals(fitted_plot) 
    684689 
     
    695700        """ 
    696701        # Create a new index for holding data 
     702        fitted_data.symbol = "Line" 
    697703        self.createNewIndex(fitted_data) 
    698704        # Calculate difference between return_data and logic.data 
     
    704710        if self.data_is_loaded: 
    705711            residuals_plot = FittingUtilities.plotResiduals(self.data, fitted_data) 
     712            residuals_plot.id = "Residual " + residuals_plot.id 
    706713            self.createNewIndex(residuals_plot) 
     714 
     715        self.communicate.plotUpdateSignal.emit([fitted_data]) 
    707716 
    708717    def calcException(self, etype, value, tb): 
Note: See TracChangeset for help on using the changeset viewer.