Changeset 1fc7411 in sasview


Ignore:
Timestamp:
Feb 24, 2009 1:54:48 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
fe3aba9
Parents:
3e1a859
Message:

error handling for selected data to fit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitpanel.py

    r3e1a859 r1fc7411  
    4949        self.model_list_box={} 
    5050        # save the title of the last page tab added 
    51         self.fit_page_name=None 
     51        self.fit_page_name=[] 
    5252        self.draw_model_name=None 
    5353        #model page info 
     
    105105            name = 'Fit' 
    106106        flag2=self.draw_model_name !=name 
    107         flag= ((self.draw_model_name ==name) and (data.__class__.__name__ is "Data2D")) 
     107        flag= ((self.draw_model_name ==name) and (data.__class__.__name__ is "Data2D"))or\ 
     108        (self.draw_model_name !=name) 
    108109        #if self.fit_page_name != name and self.draw_model_name !=name: 
    109         if self.fit_page_name != name and flag : 
     110        if not name in self.fit_page_name and flag : 
    110111            #self.about_page.Disable() 
    111112            from fitpage1D import FitPage1D 
     
    118119            self.AddPage(page=panel,caption=name,select=True) 
    119120            panel.populate_box( self.model_list_box) 
    120             self.fit_page_name = name 
    121             EVT_FIT_PAGE 
     121            self.fit_page_name.append(name) 
     122     
    122123            return panel #,m_name 
    123124        else: 
     
    205206            sim_page = self.GetPage(1) 
    206207            selected_page = self.GetPage(self.GetSelection()) 
    207             print "sim_page ",sim_page ,selected_page 
     208            #print "sim_page ",sim_page ,selected_page 
    208209            if sim_page != selected_page: 
    209                 print "sim_page ",sim_page ,selected_page 
     210                #print "sim_page ",sim_page ,selected_page 
    210211                # remove the check box link to the model name of this page (selected_page) 
    211212                sim_page.remove_model(selected_page) 
     
    218219                #Delete the page from notebook 
    219220                page_number = self.GetSelection() 
    220                 print "on close",selected_page.name,self.GetPageText(page_number),self.draw_model_name 
     221                #print "on close",selected_page.name,self.GetPageText(page_number),self.draw_model_name 
     222                 
     223                if selected_page.name in self.fit_page_name: 
     224                    self.fit_page_name.remove(selected_page.name) 
     225                     
    221226                if selected_page.name== self.draw_model_name: 
    222                     print "went here" 
     227                    #print "went here" 
    223228                    self.draw_model_name=None 
    224229                    self.model_page=None 
     
    230235                i=self.DeletePage(page_number) 
    231236                #self.count =self.count -1  
    232                 self.fit_page_name=None 
     237                 
    233238        except: 
    234239            raise 
Note: See TracChangeset for help on using the changeset viewer.