Changeset 3fafe15 in sasview


Ignore:
Timestamp:
Mar 10, 2011 11:53:39 AM (13 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:
e8bf1ed
Parents:
003fa4e
Message:

working on 1D \2D toggle

File:
1 edited

Legend:

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

    rfa65e99 r3fafe15  
    594594        wx.PostEvent(self.parent, NewPlotEvent(id=id, 
    595595                                                   group_id=group_id, 
    596                                                    remove=True)) 
     596                                                   action='remove')) 
    597597            
    598598    def store_data(self, id, data=None, caption=None): 
     
    652652                    if group_id not in data.group_id: 
    653653                        data.group_id.append(group_id) 
    654             self.parent.update_data(prev_data=theory_data, new_data=data) 
    655                      
     654            self.parent.update_data(prev_data=theory_data, new_data=data)        
    656655        self.store_data(id=page.id, data=data, caption=page.window_name) 
    657656        if self.sim_page is not None: 
     
    10871086        theory.ymin = ymin  
    10881087        theory.ymax = ymax  
    1089         theory.group_id = str(id) + "Model2D" 
    1090         theory.id = str(id) + "Mode2D" 
     1088        group_id = str(id) + " Model2D" 
     1089        if group_id not in theory.group_id: 
     1090            theory.group_id.append(group_id) 
     1091        theory.id = str(id) + " Model2D" 
    10911092   
    10921093                 
     
    11261127                new_plot.is_data = False  
    11271128            new_plot.id =  str(id) + " Model1D"   
    1128             print "new_plot.id", new_plot.id 
     1129             
    11291130            #find if this theory was already plotted and replace that plot given 
    11301131            #the same id 
     
    11331134                if theory_data is not None: 
    11341135                    temp_id = theory_data.id 
    1135                     print "theory_data id", temp_id 
    11361136                    new_plot.id = temp_id 
    1137             if toggle_mode_on: 
    1138                 new_plot.id =  str(id) + " Model"   
     1137              
    11391138            new_plot.name = model.name + " ["+ str(model.__class__.__name__)+ "]" 
    11401139            new_plot.xaxis(_xaxis, _xunit) 
    11411140            new_plot.yaxis(_yaxis, _yunit) 
     1141            if toggle_mode_on: 
     1142                new_plot.id =  str(id) + " Model"  
     1143                wx.PostEvent(self.parent,  
     1144                             NewPlotEvent(group_id=str(id) + " Model2D", 
     1145                                               action="Hide")) 
     1146                print "toggle model on  -->1d" 
    11421147            self.page_finder[id].set_theory_data(new_plot) 
    11431148            if data is None: 
     
    11471152            else: 
    11481153                data_id = data.id 
     1154            
    11491155            self.parent.append_theory(data_id=data_id,  
    11501156                                          theory=new_plot, state=state) 
     
    11941200        else: 
    11951201            new_plot.id = str(id) + " Model2D" 
    1196             new_plot.group_id = str(id) + " Model2D" 
     1202            group_id = str(id) + " Model2D" 
     1203            if group_id not in new_plot.group_id: 
     1204                new_plot.group_id.append(group_id) 
    11971205          
    11981206            new_plot.x_bins = data.x_bins 
     
    12161224        theory_data = deepcopy(new_plot) 
    12171225        theory_data.name = "Unknown" 
     1226        if toggle_mode_on: 
     1227            new_plot.id = str(id) + " Model"       
     1228            wx.PostEvent(self.parent,  
     1229                             NewPlotEvent(group_id=str(id) + " Model1D", 
     1230                                               action="Hide")) 
    12181231        self.page_finder[id].set_theory_data(theory_data) 
    12191232         
     
    12241237        else: 
    12251238            data_id = data.id 
     1239         
    12261240        self.parent.append_theory(data_id=data_id,  
    12271241                                          theory=new_plot, state=state) 
    1228         if toggle_mode_on: 
    1229             new_plot.id = str(id) + " Model"       
    12301242        ## plot 
    12311243        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 
    1232                          title=new_plot.title)) 
     1244                                               title=new_plot.title)) 
    12331245        # Chisqr in fitpage 
    12341246        current_pg = self.fit_panel.get_page_by_id(id) 
Note: See TracChangeset for help on using the changeset viewer.