Changeset 00f7ff1 in sasview for src/sas/sascalc


Ignore:
Timestamp:
Jun 21, 2017 9:17:18 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
81b35396
Parents:
2a0f33f
Message:

move sim fit state to sascalc pagestate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/fit/pagestate.py

    r2a0f33f r00f7ff1  
    2222import xml.dom.minidom 
    2323from xml.dom.minidom import parseString 
     24from xml.dom.minidom import getDOMImplementation 
    2425from lxml import etree 
    2526 
    2627from sasmodels import convert 
    2728import sasmodels.weights 
     29 
     30from sas.sasview import __version__ as SASVIEW_VERSION 
    2831 
    2932import sas.sascalc.dataloader 
     
    141144    Contains information to reconstruct a page of the fitpanel. 
    142145    """ 
    143     def __init__(self, parent=None, model=None, data=None): 
     146    def __init__(self, model=None, data=None): 
    144147        """ 
    145148        Initialize the current state 
     
    189192        # fit page manager 
    190193        self.manager = None 
    191         # Store the parent of this panel parent 
    192         # For this application fitpanel is the parent 
    193         self.parent = parent 
    194194        # Event_owner is the owner of model event 
    195195        self.event_owner = None 
     
    286286            model = self.model.clone() 
    287287            model.name = self.model.name 
    288         obj = PageState(self.parent, model=model) 
     288        obj = PageState(model=model) 
    289289        obj.file = copy.deepcopy(self.file) 
    290290        obj.data = copy.deepcopy(self.data) 
     
    773773        :param batch_fit_state: simultaneous fit state 
    774774        """ 
    775         from xml.dom.minidom import getDOMImplementation 
    776  
    777775        # Check whether we have to write a standalone XML file 
    778776        if doc is None: 
     
    802800 
    803801        attr = newdoc.createAttribute("version") 
    804         from sas import sasview 
    805         attr.nodeValue = sasview.__version__ 
     802        attr.nodeValue = SASVIEW_VERSION 
    806803        # attr.nodeValue = '1.0' 
    807804        top_element.setAttributeNode(attr) 
     
    10861083                    setattr(self, varname, dic) 
    10871084 
     1085class SimFitPageState: 
     1086    """ 
     1087    State of the simultaneous fit page for saving purposes 
     1088    """ 
     1089 
     1090    def __init__(self): 
     1091        # Sim Fit Page Number 
     1092        self.fit_page_no = None 
     1093        # Select all data 
     1094        self.select_all = False 
     1095        # Data sets sent to fit page 
     1096        self.model_list = [] 
     1097        # Data sets to be fit 
     1098        self.model_to_fit = [] 
     1099        # Number of constraints 
     1100        self.no_constraint = 0 
     1101        # Dictionary of constraints 
     1102        self.constraint_dict = {} 
     1103        # List of constraints 
     1104        self.constraints_list = [] 
    10881105 
    10891106class Reader(CansasReader): 
     
    11681185                                         namespaces={'ns': CANSAS_NS}) 
    11691186            if simfitstate: 
    1170                 from simfitpage import SimFitPageState 
    11711187                sim_fit_state = SimFitPageState() 
    11721188                simfitstate_0 = simfitstate[0] 
Note: See TracChangeset for help on using the changeset viewer.