Ignore:
Timestamp:
Mar 7, 2017 1:15:13 PM (7 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:
096181d
Parents:
7e98655
Message:

Saving and then loading in same save state working with custom pinhole dQ as a percentage. #850

File:
1 edited

Legend:

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

    r71601312 rd85f1d8a  
    7474                            ["dq_l", "dq_l", "float"], 
    7575                            ["dq_r", "dq_r", "float"], 
    76                             ["dx_max", "dx_max", "float"], 
    77                             ["dx_min", "dx_min", "float"], 
     76                            ["dx_percent", "dx_percent", "float"], 
    7877                            ["dxl", "dxl", "float"], 
    7978                            ["dxw", "dxw", "float"]] 
     
    215214        self.dq_l = None 
    216215        self.dq_r = None 
    217         self.dx_max = None 
    218         self.dx_min = None 
     216        self.dx_percent = None 
    219217        self.dxl = None 
    220218        self.dxw = None 
     
    343341        obj.dq_l = copy.deepcopy(self.dq_l) 
    344342        obj.dq_r = copy.deepcopy(self.dq_r) 
    345         obj.dx_max = copy.deepcopy(self.dx_max) 
    346         obj.dx_min = copy.deepcopy(self.dx_min) 
     343        obj.dx_percent = copy.deepcopy(self.dx_percent) 
    347344        obj.dxl = copy.deepcopy(self.dxl) 
    348345        obj.dxw = copy.deepcopy(self.dxw) 
     
    562559        rep += "dq_l  : %s\n" % self.dq_l 
    563560        rep += "dq_r  : %s\n" % self.dq_r 
    564         rep += "dx_max  : %s\n" % str(self.dx_max) 
    565         rep += "dx_min : %s\n" % str(self.dx_min) 
     561        rep += "dx_percent  : %s\n" % str(self.dx_percent) 
    566562        rep += "dxl  : %s\n" % str(self.dxl) 
    567563        rep += "dxw : %s\n" % str(self.dxw) 
     
    10491045 
    10501046                for item in LIST_OF_STATE_ATTRIBUTES: 
    1051                     node = get_content('ns:%s' % item[0], entry) 
     1047                    try: 
     1048                        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) 
    10521060                    setattr(self, item[0], parse_entry_helper(node, item)) 
    10531061 
Note: See TracChangeset for help on using the changeset viewer.