Changeset 096181d in sasview


Ignore:
Timestamp:
Mar 7, 2017 3:47:21 PM (8 years ago)
Author:
krzywon
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
d5aff7f
Parents:
d85f1d8a
Message:

Coerce old custom pinhole smeared loaded from save states to q_min/dq_min. #850

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    rd85f1d8a r096181d  
    12471247            self.dx_percent = state.dx_percent 
    12481248            if self.dx_percent is not None: 
    1249                 self.smear_pinhole_percent.SetValue(str(self.dx_percent)) 
     1249                if state.dx_old: 
     1250                    self.dx_percent = self.data.x[0] / self.dx_percent 
     1251                self.smear_pinhole_percent.SetValue("%.2f" % self.dx_percent) 
    12501252            self.onPinholeSmear(event=None) 
    12511253        elif self.slit_smearer.GetValue(): 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    rd85f1d8a r096181d  
    215215        self.dq_r = None 
    216216        self.dx_percent = None 
     217        self.dx_old = False 
    217218        self.dxl = None 
    218219        self.dxw = None 
     
    342343        obj.dq_r = copy.deepcopy(self.dq_r) 
    343344        obj.dx_percent = copy.deepcopy(self.dx_percent) 
     345        obj.dx_old = copy.deepcopy(self.dx_old) 
    344346        obj.dxl = copy.deepcopy(self.dxl) 
    345347        obj.dxw = copy.deepcopy(self.dxw) 
     
    10451047 
    10461048                for item in LIST_OF_STATE_ATTRIBUTES: 
    1047                     try: 
     1049                    node = get_content('ns:%s' % 'dx_min', entry) 
     1050                    if item[0] == "dx_percent" and node is not None: 
     1051                        dxmin = ["dx_min", "dx_percent", "float"] 
     1052                        setattr(self, item[0], parse_entry_helper(node, dxmin)) 
     1053                        self.dx_old = True 
     1054                    else: 
    10481055                        node = get_content('ns:%s' % item[0], entry) 
    1049                     except Exception as e: 
    1050                         if item[0] == "dx_percent": 
    1051                             msg = "Custom pinhole smearing has changed " 
    1052                             msg += "as of v4.1.0. dx_min will be used to " 
    1053                             msg += "calculate %Q for smearing purposes." 
    1054                             logging.warning(msg) 
    1055                             node = get_content('ns:%s' % 'dx_min', entry) 
    1056                         else: 
    1057                             msg = "Could not find node %s.\n" % item[0] 
    1058                             msg += e.message 
    1059                             logging.error(msg) 
    1060                     setattr(self, item[0], parse_entry_helper(node, item)) 
     1056                        setattr(self, item[0], parse_entry_helper(node, item)) 
    10611057 
    10621058                for item in LIST_OF_STATE_PARAMETERS: 
Note: See TracChangeset for help on using the changeset viewer.