Ignore:
File:
1 edited

Legend:

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

    re00b76e ra95c44b  
    1313from PyQt4 import QtWebKit 
    1414 
    15 from sasmodels import product 
    1615from sasmodels import generate 
    1716from sasmodels import modelinfo 
     
    5352 
    5453class ToolTippedItemModel(QtGui.QStandardItemModel): 
    55     """ 
    56     Subclass from QStandardItemModel to allow displaying tooltips in 
    57     QTableView model. 
    58     """ 
    59     def __init__(self, parent=None): 
     54 
     55    def __init__(self, parent = None): 
    6056        QtGui.QStandardItemModel.__init__(self,parent) 
    6157 
    6258    def headerData(self, section, orientation, role): 
    63         """ 
    64         Displays tooltip for each column's header 
    65         :param section: 
    66         :param orientation: 
    67         :param role: 
    68         :return: 
    69         """ 
     59 
    7060        if role == QtCore.Qt.ToolTipRole: 
    7161            if orientation == QtCore.Qt.Horizontal: 
     
    146136    def data(self, value): 
    147137        """ 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. 
    150138        if isinstance(value, list): 
    151139            self.is_batch_fitting = True 
     
    161149 
    162150        # Update logics with data items 
    163         # Logics.data contains only a single Data1D/Data2D object 
    164151        self.logic.data = GuiUtils.dataFromItem(value[0]) 
    165152 
     
    167154        self.is2D = True if isinstance(self.logic.data, Data2D) else False 
    168155 
    169         # Let others know we're full of data now 
    170156        self.data_is_loaded = True 
    171157 
     
    347333        self.chk2DView.setVisible(False) 
    348334        self.chkMagnetism.setEnabled(self.is2D) 
    349         self.tabFitting.setTabEnabled(TAB_MAGNETISM, self.is2D) 
    350335        # Combo box or label for file name" 
    351336        if self.is_batch_fitting: 
     
    359344        # Similarly on other tabs 
    360345        self.options_widget.setEnablementOnDataLoad() 
    361  
    362         # Reload the model 
    363         self.onSelectModel() 
    364346 
    365347        # Smearing tab 
     
    644626            return 
    645627 
    646         property_index = self._magnet_model.headerData(0, 1, model_column).toInt()[0]-1 # Value, min, max, etc. 
     628        property_index = self._magnet_model.headerData(1, model_column).toInt()[0]-1 # Value, min, max, etc. 
    647629 
    648630        # Update the parameter value - note: this supports +/-inf as well 
     
    10561038        # Regardless of previous state, this should now be `plot show` functionality only 
    10571039        self.cmdPlot.setText("Show Plot") 
    1058         # Force data recalculation so existing charts are updated 
    1059         self.recalculatePlotData() 
     1040        if not self.data_is_loaded: 
     1041            self.recalculatePlotData() 
    10601042        self.showPlot() 
    10611043 
     
    12711253        structure_module = generate.load_kernel_module(structure_factor) 
    12721254        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) 
    12761255 
    12771256        new_rows = FittingUtilities.addSimpleParametersToModel(structure_parameters, self.is2D) 
Note: See TracChangeset for help on using the changeset viewer.