Ignore:
Timestamp:
Jul 11, 2016 4:31:53 AM (8 years ago)
Author:
lewis
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:
cbc0e64
Parents:
84ab7b4
Message:

On project load, only plot extrapolation/transform if they were plotted before project save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    r84ab7b4 r970df0f  
    4646        self.background = None 
    4747        self.outputs = {} 
     48        self.is_extrapolated = False 
     49        self.is_transformed = False 
    4850 
    4951        self.saved_state = DEFAULT_STATE 
     
    161163            state.appendChild(element) 
    162164 
     165        # Whether or not the extrapolate & transform buttons have been clicked 
     166        element = new_doc.createElement("is_extrapolated") 
     167        top_element.appendChild(element) 
     168        element.appendChild(new_doc.createTextNode(str(int(self.is_extrapolated)))) 
     169 
     170        element = new_doc.createElement("is_transformed") 
     171        top_element.appendChild(element) 
     172        element.appendChild(new_doc.createTextNode(str(int(self.is_transformed)))) 
     173 
    163174        # Output parameters 
    164175        if self.outputs != {} and self.outputs is not None: 
     
    187198        :param node: node of an XML document to read from (optional) 
    188199        """ 
     200        import pdb; pdb.set_trace() 
    189201        if node.get('version') and node.get('version') == '1.0': 
    190202            # Parse filename 
     
    214226                            value = None 
    215227                        self.set_saved_state(name=item, value=value) 
     228 
     229            # Parse is_extrapolated and is_transformed 
     230            entry = get_content('ns:is_extrapolated', node) 
     231            if entry is not None: 
     232                self.is_extrapolated = bool(int(entry.text.strip())) 
     233            entry = get_content('ns:is_transformed', node) 
     234            if entry is not None: 
     235                self.is_transformed = bool(int(entry.text.strip())) 
    216236 
    217237            # Parse outputs 
Note: See TracChangeset for help on using the changeset viewer.