Ignore:
File:
1 edited

Legend:

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

    ra95c44b re00b76e  
    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 
     
    626644            return 
    627645 
    628         property_index = self._magnet_model.headerData(1, model_column).toInt()[0]-1 # Value, min, max, etc. 
     646        property_index = self._magnet_model.headerData(0, 1, model_column).toInt()[0]-1 # Value, min, max, etc. 
    629647 
    630648        # Update the parameter value - note: this supports +/-inf as well 
     
    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.