Ignore:
Timestamp:
Sep 22, 2017 10:29:48 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:
ab0b93f
Parents:
1386b2f (diff), d76c43a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Paul Kienzle <pkienzle@…> (09/22/17 10:28:48)
git-committer:
Paul Kienzle <pkienzle@…> (09/22/17 10:29:48)
Message:

Merge branch 'master' into ticket-853-fit-gui-to-calc

File:
1 edited

Legend:

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

    r277257f r69363c7  
    9898            # state must be cloned 
    9999            state = page.get_state().clone() 
    100             if data is not None or page.model is not None: 
     100            # data_list only populated with real data 
     101            # Fake object in data from page.get_data() if model is selected 
     102            if len(page.data_list) is not 0 and page.model is not None: 
    101103                new_doc = self._manager.state_reader.write_toXML(data, 
    102104                                                                 state, 
    103105                                                                 batch_state) 
     106                # Fit #2 through #n are append to first fit 
    104107                if doc is not None and hasattr(doc, "firstChild"): 
    105                     child = new_doc.firstChild.firstChild 
    106                     doc.firstChild.appendChild(child) 
     108                    # Only append if properly formed new_doc 
     109                    if new_doc is not None and hasattr(new_doc, "firstChild"): 
     110                        child = new_doc.firstChild.firstChild 
     111                        doc.firstChild.appendChild(child) 
     112                # First fit defines the main document 
    107113                else: 
    108114                    doc = new_doc 
     
    396402                temp_data = page.get_data() 
    397403                if temp_data is not None and temp_data.id in data: 
    398                     self.SetSelection(pos) 
    399                     self.on_close_page(event=None) 
    400                     temp = self.GetSelection() 
    401                     self.DeletePage(temp) 
     404                    self.close_page_with_data(temp_data) 
    402405            if self.sim_page is not None: 
    403406                if len(self.sim_page.model_list) == 0: 
     
    405408                    self.SetSelection(pos) 
    406409                    self.on_close_page(event=None) 
    407                     temp = self.GetSelection() 
    408                     self.DeletePage(temp) 
     410                    self.DeletePage(pos) 
    409411                    self.sim_page = None 
    410412                    self.batch_on = False 
     
    500502            if data is None: 
    501503                return None 
     504        focused_page = self.GetPage(self.GetSelection()) 
    502505        for page in self.opened_pages.values(): 
    503506            # check if the selected data existing in the fitpanel 
    504507            pos = self.GetPageIndex(page) 
    505508            if not check_data_validity(page.get_data()) and not page.batch_on: 
     509                if page.model is not None and page != focused_page: 
     510                    # Page has an active theory and is in background - don't 
     511                    # send data here. 
     512                    continue 
    506513                # make sure data get placed in 1D empty tab if data is 1D 
    507514                # else data get place on 2D tab empty tab 
Note: See TracChangeset for help on using the changeset viewer.