Ignore:
Timestamp:
Oct 25, 2017 9:01:37 AM (7 years ago)
Author:
Adam Washington <adam.washington@…>
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:
aae5f4c
Parents:
e7a0b2f (diff), f7d14a1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ESS_GUI' of github.com:SasView/sasview into ESS_GUI

File:
1 edited

Legend:

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

    ra95c44b rf7d14a1  
    1313from PyQt4 import QtWebKit 
    1414 
     15from sasmodels import product 
    1516from sasmodels import generate 
    1617from sasmodels import modelinfo 
     
    5253 
    5354class ToolTippedItemModel(QtGui.QStandardItemModel): 
    54  
    55     def __init__(self, parent = None): 
     55    """ 
     56    Subclass from QStandardItemModel to allow displaying tooltips in 
     57    QTableView model. 
     58    """ 
     59    def __init__(self, parent=None): 
    5660        QtGui.QStandardItemModel.__init__(self,parent) 
    5761 
    5862    def headerData(self, section, orientation, role): 
    59  
     63        """ 
     64        Displays tooltip for each column's header 
     65        :param section: 
     66        :param orientation: 
     67        :param role: 
     68        :return: 
     69        """ 
    6070        if role == QtCore.Qt.ToolTipRole: 
    6171            if orientation == QtCore.Qt.Horizontal: 
     
    136146    def data(self, value): 
    137147        """ data setter """ 
     148        # Value is either a list of indices for batch fitting or a simple index 
     149        # for standard fitting. Assure we have a list, regardless. 
    138150        if isinstance(value, list): 
    139151            self.is_batch_fitting = True 
     
    149161 
    150162        # Update logics with data items 
     163        # Logics.data contains only a single Data1D/Data2D object 
    151164        self.logic.data = GuiUtils.dataFromItem(value[0]) 
    152165 
     
    154167        self.is2D = True if isinstance(self.logic.data, Data2D) else False 
    155168 
     169        # Let others know we're full of data now 
    156170        self.data_is_loaded = True 
    157171 
     
    333347        self.chk2DView.setVisible(False) 
    334348        self.chkMagnetism.setEnabled(self.is2D) 
     349        self.tabFitting.setTabEnabled(TAB_MAGNETISM, self.is2D) 
    335350        # Combo box or label for file name" 
    336351        if self.is_batch_fitting: 
     
    344359        # Similarly on other tabs 
    345360        self.options_widget.setEnablementOnDataLoad() 
     361 
     362        # Reload the model 
     363        self.onSelectModel() 
    346364 
    347365        # Smearing tab 
     
    10381056        # Regardless of previous state, this should now be `plot show` functionality only 
    10391057        self.cmdPlot.setText("Show Plot") 
    1040         if not self.data_is_loaded: 
    1041             self.recalculatePlotData() 
     1058        # Force data recalculation so existing charts are updated 
     1059        self.recalculatePlotData() 
    10421060        self.showPlot() 
    10431061 
     
    12531271        structure_module = generate.load_kernel_module(structure_factor) 
    12541272        structure_parameters = modelinfo.make_parameter_table(getattr(structure_module, 'parameters', [])) 
     1273        structure_kernel = self.models[structure_factor]() 
     1274 
     1275        self.kernel_module._model_info = product.make_product_info(self.kernel_module._model_info, structure_kernel._model_info) 
    12551276 
    12561277        new_rows = FittingUtilities.addSimpleParametersToModel(structure_parameters, self.is2D) 
Note: See TracChangeset for help on using the changeset viewer.