Changeset 8b6e4be in sasview


Ignore:
Timestamp:
Sep 25, 2018 4:25:14 AM (4 weeks ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_image_viewer, ESS_GUI_project_save
Children:
8a09457
Parents:
6f6e8e4
git-author:
Piotr Rozyczko <piotr.rozyczko@…> (09/25/18 04:19:34)
git-committer:
Piotr Rozyczko <piotr.rozyczko@…> (09/25/18 04:25:14)
Message:

check data and kernel model before using them. SASVIEW-1162

File:
1 edited

Legend:

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

    r9a7c81c r8b6e4be  
    6161        self.data = None 
    6262        self.current_smearer = None 
     63        self.kernel_model = None 
    6364 
    6465        # Let only floats in the line edits 
     
    110111        if data is None: 
    111112            self.setElementsVisibility(False) 
    112         elif isinstance(data, Data1D): 
     113 
     114    def updateKernelModel(self, kernel_model=None): 
     115        """ 
     116        Update the model 
     117        """ 
     118        self.kernel_model = kernel_model 
     119        if self.data is None: 
     120            self.setElementsVisibility(False) 
     121            return 
     122        if self.kernel_model is None: 
     123            return 
     124        elif isinstance(self.data, Data1D): 
    113125            self.cbSmearing.addItems(SMEARING_1D) 
    114126        else: 
    115127            self.cbSmearing.addItems(SMEARING_2D) 
    116128        self.cbSmearing.setCurrentIndex(0) 
    117  
    118     def updateKernelModel(self, kernel_model=None): 
    119         """ 
    120         Update the model 
    121         """ 
    122         self.kernel_model = kernel_model 
    123129 
    124130    def smearer(self): 
Note: See TracChangeset for help on using the changeset viewer.